Mercurial > hg > Game > Cerium
changeset 838:92bf8fc6a2a9 draft
Draw Span Task -> Task Array
author | Yutaka_Kinjyo |
---|---|
date | Fri, 28 May 2010 01:47:42 +0900 |
parents | 1ba88b4cfe44 |
children | 1001c4bea1a0 |
files | Renderer/Engine/spe/DrawSpan.cc Renderer/Engine/task/DrawSpan.cc Renderer/Engine/viewer.cc |
diffstat | 3 files changed, 105 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/spe/DrawSpan.cc Tue May 25 19:14:44 2010 +0900 +++ b/Renderer/Engine/spe/DrawSpan.cc Fri May 28 01:47:42 2010 +0900 @@ -494,6 +494,22 @@ static int run(SchedTask *smanager, void *rbuf, void *wbuf) { + + if ((int)smanager->get_param(5) == 0) { + + int rangex_start = (long)smanager->get_param(2); + int rangex_end = (long)smanager->get_param(3); + + int rangex = rangex_end - rangex_start + 1; + int rangey = (long)smanager->get_param(4); + + linebuf_init(smanager, rangex, rangey, 0); + + return 0; + + } + + G g0; Gptr g = &g0;
--- a/Renderer/Engine/task/DrawSpan.cc Tue May 25 19:14:44 2010 +0900 +++ b/Renderer/Engine/task/DrawSpan.cc Fri May 28 01:47:42 2010 +0900 @@ -462,6 +462,23 @@ static int run(SchedTask *smanager, void *rbuf, void *wbuf) { + + + if ((int)smanager->get_param(5) == 0) { + + int rangex_start = (long)smanager->get_param(2); + int rangex_end = (long)smanager->get_param(3); + + int rangex = rangex_end - rangex_start + 1; + int rangey = (long)smanager->get_param(4); + + linebuf_init(smanager, rangex, rangey, 0); + + return 0; + + } + + G g0; Gptr g = &g0;
--- a/Renderer/Engine/viewer.cc Tue May 25 19:14:44 2010 +0900 +++ b/Renderer/Engine/viewer.cc Fri May 28 01:47:42 2010 +0900 @@ -514,7 +514,6 @@ void Viewer::common_draw(HTaskPtr task_next) { - HTaskPtr task_draw; //task_next = manager->create_task(Dummy); //task_next->set_post(post2runLoop, (void*)this); @@ -559,7 +558,6 @@ update_task_create(light_sysswitch,size,LightSysSwitch,(int)SPE_0+i,data_update_wait); } - ppack->clear(); for (int i = 0; i < spackList_length; i++) { SpanPack *spack = &spackList[i]; @@ -571,6 +569,74 @@ int rangey = (starty + split_screen_h - 1 > this->height) ? this->height - starty + 1 : split_screen_h; +#if 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) { + + if (spack->info.size > 0) { + // 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); + task_draw->set_param(2,startx); + task_draw->set_param(3,endx); + task_draw->set_param(4,rangey); + task_draw->set_param(5,spack->info.size); + + 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)); + } + + } else { + + 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); + task_draw->set_param(2,startx); + task_draw->set_param(3,endx); + task_draw->set_param(4,rangey); + task_draw->set_param(5,spack->info.size); + + 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)); + + } + + + } + + startx += split_screen_w; + endx += split_screen_w; + + if (endx > this->width) { + 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(); + +#else if + + HTaskPtr task_draw; + while (startx < this->width) { if (spack->info.size > 0) { // Draw SpanPack @@ -582,6 +648,7 @@ task_draw->set_param(2,startx); task_draw->set_param(3,endx); task_draw->set_param(4,rangey); + task_draw->set_param(5,spack->info.size); task_draw->add_inData(spack, sizeof(SpanPack)); @@ -590,6 +657,7 @@ &pixels[(startx-1) + this->width*(starty-1 + i) ], (endx-startx+1)*sizeof(int)); } + } else { // 7.7.3 SL1 Data Cache Range Set to Zero コマンド // を使って、DMAでclearするべき... ということは、 @@ -611,6 +679,8 @@ endx = this->width; } } +#endif + } data_update_wait->spawn();