summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2016-12-06 01:50:03 -0800
committerKenneth Graunke <[email protected]>2017-01-06 15:55:41 -0800
commita46bd79ee195d699b020a8dde3fda6eab4ece0d4 (patch)
treeb6954346bd75964de4106d3abcc5925fbf6fe664 /src/compiler/glsl
parent5c580e64cc206ab160e1767c42e4d6c81f67da4d (diff)
glsl: Support gl_TessLevelInner/Outer[] as TES input variables.
Upcoming reworks in i965 are going to make it easy to handle this like any other input. Having it as a system value will just require additional code for no benefit. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r--src/compiler/glsl/builtin_variables.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp
index ca266a4c37c..d6dac6d7de5 100644
--- a/src/compiler/glsl/builtin_variables.cpp
+++ b/src/compiler/glsl/builtin_variables.cpp
@@ -1075,10 +1075,17 @@ builtin_variable_generator::generate_tes_special_vars()
add_system_value(SYSTEM_VALUE_PRIMITIVE_ID, int_t, "gl_PrimitiveID");
add_system_value(SYSTEM_VALUE_VERTICES_IN, int_t, "gl_PatchVerticesIn");
add_system_value(SYSTEM_VALUE_TESS_COORD, vec3_t, "gl_TessCoord");
- add_system_value(SYSTEM_VALUE_TESS_LEVEL_OUTER, array(float_t, 4),
- "gl_TessLevelOuter");
- add_system_value(SYSTEM_VALUE_TESS_LEVEL_INNER, array(float_t, 2),
- "gl_TessLevelInner");
+ if (this->state->ctx->Const.GLSLTessLevelsAsInputs) {
+ add_input(VARYING_SLOT_TESS_LEVEL_OUTER, array(float_t, 4),
+ "gl_TessLevelOuter")->data.patch = 1;
+ add_input(VARYING_SLOT_TESS_LEVEL_INNER, array(float_t, 2),
+ "gl_TessLevelInner")->data.patch = 1;
+ } else {
+ add_system_value(SYSTEM_VALUE_TESS_LEVEL_OUTER, array(float_t, 4),
+ "gl_TessLevelOuter");
+ add_system_value(SYSTEM_VALUE_TESS_LEVEL_INNER, array(float_t, 2),
+ "gl_TessLevelInner");
+ }
if (state->ARB_shader_viewport_layer_array_enable) {
var = add_output(VARYING_SLOT_LAYER, int_t, "gl_Layer");
var->data.interpolation = INTERP_MODE_FLAT;