Add support for the ARM extended matrix layout

This commit is contained in:
Pedro Olsen Ferreira 2024-06-07 12:48:05 +01:00 committed by arcady-lunarg
parent 68821c4da8
commit 02263efcd6
8 changed files with 548 additions and 0 deletions

View file

@ -3705,6 +3705,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
idImmOps.push_back(spv::IdImmediate(true, operands[1])); // buf
if (node->getOp() == glslang::EOpCooperativeMatrixLoad) {
idImmOps.push_back(spv::IdImmediate(true, operands[3])); // matrixLayout
auto layout = builder.getConstantScalar(operands[3]);
if (layout == spv::CooperativeMatrixLayoutRowBlockedInterleavedARM ||
layout == spv::CooperativeMatrixLayoutColumnBlockedInterleavedARM) {
builder.addExtension(spv::E_SPV_ARM_cooperative_matrix_layouts);
builder.addCapability(spv::CapabilityCooperativeMatrixLayoutsARM);
}
idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride
} else {
idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride
@ -3729,6 +3735,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
idImmOps.push_back(spv::IdImmediate(true, operands[0])); // object
if (node->getOp() == glslang::EOpCooperativeMatrixStore) {
idImmOps.push_back(spv::IdImmediate(true, operands[3])); // matrixLayout
auto layout = builder.getConstantScalar(operands[3]);
if (layout == spv::CooperativeMatrixLayoutRowBlockedInterleavedARM ||
layout == spv::CooperativeMatrixLayoutColumnBlockedInterleavedARM) {
builder.addExtension(spv::E_SPV_ARM_cooperative_matrix_layouts);
builder.addCapability(spv::CapabilityCooperativeMatrixLayoutsARM);
}
idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride
} else {
idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride