mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
glx/x11: Fix glXCreateGLXPixmap for direct rendering.
Fixes progs/xdemos/glxpixmap modified to use direct rendering.
This commit is contained in:
parent
9399b9a0e2
commit
edb1178798
1 changed files with 28 additions and 0 deletions
|
|
@ -845,6 +845,34 @@ PUBLIC GLXPixmap glXCreateGLXPixmap(Display *dpy, XVisualInfo *vis,
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue