diff options
author | Timur Kristóf <timur.kristof@gmail.com> | 2024-04-03 13:25:45 +0200 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-04-03 23:40:33 +0000 |
commit | 0ddecb3f0eeb72412269cdb0bae46dd7b3d600e3 (patch) | |
tree | cd8cfa70469e2f7a1c19204af9e5eec96f2f5ee8 | |
parent | 5156d3097bc87fefd535929f4472d8a714a7feee (diff) |
radv: Add helper to determine usage of VS prologs.
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/28172>
-rw-r--r-- | src/amd/vulkan/radv_shader_info.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/amd/vulkan/radv_shader_info.c b/src/amd/vulkan/radv_shader_info.c index d60a1a137a7..749b5d006a7 100644 --- a/src/amd/vulkan/radv_shader_info.c +++ b/src/amd/vulkan/radv_shader_info.c @@ -35,11 +35,18 @@ mark_sampler_desc(const nir_variable *var, struct radv_shader_info *info) } static bool +radv_use_vs_prolog(const nir_shader *nir, + const struct radv_graphics_state_key *gfx_state) +{ + return gfx_state->vs.has_prolog && nir->info.inputs_read; +} + +static bool radv_use_per_attribute_vb_descs(const nir_shader *nir, const struct radv_graphics_state_key *gfx_state, const struct radv_shader_stage_key *stage_key) { - return stage_key->vertex_robustness1 || (gfx_state->vs.has_prolog && nir->info.inputs_read); + return stage_key->vertex_robustness1 || radv_use_vs_prolog(nir, gfx_state); } static void @@ -537,7 +544,7 @@ gather_shader_info_vs(struct radv_device *device, const nir_shader *nir, const struct radv_graphics_state_key *gfx_state, const struct radv_shader_stage_key *stage_key, struct radv_shader_info *info) { - if (gfx_state->vs.has_prolog && nir->info.inputs_read) { + if (radv_use_vs_prolog(nir, gfx_state)) { info->vs.has_prolog = true; info->vs.dynamic_inputs = true; } |