comparison TaskManager/Test/test_render/spe/Set_Texture.cc @ 467:44c0bce54dcf

fix all examples. test_render is not working now.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 01 Oct 2009 19:25:25 +0900
parents bc5b3d327083
children
comparison
equal deleted inserted replaced
466:4fa8760e18c2 467:44c0bce54dcf
6 #include "global_alloc.h" 6 #include "global_alloc.h"
7 7
8 SchedDefineTask(SetTexture); 8 SchedDefineTask(SetTexture);
9 9
10 //texture をglobal 領域にコピーするタスク 10 //texture をglobal 領域にコピーするタスク
11 int 11 static int
12 SetTexture::run(SchedTask *s,void *rbuf, void *wbuf) 12 run(SchedTask *s,void *rbuf, void *wbuf)
13 { 13 {
14 __debug_spe("SetTexture\n"); 14 __debug_spe(s, "SetTexture\n");
15 void *src[4]; 15 void *src[4];
16 16
17 src[0] = get_input(rbuf, 0); 17 src[0] = s->get_input(rbuf, 0);
18 src[1] = get_input(rbuf, 1); 18 src[1] = s->get_input(rbuf, 1);
19 src[2] = get_input(rbuf, 2); 19 src[2] = s->get_input(rbuf, 2);
20 src[3] = get_input(rbuf, 3); 20 src[3] = s->get_input(rbuf, 3);
21 21
22 if (global_get(TEXTURE_ID)) { 22 if (s->global_get(TEXTURE_ID)) {
23 return 0; 23 return 0;
24 } else { 24 } else {
25 //タスクが共有できる領域確保 25 //タスクが共有できる領域確保
26 void *data = global_alloc(TEXTURE_ID, MAX_LOAD_SIZE*4); 26 void *data = s->global_alloc(TEXTURE_ID, MAX_LOAD_SIZE*4);
27 27
28 memcpy(data, src[0], MAX_LOAD_SIZE); 28 memcpy(data, src[0], MAX_LOAD_SIZE);
29 memcpy((void*)((int)data + MAX_LOAD_SIZE), src[1], MAX_LOAD_SIZE); 29 memcpy((void*)((int)data + MAX_LOAD_SIZE), src[1], MAX_LOAD_SIZE);
30 memcpy((void*)((int)data + MAX_LOAD_SIZE*2), src[2], MAX_LOAD_SIZE); 30 memcpy((void*)((int)data + MAX_LOAD_SIZE*2), src[2], MAX_LOAD_SIZE);
31 memcpy((void*)((int)data + MAX_LOAD_SIZE*3), src[3], MAX_LOAD_SIZE); 31 memcpy((void*)((int)data + MAX_LOAD_SIZE*3), src[3], MAX_LOAD_SIZE);