Module: Mesa
Branch: staging/22.3
Commit: fd1168327896642f8cfb06249ad8cd9c6822187e
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fd1168327896642f8cfb06249ad8cd9c6822187e

Author: Mike Blumenkrantz <[email protected]>
Date:   Fri Jan  6 13:46:37 2023 -0500

zink: only update framebuffer object during swapchain update if framebuffer 
exists

otherwise this might be randomly creating an unused framebuffer for dynamic 
render

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20584>
(cherry picked from commit 79a4d22928e2b1b3e4a4246384b33c42a14cdb57)

---

 .pick_status.json                           | 2 +-
 src/gallium/drivers/zink/zink_render_pass.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 7968a3c02c4..85cded69b7e 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -751,7 +751,7 @@
         "description": "zink: only update framebuffer object during swapchain 
update if framebuffer exists",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/drivers/zink/zink_render_pass.c 
b/src/gallium/drivers/zink/zink_render_pass.c
index 6a3912fa052..ac134422c5d 100644
--- a/src/gallium/drivers/zink/zink_render_pass.c
+++ b/src/gallium/drivers/zink/zink_render_pass.c
@@ -835,7 +835,8 @@ zink_render_update_swapchain(struct zink_context *ctx)
       zink_kopper_fixup_depth_buffer(ctx);
       if (ctx->fb_state.width != old_w || ctx->fb_state.height != old_h)
          ctx->scissor_changed = true;
-      zink_update_framebuffer_state(ctx);
+      if (ctx->framebuffer)
+         zink_update_framebuffer_state(ctx);
       ctx->swapchain_size.width = ctx->swapchain_size.height = 0;
    }
 }

Reply via email to