summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-12-07 13:11:32 +1100
committerTimothy Arceri <[email protected]>2018-01-05 11:58:55 +1100
commit452586b56ab4cc787cd5843f6fd89e682e24ec79 (patch)
tree6f19abb3765fe607bb411fefac27ab934b859386 /src/gallium/drivers/radeonsi
parent14adf7853a569b966bca80cd3429a9eb24ddebd4 (diff)
radeonsi: add dummy implementation of si_nir_scan_tess_ctrl()
Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.h3
-rw-r--r--src/gallium/drivers/radeonsi/si_shader_nir.c19
-rw-r--r--src/gallium/drivers/radeonsi/si_state_shaders.c1
3 files changed, 23 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h
index c981d3562e2..c449aa96844 100644
--- a/src/gallium/drivers/radeonsi/si_shader.h
+++ b/src/gallium/drivers/radeonsi/si_shader.h
@@ -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. */
diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
index 2757d4e4117..d331dfeaaa7 100644
--- a/src/gallium/drivers/radeonsi/si_shader_nir.c
+++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
@@ -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)
{
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 6fe6855ecc8..ecb8a0dad85 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -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);
}