summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/linker.cpp
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-05-16 08:47:32 +1000
committerDave Airlie <airlied@redhat.com>2016-05-24 11:27:29 +1000
commita08c4ebbe841e22076c6d3929248876c60b3dfcd (patch)
treec358f0975adf886d53f0963fc07703863cf03bec /src/compiler/glsl/linker.cpp
parent8c628ab13e4fa86ee662dcddb0f5a89b2d30e1a4 (diff)
downloadexternal_mesa3d-a08c4ebbe841e22076c6d3929248876c60b3dfcd.zip
external_mesa3d-a08c4ebbe841e22076c6d3929248876c60b3dfcd.tar.gz
external_mesa3d-a08c4ebbe841e22076c6d3929248876c60b3dfcd.tar.bz2
glsl: rewrite clip/cull distance lowering pass
The last version of this broke clipping, and I had to spend sometime getting this working properly. I had to introduce a third pass to count the clip/cull totals, all due to one messy corner case. We have a piglit test tes-input-gl_ClipDistance.shader_test that doesn't actually output the clip distances, it just passes them like a varying from TCS->TES, the older lowering pass worked but to lower clip/cull we need to know the total number of clip+culls used to defined the new variable correctly, and to offset culls properly. This adds an extra pass that works out the sizes for clip/cull, then lowers gl_ClipDistance then gl_CullDistance into the new gl_ClipDistanceMESA. The pass checks using the fixed array sizes code if they array has been referenced, or is actually never used, and ignores it in the latter case. Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/compiler/glsl/linker.cpp')
-rw-r--r--src/compiler/glsl/linker.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index f4d443b..ca2f060 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -4663,7 +4663,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
goto done;
if (ctx->Const.ShaderCompilerOptions[i].LowerCombinedClipCullDistance) {
- lower_clip_distance(prog->_LinkedShaders[i]);
+ lower_clip_cull_distance(prog, prog->_LinkedShaders[i]);
}
if (ctx->Const.LowerTessLevel) {