Mesa (master): glx: add initial GLX_EXT_framebuffer_sRGB support.

Dave Airlie airlied at kemper.freedesktop.org
Sun Mar 6 10:04:37 UTC 2011


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Sun Mar  6 19:54:37 2011 +1000

glx: add initial GLX_EXT_framebuffer_sRGB support.

this doesn't bind to drivers yet, just enough to in theory make indirect
work against other servers.

I'm really not sure what the rules for adding extensions to the known_gl_extensions list as it looks to be missing a few. are these GL extensions that have GLX
protocol??

Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/glx/glxconfig.c     |    5 +++++
 src/glx/glxconfig.h     |    3 +++
 src/glx/glxext.c        |    4 ++++
 src/glx/glxextensions.c |    2 ++
 src/glx/glxextensions.h |    2 ++
 5 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/glx/glxconfig.c b/src/glx/glxconfig.c
index 1d9678f..805c301 100644
--- a/src/glx/glxconfig.c
+++ b/src/glx/glxconfig.c
@@ -188,6 +188,10 @@ glx_config_get(struct glx_config * mode, int attribute, int *value_return)
       *value_return = mode->yInverted;
       return 0;
 
+   case GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT:
+      *value_return = mode->framebuffer_srgb_capable;
+      return 0;
+
       /* Applications are NOT allowed to query GLX_VISUAL_SELECT_GROUP_SGIX.
        * It is ONLY for communication between the GLX client and the GLX
        * server.
@@ -251,6 +255,7 @@ glx_config_create_list(unsigned count)
       (*next)->bindToMipmapTexture = GLX_DONT_CARE;
       (*next)->bindToTextureTargets = GLX_DONT_CARE;
       (*next)->yInverted = GLX_DONT_CARE;
+      (*next)->framebuffer_srgb_capable = GLX_DONT_CARE;
 
       next = &((*next)->next);
    }
diff --git a/src/glx/glxconfig.h b/src/glx/glxconfig.h
index f7ee958..a587612 100644
--- a/src/glx/glxconfig.h
+++ b/src/glx/glxconfig.h
@@ -100,6 +100,9 @@ struct glx_config {
     GLint bindToMipmapTexture;
     GLint bindToTextureTargets;
     GLint yInverted;
+
+    /* EXT_framebuffer_sRGB */
+    GLint framebuffer_srgb_capable;
 };
 
 #define __GLX_MIN_CONFIG_PROPS	18
diff --git a/src/glx/glxext.c b/src/glx/glxext.c
index 25d266e..38622f3 100644
--- a/src/glx/glxext.c
+++ b/src/glx/glxext.c
@@ -546,6 +546,10 @@ __glXInitializeVisualConfigFromTags(struct glx_config * config, int count,
          config->yInverted = *bp++;
          break;
 #endif
+      case GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT:
+         config->framebuffer_srgb_capable = *bp++;
+         break;
+
       case GLX_USE_GL:
          if (fbconfig_style_tags)
             bp++;
diff --git a/src/glx/glxextensions.c b/src/glx/glxextensions.c
index ffd4664..d6eb408 100644
--- a/src/glx/glxextensions.c
+++ b/src/glx/glxextensions.c
@@ -83,6 +83,7 @@ static const struct extension_info known_glx_extensions[] = {
    { GLX(EXT_visual_info),             VER(0,0), Y, Y, N, N },
 #endif
    { GLX(EXT_visual_rating),           VER(0,0), Y, Y, N, N },
+   { GLX(EXT_framebuffer_sRGB),        VER(0,0), Y, Y, N, N },
 #ifdef GLX_USE_APPLEGL
    { GLX(MESA_agp_offset),             VER(0,0), N, N, N, N }, /* Deprecated */
    { GLX(MESA_copy_sub_buffer),        VER(0,0), N, N, N, N },
@@ -190,6 +191,7 @@ static const struct extension_info known_gl_extensions[] = {
    { GL(EXT_framebuffer_blit),           VER(0,0), Y, N, N, N },
    { GL(EXT_framebuffer_multisample),    VER(0,0), Y, N, N, N },
    { GL(EXT_framebuffer_object),         VER(0,0), Y, N, N, N },
+   { GL(EXT_framebuffer_sRGB),           VER(0,0), Y, N, N, N },
    { GL(EXT_multi_draw_arrays),          VER(1,4), Y, N, Y, N },
    { GL(EXT_packed_depth_stencil),       VER(0,0), Y, N, N, N },
    { GL(EXT_packed_pixels),              VER(1,2), Y, N, N, N },
diff --git a/src/glx/glxextensions.h b/src/glx/glxextensions.h
index 333b3f9..4fa7a61 100644
--- a/src/glx/glxextensions.h
+++ b/src/glx/glxextensions.h
@@ -40,6 +40,7 @@ enum
    EXT_visual_info_bit,
    EXT_visual_rating_bit,
    EXT_import_context_bit,
+   EXT_framebuffer_sRGB_bit,
    MESA_agp_offset_bit,
    MESA_copy_sub_buffer_bit,
    MESA_depth_float_bit,
@@ -118,6 +119,7 @@ enum
    GL_EXT_framebuffer_blit_bit,
    GL_EXT_framebuffer_multisample_bit,
    GL_EXT_framebuffer_object_bit,
+   GL_EXT_framebuffer_sRGB_bit,
    GL_EXT_multi_draw_arrays_bit,
    GL_EXT_packed_depth_stencil_bit,
    GL_EXT_packed_pixels_bit,




More information about the mesa-commit mailing list