diff options
author | Aapo Tahkola <aet@rasterburn.org> | 2006-03-06 19:28:10 +0000 |
---|---|---|
committer | Aapo Tahkola <aet@rasterburn.org> | 2006-03-06 19:28:10 +0000 |
commit | c107058e7e858c0b6da195e337cce0621f31b91d (patch) | |
tree | 98f23e46ababbea253ecd4d6e035d87f0a939f81 /src/mesa/drivers/dri/r300/r300_texmem.c | |
parent | 3bca4f679a411246306e7e141c562253cb5f4c2d (diff) | |
download | external_mesa3d-c107058e7e858c0b6da195e337cce0621f31b91d.zip external_mesa3d-c107058e7e858c0b6da195e337cce0621f31b91d.tar.gz external_mesa3d-c107058e7e858c0b6da195e337cce0621f31b91d.tar.bz2 |
Port r200 tex tiling code to run on r300 but keep it disabled.
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_texmem.c')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_texmem.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_texmem.c b/src/mesa/drivers/dri/r300/r300_texmem.c index f334880..d78ec3b 100644 --- a/src/mesa/drivers/dri/r300/r300_texmem.c +++ b/src/mesa/drivers/dri/r300/r300_texmem.c @@ -261,8 +261,11 @@ static void r300UploadRectSubImage(r300ContextPtr rmesa, r300EmitBlit(rmesa, blit_format, dstPitch, GET_START(®ion), - dstPitch, t->bufAddr, - 0, 0, 0, done, width, lines); + dstPitch | (t->tile_bits >> 16), + t->bufAddr, + 0, 0, + 0, done, + width, lines); r300EmitWait(rmesa, R300_WAIT_2D); @@ -390,8 +393,8 @@ static void uploadSubImage( r300ContextPtr rmesa, r300TexObjPtr t, tex.pitch = MAX2((texImage->Width * texImage->TexFormat->TexelBytes) / 64, 1); tex.offset += tmp.x & ~1023; tmp.x = tmp.x % 1024; -#if 0 - if (t->tile_bits & R200_TXO_MICRO_TILE) { +#if 1 + if (t->tile_bits & R300_TXO_MICRO_TILE) { /* need something like "tiled coordinates" ? */ tmp.y = tmp.x / (tex.pitch * 128) * 2; tmp.x = tmp.x % (tex.pitch * 128) / 2 / texImage->TexFormat->TexelBytes; @@ -402,10 +405,10 @@ static void uploadSubImage( r300ContextPtr rmesa, r300TexObjPtr t, { tmp.x = tmp.x >> (texImage->TexFormat->TexelBytes >> 1); } -#if 0 - if ((t->tile_bits & R200_TXO_MACRO_TILE) && +#if 1 + if ((t->tile_bits & R300_TXO_MACRO_TILE) && (texImage->Width * texImage->TexFormat->TexelBytes >= 256) && - ((!(t->tile_bits & R200_TXO_MICRO_TILE) && (texImage->Height >= 8)) || + ((!(t->tile_bits & R300_TXO_MICRO_TILE) && (texImage->Height >= 8)) || (texImage->Height >= 16))) { /* weird: R200 disables macro tiling if mip width is smaller than 256 bytes, OR if height is smaller than 8 automatically, but if micro tiling is active @@ -502,6 +505,11 @@ int r300UploadTexImages(r300ContextPtr rmesa, r300TexObjPtr t, GLuint face) + t->base.memBlock->ofs; t->offset = t->bufAddr; + if (!(t->base.tObj->Image[0][0]->IsClientData)) { + /* hope it's safe to add that here... */ + t->offset |= t->tile_bits; + } + /* Mark this texobj as dirty on all units: */ t->dirty_state = TEX_ALL; |