Mercurial > hg > Game > Cerium
changeset 1119:543c735a98b3 draft
CreateSpan, pipleline trial and error on PS3.
author | tkaito@henri |
---|---|
date | Fri, 28 Jan 2011 02:03:58 +0900 |
parents | 7ba266bb54d3 |
children | 377c2dbd6e80 |
files | Renderer/Engine/spe/CreateSpan.cc |
diffstat | 1 files changed, 45 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/spe/CreateSpan.cc Fri Jan 28 02:15:08 2011 +0900 +++ b/Renderer/Engine/spe/CreateSpan.cc Fri Jan 28 02:03:58 2011 +0900 @@ -290,9 +290,46 @@ smanager->dma_load(g->spack, (memaddr)spackList[index], sizeof(SpanPack), SPAN_PACK_LOAD); g->prev_index = index; - smanager->dma_wait(SPAN_PACK_LOAD); + //smanager->dma_wait(SPAN_PACK_LOAD); } + tmp_xpos = calc(vMid10->x - vMin->x ,div_y, i, vMin->x); + tmp_end = calc(vMid->x - vMin->x ,div_y, i, vMin->x); + tmp_z = calc(vMid10->z - vMin->z ,div_y, i, vMin->z); + tmp_zpos = calc(vMid->z - vMin->z ,div_y, i, vMin->z); + + tmp_tex1 =((i/(div_y)) * vMid10->tex_x) + + ( ((div_y - i)/(div_y)) * vMin->tex_x); + tmp_tex2 =( (i/(div_y)) * vMid->tex_x) + + ( ((div_y - i)/(div_y)) * vMin->tex_x); + + tmp_tey1 =( (i/(div_y)) * vMid10->tex_y) + + ( ((div_y - i)/(div_y)) * vMin->tex_y); + tmp_tey2 =( (i/(div_y)) * vMid->tex_y) + + ( ((div_y - i)/(div_y)) * vMin->tex_y); + + if (tmp_xpos > tmp_end) { + x = (int)tmp_end; + length = (int)(tmp_xpos)-(int)(tmp_end)+1; + start_z = tmp_zpos; + end_z = tmp_z; + start_tex_x = tmp_tex2; + end_tex_x = tmp_tex1; + start_tex_y = tmp_tey2; + end_tex_y = tmp_tey1; + } else { + x = (int)tmp_xpos; + length = (int)(tmp_end)-(int)(tmp_xpos)+1; + start_z = tmp_z; + end_z = tmp_zpos; + start_tex_x = tmp_tex1; + end_tex_x = tmp_tex2; + start_tex_y = tmp_tey1; + end_tex_y = tmp_tey2; + } + + smanager->dma_wait(SPAN_PACK_LOAD); + /** * 書き込む SpanPack が満杯だったら * メインメモリで allocate した領域 (next) を持ってきて @@ -321,6 +358,7 @@ smanager->dma_load(g->spack, (memaddr)spackList[index], sizeof(SpanPack), SPAN_PACK_LOAD); + smanager->dma_wait(SPAN_PACK_LOAD); g->spack->init((index+1)*split_screen_h); } @@ -330,18 +368,19 @@ */ continue; } - + /* tmp_xpos = calc(vMid10->x - vMin->x ,div_y, i, vMin->x); tmp_end = calc(vMid->x - vMin->x ,div_y, i, vMin->x); tmp_z = calc(vMid10->z - vMin->z ,div_y, i, vMin->z); tmp_zpos = calc(vMid->z - vMin->z ,div_y, i, vMin->z); - + */ + length = (tmp_xpos > tmp_end) ? (int)tmp_xpos - (int)tmp_end : (int)tmp_end - (int)tmp_xpos; if (length == 0) { continue; } - + /* tmp_tex1 =((i/(div_y)) * vMid10->tex_x) + ( ((div_y - i)/(div_y)) * vMin->tex_x); tmp_tex2 =( (i/(div_y)) * vMid->tex_x) + @@ -371,8 +410,8 @@ start_tex_y = tmp_tey1; end_tex_y = tmp_tey2; } - - smanager->dma_wait(SPAN_PACK_LOAD); + */ + //smanager->dma_wait(SPAN_PACK_LOAD); Span *span = &g->spack->span[g->spack->info.size++];