From f9cf11136d65f20aab4fb6d5fc3ec3c59185a0b4 Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 9 Sep 2011 08:40:24 +0200 Subject: mesa git update 9 sep 2011 --- mesalib/src/glsl/linker.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'mesalib/src/glsl/linker.cpp') diff --git a/mesalib/src/glsl/linker.cpp b/mesalib/src/glsl/linker.cpp index ba81c59ff..195f58f29 100644 --- a/mesalib/src/glsl/linker.cpp +++ b/mesalib/src/glsl/linker.cpp @@ -262,6 +262,25 @@ validate_vertex_shader_executable(struct gl_shader_program *prog, return false; } + if (prog->Version >= 130) { + /* From section 7.1 (Vertex Shader Special Variables) of the + * GLSL 1.30 spec: + * + * "It is an error for a shader to statically write both + * gl_ClipVertex and gl_ClipDistance." + */ + find_assignment_visitor clip_vertex("gl_ClipVertex"); + find_assignment_visitor clip_distance("gl_ClipDistance"); + + clip_vertex.run(shader->ir); + clip_distance.run(shader->ir); + if (clip_vertex.variable_found() && clip_distance.variable_found()) { + linker_error(prog, "vertex shader writes to both `gl_ClipVertex' " + "and `gl_ClipDistance'\n"); + return false; + } + } + return true; } -- cgit v1.2.3