radv: Use radv_get_shader to get vertex shader when binding pipeline.

The shaders[MESA_SHADER_VERTEX] can be NULL for merged shaders.

Fixes: b2ac40e734
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8749
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22229>
This commit is contained in:
Timur Kristóf 2023-03-31 05:05:36 +02:00 committed by Marge Bot
parent f8558d1fb5
commit 61003e3600

View file

@ -6624,8 +6624,9 @@ radv_CmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipeline
}
/* Re-emit the vertex buffer descriptors because they are really tied to the pipeline. */
if (graphics_pipeline->base.shaders[MESA_SHADER_VERTEX] &&
graphics_pipeline->base.shaders[MESA_SHADER_VERTEX]->info.vs.vb_desc_usage_mask) {
const struct radv_shader *vs =
radv_get_shader(graphics_pipeline->base.shaders, MESA_SHADER_VERTEX);
if (vs && vs->info.vs.vb_desc_usage_mask) {
cmd_buffer->state.dirty |= RADV_CMD_DIRTY_VERTEX_BUFFER;
}