lavapipe: fix pushconst data updating

in a sequence like:
* CmdPushConstants
* CmdBindPipeline (doesn't use push constants)
* CmdDispatch
* CmdBindPipeline (uses push constants)
* CmdDispatch

the previous code would never update pushconsts and the second dispatch
would have no valid data

cc: mesa-stable

(cherry picked from commit f4461b66b6)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41402>
This commit is contained in:
Mike Blumenkrantz 2026-04-30 13:00:28 -04:00 committed by Eric Engestrom
parent 7f240ff038
commit eb5f9911c2
2 changed files with 2 additions and 5 deletions

View file

@ -1664,7 +1664,7 @@
"description": "lavapipe: fix pushconst data updating",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -332,7 +332,7 @@ update_pcbuf(struct rendering_state *state, mesa_shader_stage pstage,
static void emit_compute_state(struct rendering_state *state)
{
if (state->pcbuf_dirty[MESA_SHADER_COMPUTE])
if (state->pcbuf_dirty[MESA_SHADER_COMPUTE] && state->has_pcbuf[MESA_SHADER_COMPUTE])
update_pcbuf(state, MESA_SHADER_COMPUTE, MESA_SHADER_COMPUTE);
if (state->constbuf_dirty[MESA_SHADER_COMPUTE]) {
@ -638,9 +638,6 @@ handle_compute_shader(struct rendering_state *state, struct lvp_shader *shader)
state->has_pcbuf[MESA_SHADER_COMPUTE] = shader->push_constant_size > 0;
if (!state->has_pcbuf[MESA_SHADER_COMPUTE])
state->pcbuf_dirty[MESA_SHADER_COMPUTE] = false;
state->dispatch_info.block[0] = shader->pipeline_nir->nir->info.workgroup_size[0];
state->dispatch_info.block[1] = shader->pipeline_nir->nir->info.workgroup_size[1];
state->dispatch_info.block[2] = shader->pipeline_nir->nir->info.workgroup_size[2];