comparison TaskManager/Test/test_render/spe/DrawSpan.cpp @ 267:7f2b30acf311

merge
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 04 Jun 2009 00:01:11 +0900
parents 52db409f255a 5c9dbd54cd51
children 06d53c7b87c2
comparison
equal deleted inserted replaced
246:0b028a881f3b 267:7f2b30acf311
7 #include "viewer_types.h" 7 #include "viewer_types.h"
8 #include "Func.h" 8 #include "Func.h"
9 9
10 SchedDefineTask(DrawSpan); 10 SchedDefineTask(DrawSpan);
11 11
12 <<<<<<< local
12 #define TEX_LOAD1 0 13 #define TEX_LOAD1 0
13 #define TEX_LOAD2 1 14 #define TEX_LOAD2 1
14 #define SPAN_PACK_LOAD 2 15 #define SPAN_PACK_LOAD 2
15 #define FB_STORE 3 16 #define FB_STORE 3
16 17 =======
18 <<<<<<< local
19 static TileHashPtr hash;
20 =======
21 <<<<<<< local
22 static const int hashsize = 263;
23 >>>>>>> other
24
25 <<<<<<< local
17 DrawSpan::~DrawSpan(void) 26 DrawSpan::~DrawSpan(void)
18 { 27 {
19 smanager->dma_wait(FB_STORE); 28 smanager->dma_wait(FB_STORE);
20 free((void*)((int)linebuf*doneWrite)); 29 free((void*)((int)linebuf*doneWrite));
21 } 30 }
22 31 =======
32 static TilePtr hash_table[hashsize] = {NULL};
33 >>>>>>> other
34
35 <<<<<<< local
23 inline vector float 36 inline vector float
24 spu_re_nrm(vector float a) 37 spu_re_nrm(vector float a)
25 { 38 {
26 vector float unit = (vector float){1.0, 1.0, 1.0, 1.0}; 39 vector float unit = (vector float){1.0, 1.0, 1.0, 1.0};
27 vector float approximation; 40 vector float approximation;
28 41 =======
42 unsigned short PRIME[8] = {
43 0x002, 0x065, 0x0c7, 0x133, 0x191, 0x1f3, 0x259, 0x2bd,
44 };
45 >>>>>>> other
46
47 <<<<<<< local
29 approximation = spu_re(a); 48 approximation = spu_re(a);
30 return spu_madd(spu_nmsub(approximation, a, unit), 49 return spu_madd(spu_nmsub(approximation, a, unit),
31 approximation, approximation); 50 approximation, approximation);
32 } 51 }
33 52
42 getLocalXVec(vector signed int x) 61 getLocalXVec(vector signed int x)
43 { 62 {
44 return getLocalPositionVec(x, split_screen_w); 63 return getLocalPositionVec(x, split_screen_w);
45 } 64 }
46 65
66 =======
67 >>>>>>> other
68 static TileListPtr tileList;
69 >>>>>>> other
47 70
48 /** 71 /**
49 * テクスチャは、TEXTURE_SPLIT_PIXEL^2 のブロックに分割する 72 * テクスチャは、TEXTURE_SPLIT_PIXEL^2 のブロックに分割する
50 * 73 *
51 * +---+---+---+---+---+---+ 74 * +---+---+---+---+---+---+
100 DrawSpan::getTile(int tx, int ty, int tw, uint32 *tex_addr_top) 123 DrawSpan::getTile(int tx, int ty, int tw, uint32 *tex_addr_top)
101 { 124 {
102 int block = getTexBlock(tx, ty, tw); 125 int block = getTexBlock(tx, ty, tw);
103 return tex_addr_top + block*TEXTURE_BLOCK_SIZE; 126 return tex_addr_top + block*TEXTURE_BLOCK_SIZE;
104 } 127 }
128 =======
129 static unsigned char *tex;
130 >>>>>>> other
105 131
106 /** 132 /**
107 * FrameBuffer に書き込む rgb の領域初期化 133 * FrameBuffer に書き込む rgb の領域初期化
108 * 134 *
109 * @param width Width of Buffer 135 * @param width Width of Buffer
595 621
596 int tl_tag[2] = {TEX_LOAD1, TEX_LOAD2}; 622 int tl_tag[2] = {TEX_LOAD1, TEX_LOAD2};
597 int tl_tag_flg1 = 0; 623 int tl_tag_flg1 = 0;
598 int tl_tag_flg2 = 1; 624 int tl_tag_flg2 = 1;
599 625
626 <<<<<<< local
627 =======
628 float *zRow = (float*)smanager->get_input(1);
629 int **linebuf = (int**)smanager->allocate(sizeof(int*)*rangey);
630
631 for (int i = 0; i < rangey; i++) {
632 linebuf[i] = (int*)smanager->get_output(i);
633 <<<<<<< local
634 linebuf_init(linebuf[i], rangex, 0xffffffff);
635 =======
636 <<<<<<< local
637 linebuf_init(linebuf[i], rangex, 0xffffff);
638 =======
639 //linebuf_init(linebuf[i], rangex, 0x00ff00ff);
640 linebuf_init(linebuf[i], rangex, 0);
641 >>>>>>> other
642 >>>>>>> other
643 }
644
645 >>>>>>> other
600 do { 646 do {
601 /** 647 /**
602 * SpanPack->next が存在する場合、 648 * SpanPack->next が存在する場合、
603 * 現在の SpanPack を処理してる間に 649 * 現在の SpanPack を処理してる間に
604 * 次の SpanPack の DMA 転送を行う 650 * 次の SpanPack の DMA 転送を行う
608 sizeof(SpanPack), SPAN_PACK_LOAD); 654 sizeof(SpanPack), SPAN_PACK_LOAD);
609 } else { 655 } else {
610 next_spack = NULL; 656 next_spack = NULL;
611 } 657 }
612 658
659 <<<<<<< local
613 SpanPtr resume_span = &nop_span; 660 SpanPtr resume_span = &nop_span;
614 int resume_span_x = 0; 661 int resume_span_x = 0;
615 662
616 for (int t = 0; t < spack->info.size; t++) { 663 for (int t = 0; t < spack->info.size; t++) {
617 SpanPtr next_span; 664 SpanPtr next_span;
618 int next_span_x; 665 int next_span_x;
619 666
667 =======
668 for (int t = spack->info.start; t < spack->info.size; t++) {
669 >>>>>>> other
620 span = &spack->span[t]; 670 span = &spack->span[t];
621 671
622 /** 672 /**
623 * span の長さによって、drawLine か drawDot を選択している 673 * span の長さによって、drawLine か drawDot を選択している
624 */ 674 */
664 * goto FINISH; の時は reboot なので 714 * goto FINISH; の時は reboot なので
665 * linebuf, zRow は free() しない 715 * linebuf, zRow は free() しない
666 */ 716 */
667 717
668 free(free_spack); 718 free(free_spack);
719 <<<<<<< local
720 =======
721 free(linebuf);
722 <<<<<<< local
723 =======
724 free(zRow);
725 <<<<<<< local
726 =======
727 <<<<<<< local
728 free(tileList);
729 free(tilist);
730 free(next_tilist);
731 >>>>>>> other
732 >>>>>>> other
733
734 =======
735 free(tex);
736 >>>>>>> other
737 >>>>>>> other
669 return 0; 738 return 0;
670 } 739 }