summaryrefslogtreecommitdiffstats
path: root/src/glsl/linker.cpp
diff options
context:
space:
mode:
authorChris Forbes <[email protected]>2014-09-09 19:25:02 +1200
committerMarek Olšák <[email protected]>2015-07-23 00:59:28 +0200
commitdf16e0dd63dfeb7d5086339113ff7d7197010847 (patch)
tree4636b7e514b3c424f35c76e7db17348ffeb77fbd /src/glsl/linker.cpp
parent0e94f350eeecd84cd5f15b10837b285bc9120684 (diff)
glsl: analyze TES usage of gl_ClipDistance
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/linker.cpp')
-rw-r--r--src/glsl/linker.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index c74ec56f3a2..eeab3a3ca91 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -666,6 +666,17 @@ validate_vertex_shader_executable(struct gl_shader_program *prog,
&prog->Vert.ClipDistanceArraySize);
}
+void
+validate_tess_eval_shader_executable(struct gl_shader_program *prog,
+ struct gl_shader *shader)
+{
+ if (shader == NULL)
+ return;
+
+ analyze_clip_usage(prog, shader, &prog->TessEval.UsesClipDistance,
+ &prog->TessEval.ClipDistanceArraySize);
+}
+
/**
* Verify that a fragment shader executable meets all semantic requirements
@@ -3215,6 +3226,12 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
case MESA_SHADER_VERTEX:
validate_vertex_shader_executable(prog, sh);
break;
+ case MESA_SHADER_TESS_CTRL:
+ /* nothing to be done */
+ break;
+ case MESA_SHADER_TESS_EVAL:
+ validate_tess_eval_shader_executable(prog, sh);
+ break;
case MESA_SHADER_GEOMETRY:
validate_geometry_shader_executable(prog, sh);
break;
@@ -3234,6 +3251,8 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
if (num_shaders[MESA_SHADER_GEOMETRY] > 0)
prog->LastClipDistanceArraySize = prog->Geom.ClipDistanceArraySize;
+ else if (num_shaders[MESA_SHADER_TESS_EVAL] > 0)
+ prog->LastClipDistanceArraySize = prog->TessEval.ClipDistanceArraySize;
else if (num_shaders[MESA_SHADER_VERTEX] > 0)
prog->LastClipDistanceArraySize = prog->Vert.ClipDistanceArraySize;
else