glXCreateGLXPixmap() BadMatch

Tomas Carnecky tom at
Thu Mar 23 08:32:42 CST 2006

Tomas Carnecky wrote:
> Tomas Carnecky wrote:
>> Mike Hearn wrote:
>>> Mike Hearn <mike at>
>>> Optimize thunks by storing GL context in the thread environment block
>> good job. this fixed the BadMatch error in World of Warcraft and also
>> increased performance, from ~20fps to ~25fps.
> Maybe that was too soon.. I can login with some characters, with others
> I still get the BadMatch error. This bug may be related to the minimap
> bug that caused opengl to crash when you entered a building, because I
> can login with my characters than stand outside, but now with those that
> stands in an inn (building) or in Ironforge.
> Does anyone remeber how the minimap bug was fixed and if this BadMatch
> bug may be related to it?

BadMatch is generated if the depth of pixmap does not match the
GLX_BUFFER_SIZE value of vis, or if pixmap was not created with respect
to the same screen as vis.

Futher investigation revealed this: when create_glxpixmap() is called,
physDev->depth and physDev->bitmap->pixmap_depth are 1, but
GLX_BUFFER_SIZE from the visual returns 32, I don't know how to get the
depth directly from the pixmap (in case physDev->bitmap->pixmap_depth is
not up-to-date), so any clarification how the bimap/pixmap code works
would be great.

Also, when looking where the depth is changed, I came across
X11DRV_SelectBitmap(), there you change the depth if physDev->depth and
physBitmap->pixmap_depth don't match.

In the trace I see that WoW creates lots of bitmaps and the last time a
bitmap is selected the depth is changed to 1:

trace:x11drv:X11DRV_CreateBitmap (0x340) 32x32 1 bpp
trace:x11drv:X11DRV_CreateBitmap physBitmap->pixmap_depth: 1
trace:x11drv:X11DRV_SetBitmapBits (bmp=0x340, bits=0x7fd64e50, count=0x80)
trace:x11drv:X11DRV_SetBitmapBits (physBitmap->pixmap_depth=1
trace:x11drv:X11DRV_CreateBitmap (0x33c) 32x32 24 bpp
trace:x11drv:X11DRV_CreateBitmap physBitmap->pixmap_depth: 24
trace:x11drv:X11DRV_SetBitmapBits (bmp=0x33c, bits=0x7fd888b8, count=0xc00)
trace:x11drv:X11DRV_SetBitmapBits (physBitmap->pixmap_depth=24
trace:x11drv:X11DRV_SelectBitmap changing depth of physDev(0x7fd64ed8) to 24
trace:x11drv:X11DRV_SelectBitmap changing depth of physDev(0x7fd64ed8) to 1

And also, I don't see anywhere in the trace that the bitmap depth would
be 32 (to match GLX_BUFFER_SIZE).


More information about the wine-devel mailing list