};
+/**
+ * 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, ...)
{
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();
}
GL_TRIANGLES, or GL_TRIANGLES_ADJACENCY_ARB */
GLenum OutputType; /**< GL_POINTS, GL_LINE_STRIP or GL_TRIANGLE_STRIP */
GLboolean UsesClipDistance;
+ GLboolean UsesEndPrimitive;
};
GLboolean UsesClipDistance;
GLuint ClipDistanceArraySize; /**< Size of the gl_ClipDistance array, or
0 if not present. */
+ GLboolean UsesEndPrimitive;
} Geom;
/** Vertex shader state */
dst_gp->InputType = src->Geom.InputType;
dst_gp->OutputType = src->Geom.OutputType;
dst_gp->UsesClipDistance = src->Geom.UsesClipDistance;
+ dst_gp->UsesEndPrimitive = src->Geom.UsesEndPrimitive;
}
break;
default: