[Mesa-dev] [PATCH v6 6/8] mesa/main: Use flag for EXT_sRGB instead of EXT_framebuffer_sRGB where possible
Gert Wollny
gw.fossdev at gmail.com
Thu Nov 15 12:45:57 UTC 2018
From: Gert Wollny <gert.wollny at collabora.com>
All drivers that support EXT_framebuffer_sRGB also support EXT_sRGB, but
in order to keep this commit minimal, 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
Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
---
src/mesa/main/fbobject.c | 2 +-
src/mesa/main/formatquery.c | 2 +-
src/mesa/main/framebuffer.c | 2 +-
src/mesa/main/teximage.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 68e0daf342..7d45ce43f4 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -4253,7 +4253,7 @@ get_framebuffer_attachment_parameter(struct gl_context *ctx,
}
}
else {
- if (ctx->Extensions.EXT_framebuffer_sRGB) {
+ if (ctx->Extensions.EXT_sRGB) {
*params =
_mesa_get_format_color_encoding(att->Renderbuffer->Format);
}
diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c
index 84b5f512ba..3b0f6dafad 100644
--- a/src/mesa/main/formatquery.c
+++ b/src/mesa/main/formatquery.c
@@ -1241,7 +1241,7 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname,
break;
case GL_SRGB_WRITE:
- if (!_mesa_has_EXT_framebuffer_sRGB(ctx) ||
+ if (!ctx->Extensions.EXT_sRGB ||
!_mesa_is_color_format(internalformat)) {
goto end;
}
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index 10dd2fde44..0abfdd8390 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -459,7 +459,7 @@ _mesa_update_framebuffer_visual(struct gl_context *ctx,
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;
}
}
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 6805b47c72..3c9c8ada99 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -2438,7 +2438,7 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions,
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;
}
--
2.18.1
More information about the mesa-dev
mailing list