Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Anuj Phogat <anuj.phogat <at> gmail.com>
Subject: [PATCH] mesa: set clamp bit in glGetTexImage for GL_UNSIGNED_NORMALIZED
Newsgroups: gmane.comp.video.mesa3d.devel
Date: Wednesday 25th January 2012 05:58:13 UTC (over 4 years ago)
Color clamping should be enabled in glGetTexImage if texture dataType is
GL_UNSIGNED_NORMALIZED and format is GL_LUMINANCE or GL_LUMINANCE_ALPHA

Fixes 2 Intel oglconform test cases: pxconv-gettex and pxtrans-gettex
https://bugs.freedesktop.org/show_bug.cgi?id=40864

NOTE: This is a candidate for the 8.0 branch

Signed-off-by: Anuj Phogat 
---
 src/mesa/main/texgetimage.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 8c85c1e..f89b868 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -415,7 +415,12 @@ get_tex_rgba(struct gl_context *ctx, GLuint
dimensions,
          transferOps |= IMAGE_CLAMP_BIT;
       }
    }
-
+   else if ((format == GL_LUMINANCE ||
+            format == GL_LUMINANCE_ALPHA) &&
+            dataType == GL_UNSIGNED_NORMALIZED) {
+      transferOps |= IMAGE_CLAMP_BIT;
+   }
+
    if (_mesa_is_format_compressed(texImage->TexFormat)) {
       get_tex_rgba_compressed(ctx, dimensions, format, type,
                               pixels, texImage, transferOps);
-- 
1.7.7.4
 
CD: 3ms