]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/reflect.h
Even more validation for uniform mismatches
[libs/gl.git] / source / glsl / reflect.h
diff --git a/source/glsl/reflect.h b/source/glsl/reflect.h
new file mode 100644 (file)
index 0000000..c03a5cc
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef MSP_GL_SL_REFLECT_H_
+#define MSP_GL_SL_REFLECT_H_
+
+#include "visitor.h"
+
+namespace Msp {
+namespace GL {
+namespace SL {
+
+class LocationCounter: private NodeVisitor
+{
+private:
+       unsigned r_count;
+
+public:
+       LocationCounter();
+
+       unsigned apply(VariableDeclaration &v) { v.visit(*this); return r_count; }
+
+private:
+       virtual void visit(BasicTypeDeclaration &);
+       virtual void visit(ImageTypeDeclaration &);
+       virtual void visit(StructDeclaration &);
+       virtual void visit(VariableDeclaration &);
+};
+
+} // namespace SL
+} // namespace GL
+} // namespace Msp
+
+#endif