All drivers that support EXT_framebuffer_sRGB also support EXT_sRGB, but
in order to keep this commit minial, and not to break any drivers both
flags are checked.
v2: - Use only EXT_sRGB (Ilia Mirkin)
- Move adding the flag EXT_sRGB to gl_extensions to a separate patch
v3: use _mesa_has_EXT_framebuffer_sRGB instead of extension flag
The _mesa_has function also checks for the correct versions and
should be preferred over using the flags directly (Erik)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
}
}
else {
- if (ctx->Extensions.EXT_framebuffer_sRGB) {
+ if (ctx->Extensions.EXT_sRGB) {
*params =
_mesa_get_format_color_encoding(att->Renderbuffer->Format);
}
break;
case GL_SRGB_WRITE:
- if (!_mesa_has_EXT_framebuffer_sRGB(ctx) ||
+ if (!ctx->Extensions.EXT_sRGB ||
!_mesa_is_color_format(internalformat)) {
goto end;
}
fb->Visual.rgbBits = fb->Visual.redBits
+ fb->Visual.greenBits + fb->Visual.blueBits;
if (_mesa_get_format_color_encoding(fmt) == GL_SRGB)
- fb->Visual.sRGBCapable = ctx->Extensions.EXT_framebuffer_sRGB;
+ fb->Visual.sRGBCapable = ctx->Extensions.EXT_sRGB;
break;
}
}
bool rb_is_srgb = false;
bool dst_is_srgb = false;
- if (ctx->Extensions.EXT_framebuffer_sRGB &&
+ if (ctx->Extensions.EXT_sRGB &&
_mesa_get_format_color_encoding(rb->Format) == GL_SRGB) {
rb_is_srgb = true;
}
* brings GLES on par with desktop GLs EXT_framebuffer_sRGB, in mesa this
* is also expressed by using the same extension flag
*/
- if (st->ctx->Extensions.EXT_framebuffer_sRGB) {
+ if (_mesa_has_EXT_framebuffer_sRGB(st->ctx)) {
struct pipe_screen *screen = st->pipe->screen;
const enum pipe_format srgb_format =
util_format_srgb(stfbi->visual->color_format);