From: Chris Forbes Date: Mon, 20 Jan 2014 08:30:35 +0000 (+1300) Subject: i965: Adjust map/unmap code for MinLevel/MinLayer X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ba3499ba01135c54d9b28a4bae916845cdbb64b7;p=mesa.git i965: Adjust map/unmap code for MinLevel/MinLayer This allows core mesa's TexSubImage paths etc to work correctly with views which have nonzero MinLevel or MinLayer. Signed-off-by: Chris Forbes Reviewed-by: Ian Romanick Reviewed-by: Kenneth Graunke Acked-by: Eric Anholt --- diff --git a/src/mesa/drivers/dri/i965/intel_tex.c b/src/mesa/drivers/dri/i965/intel_tex.c index b69018e4be7..f18ca456471 100644 --- a/src/mesa/drivers/dri/i965/intel_tex.c +++ b/src/mesa/drivers/dri/i965/intel_tex.c @@ -220,8 +220,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 @@ -235,7 +238,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