diff options
Diffstat (limited to 'src/mesa/main/formatquery.c')
-rw-r--r-- | src/mesa/main/formatquery.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c index bd69ea8f677..03ec11ae56f 100644 --- a/src/mesa/main/formatquery.c +++ b/src/mesa/main/formatquery.c @@ -598,6 +598,8 @@ _mesa_query_internal_format_default(struct gl_context *ctx, GLenum target, case GL_MANUAL_GENERATE_MIPMAP: case GL_AUTO_GENERATE_MIPMAP: + case GL_SRGB_READ: + case GL_SRGB_WRITE: params[0] = GL_FULL_SUPPORT; break; @@ -1109,11 +1111,23 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, break; case GL_SRGB_READ: - /* @TODO */ + if (!_mesa_has_EXT_texture_sRGB(ctx) || + !_mesa_is_srgb_format(internalformat)) { + goto end; + } + + ctx->Driver.QueryInternalFormat(ctx, target, internalformat, pname, + buffer); break; case GL_SRGB_WRITE: - /* @TODO */ + if (!_mesa_has_EXT_framebuffer_sRGB(ctx) || + !_mesa_is_color_format(internalformat)) { + goto end; + } + + ctx->Driver.QueryInternalFormat(ctx, target, internalformat, pname, + buffer); break; case GL_SRGB_DECODE_ARB: |