From 6ab25f5cde0b00d67530bd83dc885eb65191a478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 4 Feb 2024 22:24:07 -0500 Subject: [PATCH] cso: remove CSO_UNBIND_VERTEX_BUFFER0 It has no effect other than unreferencing buffers, which are then immediatelly re-bound by st/mesa, so it doesn't do anything. The name is also incorrect because it unbound all vertex buffers. Reviewed-By: Mike Blumenkrantz Part-of: --- src/gallium/auxiliary/cso_cache/cso_context.c | 2 -- src/gallium/auxiliary/cso_cache/cso_context.h | 1 - src/gallium/auxiliary/hud/hud_context.c | 2 +- src/gallium/auxiliary/postprocess/pp_run.c | 3 +-- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index 0a5a1a9b2c5..a060b3cca8e 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.c +++ b/src/gallium/auxiliary/cso_cache/cso_context.c @@ -1739,8 +1739,6 @@ cso_restore_state(struct cso_context *ctx, unsigned unbind) cso->base.pipe->set_constant_buffer(cso->base.pipe, PIPE_SHADER_FRAGMENT, 0, false, NULL); if (state_mask & CSO_BIT_VERTEX_ELEMENTS) cso_restore_vertex_elements(cso); - if (unbind & CSO_UNBIND_VERTEX_BUFFER0) - cso->base.pipe->set_vertex_buffers(cso->base.pipe, 0, false, NULL); if (state_mask & CSO_BIT_STREAM_OUTPUTS) cso_restore_stream_outputs(cso); if (state_mask & CSO_BIT_PAUSE_QUERIES) diff --git a/src/gallium/auxiliary/cso_cache/cso_context.h b/src/gallium/auxiliary/cso_cache/cso_context.h index fcd3585718b..8aded62cb3c 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.h +++ b/src/gallium/auxiliary/cso_cache/cso_context.h @@ -110,7 +110,6 @@ enum cso_unbind_flags { CSO_UNBIND_FS_IMAGE0 = (1 << 2), CSO_UNBIND_VS_CONSTANTS = (1 << 3), CSO_UNBIND_FS_CONSTANTS = (1 << 4), - CSO_UNBIND_VERTEX_BUFFER0 = (1 << 5), }; /* diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c index cc9702bff27..b43ea363e58 100644 --- a/src/gallium/auxiliary/hud/hud_context.c +++ b/src/gallium/auxiliary/hud/hud_context.c @@ -655,7 +655,7 @@ hud_draw_results(struct hud_context *hud, struct pipe_resource *tex) } done: - cso_restore_state(cso, CSO_UNBIND_FS_SAMPLERVIEW0 | CSO_UNBIND_VS_CONSTANTS | CSO_UNBIND_VERTEX_BUFFER0); + cso_restore_state(cso, CSO_UNBIND_FS_SAMPLERVIEW0 | CSO_UNBIND_VS_CONSTANTS); /* restore states not restored by cso */ if (hud->st) { diff --git a/src/gallium/auxiliary/postprocess/pp_run.c b/src/gallium/auxiliary/postprocess/pp_run.c index 8f22667efc2..893390b199a 100644 --- a/src/gallium/auxiliary/postprocess/pp_run.c +++ b/src/gallium/auxiliary/postprocess/pp_run.c @@ -188,8 +188,7 @@ pp_run(struct pp_queue_t *ppq, struct pipe_resource *in, cso_restore_state(cso, CSO_UNBIND_FS_SAMPLERVIEWS | CSO_UNBIND_FS_IMAGE0 | CSO_UNBIND_VS_CONSTANTS | - CSO_UNBIND_FS_CONSTANTS | - CSO_UNBIND_VERTEX_BUFFER0); + CSO_UNBIND_FS_CONSTANTS); /* restore states not restored by cso */ if (ppq->p->st) {