comparison 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
comparison
equal deleted inserted replaced
724:6d11ecef3b74 725:3c05b9e518ac
1 #include <stdio.h> 1 #include <stdio.h>
2 #include "DataUpdate.h" 2 #include "DataUpdate.h"
3 #include "Func.h" 3 #include "Func.h"
4 #include "string.h"
4 5
5 /* これは必須 */ 6 /* これは必須 */
6 SchedDefineTask(DataUpdate); 7 SchedDefineTask(DataUpdate);
7 8
8 static int 9 static int
9 run(SchedTask *s, void *rbuf, void *wbuf) 10 run(SchedTask *s, void *rbuf, void *wbuf)
10 { 11 {
11 12
12 float *idata = (float*)s->get_input(rbuf, 0); 13 void *idata = (void*)s->get_input(rbuf, 0);
13 int load_id = (int)s->get_param(0); 14 int size = (int)s->get_param(0);
14 float *global_data = (float*)s->global_get(load_id); 15 int load_id = (int)s->get_param(1);
16 void *global_data = (void*)s->global_get(load_id);
15 17
16 global_data[0] = idata[0]; 18 memcpy(global_data,idata,size);
17 global_data[1] = idata[1];
18 global_data[2] = idata[2];
19 global_data[3] = idata[3];
20
21 #if 0
22 s->printf("spe %f ",idata[0]);
23 s->printf("spe %f ",idata[1]);
24 s->printf("spe %f\n",idata[2]);
25 #endif
26 19
27 return 0; 20 return 0;
28 } 21 }