summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2015-02-25 15:33:08 +0000
committerEmil Velikov <emil.l.velikov@gmail.com>2015-03-11 18:11:47 +0000
commite4d3bd685540e59cd7fe722ad6bd3a2c32f277ec (patch)
treebac66e7e74c05461208943ce07a8a6235f56c403
parent614e7ebdad0ea1e0f14773db195cfcb75f74558d (diff)
meta: Fix the y offset for 1D_ARRAY in _mesa_meta_pbo_TexSubImage
The yoffset needs to be interpreted as a slice offset for 1D array textures. This patch implements that by moving the yoffset into zoffset similar to how it moves the height into depth. Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com> Cc: "10.5" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 7286a6899176a8b26aa794097288eff941f5178c)
-rw-r--r--src/mesa/drivers/common/meta_tex_subimage.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/drivers/common/meta_tex_subimage.c b/src/mesa/drivers/common/meta_tex_subimage.c
index 1d175f6679c..af911c313bb 100644
--- a/src/mesa/drivers/common/meta_tex_subimage.c
+++ b/src/mesa/drivers/common/meta_tex_subimage.c
@@ -195,8 +195,12 @@ _mesa_meta_pbo_TexSubImage(struct gl_context *ctx, GLuint dims,
if (tex_image->TexObject->Target == GL_TEXTURE_1D_ARRAY) {
assert(depth == 1);
+ assert(zoffset == 0);
depth = height;
height = 1;
+ image_height = 1;
+ zoffset = yoffset;
+ yoffset = 0;
}
_mesa_meta_bind_fbo_image(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
@@ -312,8 +316,12 @@ _mesa_meta_pbo_GetTexSubImage(struct gl_context *ctx, GLuint dims,
if (tex_image && tex_image->TexObject->Target == GL_TEXTURE_1D_ARRAY) {
assert(depth == 1);
+ assert(zoffset == 0);
depth = height;
height = 1;
+ image_height = 1;
+ zoffset = yoffset;
+ yoffset = 0;
}
/* If we were given a texture, bind it to the read framebuffer. If not,