On Fri, 2007-04-13 at 19:50 +0200, Michel Dänzer wrote:
> On Fri, 2007-04-13 at 13:32 -0400, David Reveman wrote:
> >
> > Does anyone know if some code similar to this would work?
> >
> > glxExtensions = glXQueryExtensionsString (dpy, screenNum);
> > if (!strstr (glxExtensions, "GLX_EXT_texture_from_pixmap"))
> > {
> > setenv ("LIBGL_ALWAYS_INDIRECT", "1", 1);
> > glxExtensions = glXQueryExtensionsString (dpy, screenNum);
> > if (!strstr (glxExtensions, "GLX_EXT_texture_from_pixmap"))
> > indirectRendering = TRUE
> > }
> >
> > We know pretty well what the problem is and what needs to be done to fix
> > it so I would be OK with including a workaround like this in head if
> > people insist that they want it there.
>
> I'm afraid it may not work because LIBGL_ALWAYS_INDIRECT is only
> checked in __glXInitialize().
>
> I wonder why I didn't get any feedback on my proposal: Make
> glXQueryExtensionsString take the current context into account when
> appropriate. Would it be feasible for compiz to make the context current
> before calling glXQueryExtensionsString?
That's actually what compiz is doing now as I thought that
glXQueryExtensionsString took the current context into account. However,
as this is wrong I'd prefer to remove it.
How about putting something like the attached workaround in mesa? It's
checking if the client is the window manager for any screen and avoids
using direct rendering if that's the case. It would be more better to
check if the client is the compositing manager but I couldn't think of a
way to check that without creating a top-level window and that seemed a
bit too nasty here.
- David
--- a/src/glx/x11/glxext.c
+++ b/src/glx/x11/glxext.c
@@ -1272,8 +1272,30 @@ __GLXdisplayPrivate *__glXInitialize(Display* dpy)
** (e.g., those called in AllocAndFetchScreenConfigs).
*/
if (getenv("LIBGL_ALWAYS_INDIRECT") == NULL) {
- dpyPriv->driDisplay.private =
- driCreateDisplay(dpy, &dpyPriv->driDisplay);
+ int i, always_indirect = 0;
+
+ /*
+ ** XXX: Avoid using direct rendering with window manager clients
+ ** so we can provide them with support for GLX_EXT_tfp extension
+ ** even though direct rendering support for this extension is
+ ** missing. This should be removed once GLX_EXT_tfp works with
+ ** direct rendering.
+ */
+ for (i = 0; i < ScreenCount (dpy); i++)
+ {
+ XWindowAttributes a;
+
+ XGetWindowAttributes (dpy, XRootWindow (dpy, i), &a);
+ if (a.your_event_mask & SubstructureRedirectMask)
+ {
+ always_indirect = 1;
+ break;
+ }
+ }
+
+ if (!always_indirect)
+ dpyPriv->driDisplay.private =
+ driCreateDisplay(dpy, &dpyPriv->driDisplay);
}
#endif
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mesa3d-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev