diff TaskManager/Test/test_render/spe/Load_Texture.cpp @ 109:5c194c71eca8

Cerium cvs version
author gongo@gendarme.local
date Wed, 12 Nov 2008 17:39:33 +0900
parents
children a52e193f9a42
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TaskManager/Test/test_render/spe/Load_Texture.cpp	Wed Nov 12 17:39:33 2008 +0900
@@ -0,0 +1,37 @@
+#include <stdlib.h>
+#include "Load_Texture.h"
+#include "SchedTask.h"
+#include "../spe/texture.h"
+#include "Func.h"
+
+/**
+ * 決めうちじゃなくて、
+ * create_task の時に param で渡せばおk
+ */
+#define height 128
+#define width  128
+
+// byteperpixel = 3 width = 128 dma_height= 32
+#define LOAD_SIZE 3*128*32
+#define MAX_LOAD_SIZE 16384      
+#define USE_ARRAY 3
+
+SchedDefineTask(LoadTexture);
+
+int 
+LoadTexture::run(void *rbuf , void *wbuf) 
+{
+    int addr = get_param(0);
+    
+    //タスクからタスクを生成
+    TaskPtr task = create_task(TASK_SET_TEXTURE);
+     
+    // 16kbyte づつ送ってる
+    task->add_inData(addr, MAX_LOAD_SIZE);
+    task->add_inData(addr + MAX_LOAD_SIZE, MAX_LOAD_SIZE);
+    task->add_inData(addr + MAX_LOAD_SIZE*2, MAX_LOAD_SIZE);
+    
+    wait_task(task);
+    
+    return 0;
+}