diff options
author | Antia Puentes <[email protected]> | 2015-12-19 19:17:39 +0100 |
---|---|---|
committer | Eduardo Lima Mitev <[email protected]> | 2016-03-03 15:14:07 +0100 |
commit | aeb759c7d631eb10a69245ba8d7b6a2179a268f5 (patch) | |
tree | 0f8e3b851cb1af8f4db58d0a23de2538af1344f7 /src/mesa/main/formatquery.c | |
parent | bcb2f9cdb97ab2b866e238780ba68908b10e2e79 (diff) |
mesa/formatquery: Added SRGB_DECODE_ARB <pname> query
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."
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/main/formatquery.c')
-rw-r--r-- | src/mesa/main/formatquery.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c index 03ec11ae56f..444995b6414 100644 --- a/src/mesa/main/formatquery.c +++ b/src/mesa/main/formatquery.c @@ -600,6 +600,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; @@ -1131,7 +1132,15 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, break; case GL_SRGB_DECODE_ARB: - /* @TODO */ + /* Presence of EXT_texture_sRGB_decode was already verified */ + if (!_mesa_has_EXT_texture_sRGB(ctx) || + target == GL_RENDERBUFFER || + !_mesa_is_srgb_format(internalformat)) { + goto end; + } + + ctx->Driver.QueryInternalFormat(ctx, target, internalformat, pname, + buffer); break; case GL_FILTER: |