intel/nir: Use the correct indirect lowering masks in link_shaders
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 28 Oct 2017 16:02:14 +0000 (09:02 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 9 Nov 2017 04:10:04 +0000 (20:10 -0800)
Previously, if we were linking a vec4 VS with a SIMD8/16 FS, we wouldn't
lower indirects on the fragment shader which is wrong.  Instead of using
a single indirect mask, take advantage of our new little helper.

Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
Cc: mesa-stable@lists.freedesktop.org
src/intel/compiler/brw_nir.c

index 3f11fb775545e985b04fff661c4fc0985eee787a..8f3f77f89ae4dea3dbc0974430ee133aa23cb7db 100644 (file)
@@ -686,16 +686,14 @@ brw_nir_link_shaders(const struct brw_compiler *compiler,
       NIR_PASS_V(*producer, nir_lower_global_vars_to_local);
       NIR_PASS_V(*consumer, nir_lower_global_vars_to_local);
 
-      nir_variable_mode indirect_mask = (nir_variable_mode) 0;
-      if (compiler->glsl_compiler_options[(*producer)->info.stage].EmitNoIndirectTemp)
-         indirect_mask = nir_var_local;
-
       /* The backend might not be able to handle indirects on
        * temporaries so we need to lower indirects on any of the
        * varyings we have demoted here.
        */
-      NIR_PASS_V(*producer, nir_lower_indirect_derefs, indirect_mask);
-      NIR_PASS_V(*consumer, nir_lower_indirect_derefs, indirect_mask);
+      NIR_PASS_V(*producer, nir_lower_indirect_derefs,
+                 brw_nir_no_indirect_mask(compiler, (*producer)->info.stage));
+      NIR_PASS_V(*consumer, nir_lower_indirect_derefs,
+                 brw_nir_no_indirect_mask(compiler, (*consumer)->info.stage));
 
       const bool p_is_scalar =
          compiler->scalar_stage[(*producer)->info.stage];