X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Freflectdata.h;h=2925da146b899b1e62ab642b09403400d8f2b761;hb=e70662d7812464159f2e47f4bebb69d88f89ae93;hp=90b7ce0d4a41582a8f7e89809e4375c7ca4f7b24;hpb=1b23728908f5ec9beb08b2b70737c3903745fddc;p=libs%2Fgl.git diff --git a/source/core/reflectdata.h b/source/core/reflectdata.h index 90b7ce0d..2925da14 100644 --- a/source/core/reflectdata.h +++ b/source/core/reflectdata.h @@ -14,37 +14,41 @@ Reflection data for shader programs. */ struct ReflectData { + enum + { + DEFAULT_BLOCK = -1, + PUSH_CONSTANT = -2 + }; + 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 descriptor_set = 0; + int binding = -1; }; struct UniformBlockInfo { std::string name; - unsigned data_size; - int bind_point; + unsigned data_size = 0; + int descriptor_set = 0; + int bind_point = DEFAULT_BLOCK; std::vector uniforms; - LayoutHash layout_hash; - - UniformBlockInfo(); + LayoutHash layout_hash = 0; void sort_uniforms(); void update_layout_hash(); @@ -53,17 +57,16 @@ struct ReflectData 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 uniform_blocks; std::vector uniforms; - LayoutHash layout_hash; + LayoutHash layout_hash = 0; std::vector attributes; + unsigned n_clip_distances = 0; void update_layout_hash(); };