Mesa (master): mesa/main: Use flag for EXT_sRGB instead of EXT_framebuffer_sRGB where possible

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 28 11:20:58 UTC 2019


Module: Mesa
Branch: master
Commit: 76c3f6fb3ff21e9cbe40345b6215ead1771b449b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=76c3f6fb3ff21e9cbe40345b6215ead1771b449b

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Wed Nov 14 10:58:40 2018 +0100

mesa/main: Use flag for EXT_sRGB instead of EXT_framebuffer_sRGB where possible

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 at collabora.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.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 +-
 src/mesa/state_tracker/st_manager.c | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 4ff00f273b..f7597b8399 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -4274,7 +4274,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 21415b4849..a43915e18d 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;
       }
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index caf8799a7b..5efbd1fa1d 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -476,7 +476,7 @@ st_framebuffer_create(struct st_context *st,
     * 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);




More information about the mesa-commit mailing list