Mercurial > hg > Members > kono > Cerium
comparison Renderer/Engine/viewer.cc @ 652:dbe137505f2e
bulk task list start.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 23 Nov 2009 12:01:45 +0900 |
parents | 60aa3f241b10 |
children | e201be3f6897 b7376415fa5f |
comparison
equal
deleted
inserted
replaced
651:c13bbb7d70b3 | 652:dbe137505f2e |
---|---|
146 spackList[i-1].init(i*split_screen_h); | 146 spackList[i-1].init(i*split_screen_h); |
147 } | 147 } |
148 | 148 |
149 task_next = manager->create_task(Dummy); | 149 task_next = manager->create_task(Dummy); |
150 | 150 |
151 // ここは、Iterator を用意するべきだよね | |
151 for (int i = 0; i < spe_num; i++) { | 152 for (int i = 0; i < spe_num; i++) { |
152 task_tex = manager->create_task(LoadTexture); | 153 task_tex = manager->create_task(LoadTexture); |
153 /* | |
154 * ここはもう少しわかりやすい使い方がいいかもしれぬ。こんなもん? | |
155 */ | |
156 task_tex->set_cpu((CPU_TYPE)((int)SPE_0 + i)); | 154 task_tex->set_cpu((CPU_TYPE)((int)SPE_0 + i)); |
157 task_next->wait_for(task_tex); | 155 task_next->wait_for(task_tex); |
158 task_tex->spawn(); | 156 task_tex->spawn(); |
159 } | 157 } |
160 | 158 |
464 for (int i = 0; i < range_base; i++) { | 462 for (int i = 0; i < range_base; i++) { |
465 int index_start = range*i; | 463 int index_start = range*i; |
466 int index_end = (index_start + range >= spackList_length) | 464 int index_end = (index_start + range >= spackList_length) |
467 ? spackList_length : index_start + range; | 465 ? spackList_length : index_start + range; |
468 | 466 |
469 HTaskPtr task_create_sp = manager->create_task(CreateSpan); | 467 HTaskPtr task_create_sp = manager->create_task(CreateSpan); |
470 task_create_sp->add_inData(ppack, sizeof(PolygonPack)); | |
471 task_create_sp->add_inData(spackList_ptr, | |
472 sizeof(SpanPack*)*spackList_length_align); | |
473 task_create_sp->add_inData(&spackList[index_start], sizeof(SpanPack)); | |
474 | 468 |
475 task_create_sp->set_param(0,index_start); | 469 task_create_sp->set_param(0,index_start); |
476 | 470 |
477 /** | 471 /** |
478 * ex. screen_height が 480, spenum が 6 の場合、各SPEのy担当範囲 | 472 * ex. screen_height が 480, spenum が 6 の場合、各SPEのy担当範囲 |
484 * [649..864] [865..1080] | 478 * [649..864] [865..1080] |
485 */ | 479 */ |
486 task_create_sp->set_param(1,index_start*split_screen_h + 1); | 480 task_create_sp->set_param(1,index_start*split_screen_h + 1); |
487 task_create_sp->set_param(2,index_end*split_screen_h); | 481 task_create_sp->set_param(2,index_end*split_screen_h); |
488 | 482 |
483 task_create_sp->add_inData(ppack, sizeof(PolygonPack)); | |
484 task_create_sp->add_inData(spackList_ptr, | |
485 sizeof(SpanPack*)*spackList_length_align); | |
486 task_create_sp->add_inData(&spackList[index_start], sizeof(SpanPack)); | |
487 | |
489 task_next->wait_for(task_create_sp); | 488 task_next->wait_for(task_create_sp); |
490 task_create_sp->wait_for(task_create_pp); | 489 task_create_sp->wait_for(task_create_pp); |
491 | 490 |
492 task_create_sp->set_cpu(SPE_ANY); | 491 task_create_sp->set_cpu(SPE_ANY); |
493 task_create_sp->spawn(); | 492 task_create_sp->spawn(); |
517 | 516 |
518 while (startx < this->width) { | 517 while (startx < this->width) { |
519 if (spack->info.size > 0) { | 518 if (spack->info.size > 0) { |
520 // Draw SpanPack | 519 // Draw SpanPack |
521 task_draw = manager->create_task(DrawSpan); | 520 task_draw = manager->create_task(DrawSpan); |
522 task_draw->add_inData(spack, sizeof(SpanPack)); | |
523 | 521 |
524 task_draw->set_param(0, | 522 task_draw->set_param(0, |
525 (memaddr)&pixels[(startx-1) + this->width*(starty-1)]); | 523 (memaddr)&pixels[(startx-1) + this->width*(starty-1)]); |
526 task_draw->set_param(1,this->width); | 524 task_draw->set_param(1,this->width); |
525 task_draw->set_param(2,startx); | |
526 task_draw->set_param(3,endx); | |
527 task_draw->set_param(4,rangey); | |
528 | |
529 task_draw->add_inData(spack, sizeof(SpanPack)); | |
527 | 530 |
528 for (int i = 0; i < rangey; i++) { | 531 for (int i = 0; i < rangey; i++) { |
529 task_draw->add_outData( | 532 task_draw->add_outData( |
530 &pixels[(startx-1) + this->width*(starty-1 + i) ], | 533 &pixels[(startx-1) + this->width*(starty-1 + i) ], |
531 (endx-startx+1)*sizeof(int)); | 534 (endx-startx+1)*sizeof(int)); |
537 memset(&pixels[(startx-1)+this->width*(starty-1)], | 540 memset(&pixels[(startx-1)+this->width*(starty-1)], |
538 0, (this->width)*sizeof(int)*rangey); | 541 0, (this->width)*sizeof(int)*rangey); |
539 break; | 542 break; |
540 } | 543 } |
541 | 544 |
542 task_draw->set_param(2,startx); | |
543 task_draw->set_param(3,endx); | |
544 task_draw->set_param(4,rangey); | |
545 task_draw->set_cpu(SPE_ANY); | 545 task_draw->set_cpu(SPE_ANY); |
546 task_next->wait_for(task_draw); | 546 task_next->wait_for(task_draw); |
547 task_draw->spawn(); | 547 task_draw->spawn(); |
548 | 548 |
549 startx += split_screen_w; | 549 startx += split_screen_w; |