summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2016-10-03 20:32:22 -0700
committerKenneth Graunke <[email protected]>2016-11-22 00:29:23 -0800
commit663b2e9a92f152c314f611526b8a16ff4c06249f (patch)
tree5be196955fca631312a0561fcad7c116615973f4 /src/compiler/glsl
parentf395e3445df98b0398865a1897bca003f9add6f4 (diff)
nir: Add a "compact array" flag and IO lowering code.
Certain built-in arrays, such as gl_ClipDistance[], gl_CullDistance[], gl_TessLevelInner[], and gl_TessLevelOuter[] are specified as scalar arrays. Normal scalar arrays are sparse - each array element usually occupies a whole vec4 slot. However, most hardware assumes these built-in arrays are tightly packed. The new var->data.compact flag indicates that a scalar array should be tightly packed, so a float[4] array would take up a single vec4 slot, and a float[8] array would take up two slots. They are still arrays, not vec4s, however. nir_lower_io will generate intrinsics using ARB_enhanced_layouts style component qualifiers. v2: Add nir_validate code to enforce type restrictions. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r--src/compiler/glsl/glsl_to_nir.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp
index 90fdd694007..628f8de14b3 100644
--- a/src/compiler/glsl/glsl_to_nir.cpp
+++ b/src/compiler/glsl/glsl_to_nir.cpp
@@ -329,6 +329,7 @@ nir_visitor::visit(ir_variable *ir)
var->data.explicit_index = ir->data.explicit_index;
var->data.explicit_binding = ir->data.explicit_binding;
var->data.has_initializer = ir->data.has_initializer;
+ var->data.compact = false;
var->data.location_frac = ir->data.location_frac;
switch (ir->data.depth_layout) {