X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Freflect.h;fp=source%2Fglsl%2Freflect.h;h=c03a5ccbd8b57044db6b28355863bac292c47a75;hb=8f5f54a9e165dae424e5b0bb8e488c3d01849bf6;hp=0000000000000000000000000000000000000000;hpb=20a86c5905e1f7527d3c9edc3f56f6b7679c268a;p=libs%2Fgl.git diff --git a/source/glsl/reflect.h b/source/glsl/reflect.h new file mode 100644 index 00000000..c03a5ccb --- /dev/null +++ b/source/glsl/reflect.h @@ -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