diff options
author | marha <marha@users.sourceforge.net> | 2011-06-14 08:14:45 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-06-14 08:14:45 +0200 |
commit | 6b441c10eeb02569204ff50ba8c3b739037b8141 (patch) | |
tree | f9c0dd95a41268546aeecdd31c8588c617749cd1 /mesalib/src/mesa/main/texgetimage.c | |
parent | 0d495843cebea4ae94a3138db2bf51da80a16391 (diff) | |
parent | 4d74e36f359d22b50302c82a922b79ac24dd3e23 (diff) | |
download | vcxsrv-6b441c10eeb02569204ff50ba8c3b739037b8141.tar.gz vcxsrv-6b441c10eeb02569204ff50ba8c3b739037b8141.tar.bz2 vcxsrv-6b441c10eeb02569204ff50ba8c3b739037b8141.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
mesalib/src/mesa/SConscript
mesalib/src/mesa/drivers/common/driverfuncs.c
mesalib/src/mesa/main/texgetimage.c
mesalib/src/mesa/sources.mak
mesalib/src/mesa/swrast/s_texrender.c
mesalib/src/mesa/vbo/vbo_exec_array.c
xorg-server/xkeyboard-config/configure.in
Diffstat (limited to 'mesalib/src/mesa/main/texgetimage.c')
-rw-r--r-- | mesalib/src/mesa/main/texgetimage.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/mesalib/src/mesa/main/texgetimage.c b/mesalib/src/mesa/main/texgetimage.c index 915bcf913..2efd5e75b 100644 --- a/mesalib/src/mesa/main/texgetimage.c +++ b/mesalib/src/mesa/main/texgetimage.c @@ -233,6 +233,7 @@ get_tex_rgba(struct gl_context *ctx, GLuint dimensions, const GLint width = texImage->Width;
const GLint height = texImage->Height;
const GLint depth = texImage->Depth;
+ const GLenum dataType = _mesa_get_format_datatype(texImage->TexFormat);
/* Normally, no pixel transfer ops are performed during glGetTexImage.
* The only possible exception is component clamping to [0,1].
*/
@@ -248,6 +249,19 @@ get_tex_rgba(struct gl_context *ctx, GLuint dimensions, return;
}
+ /* Clamping does not apply to GetTexImage (final conversion)?
+ * Looks like we need clamp though when going from format
+ * containing negative values to unsigned format.
+ */
+ if (format == GL_LUMINANCE || format == GL_LUMINANCE_ALPHA) {
+ transferOps |= IMAGE_CLAMP_BIT;
+ }
+ else if (!type_with_negative_values(type) &&
+ (dataType == GL_FLOAT ||
+ dataType == GL_SIGNED_NORMALIZED)) {
+ transferOps |= IMAGE_CLAMP_BIT;
+ }
+
/* glGetTexImage always returns sRGB data for sRGB textures. Make sure the
* fetch functions return sRGB data without linearizing it.
*/
@@ -262,20 +276,6 @@ get_tex_rgba(struct gl_context *ctx, GLuint dimensions, width, height, format, type,
img, row, 0);
GLint col;
- GLenum dataType = _mesa_get_format_datatype(texImage->TexFormat);
-
- /* clamp does not apply to GetTexImage (final conversion)?
- * Looks like we need clamp though when going from format
- * containing negative values to unsigned format.
- */
- if (format == GL_LUMINANCE || format == GL_LUMINANCE_ALPHA) {
- transferOps |= IMAGE_CLAMP_BIT;
- }
- else if (!type_with_negative_values(type) &&
- (dataType == GL_FLOAT ||
- dataType == GL_SIGNED_NORMALIZED)) {
- transferOps |= IMAGE_CLAMP_BIT;
- }
for (col = 0; col < width; col++) {
texImage->FetchTexelf(texImage, col, row, img, rgba[col]);
|