Mesa (master): mesa: return GL_LINEAR for .. COLOR_ENCODING if framebuffer_sRGB is unsupported

Marek Olšák mareko at kemper.freedesktop.org
Sun Jan 23 20:00:26 UTC 2011


Module: Mesa
Branch: master
Commit: 81ae8c6313adbe7681a73636dee4d5d34334d4d7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=81ae8c6313adbe7681a73636dee4d5d34334d4d7

Author: Marek Olšák <maraeo at gmail.com>
Date:   Sun Jan 23 13:26:43 2011 +0100

mesa: return GL_LINEAR for ..COLOR_ENCODING if framebuffer_sRGB is unsupported

Signed-off-by: Brian Paul <brianp at vmware.com>

---

 src/mesa/main/fbobject.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index f31d8b3..17c6295 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2072,7 +2072,14 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
                      "glGetFramebufferAttachmentParameterivEXT(pname)");
       }
       else {
-         *params = _mesa_get_format_color_encoding(att->Renderbuffer->Format);
+         if (ctx->Extensions.EXT_framebuffer_sRGB) {
+            *params = _mesa_get_format_color_encoding(att->Renderbuffer->Format);
+         }
+         else {
+            /* According to ARB_framebuffer_sRGB, we should return LINEAR
+             * if the sRGB conversion is unsupported. */
+            *params = GL_LINEAR;
+         }
       }
       return;
    case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:




More information about the mesa-commit mailing list