Module: Mesa
Branch: main
Commit: 4be5caba671e166caf8aa7dcb31acf582c67e9eb
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4be5caba671e166caf8aa7dcb31acf582c67e9eb

Author: Mike Blumenkrantz <[email protected]>
Date:   Fri Mar 24 16:11:44 2023 -0400

zink: flag vertex buffers for rebind after vstate draws

vstate draws bind their own vertex buffers unrelated to the bound
gallium buffers, so any draw occurring after a vstate draw must
rebind vertex buffers to ensure the correct ones are bound

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22116>

---

 src/gallium/drivers/zink/zink_draw.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_draw.cpp 
b/src/gallium/drivers/zink/zink_draw.cpp
index 5e06f65cee9..53432003f9e 100644
--- a/src/gallium/drivers/zink/zink_draw.cpp
+++ b/src/gallium/drivers/zink/zink_draw.cpp
@@ -974,6 +974,8 @@ zink_draw_vertex_state(struct pipe_context *pctx,
    ctx->gfx_pipeline_state.element_state = &((struct 
zink_vertex_state*)vstate)->velems.hw_state;
 
    zink_draw<HAS_MULTIDRAW, DYNAMIC_STATE, BATCH_CHANGED, true>(pctx, &dinfo, 
0, NULL, draws, num_draws, vstate, partial_velem_mask);
+   /* ensure ctx->vertex_buffers gets rebound on next non-vstate draw */
+   ctx->vertex_buffers_dirty = true;
    ctx->gfx_pipeline_state.element_state = hw_state;
 
    if (info.take_vertex_state_ownership)

Reply via email to