Joe Krahn wrote:
> I am trying to draw to two windows using one context.
> It works for Mesa, but gives severe artifacts with DRI.
> It would work to instead use glXCopyContext, but this
> still doesn't work for DRI, and it crashes the server
> with indirect rendering.
> I am using ATI Rage and Radeon, with XFree86 CVS.
> Haven't tried DRI CVS yet, but I will do this soon.
> Here is a test app illustrating context bugs:
> Aside from fixing bugs, any ideas on a workaround
> to share a context in DRI?
Thanks for the test program! It helped a lot!
I found two bugs:
1. If glViewport was never called, Mesa wouldn't get the
correct window size. This would cause no rendering to
appear. Adding a glViewport call before rendering anything
would be a work-around.
2. glXCopyContext() could lead to segfaults because of pointer
corruption. If you'd leave GL_VIEWPORT_BIT, GL_TEXTURE_BIT,
and GL_LIGHTING_BIT out of the 'mask' parameter, it would
I've checked in fixes for both the the Mesa and DRI trees.
Thought I have't tested with the Rage128 and have only done
minimal testing with Radeon.
Another thing: for test cases 2 and 4 it would be wise to put a
glFlush() after the last rendering calls of the frame. Otherwise,
glXSwapBuffers() may not trigger an implicit glFlush to complete
rendering before swapping. The GLX spec says that glXSwapBuffers
will flush the pipeline if the currently-bound window is being
swapped, but doesn't say anything about flushing a non-current
> Another unrelated thing, not actually DRI: glDrawPixels
> with GL_BITMAP and an incorrect format correctly gives an
> error in DRI, but indirect results in an Xlib error:
I'll look into this next, but maybe not tonight.