WGL_SWAP_METHOD attribute is not handled. Explicitly skip it in ConvertAttribWGLtoGLX and always return WGL_SWAP_UNDEFINED_ARB in X11DRV_wglGetPixelFormatAttribivARB, because buffers are always in undefined state after swap in GLX.
There's GLX_OML_swap_method. It is supported on fglrx, and I think it is supported on the open source drivers as well
Stefan Dösinger wrote:
There's GLX_OML_swap_method. It is supported on fglrx, and I think it is supported on the open source drivers as well
Hmm. Did not found that one. Is supported on r300/mesa7-7.1.0~git20080728.
Modified patch attached.
It would be better to actually convert the attribute in ConvertAttribWGLtoGLX, but, in case the GLX extension is missing, we must somehow tell ConvertAttribWGLtoGLX's caller, of whose currently only one exists, that it should filter the list of fbformats on this attribute itself (in general case).
In our case, if we can't tell what swap methods are on fbformats, we must assume they're GLX_SWAP_UNDEFINED_OML, and thus if WGL_SWAP_METHOD_ARB attribute in request is not WGL_SWAP_UNDEFINED_ARB, then there are zero matching fbformats(pixelformats).
Is putting the following into ConvertAttribWGLtoGLX a good idea?
case WGL_SWAP_METHOD_ARB: pop = iWGLAttr[++cur]; if (glxRequireExtension("GLX_OML_swap_method")) switch(pop) { case WGL_SWAP_EXCHANGE_ARB: PUSH2(oGLXAttr, GLX_SWAP_METHOD_OML, GLX_SWAP_EXCHANGE_OML); break; case WGL_SWAP_COPY_ARB: PUSH2(oGLXAttr, GLX_SWAP_METHOD_OML, GLX_SWAP_COPY_OML); break; case WGL_SWAP_UNDEFINED_ARB: PUSH2(oGLXAttr, GLX_SWAP_METHOD_OML, WGL_SWAP_UNDEFINED_ARB); break; default: ERR("unexpected WGL_SWAP_METHOD_ARB(%x)\n", pop); } else if (pop != WGL_SWAP_UNDEFINED_ARB) return 0; /* no fbconfig could possibly match */ break; /* they all match, swap being undefined by default */