From: Kenneth Graunke Date: Tue, 6 Dec 2016 07:09:18 +0000 (-0800) Subject: nir: Make glsl_to_nir compact scalar TessLevel arrays. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=311b1f0a98f944ce75c7684e635bc904c89ad782;p=mesa.git nir: Make glsl_to_nir compact scalar TessLevel arrays. Signed-off-by: Kenneth Graunke Reviewed-by: Jason Ekstrand --- diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index 6cf4f501ee8..69d4c2b20c6 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -284,6 +284,7 @@ nir_visitor::visit(ir_variable *ir) var->data.patch = ir->data.patch; var->data.invariant = ir->data.invariant; var->data.location = ir->data.location; + var->data.compact = false; switch(ir->data.mode) { case ir_var_auto: @@ -314,11 +315,22 @@ nir_visitor::visit(ir_variable *ir) var->data.mode = nir_var_system_value; } else { var->data.mode = nir_var_shader_in; + + if (shader->stage == MESA_SHADER_TESS_EVAL && + (ir->data.location == VARYING_SLOT_TESS_LEVEL_INNER || + ir->data.location == VARYING_SLOT_TESS_LEVEL_OUTER)) { + var->data.compact = ir->type->without_array()->is_scalar(); + } } break; case ir_var_shader_out: var->data.mode = nir_var_shader_out; + if (shader->stage == MESA_SHADER_TESS_CTRL && + (ir->data.location == VARYING_SLOT_TESS_LEVEL_INNER || + ir->data.location == VARYING_SLOT_TESS_LEVEL_OUTER)) { + var->data.compact = ir->type->without_array()->is_scalar(); + } break; case ir_var_uniform: @@ -340,7 +352,6 @@ nir_visitor::visit(ir_variable *ir) var->data.interpolation = ir->data.interpolation; var->data.origin_upper_left = ir->data.origin_upper_left; var->data.pixel_center_integer = ir->data.pixel_center_integer; - var->data.compact = false; var->data.location_frac = ir->data.location_frac; switch (ir->data.depth_layout) {