annotate Renderer/Engine/spe/DataUpdate.cc @ 749:115edac878e2 draft

add DataLoad DataUpdate
author hiroki
date Mon, 25 Jan 2010 19:23:24 +0900
parents
children c0a8af52fa43
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
749
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
1 #include <stdio.h>
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
2 #include "DataUpdate.h"
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
3 #include "Func.h"
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
4 #include "string.h"
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
5
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
6 /* これは必須 */
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
7 SchedDefineTask(DataUpdate);
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
8
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
9 static int
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
10 run(SchedTask *s, void *rbuf, void *wbuf)
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
11 {
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
12
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
13 void *idata = (void*)s->get_input(rbuf, 0);
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
14 int size = (int)s->get_param(0);
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
15 int load_id = (int)s->get_param(1);
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
16 void *global_data = (void*)s->global_get(load_id);
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
17
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
18 memcpy(global_data,idata,size);
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
19
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
20 return 0;
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
21 }