annotate Renderer/Engine/spe/DataUpdate.cc @ 1161:cc1a50cac83d draft

use MemorySegment API for pp load. do not check execution of the cell side. to be continued..
author Yutaka_Kinjyo
date Thu, 05 May 2011 00:15:43 +0900
parents 801d57ae1e29
children 95b114c66e14
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1142
801d57ae1e29 cut compile CreatePolygonTask on spe side because not enough spe memory. We have to use code loading.
yutaka@localhost.localdomain
parents: 985
diff changeset
1 //#include <stdio.h>
749
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
985
37bd2b0694e2 fix light data update
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 823
diff changeset
13 long count = (long)s->get_param(0);
37bd2b0694e2 fix light data update
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 823
diff changeset
14 long id_base = (long)s->get_param(1);
37bd2b0694e2 fix light data update
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 823
diff changeset
15 for(int i=0; i<count; i++) {
37bd2b0694e2 fix light data update
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 823
diff changeset
16 void *idata = (void*)s->get_input(rbuf, i);
37bd2b0694e2 fix light data update
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 823
diff changeset
17 long size = (long)s->get_inputSize(i);
37bd2b0694e2 fix light data update
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 823
diff changeset
18 void *global_data = (void*)s->global_get(id_base+i);
37bd2b0694e2 fix light data update
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 823
diff changeset
19 memcpy(global_data,idata,size);
37bd2b0694e2 fix light data update
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 823
diff changeset
20 }
749
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
21
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
22 return 0;
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
23 }