Mesa (8.0): mesa: Add support for glGetTexImage on GL_TEXTURE_1D_ARRAY
Eric Anholt
anholt at kemper.freedesktop.org
Fri Jan 27 19:41:58 UTC 2012
Module: Mesa
Branch: 8.0
Commit: 46c146116f43047572ca98c99a9ca0a119227801
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=46c146116f43047572ca98c99a9ca0a119227801
Author: Eric Anholt <eric at anholt.net>
Date: Fri Jan 20 15:03:12 2012 -0800
mesa: Add support for glGetTexImage on GL_TEXTURE_1D_ARRAY
Similarly to how we handle this in texstore, we have to remap height
to depth so that we MapTextureImage each image layer individually.
Fixes part of Intel oglconform's int-textures advanced.fbo.rtt
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Brian Paul <brianp at vmware.com>
(cherry picked from commit 08acd4bd61430beb20a74af23de9f63c8f077467)
---
src/mesa/main/texgetimage.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 95de24a..4eaa035 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -312,8 +312,8 @@ get_tex_rgba_uncompressed(struct gl_context *ctx, GLuint dimensions,
const gl_format texFormat =
_mesa_get_srgb_format_linear(texImage->TexFormat);
const GLuint width = texImage->Width;
- const GLuint height = texImage->Height;
- const GLuint depth = texImage->Depth;
+ GLuint height = texImage->Height;
+ GLuint depth = texImage->Depth;
GLuint img, row;
GLfloat (*rgba)[4];
GLuint (*rgba_uint)[4];
@@ -327,6 +327,11 @@ get_tex_rgba_uncompressed(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 rowstride;
More information about the mesa-commit
mailing list