radv: bind the vertex input SGPR only for relevant stages
Otherwise, user_data_0 is wrong if merged shaders are compiled separately and if we have GS. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27432>
This commit is contained in:

committed by
Marge Bot

parent
d64d7373f3
commit
dd92f5f664
@@ -6434,8 +6434,13 @@ radv_bind_pre_rast_shader(struct radv_cmd_buffer *cmd_buffer, const struct radv_
|
||||
cmd_buffer->state.dirty |= RADV_CMD_DIRTY_SHADER_QUERY;
|
||||
}
|
||||
|
||||
const bool needs_vtx_sgpr =
|
||||
shader->info.stage == MESA_SHADER_VERTEX || shader->info.stage == MESA_SHADER_MESH ||
|
||||
(shader->info.stage == MESA_SHADER_GEOMETRY && !shader->info.merged_shader_compiled_separately) ||
|
||||
(shader->info.stage == MESA_SHADER_TESS_CTRL && !shader->info.merged_shader_compiled_separately);
|
||||
|
||||
loc = radv_get_user_sgpr(shader, AC_UD_VS_BASE_VERTEX_START_INSTANCE);
|
||||
if (loc->sgpr_idx != -1) {
|
||||
if (needs_vtx_sgpr && loc->sgpr_idx != -1) {
|
||||
cmd_buffer->state.vtx_base_sgpr = shader->info.user_data_0 + loc->sgpr_idx * 4;
|
||||
cmd_buffer->state.vtx_emit_num = loc->num_sgprs;
|
||||
cmd_buffer->state.uses_drawid = shader->info.vs.needs_draw_id;
|
||||
|
Reference in New Issue
Block a user