diff options
author | Anuj Phogat <anuj.phogat@gmail.com> | 2012-02-10 16:27:19 -0800 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2012-02-14 17:52:50 -0800 |
commit | ff7ccb1cf147b4c55492bc6ec6319dcbd6f31048 (patch) | |
tree | 02bc0932aed14c079f4862293c1db767c0483269 | |
parent | 9e98d38e58e271f5fe383f3831c1919527bd8546 (diff) |
meta: Add pixel store/pack operations in decompress_texture_image
This patch adds the pixel store operations in decompress_texture_image().
decompress_texture_image() is used in glGetTexImage() for compressed
textures with unsigned, normalized values.
It also fixes the failures in intel oglconform pxstore-gettex due to
following sub test cases:
- Test all mipmaps with byte swapping enabled
- Test all small mipmaps with all allowable alignment values
- Test subimage packing for all mipmap levels
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40864
Note: This is a candidate for stable branches
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 40427025916e003cfd380c2e30df78ad2bc8fe10)
-rw-r--r-- | src/mesa/drivers/common/meta.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index aa5fef87373..2b994de565f 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -3243,7 +3243,7 @@ decompress_texture_image(struct gl_context *ctx, struct gl_texture_image *texImage, GLuint slice, GLenum destFormat, GLenum destType, - GLvoid *dest, GLint destRowLength) + GLvoid *dest) { struct decompress_state *decompress = &ctx->Meta->Decompress; struct gl_texture_object *texObj = texImage->TexObject; @@ -3273,7 +3273,7 @@ decompress_texture_image(struct gl_context *ctx, fboDrawSave = ctx->DrawBuffer->Name; fboReadSave = ctx->ReadBuffer->Name; - _mesa_meta_begin(ctx, MESA_META_ALL); + _mesa_meta_begin(ctx, MESA_META_ALL & ~MESA_META_PIXEL_STORE); /* Create/bind FBO/renderbuffer */ if (decompress->FBO == 0) { @@ -3408,7 +3408,6 @@ decompress_texture_image(struct gl_context *ctx, _mesa_PixelTransferf(GL_BLUE_SCALE, 0.0f); } - ctx->Pack.RowLength = destRowLength; _mesa_ReadPixels(0, 0, width, height, destFormat, destType, dest); } @@ -3449,8 +3448,7 @@ _mesa_meta_GetTexImage(struct gl_context *ctx, const GLuint slice = 0; /* only 2D compressed textures for now */ /* Need to unlock the texture here to prevent deadlock... */ _mesa_unlock_texture(ctx, texObj); - decompress_texture_image(ctx, texImage, slice, format, type, pixels, - ctx->Pack.RowLength); + decompress_texture_image(ctx, texImage, slice, format, type, pixels); /* ... and relock it */ _mesa_lock_texture(ctx, texObj); } |