radeonsi: add dummy implementation of si_nir_scan_tess_ctrl()
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 7 Dec 2017 02:11:32 +0000 (13:11 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Fri, 5 Jan 2018 00:58:55 +0000 (11:58 +1100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_shader.h
src/gallium/drivers/radeonsi/si_shader_nir.c
src/gallium/drivers/radeonsi/si_state_shaders.c

index c981d3562e22d12fc3f2e7a214b8a532d219e374..c449aa9684496684d7ec2bd90a2851d7ee1c8dfd 100644 (file)
@@ -652,6 +652,9 @@ const char *si_get_shader_name(const struct si_shader *shader, unsigned processo
 /* si_shader_nir.c */
 void si_nir_scan_shader(const struct nir_shader *nir,
                        struct tgsi_shader_info *info);
+void si_nir_scan_tess_ctrl(const struct nir_shader *nir,
+                          const struct tgsi_shader_info *info,
+                          struct tgsi_tessctrl_info *out);
 void si_lower_nir(struct si_shader_selector *sel);
 
 /* Inline helpers. */
index 2757d4e4117d59142547f6dad6d6f6f35043cce4..d331dfeaaa749e56b6792afcd6874c950b1f2e66 100644 (file)
@@ -130,6 +130,25 @@ static void scan_instruction(struct tgsi_shader_info *info,
        }
 }
 
+void si_nir_scan_tess_ctrl(const struct nir_shader *nir,
+                          const struct tgsi_shader_info *info,
+                          struct tgsi_tessctrl_info *out)
+{
+       memset(out, 0, sizeof(*out));
+
+       if (nir->info.stage != MESA_SHADER_TESS_CTRL)
+               return;
+
+       /* Initial value = true. Here the pass will accumulate results from
+        * multiple segments surrounded by barriers. If tess factors aren't
+        * written at all, it's a shader bug and we don't care if this will be
+        * true.
+        */
+       out->tessfactors_are_def_in_all_invocs = true;
+
+       /* TODO: Implement scanning of tess factors, see tgsi backend. */
+}
+
 void si_nir_scan_shader(const struct nir_shader *nir,
                        struct tgsi_shader_info *info)
 {
index 6fe6855ecc82a0c3fcf57738bf6499b9892af6ed..ecb8a0dad8531125b044fb994fd18c8d87b8a5ff 100644 (file)
@@ -2005,6 +2005,7 @@ static void *si_create_shader_selector(struct pipe_context *ctx,
                sel->nir = state->ir.nir;
 
                si_nir_scan_shader(sel->nir, &sel->info);
+               si_nir_scan_tess_ctrl(sel->nir, &sel->info, &sel->tcs_info);
 
                si_lower_nir(sel);
        }