From 7c24a4c6a86402be1f68d23f4d52d4d071957801 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Thu, 10 Feb 2011 10:16:21 +0100 Subject: r300g: add a way to change texture properties arbitrarily So that we can implement resource_copy on arbitrary data. --- src/gallium/drivers/r300/r300_state_derived.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/gallium/drivers/r300/r300_state_derived.c') 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. */ -- cgit v1.2.3