summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/link_varyings.cpp
diff options
context:
space:
mode:
authorTobias Klausmann <tobias.johannes.klausmann@mni.thm.de>2016-05-08 22:44:06 +0200
committerDave Airlie <airlied@redhat.com>2016-05-14 08:28:08 +1000
commitd656736bbf926c219b6bcbc0ad59132fc82a7382 (patch)
treea23cf6a705eec5b42acb4218ee9e7387e7b818a4 /src/compiler/glsl/link_varyings.cpp
parentad355652c20b245f5f2faa8622e71461e3121a7f (diff)
downloadexternal_mesa3d-d656736bbf926c219b6bcbc0ad59132fc82a7382.zip
external_mesa3d-d656736bbf926c219b6bcbc0ad59132fc82a7382.tar.gz
external_mesa3d-d656736bbf926c219b6bcbc0ad59132fc82a7382.tar.bz2
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 <tobias.johannes.klausmann@mni.thm.de> Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Diffstat (limited to 'src/compiler/glsl/link_varyings.cpp')
-rw-r--r--src/compiler/glsl/link_varyings.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
index 2555cc9..003b9d4 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -631,6 +631,10 @@ tfeedback_decl::init(struct gl_context *ctx, const void *mem_ctx,
strcmp(this->var_name, "gl_ClipDistance") == 0) {
this->lowered_builtin_array_variable = clip_distance;
}
+ if (ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].LowerCombinedClipCullDistance &&
+ strcmp(this->var_name, "gl_CullDistance") == 0) {
+ this->lowered_builtin_array_variable = cull_distance;
+ }
if (ctx->Const.LowerTessLevel &&
(strcmp(this->var_name, "gl_TessLevelOuter") == 0))
@@ -691,6 +695,9 @@ tfeedback_decl::assign_location(struct gl_context *ctx,
case clip_distance:
actual_array_size = prog->LastClipDistanceArraySize;
break;
+ case cull_distance:
+ actual_array_size = prog->LastCullDistanceArraySize;
+ break;
case tess_level_outer:
actual_array_size = 4;
break;
@@ -911,6 +918,9 @@ tfeedback_decl::find_candidate(gl_shader_program *prog,
case clip_distance:
name = "gl_ClipDistanceMESA";
break;
+ case cull_distance:
+ name = "gl_CullDistanceMESA";
+ break;
case tess_level_outer:
name = "gl_TessLevelOuterMESA";
break;