From patch 1/5:
Helpfully, I haven't taken note of which game this helped but it did
in fact fix a game crash...
I remember discussing this change before... I think this was for FFXIV. While the change is fine in terms of reducing the scope of "offset" and avoiding a calculation we may end up not needing, it wasn't clear why this would avoid a crash, and that seems somewhat concerning.
From patch 4/5:
Acquiring a GL context might be problematic during teardown (e.g. the CS thread might end up running this code after wined3d_device_uninit_3d() has already completed and device->swapchains has become NULL).
This too is a patch I've seen before. From last time:
On Wed, 9 Feb 2022 at 20:25, Matteo Bruni matteo.mystral@gmail.com wrote:
On Wed, Feb 9, 2022 at 7:44 PM Henri Verbeet hverbeet@gmail.com wrote:
I suppose this is probably fine in practice, but glFinish() always makes me a bit uncomfortable; I'd prefer just checking for the availability of fences, like in 5/5. Taking that one step further, if fences aren't supported, I don't think there's anything we would need to wait for in the first place; we can probably just avoid the glFinish() in that case as well.
Good point, I'll give that a try.
From patch 5/5:
Originally written to avoid triggering a Mesa slowpath introduced by Mesa commit e7f3a8d6959c74f63c877dd8776fe519d54f946f. It seems to me like this would be a good idea for more reasons than just that though.
It may be worth mentioning those reasons then. :)
For reference, from last time:
2020-12-03 18:52:45 @henri Mystral: 197149 caught my eye; do we actually hit that? 2020-12-03 18:56:47 @henri looking at https://cgit.freedesktop.org/mesa/mesa/commit/?id=e7f3a8d6959c74f63c877dd8776fe519d54f946f my guess would be the issue would mostly go away if we did event queries the Vulkan way 2020-12-03 18:57:03 @henri (i.e., wined3d_query_event_vk_issue()/wined3d_query_event_vk_poll()) 2020-12-03 20:31:10 @Mystral I don't know if it matters with the new event queries stuff but it did destroy perf with my branch 2020-12-03 20:32:38 @Mystral IIUC it flushes all the pending commands every time you FenceSync 2020-12-03 20:34:03 @Mystral if there are more than 1 contexts around, which is usually the case with current Wine and d3d11