summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/builtin_variables.cpp
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-05-23 21:38:38 -0400
committerIlia Mirkin <[email protected]>2016-05-23 22:22:06 -0400
commit979bcb9f4288564fb6c5807bcfbfd0a78176c3ef (patch)
tree3745984ea430424246cf087b03565f6a4dfb51ca /src/compiler/glsl/builtin_variables.cpp
parentf236f1f506f06440886450392f01992998fca7af (diff)
glsl: add EXT_clip_cull_distance support based on ARB_cull_distance
Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/compiler/glsl/builtin_variables.cpp')
-rw-r--r--src/compiler/glsl/builtin_variables.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp
index ff8a7e2db5e..c6668e86517 100644
--- a/src/compiler/glsl/builtin_variables.cpp
+++ b/src/compiler/glsl/builtin_variables.cpp
@@ -674,11 +674,14 @@ builtin_variable_generator::generate_constants()
state->Const.MaxProgramTexelOffset);
}
- if (state->is_version(130, 0)) {
+ if (state->is_version(130, 0) || state->EXT_clip_cull_distance_enable) {
add_const("gl_MaxClipDistances", state->Const.MaxClipPlanes);
+ }
+ if (state->is_version(130, 0)) {
add_const("gl_MaxVaryingComponents", state->ctx->Const.MaxVarying * 4);
}
- if (state->is_version(450, 0) || state->ARB_cull_distance_enable) {
+ if (state->is_version(450, 0) || state->ARB_cull_distance_enable ||
+ state->EXT_clip_cull_distance_enable) {
add_const("gl_MaxCullDistances", state->Const.MaxClipPlanes);
add_const("gl_MaxCombinedClipAndCullDistances",
state->Const.MaxClipPlanes);
@@ -1250,11 +1253,12 @@ builtin_variable_generator::generate_varyings()
}
}
- if (state->is_version(130, 0)) {
+ if (state->is_version(130, 0) || state->EXT_clip_cull_distance_enable) {
add_varying(VARYING_SLOT_CLIP_DIST0, array(float_t, 0),
"gl_ClipDistance");
}
- if (state->is_version(450, 0) || state->ARB_cull_distance_enable) {
+ if (state->is_version(450, 0) || state->ARB_cull_distance_enable ||
+ state->EXT_clip_cull_distance_enable) {
add_varying(VARYING_SLOT_CULL_DIST0, array(float_t, 0),
"gl_CullDistance");
}