diff --git a/common/output_stream.cpp b/common/output_stream.cpp index 6ac08f8f..18d03b54 100644 --- a/common/output_stream.cpp +++ b/common/output_stream.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include enum TextLineType { @@ -643,6 +644,7 @@ std::string ToStringTypeFlags(SpvReflectTypeFlags type_flags) { std::stringstream sstream; PRINT_AND_CLEAR_TYPE_FLAG(sstream, type_flags, ARRAY); PRINT_AND_CLEAR_TYPE_FLAG(sstream, type_flags, STRUCT); + PRINT_AND_CLEAR_TYPE_FLAG(sstream, type_flags, REF); PRINT_AND_CLEAR_TYPE_FLAG(sstream, type_flags, EXTERNAL_MASK); PRINT_AND_CLEAR_TYPE_FLAG(sstream, type_flags, EXTERNAL_BLOCK); PRINT_AND_CLEAR_TYPE_FLAG(sstream, type_flags, EXTERNAL_SAMPLED_IMAGE); @@ -934,7 +936,7 @@ std::string ToStringComponentType(const SpvReflectTypeDescription& type, uint32_ void ParseBlockMembersToTextLines(const char* indent, int indent_depth, bool flatten_cbuffers, const std::string& parent_name, uint32_t member_count, const SpvReflectBlockVariable* p_members, - std::vector* p_text_lines) { + std::vector* p_text_lines, std::unordered_set& physical_pointer_spirv_id) { const char* t = indent; for (uint32_t member_index = 0; member_index < member_count; ++member_index) { indent_depth = flatten_cbuffers ? 2 : indent_depth; @@ -949,8 +951,10 @@ void ParseBlockMembersToTextLines(const char* indent, int indent_depth, bool fla // TODO 212 - If a buffer ref has an array of itself, all members are null continue; } + bool is_struct = ((member.type_description->type_flags & static_cast(SPV_REFLECT_TYPE_FLAG_STRUCT)) != 0); bool is_ref = ((member.type_description->type_flags & static_cast(SPV_REFLECT_TYPE_FLAG_REF)) != 0); + bool is_array = ((member.type_description->type_flags & static_cast(SPV_REFLECT_TYPE_FLAG_ARRAY)) != 0); if (is_struct) { const std::string name = (member.name == nullptr ? "" : member.name); @@ -969,17 +973,29 @@ void ParseBlockMembersToTextLines(const char* indent, int indent_depth, bool fla p_text_lines->push_back(tl); } - // Members - tl = {}; - std::string current_parent_name; - if (flatten_cbuffers) { - current_parent_name = parent_name.empty() ? name : (parent_name + "." + name); + const bool array_of_structs = is_array && member.type_description->struct_type_description; + const uint32_t struct_id = + array_of_structs ? member.type_description->struct_type_description->id : member.type_description->id; + + if (physical_pointer_spirv_id.count(struct_id) == 0) { + physical_pointer_spirv_id.insert(member.type_description->id); + if (array_of_structs) { + physical_pointer_spirv_id.insert(member.type_description->struct_type_description->id); + } + + // Members + tl = {}; + std::string current_parent_name; + if (flatten_cbuffers) { + current_parent_name = parent_name.empty() ? name : (parent_name + "." + name); + } + std::vector* p_target_text_line = flatten_cbuffers ? p_text_lines : &tl.lines; + ParseBlockMembersToTextLines(t, indent_depth + 1, flatten_cbuffers, current_parent_name, member.member_count, + member.members, p_target_text_line, physical_pointer_spirv_id); + tl.text_line_flags = TEXT_LINE_TYPE_LINES; + p_text_lines->push_back(tl); } - std::vector* p_target_text_line = flatten_cbuffers ? p_text_lines : &tl.lines; - ParseBlockMembersToTextLines(t, indent_depth + 1, flatten_cbuffers, current_parent_name, member.member_count, member.members, - p_target_text_line); - tl.text_line_flags = TEXT_LINE_TYPE_LINES; - p_text_lines->push_back(tl); + physical_pointer_spirv_id.erase(member.type_description->id); // End struct tl = {}; @@ -1064,7 +1080,9 @@ void ParseBlockVariableToTextLines(const char* indent, bool flatten_cbuffers, co // Members tl = {}; - ParseBlockMembersToTextLines(indent, 2, flatten_cbuffers, "", block_var.member_count, block_var.members, &tl.lines); + std::unordered_set physical_pointer_spirv_id; + ParseBlockMembersToTextLines(indent, 2, flatten_cbuffers, "", block_var.member_count, block_var.members, &tl.lines, + physical_pointer_spirv_id); tl.text_line_flags = TEXT_LINE_TYPE_LINES; p_text_lines->push_back(tl); @@ -1534,8 +1552,10 @@ SpvReflectToYaml::SpvReflectToYaml(const SpvReflectShaderModule& shader_module, void SpvReflectToYaml::WriteTypeDescription(std::ostream& os, const SpvReflectTypeDescription& td, uint32_t indent_level) { // YAML anchors can only refer to points earlier in the doc, so child type // descriptions must be processed before the parent. - for (uint32_t i = 0; i < td.member_count; ++i) { - WriteTypeDescription(os, td.members[i], indent_level); + if (!td.copied) { + for (uint32_t i = 0; i < td.member_count; ++i) { + WriteTypeDescription(os, td.members[i], indent_level); + } } const std::string t0 = Indent(indent_level); const std::string t1 = Indent(indent_level + 1); @@ -1544,7 +1564,6 @@ void SpvReflectToYaml::WriteTypeDescription(std::ostream& os, const SpvReflectTy const std::string t4 = Indent(indent_level + 4); // Determine the index of this type within the shader module's list. - assert(type_description_to_index_.find(&td) == type_description_to_index_.end()); uint32_t type_description_index = static_cast(type_description_to_index_.size()); type_description_to_index_[&td] = type_description_index; @@ -1638,13 +1657,21 @@ void SpvReflectToYaml::WriteTypeDescription(std::ostream& os, const SpvReflectTy os << t1 << "member_count: " << td.member_count << std::endl; // struct SpvReflectTypeDescription* members; os << t1 << "members:" << std::endl; - for (uint32_t i_member = 0; i_member < td.member_count; ++i_member) { - os << t2 << "- *td" << type_description_to_index_[&(td.members[i_member])] << std::endl; + if (td.copied) { + os << t1 << "- [forward pointer]" << std::endl; + } else { + for (uint32_t i_member = 0; i_member < td.member_count; ++i_member) { + os << t2 << "- *td" << type_description_to_index_[&(td.members[i_member])] << std::endl; + } } // } SpvReflectTypeDescription; } void SpvReflectToYaml::WriteBlockVariable(std::ostream& os, const SpvReflectBlockVariable& bv, uint32_t indent_level) { + if ((bv.flags & SPV_REFLECT_VARIABLE_FLAGS_PHYSICAL_POINTER_COPY)) { + return; // catches recursive buffer references + } + for (uint32_t i = 0; i < bv.member_count; ++i) { WriteBlockVariable(os, bv.members[i], indent_level); } @@ -1722,8 +1749,11 @@ void SpvReflectToYaml::WriteBlockVariable(std::ostream& os, const SpvReflectBloc os << t1 << "members:" << std::endl; for (uint32_t i = 0; i < bv.member_count; ++i) { auto itor = block_variable_to_index_.find(&bv.members[i]); - assert(itor != block_variable_to_index_.end()); - os << t2 << "- *bv" << itor->second << std::endl; + if (itor != block_variable_to_index_.end()) { + os << t2 << "- *bv" << itor->second << std::endl; + } else { + os << t2 << "- [recursive]" << std::endl; + } } if (verbosity_ >= 1) { // SpvReflectTypeDescription* type_description; @@ -1974,6 +2004,9 @@ void SpvReflectToYaml::WriteBlockVariableTypes(std::ostream& os, const SpvReflec WriteTypeDescription(os, *td, indent_level); } + if (bv.flags & SPV_REFLECT_VARIABLE_FLAGS_PHYSICAL_POINTER_COPY) { + return; + } for (uint32_t i = 0; i < bv.member_count; ++i) { WriteBlockVariableTypes(os, bv.members[i], indent_level); } diff --git a/spirv_reflect.c b/spirv_reflect.c index e1eb50ac..a2628b97 100644 --- a/spirv_reflect.c +++ b/spirv_reflect.c @@ -196,6 +196,15 @@ typedef struct SpvReflectPrvAccessChain { SpvReflectBlockVariable* block_var; } SpvReflectPrvAccessChain; +// To prevent infinite recursion, we never walk down a +// PhysicalStorageBuffer struct twice, but incase a 2nd variable +// needs to use that struct, save a copy +typedef struct SpvReflectPrvPhysicalPointerStruct { + uint32_t struct_id; + // first variable to see the PhysicalStorageBuffer struct + SpvReflectBlockVariable* p_var; +} SpvReflectPrvPhysicalPointerStruct; + typedef struct SpvReflectPrvParser { size_t spirv_word_count; uint32_t* spirv_code; @@ -218,8 +227,11 @@ typedef struct SpvReflectPrvParser { uint32_t descriptor_count; uint32_t push_constant_count; - uint32_t physical_pointer_check[MAX_RECURSIVE_PHYSICAL_POINTER_CHECK]; + SpvReflectTypeDescription* physical_pointer_check[MAX_RECURSIVE_PHYSICAL_POINTER_CHECK]; uint32_t physical_pointer_count; + + SpvReflectPrvPhysicalPointerStruct* physical_pointer_structs; + uint32_t physical_pointer_struct_count; } SpvReflectPrvParser; // clang-format on @@ -644,6 +656,7 @@ static void DestroyParser(SpvReflectPrvParser* p_parser) { SafeFree(p_parser->source_embedded); SafeFree(p_parser->functions); SafeFree(p_parser->access_chains); + SafeFree(p_parser->physical_pointer_structs); p_parser->node_count = 0; } } @@ -1801,13 +1814,16 @@ static SpvReflectResult ParseType(SpvReflectPrvParser* p_parser, SpvReflectPrvNo if (p_type->storage_class == SpvStorageClassPhysicalStorageBuffer) { // Need to make sure we haven't started an infinite recursive loop for (uint32_t i = 0; i < p_parser->physical_pointer_count; i++) { - if (p_type->id == p_parser->physical_pointer_check[i]) { + if (p_type->id == p_parser->physical_pointer_check[i]->id) { found_recursion = true; - break; // still need to fill in p_type values + memcpy(p_type, p_parser->physical_pointer_check[i], sizeof(SpvReflectTypeDescription)); + p_type->copied = 1; + return SPV_REFLECT_RESULT_SUCCESS; } } if (!found_recursion) { - p_parser->physical_pointer_check[p_parser->physical_pointer_count] = p_type->id; + p_parser->physical_pointer_struct_count++; + p_parser->physical_pointer_check[p_parser->physical_pointer_count] = p_type; p_parser->physical_pointer_count++; if (p_parser->physical_pointer_count >= MAX_RECURSIVE_PHYSICAL_POINTER_CHECK) { return SPV_REFLECT_RESULT_ERROR_SPIRV_MAX_RECURSIVE_EXCEEDED; @@ -1815,14 +1831,16 @@ static SpvReflectResult ParseType(SpvReflectPrvParser* p_parser, SpvReflectPrvNo } } - uint32_t type_id = (uint32_t)INVALID_VALUE; - IF_READU32(result, p_parser, p_node->word_offset + 3, type_id); // Parse type - SpvReflectPrvNode* p_next_node = FindNode(p_parser, type_id); + SpvReflectPrvNode* p_next_node = FindNode(p_parser, p_node->type_id); if (IsNull(p_next_node)) { result = SPV_REFLECT_RESULT_ERROR_SPIRV_INVALID_ID_REFERENCE; SPV_REFLECT_ASSERT(false); } else if (!found_recursion) { + if (p_next_node->op == SpvOpTypeStruct) { + p_type->struct_type_description = FindType(p_module, p_next_node->result_id); + } + result = ParseType(p_parser, p_next_node, NULL, p_module, p_type); } } break; @@ -1879,6 +1897,13 @@ static SpvReflectResult ParseTypes(SpvReflectPrvParser* p_parser, SpvReflectShad } ++type_index; } + + // allocate now and fill in when parsing struct variable later + p_parser->physical_pointer_structs = (SpvReflectPrvPhysicalPointerStruct*)calloc(p_parser->physical_pointer_struct_count, + sizeof(*(p_parser->physical_pointer_structs))); + if (IsNull(p_parser->physical_pointer_structs)) { + return SPV_REFLECT_RESULT_ERROR_ALLOC_FAILED; + } return SPV_REFLECT_RESULT_SUCCESS; } @@ -2286,26 +2311,44 @@ static SpvReflectResult ParseDescriptorBlockVariable(SpvReflectPrvParser* p_pars SpvReflectTypeDescription* p_member_ptr_type = 0; bool found_recursion = false; - if (p_member_type->op == SpvOpTypePointer) { - if (p_member_type->storage_class == SpvStorageClassPhysicalStorageBuffer) { - // Need to make sure we haven't started an infinite recursive loop - for (uint32_t i = 0; i < p_parser->physical_pointer_count; i++) { - if (p_member_type->id == p_parser->physical_pointer_check[i]) { - found_recursion = true; - break; // still need to fill in p_member_type values - } + if (p_member_type->storage_class == SpvStorageClassPhysicalStorageBuffer && + (p_member_type->type_flags & SPV_REFLECT_TYPE_FLAG_REF)) { + // Remember the original type + p_member_ptr_type = p_member_type; + + // strip array + if (p_member_type->op == SpvOpTypeArray) { + SpvReflectPrvNode* p_node = FindNode(p_parser, p_member_type->id); + if (p_node == NULL) { + return SPV_REFLECT_RESULT_ERROR_SPIRV_INVALID_ID_REFERENCE; } - if (!found_recursion) { - p_parser->physical_pointer_check[p_parser->physical_pointer_count] = p_member_type->id; - p_parser->physical_pointer_count++; - if (p_parser->physical_pointer_count >= MAX_RECURSIVE_PHYSICAL_POINTER_CHECK) { - return SPV_REFLECT_RESULT_ERROR_SPIRV_MAX_RECURSIVE_EXCEEDED; - } + uint32_t element_type_id = p_node->array_traits.element_type_id; + p_member_type = FindType(p_module, element_type_id); + if (p_member_type == NULL) { + return SPV_REFLECT_RESULT_ERROR_SPIRV_INVALID_ID_REFERENCE; + } + } + + // Need to make sure we haven't started an infinite recursive loop + for (uint32_t i = 0; i < p_parser->physical_pointer_count; i++) { + if (p_member_type->id == p_parser->physical_pointer_check[i]->id) { + found_recursion = true; + break; // still need to fill in p_member_type values + } + } + if (!found_recursion) { + uint32_t struct_id = FindType(p_module, p_member_type->id)->struct_type_description->id; + p_parser->physical_pointer_structs[p_parser->physical_pointer_struct_count].struct_id = struct_id; + p_parser->physical_pointer_structs[p_parser->physical_pointer_struct_count].p_var = p_member_var; + p_parser->physical_pointer_struct_count++; + + p_parser->physical_pointer_check[p_parser->physical_pointer_count] = p_member_type; + p_parser->physical_pointer_count++; + if (p_parser->physical_pointer_count >= MAX_RECURSIVE_PHYSICAL_POINTER_CHECK) { + return SPV_REFLECT_RESULT_ERROR_SPIRV_MAX_RECURSIVE_EXCEEDED; } } - // Remember the original type - p_member_ptr_type = p_member_type; SpvReflectPrvNode* p_member_type_node = FindNode(p_parser, p_member_type->id); if (IsNull(p_member_type_node)) { return SPV_REFLECT_RESULT_ERROR_SPIRV_INVALID_ID_REFERENCE; @@ -2317,10 +2360,23 @@ static SpvReflectResult ParseDescriptorBlockVariable(SpvReflectPrvParser* p_pars } } bool is_struct = (p_member_type->type_flags & SPV_REFLECT_TYPE_FLAG_STRUCT) == SPV_REFLECT_TYPE_FLAG_STRUCT; - if (is_struct && !found_recursion) { - SpvReflectResult result = ParseDescriptorBlockVariable(p_parser, p_module, p_member_type, p_member_var); - if (result != SPV_REFLECT_RESULT_SUCCESS) { - return result; + if (is_struct) { + if (!found_recursion) { + SpvReflectResult result = ParseDescriptorBlockVariable(p_parser, p_module, p_member_type, p_member_var); + if (result != SPV_REFLECT_RESULT_SUCCESS) { + return result; + } + } else { + // if 2 member of structs are same PhysicalPointer type, copy the + // members values that aren't found skipping the recursion call + for (uint32_t i = 0; i < p_parser->physical_pointer_struct_count; i++) { + if (p_parser->physical_pointer_structs[i].struct_id == p_member_type->id) { + p_member_var->members = p_parser->physical_pointer_structs[i].p_var->members; + p_member_var->member_count = p_parser->physical_pointer_structs[i].p_var->member_count; + // Set here as it is the first time we need to walk down structs + p_member_var->flags |= SPV_REFLECT_VARIABLE_FLAGS_PHYSICAL_POINTER_COPY; + } + } } } @@ -2355,6 +2411,15 @@ static SpvReflectResult ParseDescriptorBlockVariable(SpvReflectPrvParser* p_pars return SPV_REFLECT_RESULT_SUCCESS; } +static uint32_t GetPhysicalPointerStructSize(SpvReflectPrvParser* p_parser, uint32_t id) { + for (uint32_t i = 0; i < p_parser->physical_pointer_struct_count; i++) { + if (p_parser->physical_pointer_structs[i].struct_id == id) { + return p_parser->physical_pointer_structs[i].p_var->size; + } + } + return 0; +} + static SpvReflectResult ParseDescriptorBlockVariableSizes(SpvReflectPrvParser* p_parser, SpvReflectShaderModule* p_module, bool is_parent_root, bool is_parent_aos, bool is_parent_rta, SpvReflectBlockVariable* p_var) { @@ -2412,9 +2477,14 @@ static SpvReflectResult ParseDescriptorBlockVariableSizes(SpvReflectPrvParser* p // If array of structs, parse members first... bool is_struct = (p_member_type->type_flags & SPV_REFLECT_TYPE_FLAG_STRUCT) == SPV_REFLECT_TYPE_FLAG_STRUCT; if (is_struct) { - SpvReflectResult result = ParseDescriptorBlockVariableSizes(p_parser, p_module, false, true, is_parent_rta, p_member_var); - if (result != SPV_REFLECT_RESULT_SUCCESS) { - return result; + if (p_member_var->flags & SPV_REFLECT_VARIABLE_FLAGS_PHYSICAL_POINTER_COPY) { + p_member_var->size = GetPhysicalPointerStructSize(p_parser, p_member_type->id); + } else { + SpvReflectResult result = + ParseDescriptorBlockVariableSizes(p_parser, p_module, false, true, is_parent_rta, p_member_var); + if (result != SPV_REFLECT_RESULT_SUCCESS) { + return result; + } } } // ...then array @@ -2451,10 +2521,14 @@ static SpvReflectResult ParseDescriptorBlockVariableSizes(SpvReflectPrvParser* p } case SpvOpTypeStruct: { - SpvReflectResult result = - ParseDescriptorBlockVariableSizes(p_parser, p_module, false, is_parent_aos, is_parent_rta, p_member_var); - if (result != SPV_REFLECT_RESULT_SUCCESS) { - return result; + if (p_member_var->flags & SPV_REFLECT_VARIABLE_FLAGS_PHYSICAL_POINTER_COPY) { + p_member_var->size = GetPhysicalPointerStructSize(p_parser, p_member_type->id); + } else { + SpvReflectResult result = + ParseDescriptorBlockVariableSizes(p_parser, p_module, false, is_parent_aos, is_parent_rta, p_member_var); + if (result != SPV_REFLECT_RESULT_SUCCESS) { + return result; + } } } break; @@ -2613,6 +2687,12 @@ static SpvReflectResult ParseDescriptorBlockVariableUsage(SpvReflectPrvParser* p } SpvReflectBlockVariable* p_member_var = &p_var->members[index]; + bool is_pointer_to_pointer = IsPointerToPointer(p_parser, p_access_chain->result_type_id); + if (is_pointer_to_pointer) { + // Remember block var for this access chain for downstream dereference + p_access_chain->block_var = p_member_var; + } + // Next access chain index index_index += 1; @@ -2629,10 +2709,7 @@ static SpvReflectResult ParseDescriptorBlockVariableUsage(SpvReflectPrvParser* p if (result != SPV_REFLECT_RESULT_SUCCESS) { return result; } - } else if (IsPointerToPointer(p_parser, p_access_chain->result_type_id)) { - // Remember block var for this access chain for downstream dereference - p_access_chain->block_var = p_member_var; - } else { + } else if (!is_pointer_to_pointer) { // Clear UNUSED flag for remaining variables MarkSelfAndAllMemberVarsAsUsed(p_member_var); } @@ -2647,6 +2724,8 @@ static SpvReflectResult ParseDescriptorBlocks(SpvReflectPrvParser* p_parser, Spv return SPV_REFLECT_RESULT_SUCCESS; } + p_parser->physical_pointer_struct_count = 0; + for (uint32_t descriptor_index = 0; descriptor_index < p_module->descriptor_binding_count; ++descriptor_index) { SpvReflectDescriptorBinding* p_descriptor = &(p_module->descriptor_bindings[descriptor_index]); SpvReflectTypeDescription* p_type = p_descriptor->type_description; @@ -3458,6 +3537,7 @@ static SpvReflectResult ParsePushConstantBlocks(SpvReflectPrvParser* p_parser, S return SPV_REFLECT_RESULT_ERROR_ALLOC_FAILED; } + p_parser->physical_pointer_struct_count = 0; uint32_t push_constant_index = 0; for (size_t i = 0; i < p_parser->node_count; ++i) { SpvReflectPrvNode* p_node = &(p_parser->nodes[i]); @@ -3880,7 +3960,7 @@ SpvReflectResult spvReflectGetShaderModule(size_t size, const void* p_code, SpvR } static void SafeFreeTypes(SpvReflectTypeDescription* p_type) { - if (IsNull(p_type)) { + if (IsNull(p_type) || p_type->copied) { return; } @@ -3900,6 +3980,11 @@ static void SafeFreeBlockVariables(SpvReflectBlockVariable* p_block) { return; } + // We share pointers to Physical Pointer structs and don't want to double free + if (p_block->flags & SPV_REFLECT_VARIABLE_FLAGS_PHYSICAL_POINTER_COPY) { + return; + } + if (IsNotNull(p_block->members)) { for (size_t i = 0; i < p_block->member_count; ++i) { SpvReflectBlockVariable* p_member = &p_block->members[i]; diff --git a/spirv_reflect.h b/spirv_reflect.h index 6eecfb29..08550e8f 100644 --- a/spirv_reflect.h +++ b/spirv_reflect.h @@ -220,6 +220,8 @@ typedef enum SpvReflectFormat { enum SpvReflectVariableFlagBits{ SPV_REFLECT_VARIABLE_FLAGS_NONE = 0x00000000, SPV_REFLECT_VARIABLE_FLAGS_UNUSED = 0x00000001, + // If variable points to a copy of the PhysicalStorageBuffer struct + SPV_REFLECT_VARIABLE_FLAGS_PHYSICAL_POINTER_COPY = 0x00000002, }; typedef uint32_t SpvReflectVariableFlags; @@ -362,6 +364,10 @@ typedef struct SpvReflectTypeDescription { // this gives access to the OpTypeStruct struct SpvReflectTypeDescription* struct_type_description; + // Some pointers to SpvReflectTypeDescription are really + // just copies of another reference to the same OpType + uint32_t copied; + // @deprecated use struct_type_description instead uint32_t member_count; // @deprecated use struct_type_description instead diff --git a/tests/glsl/buffer_handle_0.spv.yaml b/tests/glsl/buffer_handle_0.spv.yaml index 0b5149c6..a4c47fce 100644 --- a/tests/glsl/buffer_handle_0.spv.yaml +++ b/tests/glsl/buffer_handle_0.spv.yaml @@ -24,8 +24,8 @@ all_type_descriptions: type_name: struct_member_name: "i_1" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -33,15 +33,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 4 members: + - [forward pointer] - &td2 id: 7 op: 32 type_name: "t1" struct_member_name: "k_1" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -59,8 +60,8 @@ all_type_descriptions: type_name: struct_member_name: "i_2" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -68,15 +69,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 4 members: + - [forward pointer] - &td4 id: 8 op: 32 type_name: "t2" struct_member_name: "k_2" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -91,11 +93,11 @@ all_type_descriptions: - &td5 id: 8 op: 32 - type_name: + type_name: "t2" struct_member_name: "i_3" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -103,15 +105,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 1 members: + - [forward pointer] - &td6 id: 9 op: 32 type_name: "t3" struct_member_name: "k_3" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -129,7 +132,7 @@ all_type_descriptions: type_name: "t4" struct_member_name: "m" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -202,8 +205,8 @@ all_type_descriptions: type_name: struct_member_name: "k_1" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -211,16 +214,17 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 1 members: + - [forward pointer] - &td12 id: 11 op: 32 type_name: struct_member_name: "i_2" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -228,15 +232,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 4 members: + - [forward pointer] - &td13 id: 8 op: 32 type_name: "t2" struct_member_name: "k_2" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -251,11 +256,11 @@ all_type_descriptions: - &td14 id: 8 op: 32 - type_name: + type_name: "t2" struct_member_name: "i_3" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -263,15 +268,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 1 members: + - [forward pointer] - &td15 id: 9 op: 32 type_name: "t3" struct_member_name: "k_3" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -289,7 +295,7 @@ all_type_descriptions: type_name: "t4" struct_member_name: "i_1" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -310,7 +316,7 @@ all_type_descriptions: type_name: "t1" struct_member_name: "k_1" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -345,8 +351,8 @@ all_type_descriptions: type_name: struct_member_name: "i_1" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -354,15 +360,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 4 members: + - [forward pointer] - &td20 id: 7 op: 32 type_name: "t1" struct_member_name: "k_1" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -380,8 +387,8 @@ all_type_descriptions: type_name: struct_member_name: "i_2" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -389,15 +396,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 4 members: + - [forward pointer] - &td22 id: 8 op: 32 type_name: "t2" struct_member_name: "k_2" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -412,11 +420,11 @@ all_type_descriptions: - &td23 id: 8 op: 32 - type_name: + type_name: "t2" struct_member_name: "i_3" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -424,15 +432,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 1 members: + - [forward pointer] - &td24 id: 9 op: 32 type_name: "t3" struct_member_name: "k_3" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -450,7 +459,7 @@ all_type_descriptions: type_name: "t4" struct_member_name: "i_1" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -468,11 +477,11 @@ all_type_descriptions: - &td26 id: 8 op: 32 - type_name: + type_name: "t2" struct_member_name: "k_2" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -480,8 +489,9 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 1 members: + - [forward pointer] - &td27 id: 6 op: 21 @@ -505,8 +515,8 @@ all_type_descriptions: type_name: struct_member_name: "i_1" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -514,15 +524,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 4 members: + - [forward pointer] - &td29 id: 7 op: 32 type_name: "t1" struct_member_name: "k_1" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -540,8 +551,8 @@ all_type_descriptions: type_name: struct_member_name: "i_2" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -549,15 +560,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 4 members: + - [forward pointer] - &td31 id: 8 op: 32 type_name: "t2" struct_member_name: "k_2" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -572,11 +584,11 @@ all_type_descriptions: - &td32 id: 8 op: 32 - type_name: + type_name: "t2" struct_member_name: "i_3" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -584,15 +596,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 1 members: + - [forward pointer] - &td33 id: 9 op: 32 type_name: "t3" struct_member_name: "k_3" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -610,7 +623,7 @@ all_type_descriptions: type_name: "t4" struct_member_name: "i_2" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -628,11 +641,11 @@ all_type_descriptions: - &td35 id: 9 op: 32 - type_name: + type_name: "t3" struct_member_name: "k_3" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -640,8 +653,9 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 1 members: + - [forward pointer] - &td36 id: 6 op: 21 @@ -665,8 +679,8 @@ all_type_descriptions: type_name: struct_member_name: "i_1" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -674,15 +688,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 4 members: + - [forward pointer] - &td38 id: 7 op: 32 type_name: "t1" struct_member_name: "k_1" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -700,8 +715,8 @@ all_type_descriptions: type_name: struct_member_name: "k_2" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -709,16 +724,17 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 1 members: + - [forward pointer] - &td40 id: 8 op: 32 type_name: struct_member_name: "i_3" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -726,15 +742,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 1 members: + - [forward pointer] - &td41 id: 9 op: 32 type_name: "t3" struct_member_name: "k_3" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -752,7 +769,7 @@ all_type_descriptions: type_name: "t4" struct_member_name: "i_2" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -773,7 +790,7 @@ all_type_descriptions: type_name: "t2" struct_member_name: "i_3" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -825,8 +842,8 @@ all_type_descriptions: type_name: struct_member_name: "k_1" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -834,16 +851,17 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 1 members: + - [forward pointer] - &td47 id: 11 op: 32 type_name: struct_member_name: "i_2" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -851,15 +869,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 4 members: + - [forward pointer] - &td48 id: 8 op: 32 type_name: "t2" struct_member_name: "k_2" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -874,11 +893,11 @@ all_type_descriptions: - &td49 id: 8 op: 32 - type_name: + type_name: "t2" struct_member_name: "i_3" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -886,15 +905,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 1 members: + - [forward pointer] - &td50 id: 9 op: 32 type_name: "t3" struct_member_name: "k_3" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -912,7 +932,7 @@ all_type_descriptions: type_name: "t4" struct_member_name: "i_1" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -933,7 +953,7 @@ all_type_descriptions: type_name: "t1" struct_member_name: "k_1" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -948,11 +968,11 @@ all_type_descriptions: - &td53 id: 8 op: 32 - type_name: + type_name: "t2" struct_member_name: "k_2" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -960,16 +980,17 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 1 members: + - [forward pointer] - &td54 id: 9 op: 32 - type_name: + type_name: "t3" struct_member_name: "k_3" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -977,8 +998,9 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 1 members: + - [forward pointer] - &td55 id: 10 op: 30 @@ -1017,21 +1039,6 @@ all_block_variables: members: type_description: *td9 - &bv1 - name: "i_1" - offset: 0 - absolute_offset: 0 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: *td25 - - &bv2 name: "k_1" offset: 8 absolute_offset: 8 @@ -1045,24 +1052,9 @@ all_block_variables: array: { dims_count: 0, dims: [], stride: 0 } member_count: 1 members: - - *bv1 + - [recursive] type_description: *td17 - - &bv3 - name: "i_2" - offset: 0 - absolute_offset: 0 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: *td34 - - &bv4 + - &bv2 name: "k_2" offset: 16 absolute_offset: 16 @@ -1076,24 +1068,9 @@ all_block_variables: array: { dims_count: 0, dims: [], stride: 0 } member_count: 1 members: - - *bv3 + - [recursive] type_description: *td26 - - &bv5 - name: "i_3" - offset: 0 - absolute_offset: 0 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: *td43 - - &bv6 + - &bv3 name: "k_3" offset: 24 absolute_offset: 24 @@ -1107,9 +1084,9 @@ all_block_variables: array: { dims_count: 0, dims: [], stride: 0 } member_count: 1 members: - - *bv5 + - [recursive] type_description: *td35 - - &bv7 + - &bv4 name: "m" offset: 0 absolute_offset: 0 @@ -1124,11 +1101,11 @@ all_block_variables: member_count: 4 members: - *bv0 + - *bv1 - *bv2 - - *bv4 - - *bv6 + - *bv3 type_description: *td7 - - &bv8 + - &bv5 name: "s5" offset: 0 absolute_offset: 0 @@ -1142,9 +1119,9 @@ all_block_variables: array: { dims_count: 0, dims: [], stride: 0 } member_count: 1 members: - - *bv7 + - *bv4 type_description: *td8 - - &bv9 + - &bv6 name: "j" offset: 0 absolute_offset: 0 @@ -1159,7 +1136,7 @@ all_block_variables: member_count: 0 members: type_description: *td44 - - &bv10 + - &bv7 name: "j" offset: 0 absolute_offset: 0 @@ -1174,37 +1151,7 @@ all_block_variables: member_count: 0 members: type_description: *td9 - - &bv11 - name: "k_1" - offset: 8 - absolute_offset: 8 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: *td17 - - &bv12 - name: "i_2" - offset: 0 - absolute_offset: 0 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: *td34 - - &bv13 + - &bv8 name: "k_2" offset: 16 absolute_offset: 16 @@ -1218,24 +1165,9 @@ all_block_variables: array: { dims_count: 0, dims: [], stride: 0 } member_count: 1 members: - - *bv12 + - [recursive] type_description: *td26 - - &bv14 - name: "i_3" - offset: 0 - absolute_offset: 0 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: *td43 - - &bv15 + - &bv9 name: "k_3" offset: 24 absolute_offset: 24 @@ -1249,9 +1181,9 @@ all_block_variables: array: { dims_count: 0, dims: [], stride: 0 } member_count: 1 members: - - *bv14 + - [recursive] type_description: *td35 - - &bv16 + - &bv10 name: "i_1" offset: 0 absolute_offset: 0 @@ -1265,12 +1197,12 @@ all_block_variables: array: { dims_count: 0, dims: [], stride: 0 } member_count: 4 members: - - *bv10 - - *bv11 - - *bv13 - - *bv15 + - *bv7 + - [recursive] + - *bv8 + - *bv9 type_description: *td25 - - &bv17 + - &bv11 name: "k_1" offset: 8 absolute_offset: 8 @@ -1284,39 +1216,9 @@ all_block_variables: array: { dims_count: 0, dims: [], stride: 0 } member_count: 1 members: - - *bv16 + - *bv10 type_description: *td52 - - &bv18 - name: "k_2" - offset: 16 - absolute_offset: 16 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: *td53 - - &bv19 - name: "k_3" - offset: 24 - absolute_offset: 24 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: *td54 - - &bv20 + - &bv12 name: "x" offset: 0 absolute_offset: 0 @@ -1330,10 +1232,10 @@ all_block_variables: array: { dims_count: 0, dims: [], stride: 0 } member_count: 4 members: - - *bv9 - - *bv17 - - *bv18 - - *bv19 + - *bv6 + - *bv11 + - [recursive] + - [recursive] type_description: *td55 all_descriptor_bindings: - &db0 @@ -1345,7 +1247,7 @@ all_descriptor_bindings: descriptor_type: 7 # VK_DESCRIPTOR_TYPE_STORAGE_BUFFER resource_type: 8 # UAV image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown - block: *bv8 # "s5" + block: *bv5 # "s5" array: { dims_count: 0, dims: [] } accessed: 0 uav_counter_id: 4294967295 @@ -1361,7 +1263,7 @@ all_descriptor_bindings: descriptor_type: 7 # VK_DESCRIPTOR_TYPE_STORAGE_BUFFER resource_type: 8 # UAV image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown - block: *bv20 # "x" + block: *bv12 # "x" array: { dims_count: 0, dims: [] } accessed: 0 uav_counter_id: 4294967295 diff --git a/tests/glsl/buffer_handle_1.spv.yaml b/tests/glsl/buffer_handle_1.spv.yaml index 375d764f..2378087e 100644 --- a/tests/glsl/buffer_handle_1.spv.yaml +++ b/tests/glsl/buffer_handle_1.spv.yaml @@ -41,8 +41,8 @@ all_type_descriptions: type_name: struct_member_name: "i" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -50,15 +50,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 2 members: + - [forward pointer] - &td3 id: 7 op: 32 type_name: "t3" struct_member_name: "k" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -77,7 +78,7 @@ all_type_descriptions: type_name: "t4" struct_member_name: "m" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -165,8 +166,8 @@ all_type_descriptions: type_name: struct_member_name: "k" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -174,15 +175,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 2 members: + - [forward pointer] - &td10 id: 9 op: 32 type_name: "t4" struct_member_name: "i" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -201,7 +203,7 @@ all_type_descriptions: type_name: "t3" struct_member_name: "k" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -271,8 +273,8 @@ all_type_descriptions: type_name: struct_member_name: "i" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -280,15 +282,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 2 members: + - [forward pointer] - &td16 id: 7 op: 32 type_name: "t3" struct_member_name: "k" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -307,7 +310,7 @@ all_type_descriptions: type_name: "t4" struct_member_name: "i" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -377,8 +380,8 @@ all_type_descriptions: type_name: struct_member_name: "k" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -386,15 +389,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 2 members: + - [forward pointer] - &td22 id: 9 op: 32 type_name: "t4" struct_member_name: "i" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -413,7 +417,7 @@ all_type_descriptions: type_name: "t3" struct_member_name: "k" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -477,21 +481,6 @@ all_block_variables: members: type_description: *td12 - &bv2 - name: "i" - offset: 8 - absolute_offset: 8 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: *td17 - - &bv3 name: "k" offset: 8 absolute_offset: 8 @@ -506,9 +495,9 @@ all_block_variables: member_count: 2 members: - *bv1 - - *bv2 + - [recursive] type_description: *td11 - - &bv4 + - &bv3 name: "m" offset: 0 absolute_offset: 0 @@ -523,9 +512,9 @@ all_block_variables: member_count: 2 members: - *bv0 - - *bv3 + - *bv2 type_description: *td4 - - &bv5 + - &bv4 name: "s5" offset: 0 absolute_offset: 0 @@ -539,9 +528,9 @@ all_block_variables: array: { dims_count: 0, dims: [], stride: 0 } member_count: 1 members: - - *bv4 + - *bv3 type_description: *td5 - - &bv6 + - &bv5 name: "j" offset: 0 absolute_offset: 0 @@ -556,7 +545,7 @@ all_block_variables: member_count: 0 members: type_description: *td18 - - &bv7 + - &bv6 name: "h" offset: 0 absolute_offset: 0 @@ -571,7 +560,7 @@ all_block_variables: member_count: 0 members: type_description: *td12 - - &bv8 + - &bv7 name: "j" offset: 0 absolute_offset: 0 @@ -586,22 +575,7 @@ all_block_variables: member_count: 0 members: type_description: *td6 - - &bv9 - name: "k" - offset: 8 - absolute_offset: 8 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: *td11 - - &bv10 + - &bv8 name: "i" offset: 8 absolute_offset: 8 @@ -615,10 +589,10 @@ all_block_variables: array: { dims_count: 0, dims: [], stride: 0 } member_count: 2 members: - - *bv8 - - *bv9 + - *bv7 + - [recursive] type_description: *td17 - - &bv11 + - &bv9 name: "k" offset: 8 absolute_offset: 8 @@ -632,10 +606,10 @@ all_block_variables: array: { dims_count: 0, dims: [], stride: 0 } member_count: 2 members: - - *bv7 - - *bv10 + - *bv6 + - *bv8 type_description: *td23 - - &bv12 + - &bv10 name: "x" offset: 0 absolute_offset: 0 @@ -649,8 +623,8 @@ all_block_variables: array: { dims_count: 0, dims: [], stride: 0 } member_count: 2 members: - - *bv6 - - *bv11 + - *bv5 + - *bv9 type_description: *td24 all_descriptor_bindings: - &db0 @@ -662,7 +636,7 @@ all_descriptor_bindings: descriptor_type: 7 # VK_DESCRIPTOR_TYPE_STORAGE_BUFFER resource_type: 8 # UAV image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown - block: *bv5 # "s5" + block: *bv4 # "s5" array: { dims_count: 0, dims: [] } accessed: 1 uav_counter_id: 4294967295 @@ -678,7 +652,7 @@ all_descriptor_bindings: descriptor_type: 7 # VK_DESCRIPTOR_TYPE_STORAGE_BUFFER resource_type: 8 # UAV image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown - block: *bv12 # "x" + block: *bv10 # "x" array: { dims_count: 0, dims: [] } accessed: 1 uav_counter_id: 4294967295 diff --git a/tests/glsl/buffer_handle_2.spv.yaml b/tests/glsl/buffer_handle_2.spv.yaml index a47571b2..ea49f3c9 100644 --- a/tests/glsl/buffer_handle_2.spv.yaml +++ b/tests/glsl/buffer_handle_2.spv.yaml @@ -126,8 +126,8 @@ all_type_descriptions: type_name: struct_member_name: "c" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x60000000 # ARRAY ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -135,8 +135,9 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 1, dims: [2,], stride: 8 } - member_count: 0 + member_count: 4 members: + - [forward pointer] - &td8 id: 16 op: 28 @@ -177,8 +178,8 @@ all_type_descriptions: type_name: struct_member_name: "c" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x60000000 # ARRAY ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -186,16 +187,17 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 1, dims: [2,], stride: 8 } - member_count: 0 + member_count: 4 members: + - [forward pointer] - &td11 id: 13 op: 32 type_name: struct_member_name: "d" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -203,15 +205,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 4 members: + - [forward pointer] - &td12 id: 13 op: 32 type_name: "T1" struct_member_name: "d" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -232,7 +235,7 @@ all_type_descriptions: type_name: "T1" struct_member_name: "c" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x70080000 # ARRAY STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -250,11 +253,11 @@ all_type_descriptions: - &td14 id: 13 op: 32 - type_name: + type_name: "T1" struct_member_name: "d" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -262,15 +265,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 4 members: + - [forward pointer] - &td15 id: 14 op: 28 type_name: "T1" struct_member_name: "c" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x70080000 # ARRAY STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -288,11 +292,11 @@ all_type_descriptions: - &td16 id: 13 op: 32 - type_name: + type_name: "T1" struct_member_name: "d" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -300,8 +304,9 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 4 members: + - [forward pointer] - &td17 id: 15 op: 30 @@ -397,8 +402,8 @@ all_type_descriptions: type_name: struct_member_name: "c" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x60000000 # ARRAY ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -406,8 +411,9 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 1, dims: [2,], stride: 8 } - member_count: 0 + member_count: 4 members: + - [forward pointer] - &td23 id: 16 op: 28 @@ -448,8 +454,8 @@ all_type_descriptions: type_name: struct_member_name: "c" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x60000000 # ARRAY ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -457,16 +463,17 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 1, dims: [2,], stride: 8 } - member_count: 0 + member_count: 4 members: + - [forward pointer] - &td26 id: 13 op: 32 type_name: struct_member_name: "d" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -474,15 +481,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 4 members: + - [forward pointer] - &td27 id: 13 op: 32 type_name: "T1" struct_member_name: "d" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -503,7 +511,7 @@ all_type_descriptions: type_name: "T1" struct_member_name: "c" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x70080000 # ARRAY STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -521,27 +529,10 @@ all_type_descriptions: - &td29 id: 13 op: 32 - type_name: + type_name: "T1" struct_member_name: "d" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE - traits: - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - - &td30 - id: 18 - op: 30 - type_name: "T1" - struct_member_name: - storage_class: -1 # NOT APPLICABLE - type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -552,11 +543,8 @@ all_type_descriptions: array: { dims_count: 0, dims: [], stride: 0 } member_count: 4 members: - - *td18 - - *td19 - - *td28 - - *td29 - - &td31 + - [forward pointer] + - &td30 id: 29 op: 28 type_name: @@ -573,7 +561,7 @@ all_type_descriptions: array: { dims_count: 1, dims: [32,], stride: 4 } member_count: 0 members: - - &td32 + - &td31 id: 30 op: 30 type_name: "Block" @@ -590,8 +578,8 @@ all_type_descriptions: array: { dims_count: 0, dims: [], stride: 0 } member_count: 1 members: - - *td31 - - &td33 + - *td30 + - &td32 id: 152 op: 23 type_name: @@ -655,81 +643,6 @@ all_block_variables: members: type_description: *td2 - &bv3 - name: - offset: 0 - absolute_offset: 0 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: - - &bv4 - name: - offset: 0 - absolute_offset: 0 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: - - &bv5 - name: - offset: 0 - absolute_offset: 0 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: - - &bv6 - name: - offset: 0 - absolute_offset: 0 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: - - &bv7 - name: - offset: 0 - absolute_offset: 0 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: - - &bv8 name: "a" offset: 0 absolute_offset: 0 @@ -744,7 +657,7 @@ all_block_variables: member_count: 0 members: type_description: *td18 - - &bv9 + - &bv4 name: "b" offset: 32 absolute_offset: 0 @@ -759,142 +672,10 @@ all_block_variables: member_count: 0 members: type_description: *td19 - - &bv10 - name: - offset: 0 - absolute_offset: 0 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: - - &bv11 - name: - offset: 0 - absolute_offset: 0 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: - - &bv12 - name: - offset: 0 - absolute_offset: 0 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: - - &bv13 - name: - offset: 0 - absolute_offset: 0 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: - - &bv14 + - &bv5 name: "c" offset: 48 - absolute_offset: 0 - size: 16 - padded_size: 16 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 1, dims: [2,], stride: 8 } - member_count: 4 - members: - - *bv10 - - *bv11 - - *bv12 - - *bv13 - type_description: *td28 - - &bv15 - name: "d" - offset: 80 - absolute_offset: 0 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: *td29 - - &bv16 - name: "T1" - offset: 0 - absolute_offset: 0 - size: 80 - padded_size: 80 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 4 - members: - - *bv8 - - *bv9 - - *bv14 - - *bv15 - type_description: *td30 - - &bv17 - name: "T1" - offset: 0 - absolute_offset: 0 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 4 - members: - - *bv5 - - *bv6 - - *bv7 - - *bv16 - type_description: *td13 - - &bv18 - name: - offset: 0 - absolute_offset: 0 + absolute_offset: 48 size: 0 padded_size: 0 decorations: 0x00000000 # NONE @@ -903,44 +684,14 @@ all_block_variables: vector: { component_count: 0 } matrix: { column_count: 0, row_count: 0, stride: 0 } array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: - - &bv19 - name: "c" - offset: 48 - absolute_offset: 48 - size: 16 - padded_size: 16 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 1, dims: [2,], stride: 8 } member_count: 4 members: - *bv3 - *bv4 - - *bv17 - - *bv18 + - [recursive] + - [recursive] type_description: *td15 - - &bv20 - name: "d" - offset: 80 - absolute_offset: 80 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: *td16 - - &bv21 + - &bv6 name: "x" offset: 0 absolute_offset: 0 @@ -956,10 +707,10 @@ all_block_variables: members: - *bv1 - *bv2 - - *bv19 - - *bv20 + - *bv5 + - [recursive] type_description: *td17 - - &bv22 + - &bv7 name: "identity" offset: 0 absolute_offset: 0 @@ -973,8 +724,8 @@ all_block_variables: array: { dims_count: 1, dims: [32,], stride: 4 } member_count: 0 members: - type_description: *td31 - - &bv23 + type_description: *td30 + - &bv8 name: "pc" offset: 0 absolute_offset: 0 @@ -988,8 +739,8 @@ all_block_variables: array: { dims_count: 0, dims: [], stride: 0 } member_count: 1 members: - - *bv22 - type_description: *td32 + - *bv7 + type_description: *td31 all_descriptor_bindings: - &db0 spirv_id: 149 @@ -1016,7 +767,7 @@ all_descriptor_bindings: descriptor_type: 7 # VK_DESCRIPTOR_TYPE_STORAGE_BUFFER resource_type: 8 # UAV image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown - block: *bv21 # "x" + block: *bv6 # "x" array: { dims_count: 0, dims: [] } accessed: 1 uav_counter_id: 4294967295 @@ -1040,7 +791,7 @@ all_interface_variables: member_count: 0 members: format: 109 # VK_FORMAT_R32G32B32A32_SFLOAT - type_description: *td33 + type_description: *td32 word_offset: { location: 0 } module: generator: 8 # Khronos Glslang Reference Front End @@ -1068,5 +819,5 @@ module: output_variables: push_constant_count: 1, push_constants: - - *bv23 # "pc" + - *bv8 # "pc" ... diff --git a/tests/glsl/buffer_handle_3.spv.yaml b/tests/glsl/buffer_handle_3.spv.yaml index 654b8d9d..c6b2a092 100644 --- a/tests/glsl/buffer_handle_3.spv.yaml +++ b/tests/glsl/buffer_handle_3.spv.yaml @@ -24,8 +24,8 @@ all_type_descriptions: type_name: struct_member_name: "i" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -33,15 +33,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 1 members: + - [forward pointer] - &td2 id: 7 op: 32 type_name: "t1" struct_member_name: "k" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -59,7 +60,7 @@ all_type_descriptions: type_name: "t4" struct_member_name: "m" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -113,8 +114,8 @@ all_type_descriptions: type_name: struct_member_name: "i" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -122,15 +123,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 1 members: + - [forward pointer] - &td7 id: 7 op: 32 type_name: "t1" struct_member_name: "k" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -148,8 +150,8 @@ all_type_descriptions: type_name: struct_member_name: "i" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -157,15 +159,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 1 members: + - [forward pointer] - &td9 id: 7 op: 32 type_name: "t1" struct_member_name: "i" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -200,8 +203,8 @@ all_type_descriptions: type_name: struct_member_name: "i" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x40000000 # ??? - decoration_flags: 0x00000000 # NONE + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK traits: numeric: scalar: { width: 0, signedness: 0 } @@ -209,15 +212,16 @@ all_type_descriptions: matrix: { column_count: 0, row_count: 0, stride: 0 } image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 + member_count: 1 members: + - [forward pointer] - &td12 id: 7 op: 32 type_name: "t1" struct_member_name: "k" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: @@ -265,21 +269,6 @@ all_block_variables: members: type_description: *td5 - &bv1 - name: "i" - offset: 0 - absolute_offset: 0 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: *td9 - - &bv2 name: "k" offset: 8 absolute_offset: 8 @@ -293,9 +282,9 @@ all_block_variables: array: { dims_count: 0, dims: [], stride: 0 } member_count: 1 members: - - *bv1 + - [recursive] type_description: *td7 - - &bv3 + - &bv2 name: "m" offset: 0 absolute_offset: 0 @@ -310,9 +299,9 @@ all_block_variables: member_count: 2 members: - *bv0 - - *bv2 + - *bv1 type_description: *td3 - - &bv4 + - &bv3 name: "s5" offset: 0 absolute_offset: 0 @@ -326,9 +315,9 @@ all_block_variables: array: { dims_count: 0, dims: [], stride: 0 } member_count: 1 members: - - *bv3 + - *bv2 type_description: *td4 - - &bv5 + - &bv4 name: "j" offset: 0 absolute_offset: 0 @@ -343,22 +332,7 @@ all_block_variables: member_count: 0 members: type_description: *td10 - - &bv6 - name: "i" - offset: 0 - absolute_offset: 0 - size: 0 - padded_size: 0 - decorations: 0x00000000 # NONE - numeric: - scalar: { width: 0, signedness: 0 } - vector: { component_count: 0 } - matrix: { column_count: 0, row_count: 0, stride: 0 } - array: { dims_count: 0, dims: [], stride: 0 } - member_count: 0 - members: - type_description: *td9 - - &bv7 + - &bv5 name: "k" offset: 8 absolute_offset: 8 @@ -372,9 +346,9 @@ all_block_variables: array: { dims_count: 0, dims: [], stride: 0 } member_count: 1 members: - - *bv6 + - [recursive] type_description: *td12 - - &bv8 + - &bv6 name: "x" offset: 0 absolute_offset: 0 @@ -388,8 +362,8 @@ all_block_variables: array: { dims_count: 0, dims: [], stride: 0 } member_count: 2 members: + - *bv4 - *bv5 - - *bv7 type_description: *td13 all_descriptor_bindings: - &db0 @@ -401,7 +375,7 @@ all_descriptor_bindings: descriptor_type: 7 # VK_DESCRIPTOR_TYPE_STORAGE_BUFFER resource_type: 8 # UAV image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown - block: *bv4 # "s5" + block: *bv3 # "s5" array: { dims_count: 0, dims: [] } accessed: 0 uav_counter_id: 4294967295 @@ -417,7 +391,7 @@ all_descriptor_bindings: descriptor_type: 7 # VK_DESCRIPTOR_TYPE_STORAGE_BUFFER resource_type: 8 # UAV image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown - block: *bv8 # "x" + block: *bv6 # "x" array: { dims_count: 0, dims: [] } accessed: 0 uav_counter_id: 4294967295 diff --git a/tests/glsl/buffer_handle_4.glsl b/tests/glsl/buffer_handle_4.glsl new file mode 100644 index 00000000..87700a95 --- /dev/null +++ b/tests/glsl/buffer_handle_4.glsl @@ -0,0 +1,34 @@ +#version 460 core +#extension GL_EXT_buffer_reference : require +#extension GL_EXT_shader_explicit_arithmetic_types_float32 : require +#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require +#extension GL_EXT_shader_explicit_arithmetic_types_int32 : require + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; + +layout(buffer_reference, buffer_reference_align = 4) readonly buffer ReadVecf +{ + float32_t values[]; +}; + +layout(buffer_reference, buffer_reference_align = 4) writeonly buffer WriteVecf +{ + float32_t values[]; +}; + +layout(push_constant, std430) uniform Parameters +{ + ReadVecf a; + ReadVecf b; + WriteVecf c; + uint64_t n; +} params; + +void main() +{ + uint32_t idx = gl_GlobalInvocationID.x; + uint32_t stride = gl_NumWorkGroups.x * gl_WorkGroupSize.x; + for (; idx < params.n; idx += stride) { + params.c.values[idx] = params.a.values[idx] + params.b.values[idx]; + } +} \ No newline at end of file diff --git a/tests/glsl/buffer_handle_4.spv b/tests/glsl/buffer_handle_4.spv new file mode 100644 index 00000000..a21e6cca Binary files /dev/null and b/tests/glsl/buffer_handle_4.spv differ diff --git a/tests/glsl/buffer_handle_4.spv.yaml b/tests/glsl/buffer_handle_4.spv.yaml new file mode 100644 index 00000000..3b5724f0 --- /dev/null +++ b/tests/glsl/buffer_handle_4.spv.yaml @@ -0,0 +1,337 @@ +%YAML 1.0 +--- +all_type_descriptions: + - &td0 + id: 34 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000008 # ARRAY FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: + - &td1 + id: 30 + op: 32 + type_name: "ReadVecf" + struct_member_name: "a" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td0 + - &td2 + id: 30 + op: 32 + type_name: "ReadVecf" + struct_member_name: "b" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - [forward pointer] + - &td3 + id: 36 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000008 # ARRAY FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: + - &td4 + id: 31 + op: 32 + type_name: "WriteVecf" + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td3 + - &td5 + id: 28 + op: 21 + type_name: + struct_member_name: "n" + storage_class: 0 # UniformConstant + type_flags: 0x00000004 # INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 64, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td6 + id: 32 + op: 30 + type_name: "Parameters" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 4 + members: + - *td1 + - *td2 + - *td4 + - *td5 + - &td7 + id: 34 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000008 # ARRAY FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: + - &td8 + id: 36 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000008 # ARRAY FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: + - &td9 + id: 9 + op: 23 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00000104 # VECTOR INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: +all_block_variables: + - &bv0 + name: "values" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000080 # NON_WRITABLE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + type_description: *td7 + - &bv1 + name: "a" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *bv0 + type_description: *td1 + - &bv2 + name: "values" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000200 # ??? + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + type_description: *td8 + - &bv3 + name: "c" + offset: 16 + absolute_offset: 16 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *bv2 + type_description: *td4 + - &bv4 + name: "n" + offset: 24 + absolute_offset: 24 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 64, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + type_description: *td5 + - &bv5 + name: "params" + offset: 0 + absolute_offset: 0 + size: 32 + padded_size: 32 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 4 + members: + - *bv1 + - [recursive] + - *bv3 + - *bv4 + type_description: *td6 +all_descriptor_bindings: +all_interface_variables: + - &iv0 + spirv_id: 11 + name: "gl_GlobalInvocationID" + location: 4294967295 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000010 # BUILT_IN + built_in: 28 # GlobalInvocationId + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 104 # VK_FORMAT_R32G32B32_UINT + type_description: *td9 + word_offset: { location: 0 } + - &iv1 + spirv_id: 17 + name: "gl_NumWorkGroups" + location: 4294967295 + storage_class: 1 # Input + semantic: + decoration_flags: 0x00000010 # BUILT_IN + built_in: 24 # NumWorkgroups + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 3 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 104 # VK_FORMAT_R32G32B32_UINT + type_description: *td9 + word_offset: { location: 0 } +module: + generator: 8 # Khronos Glslang Reference Front End + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 460 + spirv_execution_model: 5 # GLCompute + shader_stage: 0x00000020 # CS + descriptor_binding_count: 0 + descriptor_bindings: + descriptor_set_count: 0 + descriptor_sets: + input_variable_count: 2, + input_variables: + - *iv0 # "gl_GlobalInvocationID" + - *iv1 # "gl_NumWorkGroups" + output_variable_count: 0, + output_variables: + push_constant_count: 1, + push_constants: + - *bv5 # "params" +... diff --git a/tests/glsl/buffer_handle_5.glsl b/tests/glsl/buffer_handle_5.glsl new file mode 100644 index 00000000..ee751d60 --- /dev/null +++ b/tests/glsl/buffer_handle_5.glsl @@ -0,0 +1,19 @@ +#version 460 core +#extension GL_EXT_buffer_reference : require + +layout(buffer_reference, buffer_reference_align = 4) readonly buffer t2 { + int values[]; +}; + +layout(buffer_reference, buffer_reference_align = 4) readonly buffer t1 { + t2 c; +}; + +layout(push_constant, std430) uniform Parameters { + t1 a; + t2 b; +} params; + +void main() { + params.a.c.values[0] = params.b.values[0] + 1; +} diff --git a/tests/glsl/buffer_handle_5.spv b/tests/glsl/buffer_handle_5.spv new file mode 100644 index 00000000..3a6eab6d Binary files /dev/null and b/tests/glsl/buffer_handle_5.spv differ diff --git a/tests/glsl/buffer_handle_5.spv.yaml b/tests/glsl/buffer_handle_5.spv.yaml new file mode 100644 index 00000000..383ff20c --- /dev/null +++ b/tests/glsl/buffer_handle_5.spv.yaml @@ -0,0 +1,232 @@ +%YAML 1.0 +--- +all_type_descriptions: + - &td0 + id: 11 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: + - &td1 + id: 7 + op: 32 + type_name: "t2" + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td0 + - &td2 + id: 6 + op: 32 + type_name: "t1" + struct_member_name: "a" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td1 + - &td3 + id: 7 + op: 32 + type_name: "t2" + struct_member_name: "b" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - [forward pointer] + - &td4 + id: 8 + op: 30 + type_name: "Parameters" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 2 + members: + - *td2 + - *td3 + - &td5 + id: 11 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: + - &td6 + id: 7 + op: 32 + type_name: "t2" + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td5 + - &td7 + id: 11 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: +all_block_variables: + - &bv0 + name: "values" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000080 # NON_WRITABLE + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + type_description: *td7 + - &bv1 + name: "c" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 16 + decorations: 0x00000080 # NON_WRITABLE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *bv0 + type_description: *td6 + - &bv2 + name: "a" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 8 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *bv1 + type_description: *td2 + - &bv3 + name: "params" + offset: 0 + absolute_offset: 0 + size: 16 + padded_size: 16 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 2 + members: + - *bv2 + - [recursive] + type_description: *td4 +all_descriptor_bindings: +all_interface_variables: +module: + generator: 8 # Khronos Glslang Reference Front End + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 460 + spirv_execution_model: 5 # GLCompute + shader_stage: 0x00000020 # CS + descriptor_binding_count: 0 + descriptor_bindings: + descriptor_set_count: 0 + descriptor_sets: + input_variable_count: 0, + input_variables: + output_variable_count: 0, + output_variables: + push_constant_count: 1, + push_constants: + - *bv3 # "params" +... diff --git a/tests/glsl/buffer_handle_6.glsl b/tests/glsl/buffer_handle_6.glsl new file mode 100644 index 00000000..1d4e5ac2 --- /dev/null +++ b/tests/glsl/buffer_handle_6.glsl @@ -0,0 +1,36 @@ +#version 450 +#extension GL_EXT_buffer_reference : require +#extension GL_ARB_enhanced_layouts : require +#extension GL_EXT_nonuniform_qualifier : require +#extension GL_KHR_shader_subgroup_arithmetic : require +layout(row_major) uniform; +layout(row_major) buffer; + +struct BDAGlobals_t_0 { + vec4 g_vTest; + vec4 g_vTest2; +}; + +layout(buffer_reference, std430, buffer_reference_align = 16) readonly buffer BufferPointer_BDAGlobals_t_0_1 { + BDAGlobals_t_0 _data; +}; + +struct GlobalsBDAPushConstant_t_0 { + BufferPointer_BDAGlobals_t_0_1 g_GlobalsBDAPerStage_0[6]; +}; + +layout(push_constant) +layout(std140) uniform _S2 { + BufferPointer_BDAGlobals_t_0_1 g_GlobalsBDAPerStage_0[6]; +} g_GlobalsBDAPushConstant_0; + +struct PS_OUTPUT_0 { + vec4 vColor_1; +}; + +layout(location = 0) out vec4 _S149; + +void main() { + _S149 = g_GlobalsBDAPushConstant_0.g_GlobalsBDAPerStage_0[0]._data.g_vTest; + return; +} \ No newline at end of file diff --git a/tests/glsl/buffer_handle_6.spv b/tests/glsl/buffer_handle_6.spv new file mode 100644 index 00000000..00ec6bfd Binary files /dev/null and b/tests/glsl/buffer_handle_6.spv differ diff --git a/tests/glsl/buffer_handle_6.spv.yaml b/tests/glsl/buffer_handle_6.spv.yaml new file mode 100644 index 00000000..b0e0137d --- /dev/null +++ b/tests/glsl/buffer_handle_6.spv.yaml @@ -0,0 +1,283 @@ +%YAML 1.0 +--- +all_type_descriptions: + - &td0 + id: 7 + op: 23 + type_name: + struct_member_name: "g_vTest" + storage_class: 0 # UniformConstant + type_flags: 0x00000108 # VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td1 + id: 7 + op: 23 + type_name: + struct_member_name: "g_vTest2" + storage_class: 0 # UniformConstant + type_flags: 0x00000108 # VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td2 + id: 15 + op: 30 + type_name: "BDAGlobals_t_0" + struct_member_name: "_data" + storage_class: 0 # UniformConstant + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 2 + members: + - *td0 + - *td1 + - &td3 + id: 13 + op: 28 + type_name: "BufferPointer_BDAGlobals_t_0_1" + struct_member_name: "g_GlobalsBDAPerStage_0" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x70080000 # ARRAY STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [6,], stride: 16 } + member_count: 1 + members: + - *td2 + - &td4 + id: 14 + op: 30 + type_name: "_S2" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td3 + - &td5 + id: 7 + op: 23 + type_name: + struct_member_name: "g_vTest" + storage_class: 0 # UniformConstant + type_flags: 0x00000108 # VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td6 + id: 7 + op: 23 + type_name: + struct_member_name: "g_vTest2" + storage_class: 0 # UniformConstant + type_flags: 0x00000108 # VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + - &td7 + id: 15 + op: 30 + type_name: "BDAGlobals_t_0" + struct_member_name: "_data" + storage_class: 0 # UniformConstant + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 2 + members: + - *td5 + - *td6 + - &td8 + id: 7 + op: 23 + type_name: + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x00000108 # VECTOR FLOAT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: +all_block_variables: + - &bv0 + name: "g_vTest" + offset: 0 + absolute_offset: 0 + size: 16 + padded_size: 16 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + type_description: *td5 + - &bv1 + name: "g_vTest2" + offset: 16 + absolute_offset: 0 + size: 16 + padded_size: 16 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + type_description: *td6 + - &bv2 + name: "_data" + offset: 0 + absolute_offset: 0 + size: 32 + padded_size: 32 + decorations: 0x00000080 # NON_WRITABLE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 2 + members: + - *bv0 + - *bv1 + type_description: *td7 + - &bv3 + name: "g_GlobalsBDAPerStage_0" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *bv2 + type_description: *td3 + - &bv4 + name: "g_GlobalsBDAPushConstant_0" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *bv3 + type_description: *td4 +all_descriptor_bindings: +all_interface_variables: + - &iv0 + spirv_id: 9 + name: "_S149" + location: 0 + storage_class: 3 # Output + semantic: + decoration_flags: 0x00000000 # NONE + built_in: -1 # ??? (-1) + numeric: + scalar: { width: 32, signedness: 0 } + vector: { component_count: 4 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + format: 109 # VK_FORMAT_R32G32B32A32_SFLOAT + type_description: *td8 + word_offset: { location: 144 } +module: + generator: 8 # Khronos Glslang Reference Front End + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 450 + spirv_execution_model: 4 # Fragment + shader_stage: 0x00000010 # PS + descriptor_binding_count: 0 + descriptor_bindings: + descriptor_set_count: 0 + descriptor_sets: + input_variable_count: 0, + input_variables: + output_variable_count: 1, + output_variables: + - *iv0 # "_S149" + push_constant_count: 1, + push_constants: + - *bv4 # "g_GlobalsBDAPushConstant_0" +... diff --git a/tests/glsl/buffer_handle_7.glsl b/tests/glsl/buffer_handle_7.glsl new file mode 100644 index 00000000..ced8bccb --- /dev/null +++ b/tests/glsl/buffer_handle_7.glsl @@ -0,0 +1,23 @@ +#version 460 core +#extension GL_EXT_buffer_reference : require + +layout(buffer_reference, buffer_reference_align = 4) readonly buffer t2 { + int values[]; +}; + +layout(buffer_reference, buffer_reference_align = 4) readonly buffer t1 { + t2 c; +}; + +layout(buffer_reference, buffer_reference_align = 4) readonly buffer t0 { + t1 a; + t2 b; +}; + +layout(push_constant, std430) uniform Parameters { + t0 x; +} params; + +void main() { + params.x.a.c.values[0] = params.x.b.values[0] + 1; +} diff --git a/tests/glsl/buffer_handle_7.spv b/tests/glsl/buffer_handle_7.spv new file mode 100644 index 00000000..10dad809 Binary files /dev/null and b/tests/glsl/buffer_handle_7.spv differ diff --git a/tests/glsl/buffer_handle_7.spv.yaml b/tests/glsl/buffer_handle_7.spv.yaml new file mode 100644 index 00000000..9d2034f4 --- /dev/null +++ b/tests/glsl/buffer_handle_7.spv.yaml @@ -0,0 +1,337 @@ +%YAML 1.0 +--- +all_type_descriptions: + - &td0 + id: 13 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: + - &td1 + id: 9 + op: 32 + type_name: "t2" + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td0 + - &td2 + id: 8 + op: 32 + type_name: "t1" + struct_member_name: "a" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td1 + - &td3 + id: 9 + op: 32 + type_name: "t2" + struct_member_name: "b" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - [forward pointer] + - &td4 + id: 6 + op: 32 + type_name: "t0" + struct_member_name: "x" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 2 + members: + - *td2 + - *td3 + - &td5 + id: 7 + op: 30 + type_name: "Parameters" + struct_member_name: + storage_class: -1 # NOT APPLICABLE + type_flags: 0x10080000 # STRUCT EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td4 + - &td6 + id: 13 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: + - &td7 + id: 9 + op: 32 + type_name: "t2" + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td6 + - &td8 + id: 8 + op: 32 + type_name: "t1" + struct_member_name: "a" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td7 + - &td9 + id: 13 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: + - &td10 + id: 9 + op: 32 + type_name: "t2" + struct_member_name: "c" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *td9 + - &td11 + id: 13 + op: 29 + type_name: + struct_member_name: "values" + storage_class: 0 # UniformConstant + type_flags: 0x20000004 # ARRAY INT + decoration_flags: 0x00000000 # NONE + traits: + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 1, dims: [0,], stride: 4 } + member_count: 0 + members: + - &td12 + id: 9 + op: 32 + type_name: "t2" + struct_member_name: "b" + storage_class: 5349 # PhysicalStorageBuffer + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK + decoration_flags: 0x00000001 # BLOCK + traits: + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - [forward pointer] +all_block_variables: + - &bv0 + name: "values" + offset: 0 + absolute_offset: 0 + size: 0 + padded_size: 0 + decorations: 0x00000080 # NON_WRITABLE + numeric: + scalar: { width: 32, signedness: 1 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 0 + members: + type_description: *td11 + - &bv1 + name: "c" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 16 + decorations: 0x00000080 # NON_WRITABLE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *bv0 + type_description: *td10 + - &bv2 + name: "a" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 8 + decorations: 0x00000080 # NON_WRITABLE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *bv1 + type_description: *td8 + - &bv3 + name: "x" + offset: 0 + absolute_offset: 0 + size: 8 + padded_size: 16 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 2 + members: + - *bv2 + - [recursive] + type_description: *td4 + - &bv4 + name: "params" + offset: 0 + absolute_offset: 0 + size: 16 + padded_size: 16 + decorations: 0x00000000 # NONE + numeric: + scalar: { width: 0, signedness: 0 } + vector: { component_count: 0 } + matrix: { column_count: 0, row_count: 0, stride: 0 } + array: { dims_count: 0, dims: [], stride: 0 } + member_count: 1 + members: + - *bv3 + type_description: *td5 +all_descriptor_bindings: +all_interface_variables: +module: + generator: 8 # Khronos Glslang Reference Front End + entry_point_name: "main" + entry_point_id: 4 + source_language: 2 # GLSL + source_language_version: 460 + spirv_execution_model: 5 # GLCompute + shader_stage: 0x00000020 # CS + descriptor_binding_count: 0 + descriptor_bindings: + descriptor_set_count: 0 + descriptor_sets: + input_variable_count: 0, + input_variables: + output_variable_count: 0, + output_variables: + push_constant_count: 1, + push_constants: + - *bv4 # "params" +... diff --git a/tests/glsl/buffer_pointer.spv.yaml b/tests/glsl/buffer_pointer.spv.yaml index 3e659c8e..26c3e43a 100644 --- a/tests/glsl/buffer_pointer.spv.yaml +++ b/tests/glsl/buffer_pointer.spv.yaml @@ -58,7 +58,7 @@ all_type_descriptions: type_name: "Data" struct_member_name: "data_ptr" storage_class: 5349 # PhysicalStorageBuffer - type_flags: 0x50080000 # STRUCT EXTERNAL_BLOCK ??? + type_flags: 0x50080000 # STRUCT REF EXTERNAL_BLOCK decoration_flags: 0x00000001 # BLOCK traits: numeric: