diff options
author | Roland Scheidegger <[email protected]> | 2009-03-28 01:19:49 +0100 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2009-03-28 02:06:40 +0100 |
commit | 02a579f2e7abc832dd46956048d1116f7dc3dd92 (patch) | |
tree | ae80b9840e9097b6fab307736a541537efdf38d4 /src/mesa/main/texstore.c | |
parent | 79e2df63af4d231a1223887e79a819b3baac9a6c (diff) |
mesa: fix a glGetTexImage issue with base-converted texture formats
need to respect the user-supplied base format, not the one derived from
the texture format actually used.
Diffstat (limited to 'src/mesa/main/texstore.c')
-rw-r--r-- | src/mesa/main/texstore.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 7e7e0ac07a4..a94df532c64 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -4078,18 +4078,18 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, for (col = 0; col < width; col++) { (*texImage->FetchTexelf)(texImage, col, row, img, rgba[col]); - if (texImage->TexFormat->BaseFormat == GL_LUMINANCE) { + if (texImage->_BaseFormat == GL_LUMINANCE) { rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); rgba[col][GCOMP] = 0.0; rgba[col][BCOMP] = 0.0; } - else if (texImage->TexFormat->BaseFormat == GL_LUMINANCE_ALPHA) { + else if (texImage->_BaseFormat == GL_LUMINANCE_ALPHA) { rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); rgba[col][GCOMP] = 0.0; rgba[col][BCOMP] = 0.0; } - else if (texImage->TexFormat->BaseFormat == GL_RGB || - texImage->TexFormat->BaseFormat == GL_RGBA) { + else if (texImage->_BaseFormat == GL_RGB || + texImage->_BaseFormat == GL_RGBA) { rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); rgba[col][GCOMP] = linear_to_nonlinear(rgba[col][GCOMP]); rgba[col][BCOMP] = linear_to_nonlinear(rgba[col][BCOMP]); @@ -4117,21 +4117,21 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, for (col = 0; col < width; col++) { (*texImage->FetchTexelf)(texImage, col, row, img, rgba[col]); - if (texImage->TexFormat->BaseFormat == GL_ALPHA) { + if (texImage->_BaseFormat == GL_ALPHA) { rgba[col][RCOMP] = 0.0; rgba[col][GCOMP] = 0.0; rgba[col][BCOMP] = 0.0; } - else if (texImage->TexFormat->BaseFormat == GL_LUMINANCE) { + else if (texImage->_BaseFormat == GL_LUMINANCE) { rgba[col][GCOMP] = 0.0; rgba[col][BCOMP] = 0.0; rgba[col][ACOMP] = 1.0; } - else if (texImage->TexFormat->BaseFormat == GL_LUMINANCE_ALPHA) { + else if (texImage->_BaseFormat == GL_LUMINANCE_ALPHA) { rgba[col][GCOMP] = 0.0; rgba[col][BCOMP] = 0.0; } - else if (texImage->TexFormat->BaseFormat == GL_INTENSITY) { + else if (texImage->_BaseFormat == GL_INTENSITY) { rgba[col][GCOMP] = 0.0; rgba[col][BCOMP] = 0.0; rgba[col][ACOMP] = 1.0; |