--- /dev/null
+#ifndef MSP_GL_REFLECTDATA_H_
+#define MSP_GL_REFLECTDATA_H_
+
+#include <string>
+#include <vector>
+#include "datatype.h"
+#include "tag.h"
+
+namespace Msp {
+namespace GL {
+
+/**
+Reflection data for shader programs.
+*/
+struct ReflectData
+{
+ typedef unsigned LayoutHash;
+ struct UniformBlockInfo;
+
+ struct UniformInfo
+ {
+ std::string name;
+ const UniformBlockInfo *block;
+ union
+ {
+ int location;
+ unsigned offset;
+ };
+ unsigned array_size;
+ unsigned array_stride;
+ unsigned matrix_stride;
+ DataType type;
+ Tag tag;
+ int binding;
+
+ UniformInfo();
+ };
+
+ struct UniformBlockInfo
+ {
+ std::string name;
+ unsigned data_size;
+ int bind_point;
+ std::vector<const UniformInfo *> uniforms;
+ LayoutHash layout_hash;
+
+ UniformBlockInfo();
+
+ void sort_uniforms();
+ void update_layout_hash();
+ };
+
+ struct AttributeInfo
+ {
+ std::string name;
+ unsigned location;
+ unsigned array_size;
+ DataType type;
+
+ AttributeInfo();
+ };
+
+ std::vector<UniformBlockInfo> uniform_blocks;
+ std::vector<UniformInfo> uniforms;
+ LayoutHash layout_hash;
+ std::vector<AttributeInfo> attributes;
+
+ void update_layout_hash();
+};
+
+} // namespace GL
+} // namespace Msp
+
+#endif