[Mesa-dev] [RFC 42/63] mesa/formatquery: Added SRGB_DECODE_ARB <pname> query

Eduardo Lima Mitev elima at igalia.com
Tue Jan 19 08:42:22 PST 2016


From: Antia Puentes <apuentes at igalia.com>

>From the ARB_internalformat_query2 specification:

   "- SRGB_DECODE_ARB: The support for toggling whether sRGB decode happens at
      sampling time (see EXT/ARB_texture_sRGB_decode) for the resource is
      returned in <params>.
      Possible values returned are FULL_SUPPORT, CAVEAT_SUPPORT, or NONE.
      If the resource or operation is not supported, NONE is returned."
---
 src/mesa/main/formatquery.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c
index 1f13b58..7f24ba5 100644
--- a/src/mesa/main/formatquery.c
+++ b/src/mesa/main/formatquery.c
@@ -598,6 +598,7 @@ _mesa_query_internal_format_default(struct gl_context *ctx, GLenum target,
    case GL_AUTO_GENERATE_MIPMAP:
    case GL_SRGB_READ:
    case GL_SRGB_WRITE:
+   case GL_SRGB_DECODE_ARB:
       params[0] = GL_FULL_SUPPORT;
       break;
 
@@ -1110,7 +1111,9 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname,
       break;
 
    case GL_SRGB_DECODE_ARB:
-      /* @TODO */
+      /* If we arrive here,  ARB_texture_sRGB_decode is supported */
+      ctx->Driver.QueryInternalFormat(ctx, target, internalformat, pname,
+                                      buffer);
       break;
 
    case GL_FILTER:
-- 
2.5.3



More information about the mesa-dev mailing list