From the ARB_internalformat_query2 specification:
"- SRGB_READ: The support for converting from sRGB colorspace on read
operations (see section 3.9.18) from 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.
- SRGB_WRITE: The support for converting to sRGB colorspace on write
operations to the resource is returned in <params>.
This indicates that writing to framebuffers with this internalformat
will encode to sRGB color spaces when FRAMEBUFFER_SRGB is enabled (see
section 4.1.8).
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 <airlied@redhat.com>
case GL_MANUAL_GENERATE_MIPMAP:
case GL_AUTO_GENERATE_MIPMAP:
+ case GL_SRGB_READ:
+ case GL_SRGB_WRITE:
params[0] = GL_FULL_SUPPORT;
break;
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: