[Mesa-dev] [PATCH 07/15] i965: Adjust map/unmap code for MinLevel/MinLayer

Chris Forbes chrisf at ijw.co.nz
Tue Jan 21 02:34:23 PST 2014


This allows core mesa's TexSubImage paths etc to work correctly
with views which have nonzero MinLevel or MinLayer.

Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
 src/mesa/drivers/dri/i965/intel_tex.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_tex.c b/src/mesa/drivers/dri/i965/intel_tex.c
index 3b14796..b601620 100644
--- a/src/mesa/drivers/dri/i965/intel_tex.c
+++ b/src/mesa/drivers/dri/i965/intel_tex.c
@@ -219,8 +219,11 @@ intel_map_texture_image(struct gl_context *ctx,
    if (tex_image->TexObject->Target == GL_TEXTURE_CUBE_MAP)
       slice = tex_image->Face;
 
-   intel_miptree_map(brw, mt, tex_image->Level, slice, x, y, w, h, mode,
-		     (void **)map, stride);
+   intel_miptree_map(brw, mt,
+                     tex_image->Level + tex_image->TexObject->MinLevel,
+                     slice + tex_image->TexObject->MinLayer,
+                     x, y, w, h, mode,
+                     (void **)map, stride);
 }
 
 static void
@@ -234,7 +237,9 @@ intel_unmap_texture_image(struct gl_context *ctx,
    if (tex_image->TexObject->Target == GL_TEXTURE_CUBE_MAP)
       slice = tex_image->Face;
 
-   intel_miptree_unmap(brw, mt, tex_image->Level, slice);
+   intel_miptree_unmap(brw, mt,
+         tex_image->Level + tex_image->TexObject->MinLevel,
+         slice + tex_image->TexObject->MinLayer);
 }
 
 static GLboolean
-- 
1.8.5.3



More information about the mesa-dev mailing list