freedreno/a3xx-a5xx: re-emit vertex state on VS change
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

On a3xx-a5xx information from vertex program is used to emit state
related to vertex buffer. However this state is not re-emitted if only
vertex program changes which causes rendering artifacts on gnome-shell
where there are 2 draws with same vertex buffer but different shaders
(due to changed vertex attribute destination regid).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35164>
This commit is contained in:
Vladly 2025-05-26 13:35:45 +00:00 committed by Marge Bot
parent 02805fd900
commit 45e61f1203
3 changed files with 6 additions and 3 deletions

View file

@ -42,7 +42,8 @@ draw_impl(struct fd_context *ctx, struct fd_ringbuffer *ring,
fd3_emit_state(ctx, ring, emit);
if (emit->dirty & (FD_DIRTY_VTXBUF | FD_DIRTY_VTXSTATE))
if ((ctx->dirty_shader[PIPE_SHADER_VERTEX] & FD_DIRTY_SHADER_PROG) ||
(emit->dirty & (FD_DIRTY_VTXBUF | FD_DIRTY_VTXSTATE)))
fd3_emit_vertex_bufs(ring, emit);
OUT_PKT0(ring, REG_A3XX_PC_VERTEX_REUSE_BLOCK_CNTL, 1);

View file

@ -30,7 +30,8 @@ draw_impl(struct fd_context *ctx, struct fd_ringbuffer *ring,
fd4_emit_state(ctx, ring, emit);
if (emit->dirty & (FD_DIRTY_VTXBUF | FD_DIRTY_VTXSTATE))
if ((ctx->dirty_shader[PIPE_SHADER_VERTEX] & FD_DIRTY_SHADER_PROG) ||
(emit->dirty & (FD_DIRTY_VTXBUF | FD_DIRTY_VTXSTATE)))
fd4_emit_vertex_bufs(ring, emit);
OUT_PKT0(ring, REG_A4XX_VFD_INDEX_OFFSET, 2);

View file

@ -30,7 +30,8 @@ draw_impl(struct fd_context *ctx, struct fd_ringbuffer *ring,
fd5_emit_state(ctx, ring, emit);
if (emit->dirty & (FD_DIRTY_VTXBUF | FD_DIRTY_VTXSTATE))
if ((ctx->dirty_shader[PIPE_SHADER_VERTEX] & FD_DIRTY_SHADER_PROG) ||
(emit->dirty & (FD_DIRTY_VTXBUF | FD_DIRTY_VTXSTATE)))
fd5_emit_vertex_bufs(ring, emit);
OUT_PKT4(ring, REG_A5XX_VFD_INDEX_OFFSET, 2);