diff options
author | Chris Forbes <chrisf@ijw.co.nz> | 2014-01-20 21:30:35 +1300 |
---|---|---|
committer | Chris Forbes <chrisf@ijw.co.nz> | 2014-04-10 18:27:41 +1200 |
commit | ba3499ba01135c54d9b28a4bae916845cdbb64b7 (patch) | |
tree | 5f32a7341e0c7e33ca01b7c13c6e1831db6fa91c | |
parent | ca1d1b2fc1d1f7fb5dbbc0719c6c899b97bc9e6b (diff) |
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 <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_tex.c | 11 |
1 files 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 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 |