i965: Simplify brw_nir_lower_vue_inputs() slightly.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 25 Feb 2016 07:44:46 +0000 (23:44 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 26 Feb 2016 23:55:59 +0000 (15:55 -0800)
The same code appeared in both branches; pull it above the if statement.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/mesa/drivers/dri/i965/brw_nir.c

index 883603ed98f321e9ee2f87cb1c6004e9dab6b0af..a5949d5d6eb65d13907c1cb0a369f95af32c6233 100644 (file)
@@ -249,19 +249,14 @@ void
 brw_nir_lower_vue_inputs(nir_shader *nir, bool is_scalar,
                          const struct brw_vue_map *vue_map)
 {
-   if (!is_scalar && nir->stage == MESA_SHADER_GEOMETRY) {
-      foreach_list_typed(nir_variable, var, node, &nir->inputs) {
-         var->data.driver_location = var->data.location;
-      }
-      nir_lower_io(nir, nir_var_shader_in, type_size_vec4);
-   } else {
-      foreach_list_typed(nir_variable, var, node, &nir->inputs) {
-         var->data.driver_location = var->data.location;
-      }
+   foreach_list_typed(nir_variable, var, node, &nir->inputs) {
+      var->data.driver_location = var->data.location;
+   }
 
-      /* Inputs are stored in vec4 slots, so use type_size_vec4(). */
-      nir_lower_io(nir, nir_var_shader_in, type_size_vec4);
+   /* Inputs are stored in vec4 slots, so use type_size_vec4(). */
+   nir_lower_io(nir, nir_var_shader_in, type_size_vec4);
 
+   if (is_scalar || nir->stage != MESA_SHADER_GEOMETRY) {
       /* This pass needs actual constants */
       nir_opt_constant_folding(nir);