*/
struct ReflectData
{
+ enum
+ {
+ DEFAULT_BLOCK = -1,
+ PUSH_CONSTANT = -2,
+ UNIFORM_BLOCK_BINDING = 0,
+ TEXTURE_BINDING = 0x1000000
+ };
+
typedef unsigned LayoutHash;
struct UniformBlockInfo;
struct UniformInfo
{
std::string name;
- const UniformBlockInfo *block;
+ const UniformBlockInfo *block = 0;
union
{
- int location;
+ int location = -1;
unsigned offset;
};
- unsigned array_size;
- unsigned array_stride;
- unsigned matrix_stride;
- DataType type;
+ unsigned array_size = 0;
+ unsigned array_stride = 0;
+ unsigned matrix_stride = 0;
+ DataType type = VOID;
Tag tag;
- int binding;
-
- UniformInfo();
+ int binding = -1;
};
struct UniformBlockInfo
{
std::string name;
- unsigned data_size;
- int bind_point;
+ unsigned data_size = 0;
+ int bind_point = DEFAULT_BLOCK;
std::vector<const UniformInfo *> uniforms;
- LayoutHash layout_hash;
-
- UniformBlockInfo();
+ LayoutHash layout_hash = 0;
void sort_uniforms();
void update_layout_hash();
struct AttributeInfo
{
std::string name;
- unsigned location;
- unsigned array_size;
- DataType type;
-
- AttributeInfo();
+ int location = -1;
+ unsigned array_size = 0;
+ DataType type = VOID;
};
std::vector<UniformBlockInfo> uniform_blocks;
std::vector<UniformInfo> uniforms;
- LayoutHash layout_hash;
+ LayoutHash layout_hash = 0;
std::vector<AttributeInfo> attributes;
+ unsigned n_clip_distances = 0;
+ unsigned n_descriptor_sets = 0;
+ std::vector<int> used_bindings;
void update_layout_hash();
+ void update_used_bindings();
};
} // namespace GL