i965: Apply add_const_offset_to_base for vec4 VS inputs too.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 13 Jan 2016 23:07:18 +0000 (15:07 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 15 Jan 2016 05:32:59 +0000 (21:32 -0800)
This shouldn't hurt anything, and I'm about to introduce a pass that
will want it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_nir.c

index 55ba732dec2274ecf1224f87ec4d0e53e53ca588..935529a6003788c64b958bda6f05afbb6b54ce88 100644 (file)
@@ -220,6 +220,11 @@ brw_nir_lower_inputs(nir_shader *nir,
        */
       nir_lower_io(nir, nir_var_shader_in, type_size_vec4);
 
+      /* This pass needs actual constants */
+      nir_opt_constant_folding(nir);
+
+      add_const_offset_to_base(nir, nir_var_shader_in);
+
       if (is_scalar) {
          /* Finally, translate VERT_ATTRIB_* values into the actual registers.
           *
@@ -229,11 +234,6 @@ brw_nir_lower_inputs(nir_shader *nir,
           */
          GLbitfield64 inputs_read = nir->info.inputs_read;
 
-         /* This pass needs actual constants */
-         nir_opt_constant_folding(nir);
-
-         add_const_offset_to_base(nir, nir_var_shader_in);
-
          nir_foreach_function(nir, function) {
             if (function->impl) {
                nir_foreach_block(function->impl, remap_vs_attrs, &inputs_read);