[PATCH] Float fbconfigs exchange patch [2/3] Extension string enabling.

Tomasz Lis listom at gmail.com
Thu May 16 07:20:30 PDT 2013


From: Tomasz Lis <tomasz.lis at intel.com>

Enables the fbconfig_float extension in list of supported extensions,
and adds it to known extensions table.

Signed-off-by: Tomasz Lis <listom at gmail.com>
---
 composite/compalloc.c  |    3 +++
 glx/extension_string.c |    5 +++++
 glx/extension_string.h |    1 +
 glx/glxdri2.c          |   10 ++++++++++
 4 files changed, 19 insertions(+)

diff --git a/composite/compalloc.c b/composite/compalloc.c
index cc69c68..46e14bf 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -565,6 +565,9 @@ compNewPixmap(WindowPtr pWin, int x, int y, int w, int h)
         XID inferiors = IncludeInferiors;
         int error;
 
+        if (!pSrcFormat || !pDstFormat) /* Might happen if the format is not supported by server */
+            return 0;
+
         PicturePtr pSrcPicture = CreatePicture(None,
                                                &pParent->drawable,
                                                pSrcFormat,
diff --git a/glx/extension_string.c b/glx/extension_string.c
index 58f930f..fad5c84 100644
--- a/glx/extension_string.c
+++ b/glx/extension_string.c
@@ -65,6 +65,10 @@ struct extension_info {
     unsigned char driver_support;
 };
 
+/**
+ * List of known GLX Extensions.
+ * The last Y/N switch informs whether the support of this extension is always enabled.
+ */
 static const struct extension_info known_glx_extensions[] = {
 /*   GLX_ARB_get_proc_address is implemented on the client. */
     /* *INDENT-OFF* */
@@ -74,6 +78,7 @@ static const struct extension_info known_glx_extensions[] = {
     { GLX(ARB_framebuffer_sRGB),        VER(0,0), N, },
     { GLX(ARB_multisample),             VER(1,4), Y, },
 
+    { GLX(ARB_fbconfig_float),          VER(1,3), N, },
     { GLX(EXT_create_context_es2_profile), VER(0,0), N, },
     { GLX(EXT_framebuffer_sRGB),        VER(0,0), N, },
     { GLX(EXT_import_context),          VER(0,0), Y, },
diff --git a/glx/extension_string.h b/glx/extension_string.h
index 81b7de3..3bec1b1 100644
--- a/glx/extension_string.h
+++ b/glx/extension_string.h
@@ -41,6 +41,7 @@ enum {
     ARB_create_context_robustness_bit,
     ARB_framebuffer_sRGB_bit,
     ARB_multisample_bit,
+    ARB_fbconfig_float_bit,
     EXT_create_context_es2_profile_bit,
     EXT_import_context_bit,
     EXT_texture_from_pixmap_bit,
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 8a1fa41..2315761 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -634,6 +634,10 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
     return &context->base;
 }
 
+/**
+ * Initializes extensions flags in glx_enable_bits when a new screen is created.
+ * @param screen The screen where glx_enable_bits are to be set.
+ */
 static void
 __glXDRIinvalidateBuffers(DrawablePtr pDraw, void *priv, XID id)
 {
@@ -889,6 +893,12 @@ initializeExtensions(__GLXDRIscreen * screen)
         LogMessage(X_INFO, "AIGLX: enabled GLX_EXT_framebuffer_sRGB\n");
     }
 
+    /* enable ARB_fbconfig_float extension (even if there are no float fbconfigs) */
+    {
+        __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_fbconfig_float");
+        LogMessage(X_INFO, "AIGLX: enabled GLX_ARB_fbconfig_float\n");
+    }
+
     for (i = 0; extensions[i]; i++) {
 #ifdef __DRI_READ_DRAWABLE
         if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) {
-- 
1.7.9.5



More information about the xorg-devel mailing list