annotate TaskManager/Test/test_render/spe/Load_Texture.cpp @ 120:a52e193f9a42

fix Load Texture
author gongo@gendarme.local
date Tue, 25 Nov 2008 00:18:49 +0900
parents 5c194c71eca8
children 776eca0daa02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
1 #include <stdlib.h>
120
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
2 #include <string.h>
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3 #include "Load_Texture.h"
120
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
4 #include "texture.h"
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
5 #include "Func.h"
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
6
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
7 /**
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
8 * 決めうちじゃなくて、
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
9 * create_task の時に param で渡せばおk
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
10 */
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
11 #define height 128
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
12 #define width 128
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
13
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
14 // byteperpixel = 3 width = 128 dma_height= 32
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
15 #define LOAD_SIZE 3*128*32
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
16 #define MAX_LOAD_SIZE 16384
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
17 #define USE_ARRAY 3
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
18
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
19 SchedDefineTask(LoadTexture);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
20
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
21 int
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
22 LoadTexture::run(void *rbuf , void *wbuf)
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
23 {
120
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
24 int addr = smanager->get_param(0);
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
25 int addrNum = smanager->get_param(1);
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
26
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
27 void **addrList = (void**)smanager->get_input(0);
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
28 void **list = (void**)global_alloc(TEXTURE2_ID, addrNum*sizeof(void*));
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
29
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
30 memcpy(list, addrList, addrNum*sizeof(void*));
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
31
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
32 #if 0
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
33 //タスクからタスクを生成
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
34 TaskPtr task = create_task(TASK_SET_TEXTURE);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
35
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
36 // 16kbyte づつ送ってる
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
37 task->add_inData(addr, MAX_LOAD_SIZE);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
38 task->add_inData(addr + MAX_LOAD_SIZE, MAX_LOAD_SIZE);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
39 task->add_inData(addr + MAX_LOAD_SIZE*2, MAX_LOAD_SIZE);
120
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
40 task->add_inData(addr + MAX_LOAD_SIZE*3, MAX_LOAD_SIZE);
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
41
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
42 wait_task(task);
120
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
43 #endif
a52e193f9a42 fix Load Texture
gongo@gendarme.local
parents: 109
diff changeset
44
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
45 return 0;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
46 }