radv: track if TES reads tess factors differently
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 31 Jul 2023 16:12:01 +0000 (18:12 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 2 Aug 2023 16:59:18 +0000 (16:59 +0000)
This information will be passed through the TCS epilog key.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24404>

src/amd/vulkan/radv_shader.h
src/amd/vulkan/radv_shader_info.c

index 242cbb9..9cb0841 100644 (file)
@@ -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;
index 19613c0..9ecdfe0 100644 (file)
@@ -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;