summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300/r300_state_derived.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2011-02-10 10:16:21 +0100
committerMarek Olšák <maraeo@gmail.com>2011-02-10 11:27:35 +0100
commit7c24a4c6a86402be1f68d23f4d52d4d071957801 (patch)
treef376fc6a6b24bdf10eec03366be4bd8dc88bde3f /src/gallium/drivers/r300/r300_state_derived.c
parent56ba7e913fef0ea2b1bead582108f9ab3ab8263d (diff)
r300g: add a way to change texture properties arbitrarily
So that we can implement resource_copy on arbitrary data.
Diffstat (limited to 'src/gallium/drivers/r300/r300_state_derived.c')
-rw-r--r--src/gallium/drivers/r300/r300_state_derived.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c
index 41a02f37ce..41b57b502f 100644
--- a/src/gallium/drivers/r300/r300_state_derived.c
+++ b/src/gallium/drivers/r300/r300_state_derived.c
@@ -733,13 +733,18 @@ static void r300_merge_textures_and_samplers(struct r300_context* r300)
/* Even though we do not implement mipmapping for NPOT
* textures, we should at least honor the minimum level
* which is allowed to be displayed. We do this by setting up
- * an i-th mipmap level as the zero level. */
+ * the i-th mipmap level as the zero level. */
+ unsigned offset = tex->tex_offset +
+ tex->tex.offset_in_bytes[min_level];
+
r300_texture_setup_format_state(r300->screen, tex,
min_level,
&texstate->format);
- texstate->format.tile_config |=
- tex->tex.offset_in_bytes[min_level] & 0xffffffe0;
- assert((tex->tex.offset_in_bytes[min_level] & 0x1f) == 0);
+ texstate->format.tile_config |= offset & 0xffffffe0;
+ assert((offset & 0x1f) == 0);
+ } else {
+ texstate->format.tile_config |= tex->tex_offset & 0xffffffe0;
+ assert((tex->tex_offset & 0x1f) == 0);
}
/* Assign a texture cache region. */