Mercurial > hg > Members > kono > Cerium
changeset 750:2eafb52b7563
add DataLoad DataUpdate
author | hiroki |
---|---|
date | Mon, 25 Jan 2010 19:23:24 +0900 |
parents | 62d94ad0cef3 |
children | 8b45afad160f |
files | Renderer/Engine/spe/DataLoad.cc Renderer/Engine/spe/DataLoad.h Renderer/Engine/spe/DataUpdate.cc Renderer/Engine/spe/DataUpdate.h |
diffstat | 4 files changed, 64 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Renderer/Engine/spe/DataLoad.cc Mon Jan 25 19:23:24 2010 +0900 @@ -0,0 +1,25 @@ +#include <stdio.h> +#include <string.h> +#include "DataLoad.h" +#include "Func.h" + +/* これは必須 */ +SchedDefineTask(DataLoad); + +static int +run(SchedTask *s, void *rbuf, void *wbuf) +{ + + int size = (int)s->get_param(0); + int load_id = (int)s->get_param(1); + + //printf("size %d",sizeof(float)*length); + + s->global_alloc(load_id, size); + + //MemList *ml = s->createMemList(length,length); + //s->global_set(load_id, (void *)ml); + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Renderer/Engine/spe/DataLoad.h Mon Jan 25 19:23:24 2010 +0900 @@ -0,0 +1,9 @@ +#ifndef INCLUDED_TASK_LOAD +#define INCLUDED_TASK_LOAD + +#ifndef INCLUDED_SCHED_TASK +# include "SchedTask.h" +#endif + + +#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Renderer/Engine/spe/DataUpdate.cc Mon Jan 25 19:23:24 2010 +0900 @@ -0,0 +1,21 @@ +#include <stdio.h> +#include "DataUpdate.h" +#include "Func.h" +#include "string.h" + +/* これは必須 */ +SchedDefineTask(DataUpdate); + +static int +run(SchedTask *s, void *rbuf, void *wbuf) +{ + + void *idata = (void*)s->get_input(rbuf, 0); + int size = (int)s->get_param(0); + int load_id = (int)s->get_param(1); + void *global_data = (void*)s->global_get(load_id); + + memcpy(global_data,idata,size); + + return 0; +}