radv: reset some dynamic states when the fragment shader stage is unbound

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23494>
(cherry picked from commit 71b6108f67)
This commit is contained in:
Samuel Pitoiset 2023-06-12 08:43:34 +02:00 committed by Eric Engestrom
parent 2c81fbf6d9
commit be57dc25ac
2 changed files with 12 additions and 1 deletions

View file

@ -391,7 +391,7 @@
"description": "radv: reset some dynamic states when the fragment shader stage is unbound",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -6612,6 +6612,17 @@ radv_bind_shader(struct radv_cmd_buffer *cmd_buffer, struct radv_shader *shader,
if (!shader) {
cmd_buffer->state.shaders[stage] = NULL;
cmd_buffer->state.active_stages &= ~mesa_to_vk_shader_stage(stage);
/* Reset some dynamic states when a shader stage is unbound. */
switch (stage) {
case MESA_SHADER_FRAGMENT:
cmd_buffer->state.dirty |= RADV_CMD_DIRTY_DYNAMIC_CONSERVATIVE_RAST_MODE |
RADV_CMD_DIRTY_DYNAMIC_RASTERIZATION_SAMPLES |
RADV_CMD_DIRTY_DYNAMIC_FRAGMENT_SHADING_RATE;
break;
default:
break;
}
return;
}