summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro PiƱeiro <apinheiro@igalia.com>2015-06-25 09:52:35 +0200
committerJason Ekstrand <jason.ekstrand@intel.com>2015-08-03 09:40:48 -0700
commit9e5d827f455f3c72af6cb8d60b97890bab8d5ad0 (patch)
tree85a0529c20e351ff6a0afd0041dfbf82716816aa
parentef1b30ae637e613b384541324c199d2dbe6b44bd (diff)
i965/nir: Disable alu_to_scalar pass on non-scalar shaders
Disables nir_lower_alu_to_scalar when the shader stage being processed work on vec4 vectors, like the upcoming NIR->vec4 backend. Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
-rw-r--r--src/mesa/drivers/dri/i965/brw_nir.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c
index 4f7335024a4..a838ccaed83 100644
--- a/src/mesa/drivers/dri/i965/brw_nir.c
+++ b/src/mesa/drivers/dri/i965/brw_nir.c
@@ -27,15 +27,19 @@
#include "program/prog_to_nir.h"
static void
-nir_optimize(nir_shader *nir)
+nir_optimize(nir_shader *nir, bool is_scalar)
{
bool progress;
do {
progress = false;
nir_lower_vars_to_ssa(nir);
nir_validate_shader(nir);
- nir_lower_alu_to_scalar(nir);
- nir_validate_shader(nir);
+
+ if (is_scalar) {
+ nir_lower_alu_to_scalar(nir);
+ nir_validate_shader(nir);
+ }
+
progress |= nir_copy_prop(nir);
nir_validate_shader(nir);
nir_lower_phis_to_scalar(nir);
@@ -92,14 +96,14 @@ brw_create_nir(struct brw_context *brw,
nir_split_var_copies(nir);
nir_validate_shader(nir);
- nir_optimize(nir);
+ nir_optimize(nir, is_scalar);
/* Lower a bunch of stuff */
nir_lower_var_copies(nir);
nir_validate_shader(nir);
/* Get rid of split copies */
- nir_optimize(nir);
+ nir_optimize(nir, is_scalar);
if (is_scalar) {
nir_assign_var_locations_direct_first(nir, &nir->uniforms,
@@ -135,7 +139,7 @@ brw_create_nir(struct brw_context *brw,
nir_lower_atomics(nir);
nir_validate_shader(nir);
- nir_optimize(nir);
+ nir_optimize(nir, is_scalar);
if (brw->gen >= 6) {
/* Try and fuse multiply-adds */