summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2016-12-05 23:09:18 -0800
committerKenneth Graunke <[email protected]>2017-01-06 15:55:46 -0800
commit311b1f0a98f944ce75c7684e635bc904c89ad782 (patch)
tree1b4d0fc2286470a9462128103d0b9f2153864d7c /src
parent496693d4664f78dda5d9d9d2e94f2cb6e690a81e (diff)
nir: Make glsl_to_nir compact scalar TessLevel arrays.
Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/glsl/glsl_to_nir.cpp13
1 files changed, 12 insertions, 1 deletions
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) {