summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/r300_texmem.c
diff options
context:
space:
mode:
authorAapo Tahkola <aet@rasterburn.org>2006-03-06 19:28:10 +0000
committerAapo Tahkola <aet@rasterburn.org>2006-03-06 19:28:10 +0000
commitc107058e7e858c0b6da195e337cce0621f31b91d (patch)
tree98f23e46ababbea253ecd4d6e035d87f0a939f81 /src/mesa/drivers/dri/r300/r300_texmem.c
parent3bca4f679a411246306e7e141c562253cb5f4c2d (diff)
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.c22
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 f334880f27..d78ec3b12c 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(&region),
- 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;