summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/builtin_variables.cpp
diff options
context:
space:
mode:
authorTobias Klausmann <[email protected]>2016-05-08 22:44:06 +0200
committerDave Airlie <[email protected]>2016-05-14 08:28:08 +1000
commitd656736bbf926c219b6bcbc0ad59132fc82a7382 (patch)
treea23cf6a705eec5b42acb4218ee9e7387e7b818a4 /src/compiler/glsl/builtin_variables.cpp
parentad355652c20b245f5f2faa8622e71461e3121a7f (diff)
glsl: Add arb_cull_distance support (v3)
v2: make too large array a compile error v3: squash mesa/prog patch to avoid static compiler errors in bisect Signed-off-by: Tobias Klausmann <[email protected]> Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
Diffstat (limited to 'src/compiler/glsl/builtin_variables.cpp')
-rw-r--r--src/compiler/glsl/builtin_variables.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp
index cc32990fc2f..ff8a7e2db5e 100644
--- a/src/compiler/glsl/builtin_variables.cpp
+++ b/src/compiler/glsl/builtin_variables.cpp
@@ -302,7 +302,7 @@ public:
const glsl_type *construct_interface_instance() const;
private:
- glsl_struct_field fields[10];
+ glsl_struct_field fields[11];
unsigned num_fields;
};
@@ -678,6 +678,11 @@ builtin_variable_generator::generate_constants()
add_const("gl_MaxClipDistances", state->Const.MaxClipPlanes);
add_const("gl_MaxVaryingComponents", state->ctx->Const.MaxVarying * 4);
}
+ if (state->is_version(450, 0) || state->ARB_cull_distance_enable) {
+ add_const("gl_MaxCullDistances", state->Const.MaxClipPlanes);
+ add_const("gl_MaxCombinedClipAndCullDistances",
+ state->Const.MaxClipPlanes);
+ }
if (state->has_geometry_shader()) {
add_const("gl_MaxVertexOutputComponents",
@@ -1249,6 +1254,10 @@ builtin_variable_generator::generate_varyings()
add_varying(VARYING_SLOT_CLIP_DIST0, array(float_t, 0),
"gl_ClipDistance");
}
+ if (state->is_version(450, 0) || state->ARB_cull_distance_enable) {
+ add_varying(VARYING_SLOT_CULL_DIST0, array(float_t, 0),
+ "gl_CullDistance");
+ }
if (compatibility) {
add_varying(VARYING_SLOT_TEX0, array(vec4_t, 0), "gl_TexCoord");