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>
This commit is contained in:

committed by
Dave Airlie

parent
ad355652c2
commit
d656736bbf
@@ -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;
|
||||
|
Reference in New Issue
Block a user