Mercurial > hg > Game > Cerium
changeset 857:2fa8943d989a draft
DrawSpan taskArray bug fix
author | yutaka@localhost.localdomain |
---|---|
date | Thu, 10 Jun 2010 23:21:51 +0900 |
parents | aa37b133e1c3 |
children | 9f6e29836095 |
files | Renderer/Engine/viewer.cc |
diffstat | 1 files changed, 33 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/viewer.cc Thu Jun 10 17:22:15 2010 +0900 +++ b/Renderer/Engine/viewer.cc Thu Jun 10 23:21:51 2010 +0900 @@ -568,16 +568,18 @@ int rangey = (starty + split_screen_h - 1 > this->height) ? this->height - starty + 1 : split_screen_h; -#if 0 +#if 1 + + if(spack->info.size > 0) { - int array_task_num = (this->width + split_screen_w - 1) / split_screen_w; - HTaskPtr task_draw_array = manager->create_task_array(DrawSpan, array_task_num, 6, 1, rangey); - Task *task_draw = 0; - - while (startx < this->width) { - + int array_task_num = (this->width + split_screen_w - 1) / split_screen_w; + HTaskPtr task_draw_array = manager->create_task_array(DrawSpan, array_task_num, 6, 1, rangey); + Task *task_draw = 0; + + while (startx < this->width) { + // Draw SpanPack - + task_draw = task_draw_array->next_task_array(DrawSpan,task_draw); task_draw->set_param(0,(memaddr)&pixels[(startx-1) + this->width*(starty-1)]); task_draw->set_param(1,this->width); @@ -589,9 +591,9 @@ task_draw->set_inData(0,spack, sizeof(SpanPack)); for (int i = 0; i < rangey; i++) { - task_draw->set_outData(i, - &pixels[(startx-1) + this->width*(starty-1 + i) ], - (endx-startx+1)*sizeof(int)); + task_draw->set_outData(i, + &pixels[(startx-1) + this->width*(starty-1 + i) ], + (endx-startx+1)*sizeof(int)); } startx += split_screen_w; @@ -601,20 +603,27 @@ endx = this->width; } - } + } + + task_draw_array->spawn_task_array(task_draw->next()); + task_draw_array->set_cpu(SPE_ANY); + task_next->wait_for(task_draw_array); + task_draw_array->wait_for(data_update_wait); + task_draw_array->spawn(); - task_draw_array->spawn_task_array(task_draw->next()); - task_draw_array->set_cpu(SPE_ANY); - task_next->wait_for(task_draw_array); - task_draw_array->wait_for(data_update_wait); - task_draw_array->spawn(); + } else { + + memset(&pixels[(startx-1)+this->width*(starty-1)], + 0, (this->width)*sizeof(int)*rangey); -#else if + } + +#else HTaskPtr task_draw; while (startx < this->width) { - if (spack->info.size > 0) { + if (spack->info.size > 0) { // Draw SpanPack task_draw = manager->create_task(DrawSpan); @@ -634,14 +643,14 @@ (endx-startx+1)*sizeof(int)); } - } else { + } else { // 7.7.3 SL1 Data Cache Range Set to Zero コマンド // を使って、DMAでclearするべき... ということは、 // それもSPEでやる方が良い? - memset(&pixels[(startx-1)+this->width*(starty-1)], - 0, (this->width)*sizeof(int)*rangey); - break; - } + memset(&pixels[(startx-1)+this->width*(starty-1)], + 0, (this->width)*sizeof(int)*rangey); + break; + } task_draw->set_cpu(SPE_ANY); task_next->wait_for(task_draw);