summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2019-04-25 17:02:51 +1000
committerTimothy Arceri <[email protected]>2019-05-01 09:41:07 +1000
commit90f3bf7437eb735bf51d8fcbfbb0adeed9cfcf89 (patch)
tree2f824201611f6476f3bc8774ec9928fb9aab7ae1 /src/gallium/drivers
parenta004e95dd73119e994cc427a1e3ea6dc11daecf6 (diff)
radeonsi/nir: call radeonsi nir opts before the scan pass
Some of the opts are not called in the general optimastion loop in the state trackers glsl -> nir conversion. We need to call the radeonsi specific optimisation once before scanning over the nir otherwise we can end up gathering info on code that is later removed. Fixes an assert in the piglit test: ./bin/varying-struct-centroid_gles3 Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/radeonsi/si_compute.c1
-rw-r--r--src/gallium/drivers/radeonsi/si_state_shaders.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c
index 541d7e6f118..f1a433b72df 100644
--- a/src/gallium/drivers/radeonsi/si_compute.c
+++ b/src/gallium/drivers/radeonsi/si_compute.c
@@ -106,6 +106,7 @@ static void si_create_compute_state_async(void *job, int thread_index)
assert(program->ir_type == PIPE_SHADER_IR_NIR);
sel.nir = program->ir.nir;
+ si_nir_opts(sel.nir);
si_nir_scan_shader(sel.nir, &sel.info);
si_lower_nir(&sel);
}
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 55df95477d3..db4c77da2ff 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -2247,6 +2247,7 @@ static void *si_create_shader_selector(struct pipe_context *ctx,
sel->nir = state->ir.nir;
+ si_nir_opts(sel->nir);
si_nir_scan_shader(sel->nir, &sel->info);
si_nir_scan_tess_ctrl(sel->nir, &sel->tcs_info);
}