mesa: return GL_LINEAR for ..COLOR_ENCODING if framebuffer_sRGB is unsupported
authorMarek Olšák <maraeo@gmail.com>
Sun, 23 Jan 2011 12:26:43 +0000 (13:26 +0100)
committerMarek Olšák <maraeo@gmail.com>
Sun, 23 Jan 2011 19:59:46 +0000 (20:59 +0100)
Signed-off-by: Brian Paul <brianp@vmware.com>
src/mesa/main/fbobject.c

index f31d8b36db8ffbde680bc3753636b7bbe2cbcac6..17c629544be67bbe12f722e71b337256e77e6221 100644 (file)
@@ -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: