diff options
Diffstat (limited to '3rdparty/bgfx/3rdparty/spirv-tools/source/opt/type_manager.cpp')
-rw-r--r-- | 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/type_manager.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/type_manager.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/type_manager.cpp index d3494819430..166b8281f60 100644 --- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/type_manager.cpp +++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/type_manager.cpp @@ -409,6 +409,22 @@ uint32_t TypeManager::GetTypeInstruction(const Type* type) { {static_cast<uint32_t>( type->AsForwardPointer()->storage_class())}}}); break; + case Type::kCooperativeMatrixNV: { + auto coop_mat = type->AsCooperativeMatrixNV(); + uint32_t const component_type = + GetTypeInstruction(coop_mat->component_type()); + if (component_type == 0) { + return 0; + } + typeInst = MakeUnique<Instruction>( + context(), SpvOpTypeCooperativeMatrixNV, 0, id, + std::initializer_list<Operand>{ + {SPV_OPERAND_TYPE_ID, {component_type}}, + {SPV_OPERAND_TYPE_SCOPE_ID, {coop_mat->scope_id()}}, + {SPV_OPERAND_TYPE_ID, {coop_mat->rows_id()}}, + {SPV_OPERAND_TYPE_ID, {coop_mat->columns_id()}}}); + break; + } default: assert(false && "Unexpected type"); break; @@ -604,6 +620,14 @@ Type* TypeManager::RebuildType(const Type& type) { } break; } + case Type::kCooperativeMatrixNV: { + const CooperativeMatrixNV* cm_type = type.AsCooperativeMatrixNV(); + const Type* component_type = cm_type->component_type(); + rebuilt_ty = MakeUnique<CooperativeMatrixNV>( + RebuildType(*component_type), cm_type->scope_id(), cm_type->rows_id(), + cm_type->columns_id()); + break; + } default: assert(false && "Unhandled type"); return nullptr; @@ -832,6 +856,12 @@ Type* TypeManager::RecordIfTypeDefinition(const Instruction& inst) { case SpvOpTypeAccelerationStructureNV: type = new AccelerationStructureNV(); break; + case SpvOpTypeCooperativeMatrixNV: + type = new CooperativeMatrixNV(GetType(inst.GetSingleWordInOperand(0)), + inst.GetSingleWordInOperand(1), + inst.GetSingleWordInOperand(2), + inst.GetSingleWordInOperand(3)); + break; default: SPIRV_UNIMPLEMENTED(consumer_, "unhandled type"); break; |