annotate Renderer/Engine/spe/DataUpdate.cc @ 725:3c05b9e518ac

Light data load fix (general load routine)
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 19 Dec 2009 15:02:43 +0900
parents 72d8bd31fc8c
children 4455e7b0caf3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
686
72d8bd31fc8c add spe/DataLoad spe/DataUpdate
hiroki@localhost.localdomain
parents:
diff changeset
1 #include <stdio.h>
72d8bd31fc8c add spe/DataLoad spe/DataUpdate
hiroki@localhost.localdomain
parents:
diff changeset
2 #include "DataUpdate.h"
72d8bd31fc8c add spe/DataLoad spe/DataUpdate
hiroki@localhost.localdomain
parents:
diff changeset
3 #include "Func.h"
725
3c05b9e518ac Light data load fix (general load routine)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 686
diff changeset
4 #include "string.h"
686
72d8bd31fc8c add spe/DataLoad spe/DataUpdate
hiroki@localhost.localdomain
parents:
diff changeset
5
72d8bd31fc8c add spe/DataLoad spe/DataUpdate
hiroki@localhost.localdomain
parents:
diff changeset
6 /* これは必須 */
72d8bd31fc8c add spe/DataLoad spe/DataUpdate
hiroki@localhost.localdomain
parents:
diff changeset
7 SchedDefineTask(DataUpdate);
72d8bd31fc8c add spe/DataLoad spe/DataUpdate
hiroki@localhost.localdomain
parents:
diff changeset
8
72d8bd31fc8c add spe/DataLoad spe/DataUpdate
hiroki@localhost.localdomain
parents:
diff changeset
9 static int
72d8bd31fc8c add spe/DataLoad spe/DataUpdate
hiroki@localhost.localdomain
parents:
diff changeset
10 run(SchedTask *s, void *rbuf, void *wbuf)
72d8bd31fc8c add spe/DataLoad spe/DataUpdate
hiroki@localhost.localdomain
parents:
diff changeset
11 {
72d8bd31fc8c add spe/DataLoad spe/DataUpdate
hiroki@localhost.localdomain
parents:
diff changeset
12
725
3c05b9e518ac Light data load fix (general load routine)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 686
diff changeset
13 void *idata = (void*)s->get_input(rbuf, 0);
3c05b9e518ac Light data load fix (general load routine)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 686
diff changeset
14 int size = (int)s->get_param(0);
3c05b9e518ac Light data load fix (general load routine)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 686
diff changeset
15 int load_id = (int)s->get_param(1);
3c05b9e518ac Light data load fix (general load routine)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 686
diff changeset
16 void *global_data = (void*)s->global_get(load_id);
686
72d8bd31fc8c add spe/DataLoad spe/DataUpdate
hiroki@localhost.localdomain
parents:
diff changeset
17
725
3c05b9e518ac Light data load fix (general load routine)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 686
diff changeset
18 memcpy(global_data,idata,size);
686
72d8bd31fc8c add spe/DataLoad spe/DataUpdate
hiroki@localhost.localdomain
parents:
diff changeset
19
72d8bd31fc8c add spe/DataLoad spe/DataUpdate
hiroki@localhost.localdomain
parents:
diff changeset
20 return 0;
72d8bd31fc8c add spe/DataLoad spe/DataUpdate
hiroki@localhost.localdomain
parents:
diff changeset
21 }