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

Author: Dave Airlie <[email protected]>
Date:   Tue Sep 26 11:40:18 2023 +1000

llvmpipe: reset viewport_index_slot in fb bind

I hit a problem running a set of lvp caselists with
dEQP-VK.transform_feedback.simple.draw_indirect_endqueryindexed_streamid_0_16,Crash

This was crashing due to
 assert(setup->viewport_index_slot < 0);
in try_update_scene_state

This was because a previous draw had set viewport index slot to 2,
but a clear then draw sequence never resets it, so the clear gets
a scene, and when the subsequent flush happens for that scene,
the viewport_index_slot is never updated. It only gets updated on
draws.

This just resets it as lp_setup_update_state will always pick up
the correct one for the next draw.

Cc: mesa-stable
Reviewed-by: Roland Scheidegger <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25387>
(cherry picked from commit 8791aab20f21bf206cbd187840fea327a5942af5)

---

 .pick_status.json                       | 2 +-
 src/gallium/drivers/llvmpipe/lp_setup.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index bffb601a3d6..6349c3c34fc 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -3124,7 +3124,7 @@
         "description": "llvmpipe: reset viewport_index_slot in fb bind",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null,
         "notes": null
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c 
b/src/gallium/drivers/llvmpipe/lp_setup.c
index 9b58e7158f6..6c7f887ba70 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -410,6 +410,7 @@ lp_setup_bind_framebuffer(struct lp_setup_context *setup,
    setup->framebuffer.y0 = 0;
    setup->framebuffer.x1 = fb->width-1;
    setup->framebuffer.y1 = fb->height-1;
+   setup->viewport_index_slot = -1;
    setup->dirty |= LP_SETUP_NEW_SCISSOR;
 }
 

Reply via email to