changeset 1411:3361f2b7c63b draft

fix cpu iterator
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 18 Feb 2012 10:46:22 +0900
parents acfa426b277e
children f40558ec00a8
files Renderer/Engine/Light.cc Renderer/Engine/Makefile.macosx
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Renderer/Engine/Light.cc	Sat Feb 18 10:25:42 2012 +0900
+++ b/Renderer/Engine/Light.cc	Sat Feb 18 10:46:22 2012 +0900
@@ -15,7 +15,7 @@
     }
 
 
-    for(int i = 0;i<=spe_num;) { // including CPU_PPE==0
+    for(int i = 0;i<SPE_0+spe_num;) { // including CPU_PPE==0
         HTaskPtr data_load = manager->create_task(DataAllocate);
 	data_load->set_param(0,(memaddr)3);                         // num of allocate block
 	data_load->set_param(1,(memaddr)(sizeof(float)*4*light_num)); // 1st allocate size
@@ -26,7 +26,7 @@
 	data_load->set_param(6,(memaddr)LightSysSwitch);            // 3rd id
 	data_load->set_cpu((CPU_TYPE)i);
 	data_load->spawn();
-	i++;
+	if (i==0) i=SPE_0; else i++;
     }
 
     light_switch = (int*)manager->allocate(size);
@@ -83,7 +83,7 @@
 
 
     HTask *data_update_wait = manager->create_task(Dummy);
-    for(int i = 0;i<=spe_num;) { // including CPU_PPE==0
+    for(int i = 0;i<SPE_0+spe_num;) { // including CPU_PPE==0
 	HTaskPtr data_update = manager->create_task(DataUpdate);
 	data_update->set_param(0,3);
 	data_update->set_param(1,LightData);              // GlobalSet ID base
@@ -93,7 +93,7 @@
         data_update->set_cpu((CPU_TYPE)i);
         data_update_wait->wait_for(data_update);
 	data_update->spawn();
-	i++;
+	if (i==0) i=SPE_0; else i++;
     }
     return data_update_wait; 
 }
--- a/Renderer/Engine/Makefile.macosx	Sat Feb 18 10:25:42 2012 +0900
+++ b/Renderer/Engine/Makefile.macosx	Sat Feb 18 10:46:22 2012 +0900
@@ -24,6 +24,7 @@
 all: $(TARGET)
 
 $(TARGET) : $(OBJS) $(TASK_OBJS)
+	rm -f $@
 	$(AR) crus $@ $(OBJS) $(TASK_OBJS)