aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/linker.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-09-18 08:09:44 +0200
committermarha <marha@users.sourceforge.net>2013-09-18 08:09:44 +0200
commit09bfe74fc7d4a6f97eddb034df371e66e314ea12 (patch)
treeb63caf666a8c36ddcc9a4202f7cecac49998e98d /mesalib/src/glsl/linker.cpp
parent5a54fa6e45ee10cf58ee1b6d2eb5522a24bb8745 (diff)
parent7f669a708bd35bdf8e842f762ec68f9ad0ec0486 (diff)
downloadvcxsrv-09bfe74fc7d4a6f97eddb034df371e66e314ea12.tar.gz
vcxsrv-09bfe74fc7d4a6f97eddb034df371e66e314ea12.tar.bz2
vcxsrv-09bfe74fc7d4a6f97eddb034df371e66e314ea12.zip
Merge remote-tracking branch 'origin/released'
* origin/released: libX11 mesa pixman xserver git update 18 Sep 2013 Conflicts: pixman/pixman/pixman-sse2.c
Diffstat (limited to 'mesalib/src/glsl/linker.cpp')
-rw-r--r--mesalib/src/glsl/linker.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/mesalib/src/glsl/linker.cpp b/mesalib/src/glsl/linker.cpp
index 65afc2e69..8a143fddf 100644
--- a/mesalib/src/glsl/linker.cpp
+++ b/mesalib/src/glsl/linker.cpp
@@ -249,6 +249,33 @@ public:
};
+/**
+ * Visitor that determines whether or not a shader uses ir_end_primitive.
+ */
+class find_end_primitive_visitor : public ir_hierarchical_visitor {
+public:
+ find_end_primitive_visitor()
+ : found(false)
+ {
+ /* empty */
+ }
+
+ virtual ir_visitor_status visit(ir_end_primitive *)
+ {
+ found = true;
+ return visit_stop;
+ }
+
+ bool end_primitive_found()
+ {
+ return found;
+ }
+
+private:
+ bool found;
+};
+
+
void
linker_error(gl_shader_program *prog, const char *fmt, ...)
{
@@ -517,6 +544,10 @@ validate_geometry_shader_executable(struct gl_shader_program *prog,
analyze_clip_usage("geometry", prog, shader, &prog->Geom.UsesClipDistance,
&prog->Geom.ClipDistanceArraySize);
+
+ find_end_primitive_visitor end_primitive;
+ end_primitive.run(shader->ir);
+ prog->Geom.UsesEndPrimitive = end_primitive.end_primitive_found();
}