[PATCH] Replaces old use of floatMode attribute with new, extended range of values in __DRI_ATTRIB_RENDER_TYPE. Also adds new conditions, where the float modes support requires it. Enables support for not only float configs, but packed float configs as well.

Daniel Czarnowski daniel.czarnowski at intel.com
Wed Oct 23 12:53:59 CEST 2013


---
 configure.ac           |    2 +-
 glx/glxdricommon.c     |   30 ++++++++++++++++++++++++++++--
 hw/xwin/glx/indirect.c |    4 +++-
 3 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index c6ecba4..569cfc6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -809,7 +809,7 @@ LIBAPPLEWM="applewm >= 1.4"
 LIBDMX="dmx >= 1.0.99.1"
 LIBDRI="dri >= 7.8.0"
 LIBDRM="libdrm >= 2.3.0"
-LIBGL="gl >= 7.1.0"
+LIBGL="gl >= 9.2.0"
 LIBXEXT="xext >= 1.0.99.4"
 LIBXFONT="xfont >= 1.4.2"
 LIBXI="xi >= 1.2.99.1"
diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c
index b027f24..641cb68 100644
--- a/glx/glxdricommon.c
+++ b/glx/glxdricommon.c
@@ -36,6 +36,7 @@
 #include <GL/internal/dri_interface.h>
 #include <os.h>
 #include "glxserver.h"
+#include "glxext.h"
 #include "glxcontext.h"
 #include "glxscreens.h"
 #include "glxdricommon.h"
@@ -127,6 +128,7 @@ createModeFromConfig(const __DRIcoreExtension * core,
                      unsigned int visualType, unsigned int drawableType)
 {
     __GLXDRIconfig *config;
+    GLint renderType = 0;
     unsigned int attrib, value;
     int i;
 
@@ -140,9 +142,13 @@ createModeFromConfig(const __DRIcoreExtension * core,
         case __DRI_ATTRIB_RENDER_TYPE:
             config->config.renderType = 0;
             if (value & __DRI_ATTRIB_RGBA_BIT)
-                config->config.renderType |= GLX_RGBA_BIT;
+                renderType |= GLX_RGBA_BIT;
             if (value & __DRI_ATTRIB_COLOR_INDEX_BIT)
-                config->config.renderType |= GLX_COLOR_INDEX_BIT;
+                renderType |= GLX_COLOR_INDEX_BIT;
+            if (value & __DRI_ATTRIB_FLOAT_BIT)
+                renderType |= GLX_RGBA_FLOAT_BIT_ARB;
+            if (value & __DRI_ATTRIB_UNSIGNED_FLOAT_BIT)
+                renderType |= GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT;
             break;
         case __DRI_ATTRIB_CONFIG_CAVEAT:
             if (value & __DRI_ATTRIB_NON_CONFORMANT_CONFIG)
@@ -168,6 +174,9 @@ createModeFromConfig(const __DRIcoreExtension * core,
         }
     }
 
+    if (renderType) /* fbconfig render type are bit fields */
+        config->config.renderType = renderType;
+
     config->config.next = NULL;
     config->config.xRenderable = GL_TRUE;
     config->config.visualType = visualType;
@@ -187,6 +196,14 @@ glxConvertConfigs(const __DRIcoreExtension * core,
     head.next = NULL;
 
     for (i = 0; configs[i]; i++) {
+        /* Don't add float modes at all if we don't want pbuffer drawableTypes */
+        int renderType = 0;
+        if (core->getConfigAttrib(configs[i],__DRI_ATTRIB_RENDER_TYPE, &renderType)) {
+            if ((renderType & (__DRI_ATTRIB_UNSIGNED_FLOAT_BIT | __DRI_ATTRIB_FLOAT_BIT)) && 
+                !(drawableType & GLX_PBUFFER_BIT))
+                continue;
+        }
+        /* Add all the others */
         tail->next = createModeFromConfig(core,
                                           configs[i], GLX_TRUE_COLOR,
                                           drawableType);
@@ -197,6 +214,15 @@ glxConvertConfigs(const __DRIcoreExtension * core,
     }
 
     for (i = 0; configs[i]; i++) {
+        /* Don't add float modes at all if we don't want pbuffer drawableTypes */
+        int renderType = 0;
+        if (core->getConfigAttrib(configs[i],__DRI_ATTRIB_RENDER_TYPE, &renderType)) {
+            if ((renderType & (__DRI_ATTRIB_UNSIGNED_FLOAT_BIT |
+                __DRI_ATTRIB_FLOAT_BIT)) && 
+                !(drawableType & GLX_PBUFFER_BIT))
+                continue;
+        }
+        /* Add all the others */
         tail->next = createModeFromConfig(core,
                                           configs[i], GLX_DIRECT_COLOR,
                                           drawableType);
diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index 14a4711..e389499 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -386,7 +386,9 @@ fbConfigsDump(unsigned int n, __GLXconfig * c)
                c->accumAlphaBits, c->sampleBuffers, c->samples,
                (c->drawableType & GLX_WINDOW_BIT) ? "y" : ".",
                (c->drawableType & GLX_PIXMAP_BIT) ? "y" : ".",
-               (c->drawableType & GLX_PBUFFER_BIT) ? "y" : ".", ".",
+               (c->drawableType & GLX_PBUFFER_BIT) ? "y" : ".",
+               (c->renderType & (GLX_RGBA_FLOAT_BIT_ARB |
+                   GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT)) ? "y" : ".",
                (c->transparentPixel != GLX_NONE_EXT) ? "y" : ".",
                c->visualSelectGroup,
                (c->visualRating == GLX_SLOW_VISUAL_EXT) ? "*" : " ");
-- 
1.7.10.4

--------------------------------------------------------------------

Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.



More information about the xorg-devel mailing list