On Thu, 2009-08-27 at 22:35 +0200, thomas.cook...@nokia.com wrote: > >> > > While I have this working, it seems a little hacky and isn't widely > >> > > supported (I have it working on 1 driver build for 1 bit of hardware). > >> > > >> > If you mean rendering to pixmaps isn't widely supported, that should be > >> > getting better with DRI2. > >> > >> I hope so. Although even with DRI2, I think my Intel drivers have broken > >> pixmap rendering at the moment (although it could be Qt which is doing > >> something strange). > > > >What's your test? mesa/progs/xdemos/glxgears_pixmap seems to work fine > >here with intel and radeon. > > I was testing with just Qt API, but I've also checked that > mesa/progs/xdemos/glxpixmap also fails with BadDrawable errors if > you change it to use a direct rendering context: > > - ctx = glXCreateContext( dpy, visinfo, NULL, False ); > + ctx = glXCreateContext( dpy, visinfo, NULL, True ); > > However, after your suggestion, I also tried glxgears_pixmap > which seems to work fine with a direct rendering context. I > can only assume this is because it uses the FBConfig APIs > rather than the older glX APIs (which Qt also uses)?
The Mesa libGL patch below fixes progs/xdemos/glxpixmap here with direct rendering, does it help for Qt? diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c index 2efe191..4f87bd8 100644 --- a/src/glx/x11/glxcmds.c +++ b/src/glx/x11/glxcmds.c @@ -880,6 +880,34 @@ glXCreateGLXPixmap(Display * dpy, XVisualInfo * vis, Pixmap pixmap) req->glxpixmap = xid = XAllocID(dpy); UnlockDisplay(dpy); SyncHandle(); + +#ifdef GLX_DIRECT_RENDERING + do { + /* FIXME: Maybe delay __DRIdrawable creation until the drawable + * is actually bound to a context... */ + + __GLXdisplayPrivate *const priv = __glXInitialize(dpy); + __GLXDRIdrawable *pdraw; + __GLXscreenConfigs *psc; + __GLcontextModes *modes; + + psc = &priv->screenConfigs[vis->screen]; + if (psc->driScreen == NULL) + break; + modes = _gl_context_modes_find_visual(psc->visuals, vis->visualid); + pdraw = psc->driScreen->createDrawable(psc, pixmap, req->glxpixmap, modes); + if (pdraw == NULL) { + fprintf(stderr, "failed to create pixmap\n"); + break; + } + + if (__glxHashInsert(psc->drawHash, req->glxpixmap, pdraw)) { + (*pdraw->destroyDrawable) (pdraw); + return None; /* FIXME: Check what we're supposed to do here... */ + } + } while (0); +#endif + return xid; } -- Earthling Michel Dänzer | http://www.vmware.com Libre software enthusiast | Debian, X and DRI developer ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july -- _______________________________________________ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel