diff options
author | Anuj Phogat <[email protected]> | 2014-07-14 16:16:47 -0700 |
---|---|---|
committer | Anuj Phogat <[email protected]> | 2014-07-17 15:52:27 -0700 |
commit | 984a02ba556802775d63a9ce77b4dac567bf8680 (patch) | |
tree | 59bf7cfd267be4309a184c5352c3b7f3c9071eb6 /src/mesa/drivers/dri/i965 | |
parent | 5d9f5cd35b63e8d7fdb42a5ad26c53d2a19f6985 (diff) |
i965: Fix z_offset computation in intel_miptree_unmap_depthstencil()
The bug is triggered by using glTexSubImage2d() with GL_DEPTH_STENCIL
as base internal format and non-zero x, y offsets. Currently x, y
offsets are ignored while updating the texture image.
Fixes Khronos GLES3 CTS tests:
npot_tex_sub_image_2d
npot_tex_sub_image_3d
npot_pbo_tex_sub_image_2d
npot_pbo_tex_sub_image_2d
Cc: <[email protected]>
Signed-off-by: Anuj Phogat <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index 2ab0faa632c..b36ffc78917 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -2129,9 +2129,9 @@ intel_miptree_unmap_depthstencil(struct brw_context *brw, x + s_image_x + map->x, y + s_image_y + map->y, brw->has_swizzling); - ptrdiff_t z_offset = ((y + z_image_y) * + ptrdiff_t z_offset = ((y + z_image_y + map->y) * (z_mt->pitch / 4) + - (x + z_image_x)); + (x + z_image_x + map->x)); if (map_z32f_x24s8) { z_map[z_offset] = packed_map[(y * map->w + x) * 2 + 0]; |