summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texgetimage.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-10-01 09:22:13 +1000
committerDave Airlie <airlied@redhat.com>2014-10-03 10:37:55 +1000
commit8df3c02cdc0a81db43f63e5a93fbae1b3435d23d (patch)
tree5ea3cf6ab3a1ab9dc075b17a1732b1d39c78a927 /src/mesa/main/texgetimage.c
parentb4ffd19e6c9f61dfa4e0eda1f606cd255b27208f (diff)
downloadexternal_mesa3d-8df3c02cdc0a81db43f63e5a93fbae1b3435d23d.zip
external_mesa3d-8df3c02cdc0a81db43f63e5a93fbae1b3435d23d.tar.gz
external_mesa3d-8df3c02cdc0a81db43f63e5a93fbae1b3435d23d.tar.bz2
mesa: fix GetTexImage for 1D array depth textures
While running piglit in virgl, I hit an assert in intel driver. "qemu-system-x86_64: intel_tex.c:219: intel_map_texture_image: Assertion `tex_image->TexObject->Target != 0x8C18 || h == 1' failed." Thanks to Eric and Ken for pointing me in the right direction, Fix the get_tex_depth to do the same fixup as get_tex_rgba does for 1D array textures. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Eric Anholt <eric@anholt.net> Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/mesa/main/texgetimage.c')
-rw-r--r--src/mesa/main/texgetimage.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 2c54e4a..cb5f793 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -78,8 +78,8 @@ get_tex_depth(struct gl_context *ctx, GLuint dimensions,
struct gl_texture_image *texImage)
{
const GLint width = texImage->Width;
- const GLint height = texImage->Height;
- const GLint depth = texImage->Depth;
+ GLint height = texImage->Height;
+ GLint depth = texImage->Depth;
GLint img, row;
GLfloat *depthRow = malloc(width * sizeof(GLfloat));
@@ -88,6 +88,11 @@ get_tex_depth(struct gl_context *ctx, GLuint dimensions,
return;
}
+ if (texImage->TexObject->Target == GL_TEXTURE_1D_ARRAY) {
+ depth = height;
+ height = 1;
+ }
+
for (img = 0; img < depth; img++) {
GLubyte *srcMap;
GLint srcRowStride;