wined3d: Don't use separate GL contexts for different swapchains.
commit72597b170e814599ef2be4b19dc4b9de0932a30f
authorMatteo Bruni <mbruni@codeweavers.com>
Wed, 5 Aug 2020 18:09:38 +0000 (5 20:09 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Wed, 30 Nov 2022 19:38:27 +0000 (30 20:38 +0100)
tree2eaf360c860b6915b0cec7a4560a867d4fc87188
parentee349306e29309e629acd5e441374c369c489a5f
wined3d: Don't use separate GL contexts for different swapchains.

This avoids triggering a Mesa slowpath introduced
by Mesa commit e7f3a8d6959c74f63c877dd8776fe519d54f946f.

Additionally, it helps applications using multiple swapchains and
queries (e.g. the one in bug 43773) by not requiring extra context
switches when polling queries. For the records, the actual issue from
bug 43773 was probably fixed a long time ago, maybe already by
7b62a970e9ad3b4179394cf54f0232475fe2388a or thereabouts.

The downside of this change is that we'll now end up calling
glFinish() when there are multiple threads using the same device when
CSMT is disabled. That's a non-default setting and one that should
only be used for troubleshooting purposes at this point, so it
shouldn't be too bad of an issue. It might also make sense to just get
rid of that glFinish() entirely, it's never going to be a complete
fix.
dlls/wined3d/adapter_gl.c
dlls/wined3d/context_gl.c
dlls/wined3d/device.c
dlls/wined3d/swapchain.c
dlls/wined3d/wined3d_private.h