annotate Renderer/Engine/spe/DataAllocate.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: 988
diff changeset
1 //#include <stdio.h>
749
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
2 #include <string.h>
915
aa9728394194 create_polygon_task ..not worked yet.
yutaka@localhost.localdomain
parents: 823
diff changeset
3 #include "DataAllocate.h"
749
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
4 #include "Func.h"
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
5
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
6 /* これは必須 */
915
aa9728394194 create_polygon_task ..not worked yet.
yutaka@localhost.localdomain
parents: 823
diff changeset
7 SchedDefineTask(DataAllocate);
749
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
988
da1cec21f0c9 fix for double buffer
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 986
diff changeset
13 int count = (int)s->get_param(0);
986
b3a8545eb2fa double buffering of spanpack/polgonpack
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 915
diff changeset
14 for(int i=0;i<count;i++) {
b3a8545eb2fa double buffering of spanpack/polgonpack
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 915
diff changeset
15 void *idata = s->get_input(rbuf, i);
b3a8545eb2fa double buffering of spanpack/polgonpack
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 915
diff changeset
16 long size = (long)s->get_param(i*2+1);
b3a8545eb2fa double buffering of spanpack/polgonpack
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 915
diff changeset
17 long load_id = (long)s->get_param(i*2+2);
749
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
18
986
b3a8545eb2fa double buffering of spanpack/polgonpack
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 915
diff changeset
19 void *buff = s->global_alloc(load_id, size);
b3a8545eb2fa double buffering of spanpack/polgonpack
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 915
diff changeset
20 if (idata != NULL) {
b3a8545eb2fa double buffering of spanpack/polgonpack
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 915
diff changeset
21 memcpy(buff,idata,size);
b3a8545eb2fa double buffering of spanpack/polgonpack
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 915
diff changeset
22 }
915
aa9728394194 create_polygon_task ..not worked yet.
yutaka@localhost.localdomain
parents: 823
diff changeset
23 }
749
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
24
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
25 return 0;
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
26 }
115edac878e2 add DataLoad DataUpdate
hiroki
parents:
diff changeset
27