aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/linker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/glsl/linker.cpp')
-rw-r--r--mesalib/src/glsl/linker.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/mesalib/src/glsl/linker.cpp b/mesalib/src/glsl/linker.cpp
index 195f58f29..d802a0a9b 100644
--- a/mesalib/src/glsl/linker.cpp
+++ b/mesalib/src/glsl/linker.cpp
@@ -244,7 +244,9 @@ count_attribute_slots(const glsl_type *t)
/**
- * Verify that a vertex shader executable meets all semantic requirements
+ * Verify that a vertex shader executable meets all semantic requirements.
+ *
+ * Also sets prog->Vert.UsesClipDistance as a side effect.
*
* \param shader Vertex shader executable to be verified
*/
@@ -279,6 +281,7 @@ validate_vertex_shader_executable(struct gl_shader_program *prog,
"and `gl_ClipDistance'\n");
return false;
}
+ prog->Vert.UsesClipDistance = clip_distance.variable_found();
}
return true;
@@ -1743,6 +1746,9 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
if (!prog->LinkStatus)
goto done;
+ if (ctx->ShaderCompilerOptions[i].LowerClipDistance)
+ lower_clip_distance(prog->_LinkedShaders[i]->ir);
+
while (do_common_optimization(prog->_LinkedShaders[i]->ir, true, 32))
;
}