[Mesa-dev] [PATCH] GLX: Add an env var to enable the support of GLX extensions needing both client and server support, in case of client support and direct rendering.

Axel Davy axel.davy at ens.fr
Wed Jun 18 20:32:45 PDT 2014


In the case of XWayland, there's no accelerated indirect rendering.
For example GLX_ARB_create_context is not advertised by the server,
and according to the spec, we are not allowed to advertise it
to the application because of that.

This env var makes Mesa ignore this restriction, and
a GLX extension is advertised whenever the client supports it.

Signed-off-by: Axel Davy <axel.davy at ens.fr>
---
 src/glx/glxextensions.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/glx/glxextensions.c b/src/glx/glxextensions.c
index ce5d66d..34cb6d0 100644
--- a/src/glx/glxextensions.c
+++ b/src/glx/glxextensions.c
@@ -566,10 +566,15 @@ __glXCalculateUsableExtensions(struct glx_screen * psc,
                                GLboolean display_is_direct_capable,
                                int minor_version)
 {
+   const char *ignore_server_restrictions = getenv("IGNORE_SERVER");
+   unsigned char should_ignore_server_restrictions = 0;
    unsigned char server_support[8];
    unsigned char usable[8];
    unsigned i;
 
+   if (ignore_server_restrictions && !strcmp(ignore_server_restrictions,"1"))
+      should_ignore_server_restrictions = 0xff;
+
    __glXExtensionsCtr();
    __glXExtensionsCtrScreen(psc);
 
@@ -617,7 +622,9 @@ __glXCalculateUsableExtensions(struct glx_screen * psc,
             | (client_glx_support[i] & psc->direct_support[i] &
                server_support[i])
             | (client_glx_support[i] & psc->direct_support[i] &
-               direct_glx_only[i]);
+               direct_glx_only[i])
+            | (client_glx_support[i] & psc->direct_support[i] &
+               should_ignore_server_restrictions);
       }
    }
    else {
-- 
1.9.1



More information about the mesa-dev mailing list