wgl: Flush and wait when unbinding a context that references a swapchain

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40876>
This commit is contained in:
Jesse Natalie 2026-04-09 16:33:01 -07:00 committed by Marge Bot
parent ad65ed643b
commit 6ffac15b31

View file

@ -443,7 +443,10 @@ stw_make_current(struct stw_framebuffer *fb, struct stw_framebuffer *fbRead, str
return true;
}
} else {
if (old_ctx->shared) {
if (old_ctx->shared ||
/* Using a winsys framebuffer effectively means that there's sharing since another
* context might end up using the same resources. */
(old_ctx->current_framebuffer && old_ctx->current_framebuffer->winsys_framebuffer)) {
if (old_ctx->current_framebuffer) {
stw_st_flush(old_ctx->st, old_ctx->current_framebuffer->drawable,
ST_FLUSH_FRONT | ST_FLUSH_WAIT);