From 73259c9ec40ae67aa244cde4367a63a66b47b675 Mon Sep 17 00:00:00 2001 From: Konstantin Seurer Date: Fri, 15 Mar 2024 19:05:47 +0100 Subject: [PATCH] lavapipe: Add an api_stage parameter to update_pcbuf llvmpipe does not support ray tracing stages, so update_pcbuf needs to be aware of the Vulkan and the llvmpipe stage. Reviewed-By: Mike Blumenkrantz Part-of: --- src/gallium/frontends/lavapipe/lvp_execute.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c index 247affd460e..75bc82b3609 100644 --- a/src/gallium/frontends/lavapipe/lvp_execute.c +++ b/src/gallium/frontends/lavapipe/lvp_execute.c @@ -269,9 +269,10 @@ get_pcbuf_size(struct rendering_state *state, enum pipe_shader_type pstage) } static void -update_pcbuf(struct rendering_state *state, enum pipe_shader_type pstage) +update_pcbuf(struct rendering_state *state, enum pipe_shader_type pstage, + enum pipe_shader_type api_stage) { - unsigned size = get_pcbuf_size(state, pstage); + unsigned size = get_pcbuf_size(state, api_stage); if (size) { uint8_t *mem; struct pipe_constant_buffer cbuf; @@ -282,7 +283,7 @@ update_pcbuf(struct rendering_state *state, enum pipe_shader_type pstage) memcpy(mem, state->push_constants, size); state->pctx->set_constant_buffer(state->pctx, pstage, 0, true, &cbuf); } - state->pcbuf_dirty[pstage] = false; + state->pcbuf_dirty[api_stage] = false; } static void @@ -373,7 +374,7 @@ static void emit_compute_state(struct rendering_state *state) { bool pcbuf_dirty = state->pcbuf_dirty[MESA_SHADER_COMPUTE]; if (state->pcbuf_dirty[MESA_SHADER_COMPUTE]) - update_pcbuf(state, MESA_SHADER_COMPUTE); + update_pcbuf(state, MESA_SHADER_COMPUTE, MESA_SHADER_COMPUTE); if (state->constbuf_dirty[MESA_SHADER_COMPUTE]) { for (unsigned i = 0; i < state->num_const_bufs[MESA_SHADER_COMPUTE]; i++) @@ -556,7 +557,7 @@ static void emit_state(struct rendering_state *state) lvp_forall_gfx_stage(sh) { pcbuf_dirty[sh] = state->pcbuf_dirty[sh]; if (state->pcbuf_dirty[sh]) - update_pcbuf(state, sh); + update_pcbuf(state, sh, sh); } lvp_forall_gfx_stage(sh) {