Mercurial > hg > Game > Cerium
changeset 842:8accca9e168e draft
merged
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 02 Jun 2010 01:40:06 +0900 |
parents | 8d702fc5d77a (current diff) ee23700a135b (diff) |
children | de64695a7f02 |
files | Renderer/Engine/viewer.cc |
diffstat | 4 files changed, 82 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/spe/DrawSpan.cc Wed Jun 02 01:39:15 2010 +0900 +++ b/Renderer/Engine/spe/DrawSpan.cc Wed Jun 02 01:40:06 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 Wed Jun 02 01:39:15 2010 +0900 +++ b/Renderer/Engine/task/DrawSpan.cc Wed Jun 02 01:40:06 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 Wed Jun 02 01:39:15 2010 +0900 +++ b/Renderer/Engine/viewer.cc Wed Jun 02 01:40:06 2010 +0900 @@ -513,7 +513,6 @@ void Viewer::common_draw(HTaskPtr task_next) { - HTaskPtr task_draw; //task_next = manager->create_task(Dummy); //task_next->set_post(post2runLoop, (void*)this); @@ -558,7 +557,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]; @@ -570,6 +568,51 @@ int rangey = (starty + split_screen_h - 1 > this->height) ? this->height - starty + 1 : split_screen_h; +#if 1 + + 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); + 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 @@ -581,6 +624,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)); @@ -589,6 +633,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するべき... ということは、 @@ -610,6 +655,8 @@ endx = this->width; } } +#endif + } data_update_wait->spawn();