From 6ffac15b31d7d54e2998981c65d6bbe7bfc81322 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Thu, 9 Apr 2026 16:33:01 -0700 Subject: [PATCH] wgl: Flush and wait when unbinding a context that references a swapchain Reviewed-by: Sil Vilerino Part-of: --- src/gallium/frontends/wgl/stw_context.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gallium/frontends/wgl/stw_context.c b/src/gallium/frontends/wgl/stw_context.c index 7297d3f1e51..14fab3d9cec 100644 --- a/src/gallium/frontends/wgl/stw_context.c +++ b/src/gallium/frontends/wgl/stw_context.c @@ -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);