annotate Renderer/Engine/spe/DataAllocate.cc @ 986:ac437c3cf766 akira

double buffering of spanpack/polgonpack not yet worked.
author root@henri.cr.ie.u-ryukyu.ac.jp
date Fri, 01 Oct 2010 03:42:25 +0900
parents ad10d6d39ca6
children 0b6f8c82625a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
750
2eafb52b7563 add DataLoad DataUpdate
hiroki
parents:
diff changeset
1 #include <stdio.h>
2eafb52b7563 add DataLoad DataUpdate
hiroki
parents:
diff changeset
2 #include <string.h>
915
ad10d6d39ca6 create_polygon_task ..not worked yet.
yutaka@localhost.localdomain
parents: 823
diff changeset
3 #include "DataAllocate.h"
750
2eafb52b7563 add DataLoad DataUpdate
hiroki
parents:
diff changeset
4 #include "Func.h"
2eafb52b7563 add DataLoad DataUpdate
hiroki
parents:
diff changeset
5
2eafb52b7563 add DataLoad DataUpdate
hiroki
parents:
diff changeset
6 /* これは必須 */
915
ad10d6d39ca6 create_polygon_task ..not worked yet.
yutaka@localhost.localdomain
parents: 823
diff changeset
7 SchedDefineTask(DataAllocate);
750
2eafb52b7563 add DataLoad DataUpdate
hiroki
parents:
diff changeset
8
2eafb52b7563 add DataLoad DataUpdate
hiroki
parents:
diff changeset
9 static int
2eafb52b7563 add DataLoad DataUpdate
hiroki
parents:
diff changeset
10 run(SchedTask *s, void *rbuf, void *wbuf)
2eafb52b7563 add DataLoad DataUpdate
hiroki
parents:
diff changeset
11 {
2eafb52b7563 add DataLoad DataUpdate
hiroki
parents:
diff changeset
12
986
ac437c3cf766 double buffering of spanpack/polgonpack
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 915
diff changeset
13 int count = (int)s->get_input(rbuf, 0);
ac437c3cf766 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++) {
ac437c3cf766 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);
ac437c3cf766 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);
ac437c3cf766 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);
750
2eafb52b7563 add DataLoad DataUpdate
hiroki
parents:
diff changeset
18
986
ac437c3cf766 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);
ac437c3cf766 double buffering of spanpack/polgonpack
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 915
diff changeset
20 if (idata != NULL) {
ac437c3cf766 double buffering of spanpack/polgonpack
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 915
diff changeset
21 memcpy(buff,idata,size);
ac437c3cf766 double buffering of spanpack/polgonpack
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 915
diff changeset
22 }
915
ad10d6d39ca6 create_polygon_task ..not worked yet.
yutaka@localhost.localdomain
parents: 823
diff changeset
23 }
750
2eafb52b7563 add DataLoad DataUpdate
hiroki
parents:
diff changeset
24
2eafb52b7563 add DataLoad DataUpdate
hiroki
parents:
diff changeset
25 return 0;
2eafb52b7563 add DataLoad DataUpdate
hiroki
parents:
diff changeset
26 }
2eafb52b7563 add DataLoad DataUpdate
hiroki
parents:
diff changeset
27