[Mesa-dev] [PATCH] gallium/wgl: Avoid calling SetPixelFormat if used as drop-in opengl32

Frank Richter frank.richter at dynardo.de
Mon Nov 5 11:45:15 UTC 2018


Hello,
I've stumbled across an issue were Mesa failed to create a context when 
it's used as a opengl32 surrogate (from Qt). The weird thing was that 
the failure only happened on certain graphics hardware, even though Mesa 
was supposed to take over GL duties.
As it turns out, the problem was the call to the GDI SetPixelFormat() 
function, which occasionally failed & broke the DC. The failure reason 
isn't quite clear, but it appears to be some sort of race condition, as 
everything works now and then, or when things happen with different timings.

Anyway, since Mesa is supposed to replace opengl32 entirely it seems 
appropriate to avoid calling GDI SetPixelFormat(). The code path that 
calls SetPixelFormat() will have set the pixel format in the 
Mesa-related structures, so GetPixelFormat() won't be called by the 
context creation anyway.

Thoughts on that? Does the reasoning sound sensible?

-f.r.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-gallium-wgl-Avoid-calling-SetPixelFormat-if-used-as-.patch
Type: text/x-patch
Size: 1814 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20181105/dab89119/attachment.bin>


More information about the mesa-dev mailing list