r600: fix mipmaps
authorAlex Deucher <alexdeucher@gmail.com>
Thu, 30 Jul 2009 07:30:46 +0000 (03:30 -0400)
committerAlex Deucher <alexdeucher@gmail.com>
Thu, 30 Jul 2009 07:31:37 +0000 (03:31 -0400)
redbook mipmap works

src/mesa/drivers/dri/r600/r600_texstate.c
src/mesa/drivers/dri/r600/r700_render.c

index 6918b3b8a12a102fc504c030d114e4c096f425c5..4840586858d0ebae6e727be964be4f5eb7c5f5be 100644 (file)
@@ -610,6 +610,11 @@ static void setup_hardware_state(context_t *rmesa, struct gl_texture_object *tex
        SETfield(t->SQ_TEX_RESOURCE1, firstImage->Height - 1,
                 TEX_HEIGHT_shift, TEX_HEIGHT_mask);
 
+       if ((t->mt->lastLevel - t->mt->firstLevel) > 0) {
+               t->SQ_TEX_RESOURCE3 = t->mt->levels[0].size / 256;
+               SETfield(t->SQ_TEX_RESOURCE4, t->mt->firstLevel, BASE_LEVEL_shift, BASE_LEVEL_mask);
+               SETfield(t->SQ_TEX_RESOURCE5, t->mt->lastLevel, LAST_LEVEL_shift, LAST_LEVEL_mask);
+       }
 }
 
 /**
index 4e0d5391d0a0336319487f06e293ca2b99df8b45..1810f4be0eee71abbf7e9247a68de670d73bcb13 100644 (file)
@@ -173,7 +173,7 @@ GLboolean r700SendTextureState(context_t *context)
                                                 RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0, 0, &offset_mod);
                            R600_OUT_BATCH_RELOC(r700->textures[i]->SQ_TEX_RESOURCE3,
                                                 bo,
-                                                0,
+                                                r700->textures[i]->SQ_TEX_RESOURCE3,
                                                 RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0, 0, &offset_mod);
                            R600_OUT_BATCH(r700->textures[i]->SQ_TEX_RESOURCE4);
                            R600_OUT_BATCH(r700->textures[i]->SQ_TEX_RESOURCE5);