From c12ab8af96daa5581f605a1a63fc5299294dec46 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Mon, 31 Jul 2023 18:12:01 +0200 Subject: [PATCH] radv: track if TES reads tess factors differently This information will be passed through the TCS epilog key. Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_shader.h | 1 + src/amd/vulkan/radv_shader_info.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index 242cbb9..9cb0841 100644 --- a/src/amd/vulkan/radv_shader.h +++ b/src/amd/vulkan/radv_shader.h @@ -349,6 +349,7 @@ struct radv_shader_info { enum gl_tess_spacing spacing; bool ccw; bool point_mode; + bool reads_tess_factors; unsigned tcs_vertices_out; uint8_t num_linked_inputs; uint8_t num_linked_outputs; diff --git a/src/amd/vulkan/radv_shader_info.c b/src/amd/vulkan/radv_shader_info.c index 19613c0..9ecdfe0 100644 --- a/src/amd/vulkan/radv_shader_info.c +++ b/src/amd/vulkan/radv_shader_info.c @@ -502,6 +502,8 @@ gather_shader_info_tes(struct radv_device *device, const nir_shader *nir, struct info->tes.ccw = nir->info.tess.ccw; info->tes.point_mode = nir->info.tess.point_mode; info->tes.tcs_vertices_out = nir->info.tess.tcs_vertices_out; + info->tes.reads_tess_factors = + !!(nir->info.inputs_read & (VARYING_BIT_TESS_LEVEL_INNER | VARYING_BIT_TESS_LEVEL_OUTER)); if (!info->inputs_linked) info->tes.num_linked_inputs = util_last_bit64(nir->info.inputs_read); @@ -1611,8 +1613,7 @@ radv_link_shaders_info(struct radv_device *device, struct radv_shader_stage *pro struct radv_shader_stage *tes_stage = consumer; tcs_stage->info.has_epilog = false; - tcs_stage->info.tcs.tes_reads_tess_factors = - !!(tes_stage->nir->info.inputs_read & (VARYING_BIT_TESS_LEVEL_INNER | VARYING_BIT_TESS_LEVEL_OUTER)); + tcs_stage->info.tcs.tes_reads_tess_factors = tes_stage->info.tes.reads_tess_factors; tcs_stage->info.tcs.tes_inputs_read = tes_stage->nir->info.inputs_read; tcs_stage->info.tcs.tes_patch_inputs_read = tes_stage->nir->info.patch_inputs_read; -- 2.7.4