The Blender-on-G400 issue
glynn at gclements.plus.com
Sat Dec 10 17:02:58 PST 2005
I have the problem with Blender on a Matrox G400, described in:
It appears that the G400 driver is getting its front and back buffers
confused in certain situations. This is a problem for Blender as the
code extensively mixes drawing to both buffers.
I have tracked it down so far as adding debugging code to Blender's
shaded_button function in source/blender/src/interface_draw.c. This
code draws the (gradient-filled) background for UI buttons. AFAICT, it
always draws to the back buffer; or, at least, it is meant to.
fprintf(stderr, "shaded_button: %d\n" , db);
results in lots of lines of the form:
The value is always 1029 (== 0x0405 == GL_BACK).
However, adding code to dump out both the front and back buffers (via
glReadBuffer + glReadPixels) to PPM files at the beginning and end of
the function shows that it is actually drawing to the front buffer.
The button backgrounds then get overwritten by the text or icon, which
*are* drawn to the back buffer then copied to the front buffer using
If I add:
immediately after the above lines, the problems go away (for buttons;
other parts of the UI, e.g. menus and tooltips, are still
Given that glGetIntegerv(GL_DRAW_BUFFER) says that it's already using
the back buffer, and that the problem doesn't occur with Mesa (or
presumably other DRI drivers), it looks as if glDrawBuffer() may not
be working correctly.
Does anyone have any suggestions on where to go from here?
Glynn Clements <glynn at gclements.plus.com>
More information about the xorg