From d656736bbf926c219b6bcbc0ad59132fc82a7382 Mon Sep 17 00:00:00 2001 From: Tobias Klausmann Date: Sun, 8 May 2016 22:44:06 +0200 Subject: glsl: Add arb_cull_distance support (v3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Dave Airlie Reviewed-by: Kristian Høgsberg --- src/compiler/glsl/link_varyings.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/compiler/glsl/link_varyings.cpp') diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp index 2555cc94176..003b9d46abc 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; -- cgit v1.2.3