Implement support for GL_KHR_cooperative_matrix extension

This commit is contained in:
Boris Zanin 2023-03-16 13:01:01 +01:00 committed by arcady-lunarg
parent 91a97b4c69
commit 808c7ed17c
40 changed files with 8227 additions and 5733 deletions

View File

@ -55,5 +55,6 @@ static const char* const E_SPV_KHR_subgroup_uniform_control_flow = "SPV_KHR_subg
static const char* const E_SPV_KHR_fragment_shader_barycentric = "SPV_KHR_fragment_shader_barycentric";
static const char* const E_SPV_AMD_shader_early_and_late_fragment_tests = "SPV_AMD_shader_early_and_late_fragment_tests";
static const char* const E_SPV_KHR_ray_tracing_position_fetch = "SPV_KHR_ray_tracing_position_fetch";
static const char* const E_SPV_KHR_cooperative_matrix = "SPV_KHR_cooperative_matrix";
#endif // #ifndef GLSLextKHR_H

View File

@ -176,7 +176,7 @@ protected:
glslang::TLayoutPacking, const glslang::TQualifier&);
void decorateStructType(const glslang::TType&, const glslang::TTypeList* glslangStruct, glslang::TLayoutPacking,
const glslang::TQualifier&, spv::Id, const std::vector<spv::Id>& spvMembers);
spv::Id makeArraySizeId(const glslang::TArraySizes&, int dim);
spv::Id makeArraySizeId(const glslang::TArraySizes&, int dim, bool allowZero = false);
spv::Id accessChainLoad(const glslang::TType& type);
void accessChainStore(const glslang::TType& type, spv::Id rvalue);
void multiTypeStore(const glslang::TType&, spv::Id rValue);
@ -212,7 +212,7 @@ protected:
glslang::TBasicType typeProxy);
spv::Id createConversion(glslang::TOperator op, OpDecorations&, spv::Id destTypeId, spv::Id operand,
glslang::TBasicType typeProxy);
spv::Id createIntWidthConversion(glslang::TOperator op, spv::Id operand, int vectorSize);
spv::Id createIntWidthConversion(glslang::TOperator op, spv::Id operand, int vectorSize, spv::Id destType);
spv::Id makeSmearedConstant(spv::Id constant, int vectorSize);
spv::Id createAtomicOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId,
std::vector<spv::Id>& operands, glslang::TBasicType typeProxy,
@ -2560,12 +2560,15 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
spv::Id length;
if (node->getOperand()->getType().isCoopMat()) {
spec_constant_op_mode_setter.turnOnSpecConstantOpMode();
spv::Id typeId = convertGlslangToSpvType(node->getOperand()->getType());
assert(builder.isCooperativeMatrixType(typeId));
length = builder.createCooperativeMatrixLength(typeId);
if (node->getOperand()->getType().isCoopMatKHR()) {
length = builder.createCooperativeMatrixLengthKHR(typeId);
} else {
spec_constant_op_mode_setter.turnOnSpecConstantOpMode();
length = builder.createCooperativeMatrixLengthNV(typeId);
}
} else {
glslang::TIntermTyped* block = node->getOperand()->getAsBinaryNode()->getLeft();
block->traverse(this);
@ -3099,7 +3102,8 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
case glslang::EOpConstructStruct:
case glslang::EOpConstructTextureSampler:
case glslang::EOpConstructReference:
case glslang::EOpConstructCooperativeMatrix:
case glslang::EOpConstructCooperativeMatrixNV:
case glslang::EOpConstructCooperativeMatrixKHR:
{
builder.setLine(node->getLoc().line, node->getLoc().getFilename());
std::vector<spv::Id> arguments;
@ -3116,7 +3120,8 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
} else
constructed = builder.createOp(spv::OpSampledImage, resultType(), arguments);
} else if (node->getOp() == glslang::EOpConstructStruct ||
node->getOp() == glslang::EOpConstructCooperativeMatrix ||
node->getOp() == glslang::EOpConstructCooperativeMatrixNV ||
node->getOp() == glslang::EOpConstructCooperativeMatrixKHR ||
node->getType().isArray()) {
std::vector<spv::Id> constituents;
for (int c = 0; c < (int)arguments.size(); ++c)
@ -3291,6 +3296,8 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
break;
case glslang::EOpCooperativeMatrixLoad:
case glslang::EOpCooperativeMatrixStore:
case glslang::EOpCooperativeMatrixLoadNV:
case glslang::EOpCooperativeMatrixStoreNV:
noReturnValue = true;
break;
case glslang::EOpBeginInvocationInterlock:
@ -3502,10 +3509,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
lvalue = true;
break;
case glslang::EOpCooperativeMatrixLoad:
case glslang::EOpCooperativeMatrixLoadNV:
if (arg == 0 || arg == 1)
lvalue = true;
break;
case glslang::EOpCooperativeMatrixStore:
case glslang::EOpCooperativeMatrixStoreNV:
if (arg == 1)
lvalue = true;
break;
@ -3534,7 +3543,9 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
#ifndef GLSLANG_WEB
if (node->getOp() == glslang::EOpCooperativeMatrixLoad ||
node->getOp() == glslang::EOpCooperativeMatrixStore) {
node->getOp() == glslang::EOpCooperativeMatrixStore ||
node->getOp() == glslang::EOpCooperativeMatrixLoadNV ||
node->getOp() == glslang::EOpCooperativeMatrixStoreNV) {
if (arg == 1) {
// fold "element" parameter into the access chain
@ -3555,9 +3566,11 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
unsigned int alignment = builder.getAccessChain().alignment;
int memoryAccess = TranslateMemoryAccess(coherentFlags);
if (node->getOp() == glslang::EOpCooperativeMatrixLoad)
if (node->getOp() == glslang::EOpCooperativeMatrixLoad ||
node->getOp() == glslang::EOpCooperativeMatrixLoadNV)
memoryAccess &= ~spv::MemoryAccessMakePointerAvailableKHRMask;
if (node->getOp() == glslang::EOpCooperativeMatrixStore)
if (node->getOp() == glslang::EOpCooperativeMatrixStore ||
node->getOp() == glslang::EOpCooperativeMatrixStoreNV)
memoryAccess &= ~spv::MemoryAccessMakePointerVisibleKHRMask;
if (builder.getStorageClass(builder.getAccessChain().base) ==
spv::StorageClassPhysicalStorageBufferEXT) {
@ -3655,30 +3668,47 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
builder.setLine(node->getLoc().line, node->getLoc().getFilename());
#ifndef GLSLANG_WEB
if (node->getOp() == glslang::EOpCooperativeMatrixLoad) {
if (node->getOp() == glslang::EOpCooperativeMatrixLoad ||
node->getOp() == glslang::EOpCooperativeMatrixLoadNV) {
std::vector<spv::IdImmediate> idImmOps;
idImmOps.push_back(spv::IdImmediate(true, operands[1])); // buf
if (node->getOp() == glslang::EOpCooperativeMatrixLoad) {
idImmOps.push_back(spv::IdImmediate(true, operands[3])); // matrixLayout
idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride
} else {
idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride
idImmOps.push_back(spv::IdImmediate(true, operands[3])); // colMajor
}
idImmOps.insert(idImmOps.end(), memoryAccessOperands.begin(), memoryAccessOperands.end());
// get the pointee type
spv::Id typeId = builder.getContainedTypeId(builder.getTypeId(operands[0]));
assert(builder.isCooperativeMatrixType(typeId));
// do the op
spv::Id result = builder.createOp(spv::OpCooperativeMatrixLoadNV, typeId, idImmOps);
spv::Id result = node->getOp() == glslang::EOpCooperativeMatrixLoad
? builder.createOp(spv::OpCooperativeMatrixLoadKHR, typeId, idImmOps)
: builder.createOp(spv::OpCooperativeMatrixLoadNV, typeId, idImmOps);
// store the result to the pointer (out param 'm')
builder.createStore(result, operands[0]);
result = 0;
} else if (node->getOp() == glslang::EOpCooperativeMatrixStore) {
} else if (node->getOp() == glslang::EOpCooperativeMatrixStore ||
node->getOp() == glslang::EOpCooperativeMatrixStoreNV) {
std::vector<spv::IdImmediate> idImmOps;
idImmOps.push_back(spv::IdImmediate(true, operands[1])); // buf
idImmOps.push_back(spv::IdImmediate(true, operands[0])); // object
if (node->getOp() == glslang::EOpCooperativeMatrixStore) {
idImmOps.push_back(spv::IdImmediate(true, operands[3])); // matrixLayout
idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride
} else {
idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride
idImmOps.push_back(spv::IdImmediate(true, operands[3])); // colMajor
}
idImmOps.insert(idImmOps.end(), memoryAccessOperands.begin(), memoryAccessOperands.end());
if (node->getOp() == glslang::EOpCooperativeMatrixStore)
builder.createNoResultOp(spv::OpCooperativeMatrixStoreKHR, idImmOps);
else
builder.createNoResultOp(spv::OpCooperativeMatrixStoreNV, idImmOps);
result = 0;
} else if (node->getOp() == glslang::EOpRayQueryGetIntersectionTriangleVertexPositionsEXT) {
@ -3694,6 +3724,32 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
// store the result to the pointer (out param 'm')
builder.createStore(result, operands[2]);
result = 0;
} else if (node->getOp() == glslang::EOpCooperativeMatrixMulAdd) {
uint32_t matrixOperands = 0;
// If the optional operand is present, initialize matrixOperands to that value.
if (glslangOperands.size() == 4 && glslangOperands[3]->getAsConstantUnion()) {
matrixOperands = glslangOperands[3]->getAsConstantUnion()->getConstArray()[0].getIConst();
}
// Determine Cooperative Matrix Operands bits from the signedness of the types.
if (isTypeSignedInt(glslangOperands[0]->getAsTyped()->getBasicType()))
matrixOperands |= spv::CooperativeMatrixOperandsMatrixASignedComponentsMask;
if (isTypeSignedInt(glslangOperands[1]->getAsTyped()->getBasicType()))
matrixOperands |= spv::CooperativeMatrixOperandsMatrixBSignedComponentsMask;
if (isTypeSignedInt(glslangOperands[2]->getAsTyped()->getBasicType()))
matrixOperands |= spv::CooperativeMatrixOperandsMatrixCSignedComponentsMask;
if (isTypeSignedInt(node->getBasicType()))
matrixOperands |= spv::CooperativeMatrixOperandsMatrixResultSignedComponentsMask;
std::vector<spv::IdImmediate> idImmOps;
idImmOps.push_back(spv::IdImmediate(true, operands[0]));
idImmOps.push_back(spv::IdImmediate(true, operands[1]));
idImmOps.push_back(spv::IdImmediate(true, operands[2]));
if (matrixOperands != 0)
idImmOps.push_back(spv::IdImmediate(false, matrixOperands));
result = builder.createOp(spv::OpCooperativeMatrixMulAddKHR, resultType(), idImmOps);
} else
#endif
if (atomic) {
@ -4586,9 +4642,10 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
spvType = builder.makeVectorType(spvType, type.getVectorSize());
}
if (type.isCoopMat()) {
if (type.isCoopMatNV()) {
builder.addCapability(spv::CapabilityCooperativeMatrixNV);
builder.addExtension(spv::E_SPV_NV_cooperative_matrix);
if (type.getBasicType() == glslang::EbtFloat16)
builder.addCapability(spv::CapabilityFloat16);
if (type.getBasicType() == glslang::EbtUint8 ||
@ -4596,11 +4653,29 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
builder.addCapability(spv::CapabilityInt8);
}
spv::Id scope = makeArraySizeId(*type.getTypeParameters(), 1);
spv::Id rows = makeArraySizeId(*type.getTypeParameters(), 2);
spv::Id cols = makeArraySizeId(*type.getTypeParameters(), 3);
spv::Id scope = makeArraySizeId(*type.getTypeParameters()->arraySizes, 1);
spv::Id rows = makeArraySizeId(*type.getTypeParameters()->arraySizes, 2);
spv::Id cols = makeArraySizeId(*type.getTypeParameters()->arraySizes, 3);
spvType = builder.makeCooperativeMatrixType(spvType, scope, rows, cols);
spvType = builder.makeCooperativeMatrixTypeNV(spvType, scope, rows, cols);
}
if (type.isCoopMatKHR()) {
builder.addCapability(spv::CapabilityCooperativeMatrixKHR);
builder.addExtension(spv::E_SPV_KHR_cooperative_matrix);
if (type.getBasicType() == glslang::EbtFloat16)
builder.addCapability(spv::CapabilityFloat16);
if (type.getBasicType() == glslang::EbtUint8 || type.getBasicType() == glslang::EbtInt8) {
builder.addCapability(spv::CapabilityInt8);
}
spv::Id scope = makeArraySizeId(*type.getTypeParameters()->arraySizes, 0);
spv::Id rows = makeArraySizeId(*type.getTypeParameters()->arraySizes, 1);
spv::Id cols = makeArraySizeId(*type.getTypeParameters()->arraySizes, 2);
spv::Id use = builder.makeUintConstant(type.getCoopMatKHRuse());
spvType = builder.makeCooperativeMatrixTypeKHR(spvType, scope, rows, cols, use);
}
if (type.isArray()) {
@ -4951,7 +5026,7 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type,
// This is not quite trivial, because of specialization constants.
// Sometimes, a raw constant is turned into an Id, and sometimes
// a specialization constant expression is.
spv::Id TGlslangToSpvTraverser::makeArraySizeId(const glslang::TArraySizes& arraySizes, int dim)
spv::Id TGlslangToSpvTraverser::makeArraySizeId(const glslang::TArraySizes& arraySizes, int dim, bool allowZero)
{
// First, see if this is sized with a node, meaning a specialization constant:
glslang::TIntermTyped* specNode = arraySizes.getDimNode(dim);
@ -4965,7 +5040,10 @@ spv::Id TGlslangToSpvTraverser::makeArraySizeId(const glslang::TArraySizes& arra
// Otherwise, need a compile-time (front end) size, get it:
int size = arraySizes.getDimSize(dim);
if (!allowZero)
assert(size > 0);
return builder.makeUintConstant(size);
}
@ -7287,7 +7365,9 @@ spv::Id TGlslangToSpvTraverser::createUnaryMatrixOperation(spv::Op op, OpDecorat
// For converting integers where both the bitwidth and the signedness could
// change, but only do the width change here. The caller is still responsible
// for the signedness conversion.
spv::Id TGlslangToSpvTraverser::createIntWidthConversion(glslang::TOperator op, spv::Id operand, int vectorSize)
// destType is the final type that will be converted to, but this function
// may only be doing part of that conversion.
spv::Id TGlslangToSpvTraverser::createIntWidthConversion(glslang::TOperator op, spv::Id operand, int vectorSize, spv::Id destType)
{
// Get the result type width, based on the type to convert to.
int width = 32;
@ -7358,6 +7438,11 @@ spv::Id TGlslangToSpvTraverser::createIntWidthConversion(glslang::TOperator op,
if (vectorSize > 0)
type = builder.makeVectorType(type, vectorSize);
else if (builder.getOpCode(destType) == spv::OpTypeCooperativeMatrixKHR ||
builder.getOpCode(destType) == spv::OpTypeCooperativeMatrixNV) {
type = builder.makeCooperativeMatrixTypeWithSameShape(type, destType);
}
return builder.createUnaryOp(convOp, type, operand);
}
@ -7630,7 +7715,7 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, OpDecora
case glslang::EOpConvUint64ToInt16:
case glslang::EOpConvUint64ToInt:
// OpSConvert/OpUConvert + OpBitCast
operand = createIntWidthConversion(op, operand, vectorSize);
operand = createIntWidthConversion(op, operand, vectorSize, destType);
if (builder.isInSpecConstCodeGenMode()) {
// Build zero scalar or vector for OpIAdd.
@ -8963,7 +9048,7 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
case glslang::EOpSetMeshOutputsEXT:
builder.createNoResultOp(spv::OpSetMeshOutputsEXT, operands);
return 0;
case glslang::EOpCooperativeMatrixMulAdd:
case glslang::EOpCooperativeMatrixMulAddNV:
opCode = spv::OpCooperativeMatrixMulAddNV;
break;
case glslang::EOpHitObjectTraceRayNV:

View File

@ -680,6 +680,7 @@ namespace spv {
case spv::OperandKernelEnqueueFlags:
case spv::OperandKernelProfilingInfo:
case spv::OperandCapability:
case spv::OperandCooperativeMatrixOperands:
++word;
break;

View File

@ -481,15 +481,41 @@ Id Builder::makeMatrixType(Id component, int cols, int rows)
return type->getResultId();
}
Id Builder::makeCooperativeMatrixType(Id component, Id scope, Id rows, Id cols)
Id Builder::makeCooperativeMatrixTypeKHR(Id component, Id scope, Id rows, Id cols, Id use)
{
// try to find it
Instruction* type;
for (int t = 0; t < (int)groupedTypes[OpTypeCooperativeMatrixKHR].size(); ++t) {
type = groupedTypes[OpTypeCooperativeMatrixKHR][t];
if (type->getIdOperand(0) == component &&
type->getIdOperand(1) == scope &&
type->getIdOperand(2) == rows &&
type->getIdOperand(3) == cols &&
type->getIdOperand(4) == use)
return type->getResultId();
}
// not found, make it
type = new Instruction(getUniqueId(), NoType, OpTypeCooperativeMatrixKHR);
type->addIdOperand(component);
type->addIdOperand(scope);
type->addIdOperand(rows);
type->addIdOperand(cols);
type->addIdOperand(use);
groupedTypes[OpTypeCooperativeMatrixKHR].push_back(type);
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
module.mapInstruction(type);
return type->getResultId();
}
Id Builder::makeCooperativeMatrixTypeNV(Id component, Id scope, Id rows, Id cols)
{
// try to find it
Instruction* type;
for (int t = 0; t < (int)groupedTypes[OpTypeCooperativeMatrixNV].size(); ++t) {
type = groupedTypes[OpTypeCooperativeMatrixNV][t];
if (type->getIdOperand(0) == component &&
type->getIdOperand(1) == scope &&
type->getIdOperand(2) == rows &&
if (type->getIdOperand(0) == component && type->getIdOperand(1) == scope && type->getIdOperand(2) == rows &&
type->getIdOperand(3) == cols)
return type->getResultId();
}
@ -507,6 +533,17 @@ Id Builder::makeCooperativeMatrixType(Id component, Id scope, Id rows, Id cols)
return type->getResultId();
}
Id Builder::makeCooperativeMatrixTypeWithSameShape(Id component, Id otherType)
{
Instruction* instr = module.getInstruction(otherType);
if (instr->getOpCode() == OpTypeCooperativeMatrixNV) {
return makeCooperativeMatrixTypeNV(component, instr->getIdOperand(1), instr->getIdOperand(2), instr->getIdOperand(3));
} else {
assert(instr->getOpCode() == OpTypeCooperativeMatrixKHR);
return makeCooperativeMatrixTypeKHR(component, instr->getIdOperand(1), instr->getIdOperand(2), instr->getIdOperand(3), instr->getIdOperand(4));
}
}
Id Builder::makeGenericType(spv::Op opcode, std::vector<spv::IdImmediate>& operands)
{
// try to find it
@ -1254,6 +1291,7 @@ int Builder::getNumTypeConstituents(Id typeId) const
}
case OpTypeStruct:
return instr->getNumOperands();
case OpTypeCooperativeMatrixKHR:
case OpTypeCooperativeMatrixNV:
// has only one constituent when used with OpCompositeConstruct.
return 1;
@ -1303,6 +1341,7 @@ Id Builder::getContainedTypeId(Id typeId, int member) const
case OpTypeMatrix:
case OpTypeArray:
case OpTypeRuntimeArray:
case OpTypeCooperativeMatrixKHR:
case OpTypeCooperativeMatrixNV:
return instr->getIdOperand(0);
case OpTypePointer:
@ -1769,6 +1808,7 @@ Id Builder::makeCompositeConstant(Id typeId, const std::vector<Id>& members, boo
case OpTypeVector:
case OpTypeArray:
case OpTypeMatrix:
case OpTypeCooperativeMatrixKHR:
case OpTypeCooperativeMatrixNV:
if (! specConstant) {
Id existing = findCompositeConstant(typeClass, typeId, members);
@ -2405,7 +2445,24 @@ Id Builder::createArrayLength(Id base, unsigned int member)
return length->getResultId();
}
Id Builder::createCooperativeMatrixLength(Id type)
Id Builder::createCooperativeMatrixLengthKHR(Id type)
{
spv::Id intType = makeUintType(32);
// Generate code for spec constants if in spec constant operation
// generation mode.
if (generatingOpCodeForSpecConst) {
return createSpecConstantOp(OpCooperativeMatrixLengthKHR, intType, std::vector<Id>(1, type), std::vector<Id>());
}
Instruction* length = new Instruction(getUniqueId(), intType, OpCooperativeMatrixLengthKHR);
length->addIdOperand(type);
buildPoint->addInstruction(std::unique_ptr<Instruction>(length));
return length->getResultId();
}
Id Builder::createCooperativeMatrixLengthNV(Id type)
{
spv::Id intType = makeUintType(32);

View File

@ -203,7 +203,9 @@ public:
Id makeImageType(Id sampledType, Dim, bool depth, bool arrayed, bool ms, unsigned sampled, ImageFormat format);
Id makeSamplerType();
Id makeSampledImageType(Id imageType);
Id makeCooperativeMatrixType(Id component, Id scope, Id rows, Id cols);
Id makeCooperativeMatrixTypeKHR(Id component, Id scope, Id rows, Id cols, Id use);
Id makeCooperativeMatrixTypeNV(Id component, Id scope, Id rows, Id cols);
Id makeCooperativeMatrixTypeWithSameShape(Id component, Id otherType);
Id makeGenericType(spv::Op opcode, std::vector<spv::IdImmediate>& operands);
// SPIR-V NonSemantic Shader DebugInfo Instructions
@ -286,7 +288,10 @@ public:
#ifdef GLSLANG_WEB
bool isCooperativeMatrixType(Id typeId)const { return false; }
#else
bool isCooperativeMatrixType(Id typeId)const { return getTypeClass(typeId) == OpTypeCooperativeMatrixNV; }
bool isCooperativeMatrixType(Id typeId)const
{
return getTypeClass(typeId) == OpTypeCooperativeMatrixKHR || getTypeClass(typeId) == OpTypeCooperativeMatrixNV;
}
#endif
bool isAggregateType(Id typeId) const
{ return isArrayType(typeId) || isStructType(typeId) || isCooperativeMatrixType(typeId); }
@ -464,8 +469,10 @@ public:
// Create an OpArrayLength instruction
Id createArrayLength(Id base, unsigned int member);
// Create an OpCooperativeMatrixLengthKHR instruction
Id createCooperativeMatrixLengthKHR(Id type);
// Create an OpCooperativeMatrixLengthNV instruction
Id createCooperativeMatrixLength(Id type);
Id createCooperativeMatrixLengthNV(Id type);
// Create an OpCompositeExtract instruction
Id createCompositeExtract(Id composite, Id typeId, unsigned index);

View File

@ -790,6 +790,21 @@ const char* MemoryAccessString(int mem)
}
}
const int CooperativeMatrixOperandsCeiling = 6;
const char* CooperativeMatrixOperandsString(int op)
{
switch (op) {
case CooperativeMatrixOperandsMatrixASignedComponentsShift: return "ASignedComponents";
case CooperativeMatrixOperandsMatrixBSignedComponentsShift: return "BSignedComponents";
case CooperativeMatrixOperandsMatrixCSignedComponentsShift: return "CSignedComponents";
case CooperativeMatrixOperandsMatrixResultSignedComponentsShift: return "ResultSignedComponents";
case CooperativeMatrixOperandsSaturatingAccumulationShift: return "SaturatingAccumulation";
default: return "Bad";
}
}
const char* ScopeString(int mem)
{
switch (mem) {
@ -993,6 +1008,7 @@ const char* CapabilityString(int info)
case CapabilityVariablePointers: return "VariablePointers";
case CapabilityCooperativeMatrixNV: return "CooperativeMatrixNV";
case CapabilityCooperativeMatrixKHR: return "CooperativeMatrixKHR";
case CapabilityShaderSMBuiltinsNV: return "ShaderSMBuiltinsNV";
case CapabilityFragmentShaderSampleInterlockEXT: return "CapabilityFragmentShaderSampleInterlockEXT";
@ -1473,6 +1489,11 @@ const char* OpcodeString(int op)
case OpCooperativeMatrixStoreNV: return "OpCooperativeMatrixStoreNV";
case OpCooperativeMatrixMulAddNV: return "OpCooperativeMatrixMulAddNV";
case OpCooperativeMatrixLengthNV: return "OpCooperativeMatrixLengthNV";
case OpTypeCooperativeMatrixKHR: return "OpTypeCooperativeMatrixKHR";
case OpCooperativeMatrixLoadKHR: return "OpCooperativeMatrixLoadKHR";
case OpCooperativeMatrixStoreKHR: return "OpCooperativeMatrixStoreKHR";
case OpCooperativeMatrixMulAddKHR: return "OpCooperativeMatrixMulAddKHR";
case OpCooperativeMatrixLengthKHR: return "OpCooperativeMatrixLengthKHR";
case OpDemoteToHelperInvocationEXT: return "OpDemoteToHelperInvocationEXT";
case OpIsHelperInvocationEXT: return "OpIsHelperInvocationEXT";
@ -1536,6 +1557,7 @@ EnumParameters LoopControlParams[FunctionControlCeiling];
EnumParameters SelectionControlParams[SelectControlCeiling];
EnumParameters FunctionControlParams[FunctionControlCeiling];
EnumParameters MemoryAccessParams[MemoryAccessCeiling];
EnumParameters CooperativeMatrixOperandsParams[CooperativeMatrixOperandsCeiling];
// Set up all the parameterizing descriptions of the opcodes, operands, etc.
void Parameterize()
@ -1630,6 +1652,8 @@ void Parameterize()
InstructionDesc[OpModuleProcessed].setResultAndType(false, false);
InstructionDesc[OpTypeCooperativeMatrixNV].setResultAndType(true, false);
InstructionDesc[OpCooperativeMatrixStoreNV].setResultAndType(false, false);
InstructionDesc[OpTypeCooperativeMatrixKHR].setResultAndType(true, false);
InstructionDesc[OpCooperativeMatrixStoreKHR].setResultAndType(false, false);
InstructionDesc[OpBeginInvocationInterlockEXT].setResultAndType(false, false);
InstructionDesc[OpEndInvocationInterlockEXT].setResultAndType(false, false);
@ -1701,6 +1725,7 @@ void Parameterize()
OperandClassParams[OperandKernelEnqueueFlags].set(0, KernelEnqueueFlagsString, nullptr);
OperandClassParams[OperandKernelProfilingInfo].set(0, KernelProfilingInfoString, nullptr, true);
OperandClassParams[OperandCapability].set(0, CapabilityString, nullptr);
OperandClassParams[OperandCooperativeMatrixOperands].set(CooperativeMatrixOperandsCeiling, CooperativeMatrixOperandsString, CooperativeMatrixOperandsParams, true);
OperandClassParams[OperandOpcode].set(OpCodeMask + 1, OpcodeString, nullptr);
// set name of operator, an initial set of <id> style operands, and the description
@ -3093,6 +3118,34 @@ void Parameterize()
InstructionDesc[OpCooperativeMatrixLengthNV].operands.push(OperandId, "'Type'");
InstructionDesc[OpTypeCooperativeMatrixKHR].operands.push(OperandId, "'Component Type'");
InstructionDesc[OpTypeCooperativeMatrixKHR].operands.push(OperandId, "'Scope'");
InstructionDesc[OpTypeCooperativeMatrixKHR].operands.push(OperandId, "'Rows'");
InstructionDesc[OpTypeCooperativeMatrixKHR].operands.push(OperandId, "'Columns'");
InstructionDesc[OpTypeCooperativeMatrixKHR].operands.push(OperandId, "'Use'");
InstructionDesc[OpCooperativeMatrixLoadKHR].operands.push(OperandId, "'Pointer'");
InstructionDesc[OpCooperativeMatrixLoadKHR].operands.push(OperandId, "'Memory Layout'");
InstructionDesc[OpCooperativeMatrixLoadKHR].operands.push(OperandId, "'Stride'");
InstructionDesc[OpCooperativeMatrixLoadKHR].operands.push(OperandMemoryAccess, "'Memory Access'");
InstructionDesc[OpCooperativeMatrixLoadKHR].operands.push(OperandLiteralNumber, "", true);
InstructionDesc[OpCooperativeMatrixLoadKHR].operands.push(OperandId, "", true);
InstructionDesc[OpCooperativeMatrixStoreKHR].operands.push(OperandId, "'Pointer'");
InstructionDesc[OpCooperativeMatrixStoreKHR].operands.push(OperandId, "'Object'");
InstructionDesc[OpCooperativeMatrixStoreKHR].operands.push(OperandId, "'Memory Layout'");
InstructionDesc[OpCooperativeMatrixStoreKHR].operands.push(OperandId, "'Stride'");
InstructionDesc[OpCooperativeMatrixStoreKHR].operands.push(OperandMemoryAccess, "'Memory Access'");
InstructionDesc[OpCooperativeMatrixStoreKHR].operands.push(OperandLiteralNumber, "", true);
InstructionDesc[OpCooperativeMatrixStoreKHR].operands.push(OperandId, "", true);
InstructionDesc[OpCooperativeMatrixMulAddKHR].operands.push(OperandId, "'A'");
InstructionDesc[OpCooperativeMatrixMulAddKHR].operands.push(OperandId, "'B'");
InstructionDesc[OpCooperativeMatrixMulAddKHR].operands.push(OperandId, "'C'");
InstructionDesc[OpCooperativeMatrixMulAddKHR].operands.push(OperandCooperativeMatrixOperands, "'Cooperative Matrix Operands'", true);
InstructionDesc[OpCooperativeMatrixLengthKHR].operands.push(OperandId, "'Type'");
InstructionDesc[OpDemoteToHelperInvocationEXT].setResultAndType(false, false);
InstructionDesc[OpReadClockKHR].operands.push(OperandScope, "'Scope'");

View File

@ -156,6 +156,7 @@ enum OperandClass {
OperandKernelEnqueueFlags,
OperandKernelProfilingInfo,
OperandCapability,
OperandCooperativeMatrixOperands,
OperandOpcode,

View File

@ -1144,6 +1144,7 @@ enum Capability {
CapabilityDotProduct = 6019,
CapabilityDotProductKHR = 6019,
CapabilityRayCullMaskKHR = 6020,
CapabilityCooperativeMatrixKHR = 6022,
CapabilityBitInstructions = 6025,
CapabilityGroupNonUniformRotateKHR = 6026,
CapabilityAtomicFloat32AddEXT = 6033,
@ -1261,6 +1262,37 @@ enum PackedVectorFormat {
PackedVectorFormatMax = 0x7fffffff,
};
enum CooperativeMatrixOperandsShift {
CooperativeMatrixOperandsMatrixASignedComponentsShift = 0,
CooperativeMatrixOperandsMatrixBSignedComponentsShift = 1,
CooperativeMatrixOperandsMatrixCSignedComponentsShift = 2,
CooperativeMatrixOperandsMatrixResultSignedComponentsShift = 3,
CooperativeMatrixOperandsSaturatingAccumulationShift = 4,
CooperativeMatrixOperandsMax = 0x7fffffff,
};
enum CooperativeMatrixOperandsMask {
CooperativeMatrixOperandsMaskNone = 0,
CooperativeMatrixOperandsMatrixASignedComponentsMask = 0x00000001,
CooperativeMatrixOperandsMatrixBSignedComponentsMask = 0x00000002,
CooperativeMatrixOperandsMatrixCSignedComponentsMask = 0x00000004,
CooperativeMatrixOperandsMatrixResultSignedComponentsMask = 0x00000008,
CooperativeMatrixOperandsSaturatingAccumulationMask = 0x00000010,
};
enum CooperativeMatrixLayout {
CooperativeMatrixLayoutCooperativeMatrixRowMajorKHR = 0,
CooperativeMatrixLayoutCooperativeMatrixColumnMajorKHR = 1,
CooperativeMatrixLayoutMax = 0x7fffffff,
};
enum CooperativeMatrixUse {
CooperativeMatrixUseMatrixAKHR = 0,
CooperativeMatrixUseMatrixBKHR = 1,
CooperativeMatrixUseMatrixAccumulatorKHR = 2,
CooperativeMatrixUseMax = 0x7fffffff,
};
enum Op {
OpNop = 0,
OpUndef = 1,
@ -1634,6 +1666,11 @@ enum Op {
OpUDotAccSatKHR = 4454,
OpSUDotAccSat = 4455,
OpSUDotAccSatKHR = 4455,
OpTypeCooperativeMatrixKHR = 4456,
OpCooperativeMatrixLoadKHR = 4457,
OpCooperativeMatrixStoreKHR = 4458,
OpCooperativeMatrixMulAddKHR = 4459,
OpCooperativeMatrixLengthKHR = 4460,
OpTypeRayQueryKHR = 4472,
OpRayQueryInitializeKHR = 4473,
OpRayQueryTerminateKHR = 4474,
@ -2346,6 +2383,11 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case OpSDotAccSat: *hasResult = true; *hasResultType = true; break;
case OpUDotAccSat: *hasResult = true; *hasResultType = true; break;
case OpSUDotAccSat: *hasResult = true; *hasResultType = true; break;
case OpTypeCooperativeMatrixKHR: *hasResult = true; *hasResultType = false; break;
case OpCooperativeMatrixLoadKHR: *hasResult = true; *hasResultType = true; break;
case OpCooperativeMatrixStoreKHR: *hasResult = false; *hasResultType = false; break;
case OpCooperativeMatrixMulAddKHR: *hasResult = true; *hasResultType = true; break;
case OpCooperativeMatrixLengthKHR: *hasResult = true; *hasResultType = true; break;
case OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break;
case OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break;
case OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break;
@ -2722,6 +2764,10 @@ inline FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShad
inline FragmentShadingRateMask operator&(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) & unsigned(b)); }
inline FragmentShadingRateMask operator^(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) ^ unsigned(b)); }
inline FragmentShadingRateMask operator~(FragmentShadingRateMask a) { return FragmentShadingRateMask(~unsigned(a)); }
inline CooperativeMatrixOperandsMask operator|(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) | unsigned(b)); }
inline CooperativeMatrixOperandsMask operator&(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) & unsigned(b)); }
inline CooperativeMatrixOperandsMask operator^(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) ^ unsigned(b)); }
inline CooperativeMatrixOperandsMask operator~(CooperativeMatrixOperandsMask a) { return CooperativeMatrixOperandsMask(~unsigned(a)); }
} // end namespace spv

View File

@ -0,0 +1,402 @@
spv.coopmatKHR.comp
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 250
Capability Shader
Capability Float16
Capability Int16
Capability Int8
Capability StorageUniformBufferBlock16
Capability VulkanMemoryModelKHR
Capability PhysicalStorageBufferAddressesEXT
Capability CooperativeMatrixKHR
Extension "SPV_KHR_16bit_storage"
Extension "SPV_KHR_cooperative_matrix"
Extension "SPV_KHR_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
Extension "SPV_KHR_vulkan_memory_model"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT VulkanKHR
EntryPoint GLCompute 4 "main"
ExecutionMode 4 LocalSize 64 1 1
Source GLSL 450
SourceExtension "GL_EXT_buffer_reference"
SourceExtension "GL_EXT_shader_explicit_arithmetic_types"
SourceExtension "GL_KHR_cooperative_matrix"
SourceExtension "GL_KHR_memory_scope_semantics"
Name 4 "main"
Name 15 "f16(f161;"
Name 14 "m"
Name 22 "f32(f1;"
Name 21 "m"
Name 35 "m"
Name 53 "m2"
Name 57 "x"
Name 65 "tempArg"
Name 69 "Block"
MemberName 69(Block) 0 "y"
MemberName 69(Block) 1 "x"
Name 71 "block"
Name 80 "tempArg"
Name 85 "Block16"
MemberName 85(Block16) 0 "y"
MemberName 85(Block16) 1 "x"
MemberName 85(Block16) 2 "b"
Name 88 "Block"
MemberName 88(Block) 0 "y"
MemberName 88(Block) 1 "x"
Name 90 "block16"
Name 97 "tempArg"
Name 110 "D"
Name 114 "A"
Name 118 "B"
Name 120 "C"
Name 124 "l"
Name 128 "Y"
Name 129 "Z"
Name 132 "F"
Name 137 "a"
Name 141 "md1"
Name 152 "mC2"
Name 157 "tempArg"
Name 163 "tempArg"
Name 169 "p1"
Name 170 "param"
Name 173 "p2"
Name 174 "param"
Name 188 "tempArg"
Name 193 "shmatrix"
Name 197 "ms"
Name 204 "ms8A"
Name 208 "ms8B"
Name 212 "ms8C"
Name 227 "m16"
Name 233 "mC"
Name 234 "F"
Name 239 "S"
MemberName 239(S) 0 "a"
MemberName 239(S) 1 "b"
MemberName 239(S) 2 "c"
Name 244 "SC"
Name 249 "scm"
Decorate 67 ArrayStride 4
Decorate 68 ArrayStride 4
MemberDecorate 69(Block) 0 Offset 0
MemberDecorate 69(Block) 1 Offset 4194304
Decorate 69(Block) Block
Decorate 71(block) DescriptorSet 0
Decorate 71(block) Binding 0
Decorate 81 ArrayStride 2
Decorate 83 ArrayStride 2
MemberDecorate 85(Block16) 0 Offset 0
MemberDecorate 85(Block16) 1 Offset 2097152
MemberDecorate 85(Block16) 2 Offset 2097160
Decorate 85(Block16) Block
Decorate 86 ArrayStride 4
Decorate 87 ArrayStride 4
MemberDecorate 88(Block) 0 Offset 0
MemberDecorate 88(Block) 1 Offset 4194304
Decorate 88(Block) Block
Decorate 90(block16) DescriptorSet 0
Decorate 90(block16) Binding 0
Decorate 128(Y) SpecId 0
Decorate 232 BuiltIn WorkgroupSize
Decorate 234(F) SpecId 1
Decorate 244(SC) SpecId 2
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 16
7: TypeInt 32 0
8: 7(int) Constant 3
9: 7(int) Constant 8
10: 7(int) Constant 2
11: TypeCooperativeMatrixKHR 6(float16_t) 8 9 9 10
12: TypePointer Function 11
13: TypeFunction 11 12(ptr)
17: TypeFloat 32
18: TypeCooperativeMatrixKHR 17(float) 8 9 9 10
19: TypePointer Function 18
20: TypeFunction 18 19(ptr)
32: 7(int) Constant 16
33: TypeCooperativeMatrixKHR 17(float) 8 32 9 10
34: TypePointer Function 33
36: 17(float) Constant 0
37: 33 ConstantComposite 36
46: 17(float) Constant 1073741824
51: TypeCooperativeMatrixKHR 6(float16_t) 8 32 9 10
52: TypePointer Function 51
56: TypePointer Function 17(float)
58: TypeInt 32 1
59: 58(int) Constant 1
62: 58(int) Constant 0
66: 7(int) Constant 1048576
67: TypeArray 17(float) 66
68: TypeRuntimeArray 17(float)
69(Block): TypeStruct 67 68
70: TypePointer StorageBuffer 69(Block)
71(block): 70(ptr) Variable StorageBuffer
72: 7(int) Constant 5
73: TypePointer StorageBuffer 17(float)
75: 7(int) Constant 128
81: TypeArray 6(float16_t) 66
82: 7(int) Constant 1
83: TypeArray 6(float16_t) 82
TypeForwardPointer 84 PhysicalStorageBufferEXT
85(Block16): TypeStruct 81 83 84
86: TypeArray 17(float) 66
87: TypeRuntimeArray 17(float)
88(Block): TypeStruct 86 87
84: TypePointer PhysicalStorageBufferEXT 88(Block)
89: TypePointer StorageBuffer 85(Block16)
90(block16): 89(ptr) Variable StorageBuffer
91: TypePointer StorageBuffer 6(float16_t)
98: 58(int) Constant 2
99: TypePointer StorageBuffer 84(ptr)
102: TypePointer PhysicalStorageBufferEXT 17(float)
111: 7(int) Constant 0
112: TypeCooperativeMatrixKHR 6(float16_t) 8 32 9 111
113: TypePointer Function 112
116: TypeCooperativeMatrixKHR 6(float16_t) 8 9 9 82
117: TypePointer Function 116
123: TypePointer Function 58(int)
127: 58(int) Constant 8
128(Y): 58(int) SpecConstant 2
129(Z): 58(int) SpecConstantOp 132 127 128(Y)
130: TypeCooperativeMatrixKHR 6(float16_t) 8 129(Z) 129(Z) 10
131: TypePointer Function 130
133:6(float16_t) Constant 0
134: 130 ConstantComposite 133
135: TypeArray 33 72
136: TypePointer Function 135
138: 58(int) Constant 3
139: 17(float) Constant 1065353216
145: 58(int) Constant 1234
149: TypeCooperativeMatrixKHR 6(float16_t) 8 129(Z) 9 10
150: TypeArray 149 8
151: TypePointer Private 150
152(mC2): 151(ptr) Variable Private
153: TypePointer Private 149
177: 11 ConstantComposite 133
178: 18 ConstantComposite 36
182:6(float16_t) Constant 16384
185: 17(float) Constant 1082130432
189: TypeVector 7(int) 4
190: 7(int) Constant 32
191: TypeArray 189(ivec4) 190
192: TypePointer Workgroup 191
193(shmatrix): 192(ptr) Variable Workgroup
194: TypePointer Workgroup 189(ivec4)
201: TypeInt 8 1
202: TypeCooperativeMatrixKHR 201(int8_t) 8 9 9 111
203: TypePointer Function 202
206: TypeCooperativeMatrixKHR 201(int8_t) 8 9 9 82
207: TypePointer Function 206
210: TypeCooperativeMatrixKHR 201(int8_t) 8 9 9 10
211: TypePointer Function 210
222: 58(int) Constant 16
224: TypeInt 16 1
225: TypeCooperativeMatrixKHR 224(int16_t) 8 9 9 111
226: TypePointer Function 225
230: TypeVector 7(int) 3
231: 7(int) Constant 64
232: 230(ivec3) ConstantComposite 231 82 82
233(mC): 153(ptr) Variable Private
234(F): 17(float) SpecConstant 1077936128
235: TypeCooperativeMatrixKHR 17(float) 8 129(Z) 9 10
236: 235 ConstantComposite 36
237:6(float16_t) Constant 15360
238: 11 ConstantComposite 237
239(S): TypeStruct 58(int) 58(int) 58(int)
240: 58(int) Constant 12
241: 58(int) Constant 23
242: 58(int) Constant 34
243: 239(S) ConstantComposite 240 241 242
244(SC): 58(int) SpecConstant 1
245: TypeCooperativeMatrixKHR 6(float16_t) 8 244(SC) 244(SC) 10
246: TypeArray 245 244(SC)
247: TypeArray 246 244(SC)
248: TypePointer Private 247
249(scm): 248(ptr) Variable Private
4(main): 2 Function None 3
5: Label
35(m): 34(ptr) Variable Function
53(m2): 52(ptr) Variable Function
57(x): 56(ptr) Variable Function
65(tempArg): 34(ptr) Variable Function
80(tempArg): 52(ptr) Variable Function
97(tempArg): 34(ptr) Variable Function
110(D): 34(ptr) Variable Function
114(A): 113(ptr) Variable Function
118(B): 117(ptr) Variable Function
120(C): 34(ptr) Variable Function
124(l): 123(ptr) Variable Function
132(F): 131(ptr) Variable Function
137(a): 136(ptr) Variable Function
141(md1): 56(ptr) Variable Function
157(tempArg): 34(ptr) Variable Function
163(tempArg): 52(ptr) Variable Function
169(p1): 12(ptr) Variable Function
170(param): 12(ptr) Variable Function
173(p2): 19(ptr) Variable Function
174(param): 19(ptr) Variable Function
188(tempArg): 52(ptr) Variable Function
197(ms): 52(ptr) Variable Function
204(ms8A): 203(ptr) Variable Function
208(ms8B): 207(ptr) Variable Function
212(ms8C): 211(ptr) Variable Function
227(m16): 226(ptr) Variable Function
Store 35(m) 37
38: 33 Load 35(m)
39: 33 Load 35(m)
40: 33 FAdd 38 39
Store 35(m) 40
41: 33 Load 35(m)
42: 33 Load 35(m)
43: 33 FSub 41 42
Store 35(m) 43
44: 33 Load 35(m)
45: 33 FNegate 44
Store 35(m) 45
47: 33 Load 35(m)
48: 33 MatrixTimesScalar 47 46
Store 35(m) 48
49: 33 Load 35(m)
50: 33 MatrixTimesScalar 49 46
Store 35(m) 50
54: 33 Load 35(m)
55: 51 FConvert 54
Store 53(m2) 55
60: 56(ptr) AccessChain 35(m) 59
61: 17(float) Load 60
Store 57(x) 61
63: 17(float) Load 57(x)
64: 56(ptr) AccessChain 35(m) 62
Store 64 63
74: 73(ptr) AccessChain 71(block) 59 32
76: 33 CooperativeMatrixLoadKHR 74 62 75 MakePointerVisibleKHR NonPrivatePointerKHR 72
Store 65(tempArg) 76
77: 33 Load 65(tempArg)
Store 35(m) 77
78: 33 Load 35(m)
79: 73(ptr) AccessChain 71(block) 59 32
CooperativeMatrixStoreKHR 79 78 62 75 MakePointerAvailableKHR NonPrivatePointerKHR 72
92: 91(ptr) AccessChain 90(block16) 59 32
93: 51 CooperativeMatrixLoadKHR 92 62 75 MakePointerVisibleKHR NonPrivatePointerKHR 72
Store 80(tempArg) 93
94: 51 Load 80(tempArg)
Store 53(m2) 94
95: 51 Load 53(m2)
96: 91(ptr) AccessChain 90(block16) 59 32
CooperativeMatrixStoreKHR 96 95 62 75 MakePointerAvailableKHR NonPrivatePointerKHR 72
100: 99(ptr) AccessChain 90(block16) 98
101: 84(ptr) Load 100 MakePointerVisibleKHR NonPrivatePointerKHR 72
103: 102(ptr) AccessChain 101 59 32
104: 33 CooperativeMatrixLoadKHR 103 62 75 Aligned MakePointerVisibleKHR NonPrivatePointerKHR 16 72
Store 97(tempArg) 104
105: 33 Load 97(tempArg)
Store 35(m) 105
106: 33 Load 35(m)
107: 99(ptr) AccessChain 90(block16) 98
108: 84(ptr) Load 107 MakePointerVisibleKHR NonPrivatePointerKHR 72
109: 102(ptr) AccessChain 108 59 32
CooperativeMatrixStoreKHR 109 106 62 75 Aligned MakePointerAvailableKHR NonPrivatePointerKHR 16 72
115: 112 Load 114(A)
119: 116 Load 118(B)
121: 33 Load 120(C)
122: 33 CooperativeMatrixMulAddKHR 115 119 121
Store 110(D) 122
125: 7(int) CooperativeMatrixLengthKHR 33
126: 58(int) Bitcast 125
Store 124(l) 126
Store 132(F) 134
140: 56(ptr) AccessChain 137(a) 138 62
Store 140 139
Store 141(md1) 36
142: 33 Load 35(m)
143: 33 Load 35(m)
144: 33 FAdd 143 142
Store 35(m) 144
146: 17(float) CompositeExtract 144 1234
147: 17(float) Load 141(md1)
148: 17(float) FAdd 147 146
Store 141(md1) 148
154: 153(ptr) AccessChain 152(mC2) 98
155: 149 Load 154
156: 153(ptr) AccessChain 152(mC2) 59
Store 156 155
158: 73(ptr) AccessChain 71(block) 62 32
159: 33 CooperativeMatrixLoadKHR 158 62 75 MakePointerVisibleKHR NonPrivatePointerKHR 72
Store 157(tempArg) 159
160: 33 Load 157(tempArg)
Store 35(m) 160
161: 33 Load 35(m)
162: 73(ptr) AccessChain 71(block) 62 32
CooperativeMatrixStoreKHR 162 161 62 75 MakePointerAvailableKHR NonPrivatePointerKHR 72
164: 91(ptr) AccessChain 90(block16) 62 32
165: 51 CooperativeMatrixLoadKHR 164 62 75 MakePointerVisibleKHR NonPrivatePointerKHR 72
Store 163(tempArg) 165
166: 51 Load 163(tempArg)
Store 53(m2) 166
167: 51 Load 53(m2)
168: 91(ptr) AccessChain 90(block16) 62 32
CooperativeMatrixStoreKHR 168 167 62 75 MakePointerAvailableKHR NonPrivatePointerKHR 72
171: 11 Load 169(p1)
Store 170(param) 171
172: 11 FunctionCall 15(f16(f161;) 170(param)
Store 169(p1) 172
175: 18 Load 173(p2)
Store 174(param) 175
176: 18 FunctionCall 22(f32(f1;) 174(param)
Store 173(p2) 176
Store 169(p1) 177
Store 173(p2) 178
179: 11 Load 169(p1)
180: 11 Load 169(p1)
181: 11 FDiv 180 179
Store 169(p1) 181
183: 11 Load 169(p1)
184: 11 MatrixTimesScalar 183 182
Store 169(p1) 184
186: 18 Load 173(p2)
187: 18 MatrixTimesScalar 186 185
Store 173(p2) 187
195: 194(ptr) AccessChain 193(shmatrix) 82
196: 51 CooperativeMatrixLoadKHR 195 62 10 MakePointerVisibleKHR NonPrivatePointerKHR 10
Store 188(tempArg) 196
198: 51 Load 188(tempArg)
Store 197(ms) 198
199: 51 Load 197(ms)
200: 194(ptr) AccessChain 193(shmatrix) 82
CooperativeMatrixStoreKHR 200 199 62 10 MakePointerAvailableKHR NonPrivatePointerKHR 10
205: 202 Load 204(ms8A)
209: 206 Load 208(ms8B)
213: 210 Load 212(ms8C)
214: 210 CooperativeMatrixMulAddKHR 205 209 213 ASignedComponents BSignedComponents CSignedComponents ResultSignedComponents
215: 202 Load 204(ms8A)
216: 206 Load 208(ms8B)
217: 210 Load 212(ms8C)
218: 210 CooperativeMatrixMulAddKHR 215 216 217 ASignedComponents BSignedComponents CSignedComponents ResultSignedComponents
219: 202 Load 204(ms8A)
220: 206 Load 208(ms8B)
221: 210 Load 212(ms8C)
223: 210 CooperativeMatrixMulAddKHR 219 220 221 ASignedComponents BSignedComponents CSignedComponents ResultSignedComponents SaturatingAccumulation
228: 225 Load 227(m16)
229: 194(ptr) AccessChain 193(shmatrix) 82
CooperativeMatrixStoreKHR 229 228 62 10 MakePointerAvailableKHR NonPrivatePointerKHR 10
Return
FunctionEnd
15(f16(f161;): 11 Function None 13
14(m): 12(ptr) FunctionParameter
16: Label
24: 11 Load 14(m)
25: 11 FNegate 24
ReturnValue 25
FunctionEnd
22(f32(f1;): 18 Function None 20
21(m): 19(ptr) FunctionParameter
23: Label
28: 18 Load 21(m)
29: 18 FNegate 28
ReturnValue 29
FunctionEnd

View File

@ -0,0 +1,38 @@
spv.coopmatKHR_Error.comp
ERROR: 0:8: 'ftemplate16' : unexpected type parameters
ERROR: 0:10: '' : coopmat missing type parameters
ERROR: 0:10: 'fnoparams' : unexpected number type parameters
ERROR: 0:17: 'void' : coopmat invalid basic type
ERROR: 0:17: 'fbadtype' : expected 8, 16, 32, or 64 bit signed or unsigned integer or 16, 32, or 64 bit float type
ERROR: 0:17: 'fbadtype' : illegal use of type 'void'
ERROR: 0:18: '' : type parameter must be a constant integer expression
ERROR: 0:18: 'void' : coopmat invalid basic type
ERROR: 0:18: '' : coopmat incorrect number of type parameters
ERROR: 0:18: 'fbadtype2' : unexpected number type parameters
ERROR: 0:18: 'fbadtype2' : expected 8, 16, 32, or 64 bit signed or unsigned integer or 16, 32, or 64 bit float type
ERROR: 0:18: 'fbadtype2' : illegal use of type 'void'
ERROR: 0:19: 'void' : coopmat invalid basic type
ERROR: 0:19: '' : coopmat incorrect number of type parameters
ERROR: 0:19: 'fbadtype3' : unexpected number type parameters
ERROR: 0:19: 'fbadtype3' : expected 8, 16, 32, or 64 bit signed or unsigned integer or 16, 32, or 64 bit float type
ERROR: 0:19: 'fbadtype3' : illegal use of type 'void'
ERROR: 0:21: '' : coopmat incorrect number of type parameters
ERROR: 0:25: '' : type parameter must be a constant integer expression
ERROR: 0:29: '' : coopmat incorrect number of type parameters
ERROR: 0:29: 'Cooperative matrix types must not be used in shared memory' : qualifier
ERROR: 0:32: 'bufmat' : member of block cannot be or contain a cooperative matrix type
ERROR: 0:41: 'assign' : cannot convert from ' temp coopmat<3, 16, 8, 0> float16_t' to ' temp coopmat<3, 16, 8, 0> float'
ERROR: 0:42: 'assign' : cannot convert from ' temp coopmat<3, 16, 8, 0> float16_t' to ' temp coopmat<3, 16, 8, 0> float'
ERROR: 0:47: 'assign' : cannot convert from ' temp coopmat<3, 8, 8, 0> float16_t' to ' temp coopmat<3, 16, 8, 0> float16_t'
ERROR: 0:53: 'assign' : cannot convert from ' temp coopmat<3, 8, 1, 0> float16_t' to ' temp coopmat<3, 8, 1, 0> float16_t'
ERROR: 0:56: 'constructor' : too many arguments
ERROR: 0:56: 'assign' : cannot convert from ' const float' to ' temp coopmat<3, 8, 8, 0> float16_t'
ERROR: 0:60: 'constructor' : Cooperative matrix constructor argument must be scalar or cooperative matrix
ERROR: 0:60: '=' : cannot convert from ' const float' to ' temp coopmat<3, 4, 4, 0> float'
ERROR: 0:63: 'expression' : left of '[' is not of type array, matrix, or vector
ERROR: 0:66: '.' : cannot apply to a cooperative matrix type: x
ERROR: 0:68: 'transpose' : no matching overloaded function found
ERROR: 33 compilation errors. No code generated.
SPIR-V is not generated for failed compile or link

View File

@ -0,0 +1,248 @@
spv.coopmatKHR_arithmetic.comp
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 196
Capability Shader
Capability Float16
Capability Int8
Capability VulkanMemoryModelKHR
Capability CooperativeMatrixKHR
Extension "SPV_KHR_cooperative_matrix"
Extension "SPV_KHR_vulkan_memory_model"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical VulkanKHR
EntryPoint GLCompute 4 "main"
ExecutionMode 4 LocalSize 64 1 1
Source GLSL 450
SourceExtension "GL_EXT_shader_explicit_arithmetic_types"
SourceExtension "GL_KHR_cooperative_matrix"
SourceExtension "GL_KHR_memory_scope_semantics"
Name 4 "main"
Name 13 "f"
Name 48 "f16"
Name 82 "u32"
Name 117 "u8"
Name 152 "i8"
Decorate 195 BuiltIn WorkgroupSize
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeInt 32 0
8: 7(int) Constant 3
9: 7(int) Constant 8
10: 7(int) Constant 0
11: TypeCooperativeMatrixKHR 6(float) 8 9 9 10
12: TypePointer Function 11
39: 6(float) Constant 1073741824
45: TypeFloat 16
46: TypeCooperativeMatrixKHR 45(float16_t) 8 9 9 10
47: TypePointer Function 46
74:45(float16_t) Constant 16384
80: TypeCooperativeMatrixKHR 7(int) 8 9 9 10
81: TypePointer Function 80
108: 7(int) Constant 2
114: TypeInt 8 0
115: TypeCooperativeMatrixKHR 114(int8_t) 8 9 9 10
116: TypePointer Function 115
143: 114(int8_t) Constant 2
149: TypeInt 8 1
150: TypeCooperativeMatrixKHR 149(int8_t) 8 9 9 10
151: TypePointer Function 150
178: 149(int8_t) Constant 2
192: TypeVector 7(int) 3
193: 7(int) Constant 64
194: 7(int) Constant 1
195: 192(ivec3) ConstantComposite 193 194 194
4(main): 2 Function None 3
5: Label
13(f): 12(ptr) Variable Function
48(f16): 47(ptr) Variable Function
82(u32): 81(ptr) Variable Function
117(u8): 116(ptr) Variable Function
152(i8): 151(ptr) Variable Function
14: 11 Load 13(f)
15: 11 Load 13(f)
16: 11 FAdd 14 15
17: 11 Load 13(f)
18: 11 Load 13(f)
19: 11 FSub 17 18
20: 11 Load 13(f)
21: 11 Load 13(f)
22: 11 FMul 20 21
23: 11 Load 13(f)
24: 11 Load 13(f)
25: 11 FDiv 23 24
26: 11 Load 13(f)
27: 11 Load 13(f)
28: 11 FAdd 27 26
Store 13(f) 28
29: 11 Load 13(f)
30: 11 Load 13(f)
31: 11 FSub 30 29
Store 13(f) 31
32: 11 Load 13(f)
33: 11 Load 13(f)
34: 11 FMul 33 32
Store 13(f) 34
35: 11 Load 13(f)
36: 11 Load 13(f)
37: 11 FDiv 36 35
Store 13(f) 37
38: 11 Load 13(f)
40: 11 MatrixTimesScalar 38 39
41: 11 Load 13(f)
42: 11 MatrixTimesScalar 41 39
43: 11 Load 13(f)
44: 11 MatrixTimesScalar 43 39
Store 13(f) 44
49: 46 Load 48(f16)
50: 46 Load 48(f16)
51: 46 FAdd 49 50
52: 46 Load 48(f16)
53: 46 Load 48(f16)
54: 46 FSub 52 53
55: 46 Load 48(f16)
56: 46 Load 48(f16)
57: 46 FMul 55 56
58: 46 Load 48(f16)
59: 46 Load 48(f16)
60: 46 FDiv 58 59
61: 46 Load 48(f16)
62: 46 Load 48(f16)
63: 46 FAdd 62 61
Store 48(f16) 63
64: 46 Load 48(f16)
65: 46 Load 48(f16)
66: 46 FSub 65 64
Store 48(f16) 66
67: 46 Load 48(f16)
68: 46 Load 48(f16)
69: 46 FMul 68 67
Store 48(f16) 69
70: 46 Load 48(f16)
71: 46 Load 48(f16)
72: 46 FDiv 71 70
Store 48(f16) 72
73: 46 Load 48(f16)
75: 46 MatrixTimesScalar 73 74
76: 46 Load 48(f16)
77: 46 MatrixTimesScalar 76 74
78: 46 Load 48(f16)
79: 46 MatrixTimesScalar 78 74
Store 48(f16) 79
83: 80 Load 82(u32)
84: 80 Load 82(u32)
85: 80 IAdd 83 84
86: 80 Load 82(u32)
87: 80 Load 82(u32)
88: 80 ISub 86 87
89: 80 Load 82(u32)
90: 80 Load 82(u32)
91: 80 IMul 89 90
92: 80 Load 82(u32)
93: 80 Load 82(u32)
94: 80 UDiv 92 93
95: 80 Load 82(u32)
96: 80 Load 82(u32)
97: 80 IAdd 96 95
Store 82(u32) 97
98: 80 Load 82(u32)
99: 80 Load 82(u32)
100: 80 ISub 99 98
Store 82(u32) 100
101: 80 Load 82(u32)
102: 80 Load 82(u32)
103: 80 IMul 102 101
Store 82(u32) 103
104: 80 Load 82(u32)
105: 80 Load 82(u32)
106: 80 UDiv 105 104
Store 82(u32) 106
107: 80 Load 82(u32)
109: 80 MatrixTimesScalar 107 108
110: 80 Load 82(u32)
111: 80 MatrixTimesScalar 110 108
112: 80 Load 82(u32)
113: 80 MatrixTimesScalar 112 108
Store 82(u32) 113
118: 115 Load 117(u8)
119: 115 Load 117(u8)
120: 115 IAdd 118 119
121: 115 Load 117(u8)
122: 115 Load 117(u8)
123: 115 ISub 121 122
124: 115 Load 117(u8)
125: 115 Load 117(u8)
126: 115 IMul 124 125
127: 115 Load 117(u8)
128: 115 Load 117(u8)
129: 115 UDiv 127 128
130: 115 Load 117(u8)
131: 115 Load 117(u8)
132: 115 IAdd 131 130
Store 117(u8) 132
133: 115 Load 117(u8)
134: 115 Load 117(u8)
135: 115 ISub 134 133
Store 117(u8) 135
136: 115 Load 117(u8)
137: 115 Load 117(u8)
138: 115 IMul 137 136
Store 117(u8) 138
139: 115 Load 117(u8)
140: 115 Load 117(u8)
141: 115 UDiv 140 139
Store 117(u8) 141
142: 115 Load 117(u8)
144: 115 MatrixTimesScalar 142 143
145: 115 Load 117(u8)
146: 115 MatrixTimesScalar 145 143
147: 115 Load 117(u8)
148: 115 MatrixTimesScalar 147 143
Store 117(u8) 148
153: 150 Load 152(i8)
154: 150 Load 152(i8)
155: 150 IAdd 153 154
156: 150 Load 152(i8)
157: 150 Load 152(i8)
158: 150 ISub 156 157
159: 150 Load 152(i8)
160: 150 Load 152(i8)
161: 150 IMul 159 160
162: 150 Load 152(i8)
163: 150 Load 152(i8)
164: 150 SDiv 162 163
165: 150 Load 152(i8)
166: 150 Load 152(i8)
167: 150 IAdd 166 165
Store 152(i8) 167
168: 150 Load 152(i8)
169: 150 Load 152(i8)
170: 150 ISub 169 168
Store 152(i8) 170
171: 150 Load 152(i8)
172: 150 Load 152(i8)
173: 150 IMul 172 171
Store 152(i8) 173
174: 150 Load 152(i8)
175: 150 Load 152(i8)
176: 150 SDiv 175 174
Store 152(i8) 176
177: 150 Load 152(i8)
179: 150 MatrixTimesScalar 177 178
180: 150 Load 152(i8)
181: 150 MatrixTimesScalar 180 178
182: 150 Load 152(i8)
183: 150 MatrixTimesScalar 182 178
Store 152(i8) 183
184: 11 Load 13(f)
185: 11 FNegate 184
186: 46 Load 48(f16)
187: 46 FNegate 186
188: 150 Load 152(i8)
189: 150 SNegate 188
190: 115 Load 117(u8)
191: 115 SNegate 190
Return
FunctionEnd

View File

@ -0,0 +1,64 @@
spv.coopmatKHR_arithmeticError.comp
ERROR: 0:21: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> float' and a right operand of type ' const float' (or there is no acceptable conversion)
ERROR: 0:22: '-' : wrong operand types: no operation '-' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> float' and a right operand of type ' const float' (or there is no acceptable conversion)
ERROR: 0:23: '/' : wrong operand types: no operation '/' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> float' and a right operand of type ' const float' (or there is no acceptable conversion)
ERROR: 0:24: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type ' const float' and a right operand of type ' temp coopmat<3, 8, 8, 0> float' (or there is no acceptable conversion)
ERROR: 0:25: '-' : wrong operand types: no operation '-' exists that takes a left-hand operand of type ' const float' and a right operand of type ' temp coopmat<3, 8, 8, 0> float' (or there is no acceptable conversion)
ERROR: 0:26: '/' : wrong operand types: no operation '/' exists that takes a left-hand operand of type ' const float' and a right operand of type ' temp coopmat<3, 8, 8, 0> float' (or there is no acceptable conversion)
ERROR: 0:27: 'assign' : cannot convert from ' const float' to ' temp coopmat<3, 8, 8, 0> float'
ERROR: 0:28: 'assign' : cannot convert from ' const float' to ' temp coopmat<3, 8, 8, 0> float'
ERROR: 0:29: 'assign' : cannot convert from ' const float' to ' temp coopmat<3, 8, 8, 0> float'
ERROR: 0:31: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> float' and a right operand of type ' temp coopmat<3, 8, 8, 0> float16_t' (or there is no acceptable conversion)
ERROR: 0:32: '-' : wrong operand types: no operation '-' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> float' and a right operand of type ' temp coopmat<3, 8, 8, 0> float16_t' (or there is no acceptable conversion)
ERROR: 0:33: '*' : wrong operand types: no operation '*' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> float' and a right operand of type ' temp coopmat<3, 8, 8, 0> float16_t' (or there is no acceptable conversion)
ERROR: 0:34: '/' : wrong operand types: no operation '/' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> float' and a right operand of type ' temp coopmat<3, 8, 8, 0> float16_t' (or there is no acceptable conversion)
ERROR: 0:35: 'assign' : cannot convert from ' temp coopmat<3, 8, 8, 0> float16_t' to ' temp coopmat<3, 8, 8, 0> float'
ERROR: 0:36: 'assign' : cannot convert from ' temp coopmat<3, 8, 8, 0> float16_t' to ' temp coopmat<3, 8, 8, 0> float'
ERROR: 0:37: 'assign' : cannot convert from ' temp coopmat<3, 8, 8, 0> float16_t' to ' temp coopmat<3, 8, 8, 0> float'
ERROR: 0:38: 'assign' : cannot convert from ' temp coopmat<3, 8, 8, 0> float16_t' to ' temp coopmat<3, 8, 8, 0> float'
ERROR: 0:40: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> float' and a right operand of type ' temp coopmat<3, 8, 8, 1> float' (or there is no acceptable conversion)
ERROR: 0:41: '-' : wrong operand types: no operation '-' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> float' and a right operand of type ' temp coopmat<3, 8, 8, 1> float' (or there is no acceptable conversion)
ERROR: 0:42: '*' : wrong operand types: no operation '*' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> float' and a right operand of type ' temp coopmat<3, 8, 8, 1> float' (or there is no acceptable conversion)
ERROR: 0:43: '/' : wrong operand types: no operation '/' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> float' and a right operand of type ' temp coopmat<3, 8, 8, 1> float' (or there is no acceptable conversion)
ERROR: 0:44: 'assign' : cannot convert from ' temp coopmat<3, 8, 8, 1> float' to ' temp coopmat<3, 8, 8, 0> float'
ERROR: 0:45: 'assign' : cannot convert from ' temp coopmat<3, 8, 8, 1> float' to ' temp coopmat<3, 8, 8, 0> float'
ERROR: 0:46: 'assign' : cannot convert from ' temp coopmat<3, 8, 8, 1> float' to ' temp coopmat<3, 8, 8, 0> float'
ERROR: 0:47: 'assign' : cannot convert from ' temp coopmat<3, 8, 8, 1> float' to ' temp coopmat<3, 8, 8, 0> float'
ERROR: 0:49: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> float' and a right operand of type ' temp coopmat<3, 16, 8, 0> float' (or there is no acceptable conversion)
ERROR: 0:50: '-' : wrong operand types: no operation '-' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> float' and a right operand of type ' temp coopmat<3, 16, 8, 0> float' (or there is no acceptable conversion)
ERROR: 0:51: '*' : wrong operand types: no operation '*' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> float' and a right operand of type ' temp coopmat<3, 16, 8, 0> float' (or there is no acceptable conversion)
ERROR: 0:52: '/' : wrong operand types: no operation '/' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> float' and a right operand of type ' temp coopmat<3, 16, 8, 0> float' (or there is no acceptable conversion)
ERROR: 0:53: 'assign' : cannot convert from ' temp coopmat<3, 16, 8, 0> float' to ' temp coopmat<3, 8, 8, 0> float'
ERROR: 0:54: 'assign' : cannot convert from ' temp coopmat<3, 16, 8, 0> float' to ' temp coopmat<3, 8, 8, 0> float'
ERROR: 0:55: 'assign' : cannot convert from ' temp coopmat<3, 16, 8, 0> float' to ' temp coopmat<3, 8, 8, 0> float'
ERROR: 0:56: 'assign' : cannot convert from ' temp coopmat<3, 16, 8, 0> float' to ' temp coopmat<3, 8, 8, 0> float'
ERROR: 0:58: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> uint8_t' and a right operand of type ' temp coopmat<3, 8, 8, 0> int8_t' (or there is no acceptable conversion)
ERROR: 0:59: '-' : wrong operand types: no operation '-' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> uint8_t' and a right operand of type ' temp coopmat<3, 8, 8, 0> int8_t' (or there is no acceptable conversion)
ERROR: 0:60: '*' : wrong operand types: no operation '*' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> uint8_t' and a right operand of type ' temp coopmat<3, 8, 8, 0> int8_t' (or there is no acceptable conversion)
ERROR: 0:61: '/' : wrong operand types: no operation '/' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> uint8_t' and a right operand of type ' temp coopmat<3, 8, 8, 0> int8_t' (or there is no acceptable conversion)
ERROR: 0:62: 'assign' : cannot convert from ' temp coopmat<3, 8, 8, 0> int8_t' to ' temp coopmat<3, 8, 8, 0> uint8_t'
ERROR: 0:63: 'assign' : cannot convert from ' temp coopmat<3, 8, 8, 0> int8_t' to ' temp coopmat<3, 8, 8, 0> uint8_t'
ERROR: 0:64: 'assign' : cannot convert from ' temp coopmat<3, 8, 8, 0> int8_t' to ' temp coopmat<3, 8, 8, 0> uint8_t'
ERROR: 0:65: 'assign' : cannot convert from ' temp coopmat<3, 8, 8, 0> int8_t' to ' temp coopmat<3, 8, 8, 0> uint8_t'
ERROR: 0:67: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> uint8_t' and a right operand of type ' const uint8_t' (or there is no acceptable conversion)
ERROR: 0:68: '-' : wrong operand types: no operation '-' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> uint8_t' and a right operand of type ' const uint8_t' (or there is no acceptable conversion)
ERROR: 0:69: '/' : wrong operand types: no operation '/' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> uint8_t' and a right operand of type ' const uint8_t' (or there is no acceptable conversion)
ERROR: 0:70: 'assign' : cannot convert from ' const uint8_t' to ' temp coopmat<3, 8, 8, 0> uint8_t'
ERROR: 0:71: 'assign' : cannot convert from ' const uint8_t' to ' temp coopmat<3, 8, 8, 0> uint8_t'
ERROR: 0:72: 'assign' : cannot convert from ' const uint8_t' to ' temp coopmat<3, 8, 8, 0> uint8_t'
ERROR: 0:74: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> int8_t' and a right operand of type ' const int8_t' (or there is no acceptable conversion)
ERROR: 0:75: '-' : wrong operand types: no operation '-' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> int8_t' and a right operand of type ' const int8_t' (or there is no acceptable conversion)
ERROR: 0:76: '/' : wrong operand types: no operation '/' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> int8_t' and a right operand of type ' const int8_t' (or there is no acceptable conversion)
ERROR: 0:77: 'assign' : cannot convert from ' const int8_t' to ' temp coopmat<3, 8, 8, 0> int8_t'
ERROR: 0:78: 'assign' : cannot convert from ' const int8_t' to ' temp coopmat<3, 8, 8, 0> int8_t'
ERROR: 0:79: 'assign' : cannot convert from ' const int8_t' to ' temp coopmat<3, 8, 8, 0> int8_t'
ERROR: 0:81: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> int' and a right operand of type ' const int' (or there is no acceptable conversion)
ERROR: 0:82: '-' : wrong operand types: no operation '-' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> int' and a right operand of type ' const int' (or there is no acceptable conversion)
ERROR: 0:83: '/' : wrong operand types: no operation '/' exists that takes a left-hand operand of type ' temp coopmat<3, 8, 8, 0> int' and a right operand of type ' const int' (or there is no acceptable conversion)
ERROR: 0:84: 'assign' : cannot convert from ' const int' to ' temp coopmat<3, 8, 8, 0> int'
ERROR: 0:85: 'assign' : cannot convert from ' const int' to ' temp coopmat<3, 8, 8, 0> int'
ERROR: 0:86: 'assign' : cannot convert from ' const int' to ' temp coopmat<3, 8, 8, 0> int'
ERROR: 59 compilation errors. No code generated.
SPIR-V is not generated for failed compile or link

View File

@ -0,0 +1,632 @@
spv.coopmatKHR_constructor.comp
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 481
Capability Shader
Capability Float16
Capability Int16
Capability Int8
Capability VulkanMemoryModelKHR
Capability CooperativeMatrixKHR
Extension "SPV_KHR_cooperative_matrix"
Extension "SPV_KHR_vulkan_memory_model"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical VulkanKHR
EntryPoint GLCompute 4 "main"
ExecutionMode 4 LocalSize 64 1 1
Source GLSL 450
SourceExtension "GL_EXT_shader_explicit_arithmetic_types"
SourceExtension "GL_KHR_cooperative_matrix"
SourceExtension "GL_KHR_memory_scope_semantics"
Name 4 "main"
Name 154 "v"
Name 158 "v"
Name 164 "v"
Name 170 "v"
Name 176 "v"
Name 182 "v"
Name 188 "v"
Name 194 "v"
Name 199 "v"
Name 204 "v"
Name 207 "v"
Name 212 "v"
Name 217 "v"
Name 222 "v"
Name 227 "v"
Name 232 "v"
Name 237 "v"
Name 242 "v"
Name 247 "v"
Name 250 "v"
Name 255 "v"
Name 260 "v"
Name 265 "v"
Name 271 "v"
Name 277 "v"
Name 282 "v"
Name 287 "v"
Name 292 "v"
Name 295 "v"
Name 300 "v"
Name 306 "v"
Name 311 "v"
Name 317 "v"
Name 322 "v"
Name 327 "v"
Name 332 "v"
Name 337 "v"
Name 340 "v"
Name 346 "v"
Name 352 "v"
Name 357 "v"
Name 362 "v"
Name 367 "v"
Name 372 "v"
Name 378 "v"
Name 384 "v"
Name 387 "v"
Name 392 "v"
Name 397 "v"
Name 402 "v"
Name 407 "v"
Name 413 "v"
Name 418 "v"
Name 424 "v"
Name 429 "v"
Name 432 "v"
Name 437 "v"
Name 442 "v"
Name 447 "v"
Name 453 "v"
Name 459 "v"
Name 464 "v"
Name 469 "v"
Name 474 "v"
Decorate 480 BuiltIn WorkgroupSize
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeInt 32 0
8: 7(int) Constant 3
9: 7(int) Constant 8
10: 7(int) Constant 0
11: TypeCooperativeMatrixKHR 6(float) 8 9 9 10
12: 6(float) Constant 1065353216
13: 11 ConstantComposite 12
14: 6(float) Constant 1073741824
15: 11 ConstantComposite 14
16: 6(float) Constant 1077936128
17: 11 ConstantComposite 16
18: 6(float) Constant 1082130432
19: 11 ConstantComposite 18
20: 6(float) Constant 1084227584
21: 11 ConstantComposite 20
22: 6(float) Constant 1086324736
23: 11 ConstantComposite 22
24: 6(float) Constant 1088421888
25: 11 ConstantComposite 24
26: 6(float) Constant 1090519040
27: 11 ConstantComposite 26
28: TypeFloat 16
29: TypeCooperativeMatrixKHR 28(float16_t) 8 9 9 10
30:28(float16_t) Constant 18816
31: 29 ConstantComposite 30
32:28(float16_t) Constant 18944
33: 29 ConstantComposite 32
34:28(float16_t) Constant 19072
35: 29 ConstantComposite 34
36:28(float16_t) Constant 19200
37: 29 ConstantComposite 36
38:28(float16_t) Constant 19328
39: 29 ConstantComposite 38
40:28(float16_t) Constant 19456
41: 29 ConstantComposite 40
42:28(float16_t) Constant 19520
43: 29 ConstantComposite 42
44:28(float16_t) Constant 19584
45: 29 ConstantComposite 44
46: TypeCooperativeMatrixKHR 7(int) 8 9 9 10
47: 7(int) Constant 21
48: 46 ConstantComposite 47
49: 7(int) Constant 22
50: 46 ConstantComposite 49
51: 7(int) Constant 23
52: 46 ConstantComposite 51
53: 7(int) Constant 24
54: 46 ConstantComposite 53
55: 7(int) Constant 25
56: 46 ConstantComposite 55
57: 7(int) Constant 26
58: 46 ConstantComposite 57
59: 7(int) Constant 27
60: 46 ConstantComposite 59
61: 7(int) Constant 28
62: 46 ConstantComposite 61
63: TypeInt 16 0
64: TypeCooperativeMatrixKHR 63(int16_t) 8 9 9 10
65: 63(int16_t) Constant 31
66: 64 ConstantComposite 65
67: 63(int16_t) Constant 32
68: 64 ConstantComposite 67
69: 63(int16_t) Constant 33
70: 64 ConstantComposite 69
71: 63(int16_t) Constant 34
72: 64 ConstantComposite 71
73: 63(int16_t) Constant 35
74: 64 ConstantComposite 73
75: 63(int16_t) Constant 36
76: 64 ConstantComposite 75
77: 63(int16_t) Constant 37
78: 64 ConstantComposite 77
79: 63(int16_t) Constant 38
80: 64 ConstantComposite 79
81: TypeInt 8 0
82: TypeCooperativeMatrixKHR 81(int8_t) 8 9 9 10
83: 81(int8_t) Constant 41
84: 82 ConstantComposite 83
85: 81(int8_t) Constant 42
86: 82 ConstantComposite 85
87: 81(int8_t) Constant 43
88: 82 ConstantComposite 87
89: 81(int8_t) Constant 44
90: 82 ConstantComposite 89
91: 81(int8_t) Constant 45
92: 82 ConstantComposite 91
93: 81(int8_t) Constant 46
94: 82 ConstantComposite 93
95: 81(int8_t) Constant 47
96: 82 ConstantComposite 95
97: 81(int8_t) Constant 48
98: 82 ConstantComposite 97
99: TypeInt 32 1
100: TypeCooperativeMatrixKHR 99(int) 8 9 9 10
101: 99(int) Constant 51
102: 100 ConstantComposite 101
103: 99(int) Constant 52
104: 100 ConstantComposite 103
105: 99(int) Constant 53
106: 100 ConstantComposite 105
107: 99(int) Constant 54
108: 100 ConstantComposite 107
109: 99(int) Constant 55
110: 100 ConstantComposite 109
111: 99(int) Constant 56
112: 100 ConstantComposite 111
113: 99(int) Constant 57
114: 100 ConstantComposite 113
115: 99(int) Constant 58
116: 100 ConstantComposite 115
117: TypeInt 16 1
118: TypeCooperativeMatrixKHR 117(int16_t) 8 9 9 10
119:117(int16_t) Constant 61
120: 118 ConstantComposite 119
121:117(int16_t) Constant 62
122: 118 ConstantComposite 121
123:117(int16_t) Constant 63
124: 118 ConstantComposite 123
125:117(int16_t) Constant 64
126: 118 ConstantComposite 125
127:117(int16_t) Constant 65
128: 118 ConstantComposite 127
129:117(int16_t) Constant 66
130: 118 ConstantComposite 129
131:117(int16_t) Constant 67
132: 118 ConstantComposite 131
133:117(int16_t) Constant 68
134: 118 ConstantComposite 133
135: TypeInt 8 1
136: TypeCooperativeMatrixKHR 135(int8_t) 8 9 9 10
137: 135(int8_t) Constant 71
138: 136 ConstantComposite 137
139: 135(int8_t) Constant 72
140: 136 ConstantComposite 139
141: 135(int8_t) Constant 73
142: 136 ConstantComposite 141
143: 135(int8_t) Constant 74
144: 136 ConstantComposite 143
145: 135(int8_t) Constant 75
146: 136 ConstantComposite 145
147: 135(int8_t) Constant 76
148: 136 ConstantComposite 147
149: 135(int8_t) Constant 77
150: 136 ConstantComposite 149
151: 135(int8_t) Constant 78
152: 136 ConstantComposite 151
153: TypePointer Function 11
155: 6(float) Constant 1120534528
156: 11 ConstantComposite 155
157: TypePointer Function 29
159:28(float16_t) Constant 22112
160: 29 ConstantComposite 159
163: TypePointer Function 46
165: 7(int) Constant 103
166: 46 ConstantComposite 165
169: TypePointer Function 64
171: 63(int16_t) Constant 104
172: 64 ConstantComposite 171
175: TypePointer Function 82
177: 81(int8_t) Constant 105
178: 82 ConstantComposite 177
181: TypePointer Function 100
183: 99(int) Constant 106
184: 100 ConstantComposite 183
187: TypePointer Function 118
189:117(int16_t) Constant 107
190: 118 ConstantComposite 189
193: TypePointer Function 136
195: 135(int8_t) Constant 108
196: 136 ConstantComposite 195
200: 6(float) Constant 1121845248
201: 11 ConstantComposite 200
205:28(float16_t) Constant 22272
206: 29 ConstantComposite 205
208: 7(int) Constant 113
209: 46 ConstantComposite 208
213: 63(int16_t) Constant 114
214: 64 ConstantComposite 213
218: 81(int8_t) Constant 115
219: 82 ConstantComposite 218
223: 99(int) Constant 116
224: 100 ConstantComposite 223
228:117(int16_t) Constant 117
229: 118 ConstantComposite 228
233: 135(int8_t) Constant 118
234: 136 ConstantComposite 233
238: 6(float) Constant 1123155968
239: 11 ConstantComposite 238
243:28(float16_t) Constant 22432
244: 29 ConstantComposite 243
248: 7(int) Constant 123
249: 46 ConstantComposite 248
251: 63(int16_t) Constant 124
252: 64 ConstantComposite 251
256: 81(int8_t) Constant 125
257: 82 ConstantComposite 256
261: 99(int) Constant 126
262: 100 ConstantComposite 261
266:117(int16_t) Constant 127
267: 118 ConstantComposite 266
272: 135(int8_t) Constant 4294967168
273: 136 ConstantComposite 272
278: 6(float) Constant 1124270080
279: 11 ConstantComposite 278
283:28(float16_t) Constant 22560
284: 29 ConstantComposite 283
288: 7(int) Constant 133
289: 46 ConstantComposite 288
293: 63(int16_t) Constant 134
294: 64 ConstantComposite 293
296: 81(int8_t) Constant 135
297: 82 ConstantComposite 296
301: 99(int) Constant 136
302: 100 ConstantComposite 301
307:117(int16_t) Constant 137
308: 118 ConstantComposite 307
312: 135(int8_t) Constant 4294967178
313: 136 ConstantComposite 312
318: 6(float) Constant 1124925440
319: 11 ConstantComposite 318
323:28(float16_t) Constant 22640
324: 29 ConstantComposite 323
328: 7(int) Constant 143
329: 46 ConstantComposite 328
333: 63(int16_t) Constant 144
334: 64 ConstantComposite 333
338: 81(int8_t) Constant 145
339: 82 ConstantComposite 338
341: 99(int) Constant 146
342: 100 ConstantComposite 341
347:117(int16_t) Constant 147
348: 118 ConstantComposite 347
353: 135(int8_t) Constant 4294967188
354: 136 ConstantComposite 353
358: 6(float) Constant 1125580800
359: 11 ConstantComposite 358
363:28(float16_t) Constant 22720
364: 29 ConstantComposite 363
368: 7(int) Constant 153
369: 46 ConstantComposite 368
373: 63(int16_t) Constant 154
374: 64 ConstantComposite 373
379: 81(int8_t) Constant 155
380: 82 ConstantComposite 379
385: 99(int) Constant 156
386: 100 ConstantComposite 385
388:117(int16_t) Constant 157
389: 118 ConstantComposite 388
393: 135(int8_t) Constant 4294967198
394: 136 ConstantComposite 393
398: 6(float) Constant 1126236160
399: 11 ConstantComposite 398
403:28(float16_t) Constant 22800
404: 29 ConstantComposite 403
408: 7(int) Constant 163
409: 46 ConstantComposite 408
414: 63(int16_t) Constant 164
415: 64 ConstantComposite 414
419: 81(int8_t) Constant 165
420: 82 ConstantComposite 419
425: 99(int) Constant 166
426: 100 ConstantComposite 425
430:117(int16_t) Constant 167
431: 118 ConstantComposite 430
433: 135(int8_t) Constant 4294967208
434: 136 ConstantComposite 433
438: 6(float) Constant 1126891520
439: 11 ConstantComposite 438
443:28(float16_t) Constant 22880
444: 29 ConstantComposite 443
448: 7(int) Constant 173
449: 46 ConstantComposite 448
454: 63(int16_t) Constant 174
455: 64 ConstantComposite 454
460: 81(int8_t) Constant 175
461: 82 ConstantComposite 460
465: 99(int) Constant 176
466: 100 ConstantComposite 465
470:117(int16_t) Constant 177
471: 118 ConstantComposite 470
475: 135(int8_t) Constant 4294967218
476: 136 ConstantComposite 475
477: TypeVector 7(int) 3
478: 7(int) Constant 64
479: 7(int) Constant 1
480: 477(ivec3) ConstantComposite 478 479 479
4(main): 2 Function None 3
5: Label
154(v): 153(ptr) Variable Function
158(v): 157(ptr) Variable Function
164(v): 163(ptr) Variable Function
170(v): 169(ptr) Variable Function
176(v): 175(ptr) Variable Function
182(v): 181(ptr) Variable Function
188(v): 187(ptr) Variable Function
194(v): 193(ptr) Variable Function
199(v): 153(ptr) Variable Function
204(v): 157(ptr) Variable Function
207(v): 163(ptr) Variable Function
212(v): 169(ptr) Variable Function
217(v): 175(ptr) Variable Function
222(v): 181(ptr) Variable Function
227(v): 187(ptr) Variable Function
232(v): 193(ptr) Variable Function
237(v): 153(ptr) Variable Function
242(v): 157(ptr) Variable Function
247(v): 163(ptr) Variable Function
250(v): 169(ptr) Variable Function
255(v): 175(ptr) Variable Function
260(v): 181(ptr) Variable Function
265(v): 187(ptr) Variable Function
271(v): 193(ptr) Variable Function
277(v): 153(ptr) Variable Function
282(v): 157(ptr) Variable Function
287(v): 163(ptr) Variable Function
292(v): 169(ptr) Variable Function
295(v): 175(ptr) Variable Function
300(v): 181(ptr) Variable Function
306(v): 187(ptr) Variable Function
311(v): 193(ptr) Variable Function
317(v): 153(ptr) Variable Function
322(v): 157(ptr) Variable Function
327(v): 163(ptr) Variable Function
332(v): 169(ptr) Variable Function
337(v): 175(ptr) Variable Function
340(v): 181(ptr) Variable Function
346(v): 187(ptr) Variable Function
352(v): 193(ptr) Variable Function
357(v): 153(ptr) Variable Function
362(v): 157(ptr) Variable Function
367(v): 163(ptr) Variable Function
372(v): 169(ptr) Variable Function
378(v): 175(ptr) Variable Function
384(v): 181(ptr) Variable Function
387(v): 187(ptr) Variable Function
392(v): 193(ptr) Variable Function
397(v): 153(ptr) Variable Function
402(v): 157(ptr) Variable Function
407(v): 163(ptr) Variable Function
413(v): 169(ptr) Variable Function
418(v): 175(ptr) Variable Function
424(v): 181(ptr) Variable Function
429(v): 187(ptr) Variable Function
432(v): 193(ptr) Variable Function
437(v): 153(ptr) Variable Function
442(v): 157(ptr) Variable Function
447(v): 163(ptr) Variable Function
453(v): 169(ptr) Variable Function
459(v): 175(ptr) Variable Function
464(v): 181(ptr) Variable Function
469(v): 187(ptr) Variable Function
474(v): 193(ptr) Variable Function
Store 154(v) 156
Store 158(v) 160
161: 29 Load 158(v)
162: 11 FConvert 161
Store 164(v) 166
167: 46 Load 164(v)
168: 11 ConvertUToF 167
Store 170(v) 172
173: 64 Load 170(v)
174: 11 ConvertUToF 173
Store 176(v) 178
179: 82 Load 176(v)
180: 11 ConvertUToF 179
Store 182(v) 184
185: 100 Load 182(v)
186: 11 ConvertSToF 185
Store 188(v) 190
191: 118 Load 188(v)
192: 11 ConvertSToF 191
Store 194(v) 196
197: 136 Load 194(v)
198: 11 ConvertSToF 197
Store 199(v) 201
202: 11 Load 199(v)
203: 29 FConvert 202
Store 204(v) 206
Store 207(v) 209
210: 46 Load 207(v)
211: 29 ConvertUToF 210
Store 212(v) 214
215: 64 Load 212(v)
216: 29 ConvertUToF 215
Store 217(v) 219
220: 82 Load 217(v)
221: 29 ConvertUToF 220
Store 222(v) 224
225: 100 Load 222(v)
226: 29 ConvertSToF 225
Store 227(v) 229
230: 118 Load 227(v)
231: 29 ConvertSToF 230
Store 232(v) 234
235: 136 Load 232(v)
236: 29 ConvertSToF 235
Store 237(v) 239
240: 11 Load 237(v)
241: 46 ConvertFToU 240
Store 242(v) 244
245: 29 Load 242(v)
246: 46 ConvertFToU 245
Store 247(v) 249
Store 250(v) 252
253: 64 Load 250(v)
254: 46 UConvert 253
Store 255(v) 257
258: 82 Load 255(v)
259: 46 UConvert 258
Store 260(v) 262
263: 100 Load 260(v)
264: 46 Bitcast 263
Store 265(v) 267
268: 118 Load 265(v)
269: 100 SConvert 268
270: 46 Bitcast 269
Store 271(v) 273
274: 136 Load 271(v)
275: 100 SConvert 274
276: 46 Bitcast 275
Store 277(v) 279
280: 11 Load 277(v)
281: 64 ConvertFToU 280
Store 282(v) 284
285: 29 Load 282(v)
286: 64 ConvertFToU 285
Store 287(v) 289
290: 46 Load 287(v)
291: 64 UConvert 290
Store 292(v) 294
Store 295(v) 297
298: 82 Load 295(v)
299: 64 UConvert 298
Store 300(v) 302
303: 100 Load 300(v)
304: 118 SConvert 303
305: 64 Bitcast 304
Store 306(v) 308
309: 118 Load 306(v)
310: 64 Bitcast 309
Store 311(v) 313
314: 136 Load 311(v)
315: 118 SConvert 314
316: 64 Bitcast 315
Store 317(v) 319
320: 11 Load 317(v)
321: 82 ConvertFToU 320
Store 322(v) 324
325: 29 Load 322(v)
326: 82 ConvertFToU 325
Store 327(v) 329
330: 46 Load 327(v)
331: 82 UConvert 330
Store 332(v) 334
335: 64 Load 332(v)
336: 82 UConvert 335
Store 337(v) 339
Store 340(v) 342
343: 100 Load 340(v)
344: 136 SConvert 343
345: 82 Bitcast 344
Store 346(v) 348
349: 118 Load 346(v)
350: 136 SConvert 349
351: 82 Bitcast 350
Store 352(v) 354
355: 136 Load 352(v)
356: 82 Bitcast 355
Store 357(v) 359
360: 11 Load 357(v)
361: 100 ConvertFToS 360
Store 362(v) 364
365: 29 Load 362(v)
366: 100 ConvertFToS 365
Store 367(v) 369
370: 46 Load 367(v)
371: 100 Bitcast 370
Store 372(v) 374
375: 64 Load 372(v)
376: 46 UConvert 375
377: 100 Bitcast 376
Store 378(v) 380
381: 82 Load 378(v)
382: 46 UConvert 381
383: 100 Bitcast 382
Store 384(v) 386
Store 387(v) 389
390: 118 Load 387(v)
391: 100 SConvert 390
Store 392(v) 394
395: 136 Load 392(v)
396: 100 SConvert 395
Store 397(v) 399
400: 11 Load 397(v)
401: 118 ConvertFToS 400
Store 402(v) 404
405: 29 Load 402(v)
406: 118 ConvertFToS 405
Store 407(v) 409
410: 46 Load 407(v)
411: 64 UConvert 410
412: 118 Bitcast 411
Store 413(v) 415
416: 64 Load 413(v)
417: 118 Bitcast 416
Store 418(v) 420
421: 82 Load 418(v)
422: 64 UConvert 421
423: 118 Bitcast 422
Store 424(v) 426
427: 100 Load 424(v)
428: 118 SConvert 427
Store 429(v) 431
Store 432(v) 434
435: 136 Load 432(v)
436: 118 SConvert 435
Store 437(v) 439
440: 11 Load 437(v)
441: 136 ConvertFToS 440
Store 442(v) 444
445: 29 Load 442(v)
446: 136 ConvertFToS 445
Store 447(v) 449
450: 46 Load 447(v)
451: 82 UConvert 450
452: 136 Bitcast 451
Store 453(v) 455
456: 64 Load 453(v)
457: 82 UConvert 456
458: 136 Bitcast 457
Store 459(v) 461
462: 82 Load 459(v)
463: 136 Bitcast 462
Store 464(v) 466
467: 100 Load 464(v)
468: 136 SConvert 467
Store 469(v) 471
472: 118 Load 469(v)
473: 136 SConvert 472
Store 474(v) 476
Return
FunctionEnd

View File

@ -0,0 +1,9 @@
spv.coopmatKHR_constructorError.comp
ERROR: 0:12: 'constructor' : Cooperative matrix type parameters mismatch
ERROR: 0:13: 'constructor' : Cooperative matrix type parameters mismatch
ERROR: 0:14: 'constructor' : Cooperative matrix type parameters mismatch
ERROR: 0:15: 'constructor' : Cooperative matrix type parameters mismatch
ERROR: 4 compilation errors. No code generated.
SPIR-V is not generated for failed compile or link

View File

@ -1,10 +1,11 @@
spv.intcoopmat.comp
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 262
// Id's are bound by 286
Capability Shader
Capability Float16
Capability Int16
Capability Int8
Capability StorageBuffer8BitAccess
Capability VulkanMemoryModelKHR
@ -72,18 +73,22 @@ spv.intcoopmat.comp
Name 207 "tempArg"
Name 212 "shmatrix"
Name 217 "ms"
Name 225 "miC"
Name 226 "muC"
Name 231 "iarr"
Name 236 "iarr2"
Name 241 "uarr"
Name 246 "uarr2"
Name 251 "S"
MemberName 251(S) 0 "a"
MemberName 251(S) 1 "b"
MemberName 251(S) 2 "c"
Name 256 "SC"
Name 261 "scm"
Name 224 "i16"
Name 230 "u16"
Name 233 "tempArg"
Name 239 "tempArg"
Name 249 "miC"
Name 250 "muC"
Name 255 "iarr"
Name 260 "iarr2"
Name 265 "uarr"
Name 270 "uarr2"
Name 275 "S"
MemberName 275(S) 0 "a"
MemberName 275(S) 1 "b"
MemberName 275(S) 2 "c"
Name 280 "SC"
Name 285 "scm"
Decorate 83 ArrayStride 4
Decorate 84 ArrayStride 4
MemberDecorate 85(Block) 0 Offset 0
@ -105,8 +110,8 @@ spv.intcoopmat.comp
Decorate 108(block8) DescriptorSet 0
Decorate 108(block8) Binding 0
Decorate 156(Y) SpecId 0
Decorate 223 BuiltIn WorkgroupSize
Decorate 256(SC) SpecId 2
Decorate 247 BuiltIn WorkgroupSize
Decorate 280(SC) SpecId 2
2: TypeVoid
3: TypeFunction 2
6: TypeInt 8 1
@ -196,47 +201,57 @@ spv.intcoopmat.comp
212(shmatrix): 211(ptr) Variable Workgroup
213: 7(int) Constant 2
214: TypePointer Workgroup 208(ivec4)
221: TypeVector 7(int) 3
222: 7(int) Constant 64
223: 221(ivec3) ConstantComposite 222 100 100
224: TypePointer Private 166
225(miC): 224(ptr) Variable Private
226(muC): 162(ptr) Variable Private
227: 7(int) SpecConstantOp 5362 166
228: 72(int) SpecConstantOp 128 227 76
229: TypeArray 72(int) 228
230: TypePointer Private 229
231(iarr): 230(ptr) Variable Private
232: 7(int) SpecConstantOp 5362 166
233: 72(int) SpecConstantOp 128 232 76
234: TypeArray 72(int) 233
235: TypePointer Private 234
236(iarr2): 235(ptr) Variable Private
237: 7(int) SpecConstantOp 5362 158
238: 72(int) SpecConstantOp 128 237 76
239: TypeArray 72(int) 238
240: TypePointer Private 239
241(uarr): 240(ptr) Variable Private
242: 7(int) SpecConstantOp 5362 158
243: 72(int) SpecConstantOp 128 242 76
244: TypeArray 72(int) 243
245: TypePointer Private 244
246(uarr2): 245(ptr) Variable Private
247: TypeCooperativeMatrixNV 72(int) 8 157(Z) 9
248: 247 ConstantComposite 73
249: 16(int8_t) Constant 1
250: 17 ConstantComposite 249
251(S): TypeStruct 72(int) 72(int) 72(int)
252: 72(int) Constant 12
253: 72(int) Constant 23
254: 72(int) Constant 34
255: 251(S) ConstantComposite 252 253 254
256(SC): 72(int) SpecConstant 1
257: TypeCooperativeMatrixNV 7(int) 8 256(SC) 256(SC)
258: TypeArray 257 256(SC)
259: TypeArray 258 256(SC)
260: TypePointer Private 259
261(scm): 260(ptr) Variable Private
221: TypeInt 16 1
222: TypeCooperativeMatrixNV 221(int16_t) 8 32 9
223: TypePointer Function 222
225:221(int16_t) Constant 0
226: 222 ConstantComposite 225
227: TypeInt 16 0
228: TypeCooperativeMatrixNV 227(int16_t) 8 32 9
229: TypePointer Function 228
231:227(int16_t) Constant 0
232: 228 ConstantComposite 231
245: TypeVector 7(int) 3
246: 7(int) Constant 64
247: 245(ivec3) ConstantComposite 246 100 100
248: TypePointer Private 166
249(miC): 248(ptr) Variable Private
250(muC): 162(ptr) Variable Private
251: 7(int) SpecConstantOp 5362 166
252: 72(int) SpecConstantOp 128 251 76
253: TypeArray 72(int) 252
254: TypePointer Private 253
255(iarr): 254(ptr) Variable Private
256: 7(int) SpecConstantOp 5362 166
257: 72(int) SpecConstantOp 128 256 76
258: TypeArray 72(int) 257
259: TypePointer Private 258
260(iarr2): 259(ptr) Variable Private
261: 7(int) SpecConstantOp 5362 158
262: 72(int) SpecConstantOp 128 261 76
263: TypeArray 72(int) 262
264: TypePointer Private 263
265(uarr): 264(ptr) Variable Private
266: 7(int) SpecConstantOp 5362 158
267: 72(int) SpecConstantOp 128 266 76
268: TypeArray 72(int) 267
269: TypePointer Private 268
270(uarr2): 269(ptr) Variable Private
271: TypeCooperativeMatrixNV 72(int) 8 157(Z) 9
272: 271 ConstantComposite 73
273: 16(int8_t) Constant 1
274: 17 ConstantComposite 273
275(S): TypeStruct 72(int) 72(int) 72(int)
276: 72(int) Constant 12
277: 72(int) Constant 23
278: 72(int) Constant 34
279: 275(S) ConstantComposite 276 277 278
280(SC): 72(int) SpecConstant 1
281: TypeCooperativeMatrixNV 7(int) 8 280(SC) 280(SC)
282: TypeArray 281 280(SC)
283: TypeArray 282 280(SC)
284: TypePointer Private 283
285(scm): 284(ptr) Variable Private
4(main): 2 Function None 3
5: Label
35(mu): 34(ptr) Variable Function
@ -264,6 +279,10 @@ spv.intcoopmat.comp
193(param): 18(ptr) Variable Function
207(tempArg): 38(ptr) Variable Function
217(ms): 38(ptr) Variable Function
224(i16): 223(ptr) Variable Function
230(u16): 229(ptr) Variable Function
233(tempArg): 223(ptr) Variable Function
239(tempArg): 229(ptr) Variable Function
Store 35(mu) 36
Store 39(mi) 41
42: 33 Load 35(mu)
@ -400,6 +419,24 @@ spv.intcoopmat.comp
219: 37 Load 217(ms)
220: 214(ptr) AccessChain 212(shmatrix) 100
CooperativeMatrixStoreNV 220 219 213 93 MakePointerAvailableKHR NonPrivatePointerKHR 213
Store 224(i16) 226
Store 230(u16) 232
234: 214(ptr) AccessChain 212(shmatrix) 100
235: 222 CooperativeMatrixLoadNV 234 213 93 MakePointerVisibleKHR NonPrivatePointerKHR 213
Store 233(tempArg) 235
236: 222 Load 233(tempArg)
Store 224(i16) 236
237: 222 Load 224(i16)
238: 214(ptr) AccessChain 212(shmatrix) 100
CooperativeMatrixStoreNV 238 237 213 93 MakePointerAvailableKHR NonPrivatePointerKHR 213
240: 214(ptr) AccessChain 212(shmatrix) 100
241: 228 CooperativeMatrixLoadNV 240 213 93 MakePointerVisibleKHR NonPrivatePointerKHR 213
Store 239(tempArg) 241
242: 228 Load 239(tempArg)
Store 230(u16) 242
243: 228 Load 230(u16)
244: 214(ptr) AccessChain 212(shmatrix) 100
CooperativeMatrixStoreNV 244 243 213 93 MakePointerAvailableKHR NonPrivatePointerKHR 213
Return
FunctionEnd
14(ineg(i81;): 10 Function None 12

121
Test/spv.coopmatKHR.comp Normal file
View File

@ -0,0 +1,121 @@
#version 450 core
#extension GL_KHR_memory_scope_semantics : enable
#extension GL_KHR_cooperative_matrix : enable
#extension GL_EXT_shader_explicit_arithmetic_types : enable
#extension GL_EXT_buffer_reference : enable
layout (local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
const int X = 8;
layout(constant_id = 0) const int Y = 2;
const int Z = X*Y;
coopmat<float16_t, gl_ScopeSubgroup, Z, 8, gl_MatrixUseAccumulator> mC;
coopmat<float16_t, gl_ScopeSubgroup, Z, 8, gl_MatrixUseAccumulator> mC2[3];
layout(constant_id = 1) const float F = 3.0;
const coopmat<float, gl_ScopeSubgroup, Z, 8, gl_MatrixUseAccumulator> mD = coopmat<float, gl_ScopeSubgroup, Z, 8, gl_MatrixUseAccumulator>(0.0);
const coopmat<float16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseAccumulator> mD2 = coopmat<float16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseAccumulator>(1);
struct S { int a; int b; int c; };
const S s = S(12, 23, 34);
layout(set = 0, binding = 0, buffer_reference) coherent buffer Block {
float y[1024*1024];
float x[];
} block;
layout(set = 0, binding = 0) coherent buffer Block16 {
float16_t y[1024*1024];
float16_t x[];
Block b;
} block16;
coopmat<float16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseAccumulator> f16(coopmat<float16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseAccumulator> m) { return -m; }
coopmat<float, gl_ScopeSubgroup, 8, 8, gl_MatrixUseAccumulator> f32(coopmat<float, gl_ScopeSubgroup, 8, 8, gl_MatrixUseAccumulator> m) { return -m; }
layout(constant_id = 2) const int SC = 1;
coopmat<float16_t, gl_ScopeSubgroup, SC, SC, gl_MatrixUseAccumulator> scm[SC][SC];
// sized for coopmat<float16_t, gl_ScopeSubgroup, 16, 16, gl_MatrixUseAccumulator>
shared uvec4 shmatrix[16*16*2/16];
void main()
{
coopmat<float, gl_ScopeSubgroup, 16, (2>1?8:4), gl_MatrixUseAccumulator> m = coopmat<float, gl_ScopeSubgroup, 16, (2>1?8:4), gl_MatrixUseAccumulator>(0.0);
m = m + m;
m = m - m;
m = -m;
m = 2.0*m;
m = m*2.0;
coopmat<float16_t, gl_ScopeSubgroup, 16, 8, gl_MatrixUseAccumulator> m2 = coopmat<float16_t, gl_ScopeSubgroup, 16, 8, gl_MatrixUseAccumulator>(m);
float x = m[1];
m[0] = x;
coopMatLoad(m, block.x, 16, 128, gl_CooperativeMatrixLayoutRowMajor);
coopMatStore(m, block.x, 16, 128, gl_CooperativeMatrixLayoutRowMajor);
coopMatLoad(m2, block16.x, 16, 128, gl_CooperativeMatrixLayoutRowMajor);
coopMatStore(m2, block16.x, 16, 128, gl_CooperativeMatrixLayoutRowMajor);
coopMatLoad(m, block16.b.x, 16, 128, gl_CooperativeMatrixLayoutRowMajor);
coopMatStore(m, block16.b.x, 16, 128, gl_CooperativeMatrixLayoutRowMajor);
coopmat<float16_t, gl_ScopeSubgroup, 16, 8, gl_MatrixUseA> A;
coopmat<float16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseB> B;
coopmat<float, gl_ScopeSubgroup, 16, 8, gl_MatrixUseAccumulator> C;
coopmat<float, gl_ScopeSubgroup, 16, 8, gl_MatrixUseAccumulator> D;
D = coopMatMulAdd(A, B, C);
int l = D.length();
coopmat<float16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseAccumulator> E;
coopmat<float16_t, gl_ScopeSubgroup, Z, Z, gl_MatrixUseAccumulator> F = coopmat<float16_t, gl_ScopeSubgroup, Z, Z, gl_MatrixUseAccumulator>(0.0);
coopmat<float, gl_ScopeSubgroup, 16, (2>1?8:4), gl_MatrixUseAccumulator> a[5];
a[3][0] = 1.0;
float md1 = mD[1];
md1 += (m += m)[1234];
mC2[1] = mC2[2];
coopMatLoad(m, block.y, 16, 128, gl_CooperativeMatrixLayoutRowMajor);
coopMatStore(m, block.y, 16, 128, gl_CooperativeMatrixLayoutRowMajor);
coopMatLoad(m2, block16.y, 16, 128, gl_CooperativeMatrixLayoutRowMajor);
coopMatStore(m2, block16.y, 16, 128, gl_CooperativeMatrixLayoutRowMajor);
coopmat<float16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseAccumulator> p1;
coopmat<float, gl_ScopeSubgroup, 8, 8, gl_MatrixUseAccumulator> p2;
p1 = f16(p1);
p2 = f32(p2);
p1 = coopmat<float16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseAccumulator>(0.0);
p2 = coopmat<float, gl_ScopeSubgroup, 8, 8, gl_MatrixUseAccumulator>(0.0);
p1 /= p1;
p1 *= float16_t(2.0);
p2 *= 4.0;
coopmat<float16_t, gl_ScopeSubgroup, 16, 8, gl_MatrixUseAccumulator> ms;
coopMatLoad(ms, shmatrix, 1, 2, gl_CooperativeMatrixLayoutRowMajor);
coopMatStore(ms, shmatrix, 1, 2, gl_CooperativeMatrixLayoutRowMajor);
coopmat<int8_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> ms8A;
coopmat<int8_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseB> ms8B;
coopmat<int8_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseAccumulator> ms8C;
coopMatMulAdd(ms8A, ms8B, ms8C);
coopMatMulAdd(ms8A, ms8B, ms8C, 0);
coopMatMulAdd(ms8A, ms8B, ms8C, gl_MatrixOperandsSaturatingAccumulation);
coopmat<int16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> m16;
coopMatStore(m16, shmatrix, 1, 2, gl_CooperativeMatrixLayoutRowMajor);
}

View File

@ -0,0 +1,69 @@
#version 450 core
#extension GL_KHR_memory_scope_semantics : enable
#extension GL_KHR_cooperative_matrix : enable
#extension GL_EXT_shader_explicit_arithmetic_types : enable
layout (local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
float<16> ftemplate16;
coopmat fnoparams;
struct S
{
int s;
};
coopmat<void, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> fbadtype;
coopmat<S, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> fbadtype2;
coopmat<16, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> fbadtype3;
coopmat<float16_t, gl_ScopeSubgroup, 8, gl_MatrixUseA> fbadnumparams;
int X = 8;
coopmat<float16_t, gl_ScopeSubgroup, 8, X, gl_MatrixUseA> fbadparam;
layout(constant_id = 0) const int Y = 1;
shared coopmat<float16_t, gl_ScopeSubgroup, 16, 16> sharedmat;
layout(set = 0, binding = 0) buffer InvBlock {
coopmat<float16_t, gl_ScopeSubgroup, 16, 16, gl_MatrixUseA> bufmat;
} invblock;
void main()
{
coopmat<float, gl_ScopeSubgroup, 16, 8, gl_MatrixUseA> f32_16_8;
coopmat<float16_t, gl_ScopeSubgroup, 16, 8, gl_MatrixUseA> f16_16_8;
// invalid implicit conversions
f32_16_8 = f16_16_8;
f32_16_8 = f16_16_8 + f16_16_8;
coopmat<float16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> f16_8_8;
// mismatching dimensions
f16_16_8 = f16_8_8;
coopmat<float16_t, gl_ScopeSubgroup, 8, Y, gl_MatrixUseA> f16_8_Y;
coopmat<float16_t, gl_ScopeSubgroup, 8, (Y+1), gl_MatrixUseA> f16_8_Y1;
// mismatching dimensions with specialization constants
f16_8_Y = f16_8_Y1;
// wrong arguments for constructor
f16_8_8 = coopmat<float16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(1, 1);
// can't construct from a builtin type
mat4 m4;
coopmat<float, gl_ScopeSubgroup, 4, 4, gl_MatrixUseA> f32_4_4 = coopmat<float, gl_ScopeSubgroup, 4, 4, gl_MatrixUseA>(m4);
// only support a single array subscript
f16_16_8[0][0];
// don't support scalar component selection
f16_16_8.x;
transpose(f16_8_8);
}

View File

@ -0,0 +1,85 @@
#version 450 core
#extension GL_KHR_memory_scope_semantics : enable
#extension GL_KHR_cooperative_matrix : enable
#extension GL_EXT_shader_explicit_arithmetic_types : enable
layout (local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
void main()
{
coopmat<float, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> f;
coopmat<float, gl_ScopeSubgroup, 8, 8, gl_MatrixUseB> f2;
coopmat<float, gl_ScopeSubgroup, 16, 8, gl_MatrixUseA> f3;
coopmat<float16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> f16;
coopmat<uint8_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> u8;
coopmat<int8_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> i8;
coopmat<uint32_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> u32;
f+f;
f-f;
f*f;
f/f;
f+=f;
f-=f;
f*=f;
f/=f;
f*2.0;
2.0*f;
f*=2.0;
f16+f16;
f16-f16;
f16*f16;
f16/f16;
f16+=f16;
f16-=f16;
f16*=f16;
f16/=f16;
f16*float16_t(2.0);
float16_t(2.0)*f16;
f16*=float16_t(2.0);
u32+u32;
u32-u32;
u32*u32;
u32/u32;
u32+=u32;
u32-=u32;
u32*=u32;
u32/=u32;
u32*uint32_t(2);
uint32_t(2)*u32;
u32*=uint32_t(2);
u8+u8;
u8-u8;
u8*u8;
u8/u8;
u8+=u8;
u8-=u8;
u8*=u8;
u8/=u8;
u8*uint8_t(2);
uint8_t(2)*u8;
u8*=uint8_t(2);
i8+i8;
i8-i8;
i8*i8;
i8/i8;
i8+=i8;
i8-=i8;
i8*=i8;
i8/=i8;
i8*int8_t(2);
int8_t(2)*i8;
i8*=int8_t(2);
-f;
-f16;
-i8;
-u8;
}

View File

@ -0,0 +1,87 @@
#version 450 core
#extension GL_KHR_memory_scope_semantics : enable
#extension GL_KHR_cooperative_matrix : enable
#extension GL_EXT_shader_explicit_arithmetic_types : enable
layout (local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
void main()
{
coopmat<float, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> f;
coopmat<float, gl_ScopeSubgroup, 8, 8, gl_MatrixUseB> f2;
coopmat<float, gl_ScopeSubgroup, 16, 8, gl_MatrixUseA> f3;
coopmat<float16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> f16;
coopmat<uint8_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> u8;
coopmat<int8_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> i8;
coopmat<int32_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> i32;
f+1.0;
f-1.0;
f/1.0;
1.0+f;
1.0-f;
1.0/f;
f+=1.0;
f-=1.0;
f/=1.0;
f+f16;
f-f16;
f*f16;
f/f16;
f+=f16;
f-=f16;
f*=f16;
f/=f16;
f+f2;
f-f2;
f*f2;
f/f2;
f+=f2;
f-=f2;
f*=f2;
f/=f2;
f+f3;
f-f3;
f*f3;
f/f3;
f+=f3;
f-=f3;
f*=f3;
f/=f3;
u8+i8;
u8-i8;
u8*i8;
u8/i8;
u8+=i8;
u8-=i8;
u8*=i8;
u8/=i8;
u8+uint8_t(1);
u8-uint8_t(1);
u8/uint8_t(1);
u8+=uint8_t(1);
u8-=uint8_t(1);
u8/=uint8_t(1);
i8+int8_t(1);
i8-int8_t(1);
i8/int8_t(1);
i8+=int8_t(1);
i8-=int8_t(1);
i8/=int8_t(1);
i32+1;
i32-1;
i32/1;
i32+=1;
i32-=1;
i32/=1;
}

View File

@ -0,0 +1,49 @@
#version 450 core
#extension GL_KHR_memory_scope_semantics : enable
#extension GL_KHR_cooperative_matrix : enable
#extension GL_EXT_shader_explicit_arithmetic_types : enable
layout (local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
void main()
{
#define TESTCONST(T, BASE) \
coopmat<T, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(coopmat<float, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(BASE+1.0)); \
coopmat<T, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(coopmat<float16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(BASE+2.0)); \
coopmat<T, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(coopmat<uint32_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(BASE+3)); \
coopmat<T, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(coopmat<uint16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(BASE+4)); \
coopmat<T, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(coopmat<uint8_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(BASE+5)); \
coopmat<T, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(coopmat<int32_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(BASE+6)); \
coopmat<T, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(coopmat<int16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(BASE+7)); \
coopmat<T, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(coopmat<int8_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(BASE+8));
TESTCONST(float, 0)
TESTCONST(float16_t, 10)
TESTCONST(uint32_t, 20)
TESTCONST(uint16_t, 30)
TESTCONST(uint8_t, 40)
TESTCONST(int32_t, 50)
TESTCONST(int16_t, 60)
TESTCONST(int8_t, 70)
#define TESTVAR(T, BASE) \
{ coopmat<float, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> v = coopmat<float, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(BASE+1.0); coopmat<T, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(v); } \
{ coopmat<float16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> v = coopmat<float16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(BASE+2.0); coopmat<T, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(v); } \
{ coopmat<uint32_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> v = coopmat<uint32_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(BASE+3); coopmat<T, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(v); } \
{ coopmat<uint16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> v = coopmat<uint16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(BASE+4); coopmat<T, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(v); } \
{ coopmat<uint8_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> v = coopmat<uint8_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(BASE+5); coopmat<T, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(v); } \
{ coopmat<int32_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> v = coopmat<int32_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(BASE+6); coopmat<T, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(v); } \
{ coopmat<int16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> v = coopmat<int16_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(BASE+7); coopmat<T, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(v); } \
{ coopmat<int8_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA> v = coopmat<int8_t, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(BASE+8); coopmat<T, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(v); }
TESTVAR(float, 100)
TESTVAR(float16_t, 110)
TESTVAR(uint32_t, 120)
TESTVAR(uint16_t, 130)
TESTVAR(uint8_t, 140)
TESTVAR(int32_t, 150)
TESTVAR(int16_t, 160)
TESTVAR(int8_t, 170)
}

View File

@ -0,0 +1,16 @@
#version 450 core
#extension GL_KHR_memory_scope_semantics : enable
#extension GL_KHR_cooperative_matrix : enable
#extension GL_EXT_shader_explicit_arithmetic_types : enable
layout (local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
void main()
{
// Test each kind of shape mismatch
coopmat<float, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(coopmat<float, gl_ScopeWorkgroup, 8, 8, gl_MatrixUseA>(0.0));
coopmat<float, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(coopmat<float, gl_ScopeSubgroup, 16, 8, gl_MatrixUseA>(0.0));
coopmat<float, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(coopmat<float, gl_ScopeSubgroup, 8, 16, gl_MatrixUseA>(0.0));
coopmat<float, gl_ScopeSubgroup, 8, 8, gl_MatrixUseA>(coopmat<float, gl_ScopeSubgroup, 8, 8, gl_MatrixUseB>(0.0));
}

View File

@ -114,4 +114,10 @@ void main()
coopMatLoadNV(ms, shmatrix, 1, 2, false);
coopMatStoreNV(ms, shmatrix, 1, 2, false);
icoopmatNV<16, gl_ScopeSubgroup, 16, 8> i16 = icoopmatNV<16, gl_ScopeSubgroup, 16, 8>(0);
ucoopmatNV<16, gl_ScopeSubgroup, 16, 8> u16 = ucoopmatNV<16, gl_ScopeSubgroup, 16, 8>(0);
coopMatLoadNV(i16, shmatrix, 1, 2, false);
coopMatStoreNV(i16, shmatrix, 1, 2, false);
coopMatLoadNV(u16, shmatrix, 1, 2, false);
coopMatStoreNV(u16, shmatrix, 1, 2, false);
}

View File

@ -66,6 +66,7 @@ enum TBasicType {
EbtReference,
EbtRayQuery,
EbtHitObjectNV,
EbtCoopmat,
#ifndef GLSLANG_WEB
// SPIR-V type defined by spirv_type
EbtSpirvType,

View File

@ -1541,6 +1541,19 @@ struct TShaderQualifiers {
}
};
class TTypeParameters {
public:
POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
TTypeParameters() : basicType(EbtVoid), arraySizes(nullptr) {}
TBasicType basicType;
TArraySizes *arraySizes;
bool operator==(const TTypeParameters& rhs) const { return basicType == rhs.basicType && *arraySizes == *rhs.arraySizes; }
bool operator!=(const TTypeParameters& rhs) const { return basicType != rhs.basicType || *arraySizes != *rhs.arraySizes; }
};
//
// TPublicType is just temporarily used while parsing and not quite the same
// information kept per node in TType. Due to the bison stack, it can't have
@ -1558,11 +1571,12 @@ public:
int vectorSize : 4;
int matrixCols : 4;
int matrixRows : 4;
bool coopmat : 1;
bool coopmatNV : 1;
bool coopmatKHR : 1;
TArraySizes* arraySizes;
const TType* userDef;
TSourceLoc loc;
TArraySizes* typeParameters;
TTypeParameters* typeParameters;
#ifndef GLSLANG_WEB
// SPIR-V type defined by spirv_type directive
TSpirvType* spirvType;
@ -1570,8 +1584,12 @@ public:
#ifdef GLSLANG_WEB
bool isCoopmat() const { return false; }
bool isCoopmatNV() const { return false; }
bool isCoopmatKHR() const { return false; }
#else
bool isCoopmat() const { return coopmat; }
bool isCoopmat() const { return coopmatNV || coopmatKHR; }
bool isCoopmatNV() const { return coopmatNV; }
bool isCoopmatKHR() const { return coopmatKHR; }
#endif
void initType(const TSourceLoc& l)
@ -1584,7 +1602,8 @@ public:
userDef = nullptr;
loc = l;
typeParameters = nullptr;
coopmat = false;
coopmatNV = false;
coopmatKHR = false;
#ifndef GLSLANG_WEB
spirvType = nullptr;
#endif
@ -1645,7 +1664,7 @@ public:
// for "empty" type (no args) or simple scalar/vector/matrix
explicit TType(TBasicType t = EbtVoid, TStorageQualifier q = EvqTemporary, int vs = 1, int mc = 0, int mr = 0,
bool isVector = false) :
basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(isVector && vs == 1), coopmat(false),
basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(-1),
arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr)
#ifndef GLSLANG_WEB
, spirvType(nullptr)
@ -1659,7 +1678,7 @@ public:
// for explicit precision qualifier
TType(TBasicType t, TStorageQualifier q, TPrecisionQualifier p, int vs = 1, int mc = 0, int mr = 0,
bool isVector = false) :
basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(isVector && vs == 1), coopmat(false),
basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(-1),
arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr)
#ifndef GLSLANG_WEB
, spirvType(nullptr)
@ -1675,7 +1694,7 @@ public:
// for turning a TPublicType into a TType, using a shallow copy
explicit TType(const TPublicType& p) :
basicType(p.basicType),
vectorSize(p.vectorSize), matrixCols(p.matrixCols), matrixRows(p.matrixRows), vector1(false), coopmat(p.coopmat),
vectorSize(p.vectorSize), matrixCols(p.matrixCols), matrixRows(p.matrixRows), vector1(false), coopmatNV(p.coopmatNV), coopmatKHR(p.coopmatKHR), coopmatKHRuse(-1),
arraySizes(p.arraySizes), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(p.typeParameters)
#ifndef GLSLANG_WEB
, spirvType(p.spirvType)
@ -1695,23 +1714,37 @@ public:
}
typeName = NewPoolTString(p.userDef->getTypeName().c_str());
}
if (p.isCoopmat() && p.typeParameters && p.typeParameters->getNumDims() > 0) {
int numBits = p.typeParameters->getDimSize(0);
if (p.isCoopmatNV() && p.typeParameters && p.typeParameters->arraySizes->getNumDims() > 0) {
int numBits = p.typeParameters->arraySizes->getDimSize(0);
if (p.basicType == EbtFloat && numBits == 16) {
basicType = EbtFloat16;
qualifier.precision = EpqNone;
} else if (p.basicType == EbtUint && numBits == 8) {
basicType = EbtUint8;
qualifier.precision = EpqNone;
} else if (p.basicType == EbtUint && numBits == 16) {
basicType = EbtUint16;
qualifier.precision = EpqNone;
} else if (p.basicType == EbtInt && numBits == 8) {
basicType = EbtInt8;
qualifier.precision = EpqNone;
} else if (p.basicType == EbtInt && numBits == 16) {
basicType = EbtInt16;
qualifier.precision = EpqNone;
}
}
if (p.isCoopmatKHR() && p.typeParameters && p.typeParameters->arraySizes->getNumDims() > 0) {
basicType = p.typeParameters->basicType;
if (p.typeParameters->arraySizes->getNumDims() == 4) {
coopmatKHRuse = p.typeParameters->arraySizes->getDimSize(3);
p.typeParameters->arraySizes->removeLastSize();
}
}
}
// for construction of sampler types
TType(const TSampler& sampler, TStorageQualifier q = EvqUniform, TArraySizes* as = nullptr) :
basicType(EbtSampler), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmat(false),
basicType(EbtSampler), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(-1),
arraySizes(as), structure(nullptr), fieldName(nullptr), typeName(nullptr),
sampler(sampler), typeParameters(nullptr)
#ifndef GLSLANG_WEB
@ -1758,14 +1791,16 @@ public:
vectorSize = 1;
vector1 = false;
} else if (isCoopMat()) {
coopmat = false;
coopmatNV = false;
coopmatKHR = false;
coopmatKHRuse = -1;
typeParameters = nullptr;
}
}
}
// for making structures, ...
TType(TTypeList* userDef, const TString& n) :
basicType(EbtStruct), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmat(false),
basicType(EbtStruct), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(-1),
arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr)
#ifndef GLSLANG_WEB
, spirvType(nullptr)
@ -1777,7 +1812,7 @@ public:
}
// For interface blocks
TType(TTypeList* userDef, const TString& n, const TQualifier& q) :
basicType(EbtBlock), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmat(false),
basicType(EbtBlock), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(-1),
qualifier(q), arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr)
#ifndef GLSLANG_WEB
, spirvType(nullptr)
@ -1788,7 +1823,7 @@ public:
}
// for block reference (first parameter must be EbtReference)
explicit TType(TBasicType t, const TType &p, const TString& n) :
basicType(t), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmat(false),
basicType(t), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(-1),
arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr)
#ifndef GLSLANG_WEB
, spirvType(nullptr)
@ -1827,7 +1862,9 @@ public:
#ifndef GLSLANG_WEB
spirvType = copyOf.spirvType;
#endif
coopmat = copyOf.isCoopMat();
coopmatNV = copyOf.isCoopMatNV();
coopmatKHR = copyOf.isCoopMatKHR();
coopmatKHRuse = copyOf.coopmatKHRuse;
}
// Make complete copy of the whole type graph rooted at 'copyOf'.
@ -1912,8 +1949,8 @@ public:
virtual const TArraySizes* getArraySizes() const { return arraySizes; }
virtual TArraySizes* getArraySizes() { return arraySizes; }
virtual TType* getReferentType() const { return referentType; }
virtual const TArraySizes* getTypeParameters() const { return typeParameters; }
virtual TArraySizes* getTypeParameters() { return typeParameters; }
virtual const TTypeParameters* getTypeParameters() const { return typeParameters; }
virtual TTypeParameters* getTypeParameters() { return typeParameters; }
virtual bool isScalar() const { return ! isVector() && ! isMatrix() && ! isStruct() && ! isArray(); }
virtual bool isScalarOrVec1() const { return isScalar() || vector1; }
@ -1968,14 +2005,19 @@ public:
#ifdef GLSLANG_WEB
bool isAtomic() const { return false; }
bool isCoopMat() const { return false; }
bool isCoopMatNV() const { return false; }
bool isCoopMatKHR() const { return false; }
bool isReference() const { return false; }
bool isSpirvType() const { return false; }
#else
bool isAtomic() const { return basicType == EbtAtomicUint; }
bool isCoopMat() const { return coopmat; }
bool isCoopMat() const { return coopmatNV || coopmatKHR; }
bool isCoopMatNV() const { return coopmatNV; }
bool isCoopMatKHR() const { return coopmatKHR; }
bool isReference() const { return getBasicType() == EbtReference; }
bool isSpirvType() const { return getBasicType() == EbtSpirvType; }
#endif
int getCoopMatKHRuse() const { return coopmatKHRuse; }
// return true if this type contains any subtype which satisfies the given predicate.
template <typename P>
@ -2092,7 +2134,7 @@ public:
}
bool containsCoopMat() const
{
return contains([](const TType* t) { return t->coopmat; } );
return contains([](const TType* t) { return t->coopmatNV || t->coopmatKHR; } );
}
bool containsReference() const
{
@ -2174,43 +2216,12 @@ public:
}
}
void updateTypeParameters(const TType& type)
{
// For when we may already be sharing existing array descriptors,
// keeping the pointers the same, just updating the contents.
assert(typeParameters != nullptr);
assert(type.typeParameters != nullptr);
*typeParameters = *type.typeParameters;
}
void copyTypeParameters(const TArraySizes& s)
void copyTypeParameters(const TTypeParameters& s)
{
// For setting a fresh new set of type parameters, not yet worrying about sharing.
typeParameters = new TArraySizes;
typeParameters = new TTypeParameters;
*typeParameters = s;
}
void transferTypeParameters(TArraySizes* s)
{
// For setting an already allocated set of sizes that this type can use
// (no copy made).
typeParameters = s;
}
void clearTypeParameters()
{
typeParameters = nullptr;
}
// Add inner array sizes, to any existing sizes, via copy; the
// sizes passed in can still be reused for other purposes.
void copyTypeParametersInnerSizes(const TArraySizes* s)
{
if (s != nullptr) {
if (typeParameters == nullptr)
copyTypeParameters(*s);
else
typeParameters->addInnerSizes(*s);
}
}
const char* getBasicString() const
{
@ -2243,6 +2254,7 @@ public:
case EbtReference: return "reference";
case EbtString: return "string";
case EbtSpirvType: return "spirv_type";
case EbtCoopmat: return "coopmat";
#endif
default: return "unknown type";
}
@ -2553,12 +2565,21 @@ public:
}
}
if (isParameterized()) {
if (isCoopMatKHR()) {
appendStr(" ");
appendStr("coopmat");
}
appendStr("<");
for (int i = 0; i < (int)typeParameters->getNumDims(); ++i) {
appendInt(typeParameters->getDimSize(i));
if (i != (int)typeParameters->getNumDims() - 1)
for (int i = 0; i < (int)typeParameters->arraySizes->getNumDims(); ++i) {
appendInt(typeParameters->arraySizes->getDimSize(i));
if (i != (int)typeParameters->arraySizes->getNumDims() - 1)
appendStr(", ");
}
if (coopmatKHRuse != -1) {
appendStr(", ");
appendInt(coopmatKHRuse);
}
appendStr(">");
}
if (getPrecision && qualifier.precision != EpqNone) {
@ -2835,7 +2856,8 @@ public:
matrixCols == right.matrixCols &&
matrixRows == right.matrixRows &&
vector1 == right.vector1 &&
isCoopMat() == right.isCoopMat() &&
isCoopMatNV() == right.isCoopMatNV() &&
isCoopMatKHR() == right.isCoopMatKHR() &&
sameStructType(right, lpidx, rpidx) &&
sameReferenceType(right);
}
@ -2844,29 +2866,70 @@ public:
// an OK function parameter
bool coopMatParameterOK(const TType& right) const
{
return isCoopMat() && right.isCoopMat() && (getBasicType() == right.getBasicType()) &&
if (isCoopMatNV()) {
return right.isCoopMatNV() && (getBasicType() == right.getBasicType()) && typeParameters == nullptr &&
right.typeParameters != nullptr;
}
if (isCoopMatKHR() && right.isCoopMatKHR()) {
return ((getBasicType() == right.getBasicType()) || (getBasicType() == EbtCoopmat) ||
(right.getBasicType() == EbtCoopmat)) &&
typeParameters == nullptr && right.typeParameters != nullptr;
}
return false;
}
bool sameCoopMatBaseType(const TType &right) const {
bool rv = coopmat && right.coopmat;
bool rv = false;
if (isCoopMatNV()) {
rv = isCoopMatNV() && right.isCoopMatNV();
if (getBasicType() == EbtFloat || getBasicType() == EbtFloat16)
rv = right.getBasicType() == EbtFloat || right.getBasicType() == EbtFloat16;
else if (getBasicType() == EbtUint || getBasicType() == EbtUint8)
rv = right.getBasicType() == EbtUint || right.getBasicType() == EbtUint8;
else if (getBasicType() == EbtInt || getBasicType() == EbtInt8)
rv = right.getBasicType() == EbtInt || right.getBasicType() == EbtInt8;
else if (getBasicType() == EbtUint || getBasicType() == EbtUint8 || getBasicType() == EbtUint16)
rv = right.getBasicType() == EbtUint || right.getBasicType() == EbtUint8 || right.getBasicType() == EbtUint16;
else if (getBasicType() == EbtInt || getBasicType() == EbtInt8 || getBasicType() == EbtInt16)
rv = right.getBasicType() == EbtInt || right.getBasicType() == EbtInt8 || right.getBasicType() == EbtInt16;
else
rv = false;
} else if (isCoopMatKHR() && right.isCoopMatKHR()) {
if (getBasicType() == EbtFloat || getBasicType() == EbtFloat16)
rv = right.getBasicType() == EbtFloat || right.getBasicType() == EbtFloat16 || right.getBasicType() == EbtCoopmat;
else if (getBasicType() == EbtUint || getBasicType() == EbtUint8 || getBasicType() == EbtUint16)
rv = right.getBasicType() == EbtUint || right.getBasicType() == EbtUint8 || right.getBasicType() == EbtUint16 || right.getBasicType() == EbtCoopmat;
else if (getBasicType() == EbtInt || getBasicType() == EbtInt8 || getBasicType() == EbtInt16)
rv = right.getBasicType() == EbtInt || right.getBasicType() == EbtInt8 || right.getBasicType() == EbtInt16 || right.getBasicType() == EbtCoopmat;
else
rv = false;
}
return rv;
}
bool sameCoopMatUse(const TType &right) const {
return coopmatKHRuse == right.coopmatKHRuse;
}
bool sameCoopMatShapeAndUse(const TType &right) const
{
if (!isCoopMat() || !right.isCoopMat() || isCoopMatKHR() != right.isCoopMatKHR())
return false;
if (coopmatKHRuse != right.coopmatKHRuse)
return false;
// Skip bit width type parameter (first array size) for coopmatNV
int firstArrayDimToCompare = isCoopMatNV() ? 1 : 0;
for (int i = firstArrayDimToCompare; i < typeParameters->arraySizes->getNumDims(); ++i) {
if (typeParameters->arraySizes->getDimSize(i) != right.typeParameters->arraySizes->getDimSize(i))
return false;
}
return true;
}
// See if two types match in all ways (just the actual type, not qualification)
bool operator==(const TType& right) const
{
#ifndef GLSLANG_WEB
return sameElementType(right) && sameArrayness(right) && sameTypeParameters(right) && sameSpirvType(right);
return sameElementType(right) && sameArrayness(right) && sameTypeParameters(right) && sameCoopMatUse(right) && sameSpirvType(right);
#else
return sameElementType(right) && sameArrayness(right) && sameTypeParameters(right);
#endif
@ -2923,8 +2986,10 @@ protected:
}
if (copyOf.typeParameters) {
typeParameters = new TArraySizes;
*typeParameters = *copyOf.typeParameters;
typeParameters = new TTypeParameters;
typeParameters->arraySizes = new TArraySizes;
*typeParameters->arraySizes = *copyOf.typeParameters->arraySizes;
typeParameters->basicType = copyOf.basicType;
}
if (copyOf.isStruct() && copyOf.structure) {
@ -2962,7 +3027,9 @@ protected:
// functionality is added.
// HLSL does have a 1-component vectors, so this will be true to disambiguate
// from a scalar.
bool coopmat : 1;
bool coopmatNV : 1;
bool coopmatKHR : 1;
int coopmatKHRuse : 4; // Accepts one of three values: 0, 1, 2 (gl_MatrixUseA, gl_MatrixUseB, gl_MatrixUseAccumulator)
TQualifier qualifier;
TArraySizes* arraySizes; // nullptr unless an array; can be shared across types
@ -2975,7 +3042,7 @@ protected:
TString *fieldName; // for structure field names
TString *typeName; // for structure type name
TSampler sampler;
TArraySizes* typeParameters;// nullptr unless a parameterized type; can be shared across types
TTypeParameters *typeParameters;// nullptr unless a parameterized type; can be shared across types
#ifndef GLSLANG_WEB
TSpirvType* spirvType; // SPIR-V type defined by spirv_type directive
#endif

View File

@ -147,6 +147,15 @@ struct TSmallArrayVector {
sizes->erase(sizes->begin());
}
void pop_back()
{
assert(sizes != nullptr && sizes->size() > 0);
if (sizes->size() == 1)
dealloc();
else
sizes->resize(sizes->size() - 1);
}
// 'this' should currently not be holding anything, and copyNonFront
// will make it hold a copy of all but the first element of rhs.
// (This would be useful for making a type that is dereferenced by
@ -306,6 +315,7 @@ struct TArraySizes {
bool isDefaultImplicitlySized() const { return implicitlySized && implicitArraySize == 0; }
void setImplicitlySized(bool isImplicitSizing) { implicitlySized = isImplicitSizing; }
void dereference() { sizes.pop_front(); }
void removeLastSize() { sizes.pop_back(); }
void copyDereferenced(const TArraySizes& rhs)
{
assert(sizes.size() == 0);

View File

@ -629,6 +629,9 @@ enum TOperator {
EOpCooperativeMatrixLoad,
EOpCooperativeMatrixStore,
EOpCooperativeMatrixMulAdd,
EOpCooperativeMatrixLoadNV,
EOpCooperativeMatrixStoreNV,
EOpCooperativeMatrixMulAddNV,
EOpBeginInvocationInterlock, // Fragment only
EOpEndInvocationInterlock, // Fragment only
@ -766,7 +769,8 @@ enum TOperator {
EOpConstructTextureSampler,
EOpConstructNonuniform, // expected to be transformed away, not present in final AST
EOpConstructReference,
EOpConstructCooperativeMatrix,
EOpConstructCooperativeMatrixNV,
EOpConstructCooperativeMatrixKHR,
EOpConstructAccStruct,
EOpConstructGuardEnd,

View File

@ -4397,6 +4397,94 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"icoopmatNV coopMatMulAddNV(icoopmatNV A, icoopmatNV B, icoopmatNV C);\n"
"ucoopmatNV coopMatMulAddNV(ucoopmatNV A, ucoopmatNV B, ucoopmatNV C);\n"
);
std::string cooperativeMatrixFuncs =
"void coopMatLoad(out coopmat m, volatile coherent int8_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent int16_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent int32_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent int64_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent uint8_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent uint16_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent uint32_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent uint64_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent float16_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent float[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent float64_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent i8vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent i16vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent i32vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent i64vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent u8vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent u16vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent u32vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent u64vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent f16vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent f32vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent f64vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent i8vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent i16vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent i32vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent i64vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent u8vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent u16vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent u32vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent u64vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent f16vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent f32vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatLoad(out coopmat m, volatile coherent f64vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent int8_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent int16_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent int32_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent int64_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent uint8_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent uint16_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent uint32_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent uint64_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent float16_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent float[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent float64_t[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent i8vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent i16vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent i32vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent i64vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent u8vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent u16vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent u32vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent u64vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent f16vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent f32vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent f64vec2[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent i8vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent i16vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent i32vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent i64vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent u8vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent u16vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent u32vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent u64vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent f16vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent f32vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"void coopMatStore(coopmat m, volatile coherent f64vec4[] buf, uint element, uint stride, int matrixLayout);\n"
"coopmat coopMatMulAdd(coopmat A, coopmat B, coopmat C);\n"
"coopmat coopMatMulAdd(coopmat A, coopmat B, coopmat C, int matrixOperands);\n";
commonBuiltins.append(cooperativeMatrixFuncs.c_str());
commonBuiltins.append(
"const int gl_MatrixUseA = 0;\n"
"const int gl_MatrixUseB = 1;\n"
"const int gl_MatrixUseAccumulator = 2;\n"
"const int gl_MatrixOperandsSaturatingAccumulation = 0x10;\n"
"const int gl_CooperativeMatrixLayoutRowMajor = 0;\n"
"const int gl_CooperativeMatrixLayoutColumnMajor = 1;\n"
"\n"
);
}
//============================================================================
@ -8897,6 +8985,12 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setFunctionExtensions("coopMatMulAddNV", 2, coopExt);
}
{
symbolTable.setFunctionExtensions("coopMatLoad", 1, &E_GL_KHR_cooperative_matrix);
symbolTable.setFunctionExtensions("coopMatStore", 1, &E_GL_KHR_cooperative_matrix);
symbolTable.setFunctionExtensions("coopMatMulAdd", 1, &E_GL_KHR_cooperative_matrix);
}
if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) {
symbolTable.setFunctionExtensions("dFdx", 1, &E_GL_NV_compute_shader_derivatives);
symbolTable.setFunctionExtensions("dFdy", 1, &E_GL_NV_compute_shader_derivatives);
@ -10005,9 +10099,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.relateToOperator("dFdyCoarse", EOpDPdyCoarse);
symbolTable.relateToOperator("fwidthCoarse",EOpFwidthCoarse);
}
symbolTable.relateToOperator("coopMatLoadNV", EOpCooperativeMatrixLoad);
symbolTable.relateToOperator("coopMatStoreNV", EOpCooperativeMatrixStore);
symbolTable.relateToOperator("coopMatMulAddNV", EOpCooperativeMatrixMulAdd);
symbolTable.relateToOperator("coopMatLoadNV", EOpCooperativeMatrixLoadNV);
symbolTable.relateToOperator("coopMatStoreNV", EOpCooperativeMatrixStoreNV);
symbolTable.relateToOperator("coopMatMulAddNV", EOpCooperativeMatrixMulAddNV);
symbolTable.relateToOperator("coopMatLoad", EOpCooperativeMatrixLoad);
symbolTable.relateToOperator("coopMatStore", EOpCooperativeMatrixStore);
symbolTable.relateToOperator("coopMatMulAdd", EOpCooperativeMatrixMulAdd);
break;
case EShLangRayGen:

View File

@ -1049,6 +1049,12 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
if (type.isArray() || node->getType().isArray())
return nullptr;
// Reject implicit conversions to cooperative matrix types
if (node->getType().isCoopMat() &&
op != EOpConstructCooperativeMatrixNV &&
op != EOpConstructCooperativeMatrixKHR)
return nullptr;
// Note: callers are responsible for other aspects of shape,
// like vector and matrix sizes.
@ -1117,7 +1123,8 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
case EOpSequence:
case EOpConstructStruct:
case EOpConstructCooperativeMatrix:
case EOpConstructCooperativeMatrixNV:
case EOpConstructCooperativeMatrixKHR:
if (type.isReference() || node->getType().isReference()) {
// types must match to assign a reference
@ -2008,8 +2015,11 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const
if (type.getQualifier().isNonUniform())
return EOpConstructNonuniform;
if (type.isCoopMat())
return EOpConstructCooperativeMatrix;
if (type.isCoopMatNV())
return EOpConstructCooperativeMatrixNV;
if (type.isCoopMatKHR())
return EOpConstructCooperativeMatrixKHR;
switch (type.getBasicType()) {
case EbtStruct:
@ -3526,20 +3536,28 @@ bool TIntermediate::promoteBinary(TIntermBinary& node)
}
if (left->getType().isCoopMat() || right->getType().isCoopMat()) {
// Operations on two cooperative matrices must have identical types
if (left->getType().isCoopMat() && right->getType().isCoopMat() &&
*left->getType().getTypeParameters() != *right->getType().getTypeParameters()) {
left->getType() != right->getType()) {
return false;
}
switch (op) {
case EOpMul:
case EOpMulAssign:
if (left->getType().isCoopMat() && right->getType().isCoopMat()) {
// Mul not supported in NV_cooperative_matrix
if (left->getType().isCoopMatNV() && right->getType().isCoopMatNV()) {
return false;
}
if (op == EOpMulAssign && right->getType().isCoopMat()) {
// NV_cooperative_matrix supports MulAssign is for mat*=scalar only.
// KHR_cooperative_matrix supports it for mat*=mat as well.
if (op == EOpMulAssign && right->getType().isCoopMatNV()) {
return false;
}
// Use MatrixTimesScalar if either operand is not a matrix. Otherwise use Mul.
if (!left->getType().isCoopMat() || !right->getType().isCoopMat()) {
node.setOp(op == EOpMulAssign ? EOpMatrixTimesScalarAssign : EOpMatrixTimesScalar);
}
// In case of scalar*matrix, take the result type from the matrix.
if (right->getType().isCoopMat()) {
node.setType(right->getType());
}

View File

@ -1501,7 +1501,8 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction
if (result->getAsTyped()->getType().isCoopMat() &&
!result->getAsTyped()->getType().isParameterized()) {
assert(fnCandidate->getBuiltInOp() == EOpCooperativeMatrixMulAdd);
assert(fnCandidate->getBuiltInOp() == EOpCooperativeMatrixMulAdd ||
fnCandidate->getBuiltInOp() == EOpCooperativeMatrixMulAddNV);
result->setType(result->getAsAggregate()->getSequence()[2]->getAsTyped()->getType());
}
@ -3642,6 +3643,12 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
}
TIntermTyped* typed = node->getAsTyped();
if (type.isCoopMat() && typed->getType().isCoopMat() &&
!type.sameCoopMatShapeAndUse(typed->getType())) {
error(loc, "Cooperative matrix type parameters mismatch", constructorString.c_str(), "");
return true;
}
if (typed == nullptr) {
error(loc, "constructor argument does not have a type", constructorString.c_str(), "");
return true;
@ -4302,7 +4309,7 @@ TPrecisionQualifier TParseContext::getDefaultPrecision(TPublicType& publicType)
return defaultPrecision[publicType.basicType];
}
void TParseContext::precisionQualifierCheck(const TSourceLoc& loc, TBasicType baseType, TQualifier& qualifier)
void TParseContext::precisionQualifierCheck(const TSourceLoc& loc, TBasicType baseType, TQualifier& qualifier, bool isCoopMat)
{
// Built-in symbols are allowed some ambiguous precisions, to be pinned down
// later by context.
@ -4314,6 +4321,9 @@ void TParseContext::precisionQualifierCheck(const TSourceLoc& loc, TBasicType ba
error(loc, "atomic counters can only be highp", "atomic_uint", "");
#endif
if (isCoopMat)
return;
if (baseType == EbtFloat || baseType == EbtUint || baseType == EbtInt || baseType == EbtSampler || baseType == EbtAtomicUint) {
if (qualifier.precision == EpqNone) {
if (relaxedErrors())
@ -4358,7 +4368,8 @@ bool TParseContext::containsFieldWithBasicType(const TType& type, TBasicType bas
//
// Do size checking for an array type's size.
//
void TParseContext::arraySizeCheck(const TSourceLoc& loc, TIntermTyped* expr, TArraySize& sizePair, const char *sizeType)
void TParseContext::arraySizeCheck(const TSourceLoc& loc, TIntermTyped* expr, TArraySize& sizePair,
const char* sizeType, const bool allowZero)
{
bool isConst = false;
sizePair.node = nullptr;
@ -4378,9 +4389,8 @@ void TParseContext::arraySizeCheck(const TSourceLoc& loc, TIntermTyped* expr, TA
TIntermSymbol* symbol = expr->getAsSymbolNode();
if (symbol && symbol->getConstArray().size() > 0)
size = symbol->getConstArray()[0].getIConst();
} else if (expr->getAsUnaryNode() &&
expr->getAsUnaryNode()->getOp() == glslang::EOpArrayLength &&
expr->getAsUnaryNode()->getOperand()->getType().isCoopMat()) {
} else if (expr->getAsUnaryNode() && expr->getAsUnaryNode()->getOp() == glslang::EOpArrayLength &&
expr->getAsUnaryNode()->getOperand()->getType().isCoopMatNV()) {
isConst = true;
size = 1;
sizePair.node = expr->getAsUnaryNode();
@ -4394,10 +4404,17 @@ void TParseContext::arraySizeCheck(const TSourceLoc& loc, TIntermTyped* expr, TA
return;
}
if (allowZero) {
if (size < 0) {
error(loc, sizeType, "", "must be a non-negative integer");
return;
}
} else {
if (size <= 0) {
error(loc, sizeType, "", "must be a positive integer");
return;
}
}
}
//
@ -7371,6 +7388,43 @@ void TParseContext::declareTypeDefaults(const TSourceLoc& loc, const TPublicType
#endif
}
void TParseContext::coopMatTypeParametersCheck(const TSourceLoc& loc, const TPublicType& publicType)
{
#ifndef GLSLANG_WEB
if (parsingBuiltins)
return;
if (publicType.isCoopmatKHR()) {
if (publicType.typeParameters == nullptr) {
error(loc, "coopmat missing type parameters", "", "");
return;
}
switch (publicType.typeParameters->basicType) {
case EbtFloat:
case EbtFloat16:
case EbtInt:
case EbtInt8:
case EbtInt16:
case EbtUint:
case EbtUint8:
case EbtUint16:
break;
default:
error(loc, "coopmat invalid basic type", TType::getBasicString(publicType.typeParameters->basicType), "");
break;
}
if (publicType.typeParameters->arraySizes->getNumDims() != 4) {
error(loc, "coopmat incorrect number of type parameters", "", "");
return;
}
int use = publicType.typeParameters->arraySizes->getDimSize(3);
if (use < 0 || use > 2) {
error(loc, "coopmat invalid matrix Use", "", "");
return;
}
}
#endif
}
bool TParseContext::vkRelaxedRemapUniformVariable(const TSourceLoc& loc, TString& identifier, const TPublicType&,
TArraySizes*, TIntermTyped* initializer, TType& type)
{
@ -7486,29 +7540,43 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden
}
if (type.isCoopMat()) {
if (type.isCoopMatKHR()) {
intermediate.setUseVulkanMemoryModel();
intermediate.setUseStorageBuffer();
if (!publicType.typeParameters || publicType.typeParameters->getNumDims() != 4) {
if (!publicType.typeParameters || !publicType.typeParameters->arraySizes ||
publicType.typeParameters->arraySizes->getNumDims() != 3) {
error(loc, "unexpected number type parameters", identifier.c_str(), "");
}
if (publicType.typeParameters) {
if (!isTypeFloat(publicType.typeParameters->basicType) && !isTypeInt(publicType.typeParameters->basicType)) {
error(loc, "expected 8, 16, 32, or 64 bit signed or unsigned integer or 16, 32, or 64 bit float type", identifier.c_str(), "");
}
}
}
else if (type.isCoopMatNV()) {
intermediate.setUseVulkanMemoryModel();
intermediate.setUseStorageBuffer();
if (!publicType.typeParameters || publicType.typeParameters->arraySizes->getNumDims() != 4) {
error(loc, "expected four type parameters", identifier.c_str(), "");
}
if (publicType.typeParameters) {
if (isTypeFloat(publicType.basicType) &&
publicType.typeParameters->getDimSize(0) != 16 &&
publicType.typeParameters->getDimSize(0) != 32 &&
publicType.typeParameters->getDimSize(0) != 64) {
publicType.typeParameters->arraySizes->getDimSize(0) != 16 &&
publicType.typeParameters->arraySizes->getDimSize(0) != 32 &&
publicType.typeParameters->arraySizes->getDimSize(0) != 64) {
error(loc, "expected 16, 32, or 64 bits for first type parameter", identifier.c_str(), "");
}
if (isTypeInt(publicType.basicType) &&
publicType.typeParameters->getDimSize(0) != 8 &&
publicType.typeParameters->getDimSize(0) != 32) {
error(loc, "expected 8 or 32 bits for first type parameter", identifier.c_str(), "");
publicType.typeParameters->arraySizes->getDimSize(0) != 8 &&
publicType.typeParameters->arraySizes->getDimSize(0) != 16 &&
publicType.typeParameters->arraySizes->getDimSize(0) != 32) {
error(loc, "expected 8, 16, or 32 bits for first type parameter", identifier.c_str(), "");
}
}
} else {
if (publicType.typeParameters && publicType.typeParameters->getNumDims() != 0) {
if (publicType.typeParameters && publicType.typeParameters->arraySizes->getNumDims() != 0) {
error(loc, "unexpected type parameters", identifier.c_str(), "");
}
}
@ -8336,14 +8404,18 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
return nullptr;
}
case EOpConstructCooperativeMatrix:
case EOpConstructCooperativeMatrixNV:
case EOpConstructCooperativeMatrixKHR:
if (node->getType() == type) {
return node;
}
if (!node->getType().isCoopMat()) {
if (type.getBasicType() != node->getType().getBasicType()) {
node = intermediate.addConversion(type.getBasicType(), node);
if (node == nullptr)
return nullptr;
}
node = intermediate.setAggregateOperator(node, EOpConstructCooperativeMatrix, type, node->getLoc());
node = intermediate.setAggregateOperator(node, op, type, node->getLoc());
} else {
TOperator op = EOpNull;
switch (type.getBasicType()) {
@ -8356,6 +8428,8 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
case EbtFloat16: op = EOpConvFloat16ToInt; break;
case EbtUint8: op = EOpConvUint8ToInt; break;
case EbtInt8: op = EOpConvInt8ToInt; break;
case EbtUint16: op = EOpConvUint16ToInt; break;
case EbtInt16: op = EOpConvInt16ToInt; break;
case EbtUint: op = EOpConvUintToInt; break;
default: assert(0);
}
@ -8366,8 +8440,33 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
case EbtFloat16: op = EOpConvFloat16ToUint; break;
case EbtUint8: op = EOpConvUint8ToUint; break;
case EbtInt8: op = EOpConvInt8ToUint; break;
case EbtUint16: op = EOpConvUint16ToUint; break;
case EbtInt16: op = EOpConvInt16ToUint; break;
case EbtInt: op = EOpConvIntToUint; break;
case EbtUint: op = EOpConvUintToInt8; break;
default: assert(0);
}
break;
case EbtInt16:
switch (node->getType().getBasicType()) {
case EbtFloat: op = EOpConvFloatToInt16; break;
case EbtFloat16: op = EOpConvFloat16ToInt16; break;
case EbtUint8: op = EOpConvUint8ToInt16; break;
case EbtInt8: op = EOpConvInt8ToInt16; break;
case EbtUint16: op = EOpConvUint16ToInt16; break;
case EbtInt: op = EOpConvIntToInt16; break;
case EbtUint: op = EOpConvUintToInt16; break;
default: assert(0);
}
break;
case EbtUint16:
switch (node->getType().getBasicType()) {
case EbtFloat: op = EOpConvFloatToUint16; break;
case EbtFloat16: op = EOpConvFloat16ToUint16; break;
case EbtUint8: op = EOpConvUint8ToUint16; break;
case EbtInt8: op = EOpConvInt8ToUint16; break;
case EbtInt16: op = EOpConvInt16ToUint16; break;
case EbtInt: op = EOpConvIntToUint16; break;
case EbtUint: op = EOpConvUintToUint16; break;
default: assert(0);
}
break;
@ -8376,6 +8475,8 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
case EbtFloat: op = EOpConvFloatToInt8; break;
case EbtFloat16: op = EOpConvFloat16ToInt8; break;
case EbtUint8: op = EOpConvUint8ToInt8; break;
case EbtInt16: op = EOpConvInt16ToInt8; break;
case EbtUint16: op = EOpConvUint16ToInt8; break;
case EbtInt: op = EOpConvIntToInt8; break;
case EbtUint: op = EOpConvUintToInt8; break;
default: assert(0);
@ -8386,6 +8487,8 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
case EbtFloat: op = EOpConvFloatToUint8; break;
case EbtFloat16: op = EOpConvFloat16ToUint8; break;
case EbtInt8: op = EOpConvInt8ToUint8; break;
case EbtInt16: op = EOpConvInt16ToUint8; break;
case EbtUint16: op = EOpConvUint16ToUint8; break;
case EbtInt: op = EOpConvIntToUint8; break;
case EbtUint: op = EOpConvUintToUint8; break;
default: assert(0);
@ -8396,6 +8499,8 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
case EbtFloat16: op = EOpConvFloat16ToFloat; break;
case EbtInt8: op = EOpConvInt8ToFloat; break;
case EbtUint8: op = EOpConvUint8ToFloat; break;
case EbtInt16: op = EOpConvInt16ToFloat; break;
case EbtUint16: op = EOpConvUint16ToFloat; break;
case EbtInt: op = EOpConvIntToFloat; break;
case EbtUint: op = EOpConvUintToFloat; break;
default: assert(0);
@ -8406,6 +8511,8 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
case EbtFloat: op = EOpConvFloatToFloat16; break;
case EbtInt8: op = EOpConvInt8ToFloat16; break;
case EbtUint8: op = EOpConvUint8ToFloat16; break;
case EbtInt16: op = EOpConvInt16ToFloat16; break;
case EbtUint16: op = EOpConvUint16ToFloat16; break;
case EbtInt: op = EOpConvIntToFloat16; break;
case EbtUint: op = EOpConvUintToFloat16; break;
default: assert(0);

View File

@ -382,7 +382,7 @@ public:
void globalCheck(const TSourceLoc&, const char* token);
bool constructorError(const TSourceLoc&, TIntermNode*, TFunction&, TOperator, TType&);
bool constructorTextureSamplerError(const TSourceLoc&, const TFunction&);
void arraySizeCheck(const TSourceLoc&, TIntermTyped* expr, TArraySize&, const char *sizeType);
void arraySizeCheck(const TSourceLoc&, TIntermTyped* expr, TArraySize&, const char *sizeType, const bool allowZero = false);
bool arrayQualifierError(const TSourceLoc&, const TQualifier&);
bool arrayError(const TSourceLoc&, const TType&);
void arraySizeRequiredCheck(const TSourceLoc&, const TArraySizes&);
@ -404,7 +404,7 @@ public:
void setDefaultPrecision(const TSourceLoc&, TPublicType&, TPrecisionQualifier);
int computeSamplerTypeIndex(TSampler&);
TPrecisionQualifier getDefaultPrecision(TPublicType&);
void precisionQualifierCheck(const TSourceLoc&, TBasicType, TQualifier&);
void precisionQualifierCheck(const TSourceLoc&, TBasicType, TQualifier&, bool isCoopMat);
void parameterTypeCheck(const TSourceLoc&, TStorageQualifier qualifier, const TType& type);
bool containsFieldWithBasicType(const TType& type ,TBasicType basicType);
TSymbol* redeclareBuiltinVariable(const TSourceLoc&, const TString&, const TQualifier&, const TShaderQualifiers&);
@ -422,6 +422,7 @@ public:
void inductiveLoopCheck(const TSourceLoc&, TIntermNode* init, TIntermLoop* loop);
void arrayLimitCheck(const TSourceLoc&, const TString&, int size);
void limitCheck(const TSourceLoc&, int value, const char* limit, const char* feature);
void coopMatTypeParametersCheck(const TSourceLoc&, const TPublicType&);
void inductiveLoopBodyCheck(TIntermNode*, long long loopIndexId, TSymbolTable&);
void constantIndexExpressionCheck(TIntermNode*);

View File

@ -770,6 +770,8 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["icoopmatNV"] = ICOOPMATNV;
(*KeywordMap)["ucoopmatNV"] = UCOOPMATNV;
(*KeywordMap)["coopmat"] = COOPMAT;
(*KeywordMap)["hitObjectNV"] = HITOBJECTNV;
(*KeywordMap)["hitObjectAttributeNV"] = HITOBJECTATTRNV;
@ -1781,6 +1783,13 @@ int TScanContext::tokenizeIdentifier()
return keyword;
return identifierOrType();
case COOPMAT:
afterType = true;
if (parseContext.symbolTable.atBuiltInLevel() ||
parseContext.extensionTurnedOn(E_GL_KHR_cooperative_matrix))
return keyword;
return identifierOrType();
case DEMOTE:
if (parseContext.extensionTurnedOn(E_GL_EXT_demote_to_helper_invocation))
return keyword;

View File

@ -263,6 +263,8 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_EXT_fragment_shader_barycentric] = EBhDisable;
extensionBehavior[E_GL_KHR_cooperative_matrix] = EBhDisable;
// #line and #include
extensionBehavior[E_GL_GOOGLE_cpp_style_line_directive] = EBhDisable;
extensionBehavior[E_GL_GOOGLE_include_directive] = EBhDisable;
@ -517,6 +519,8 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_KHR_shader_subgroup_clustered 1\n"
"#define GL_KHR_shader_subgroup_quad 1\n"
"#define GL_KHR_cooperative_matrix 1\n"
"#define GL_EXT_shader_image_int64 1\n"
"#define GL_EXT_shader_atomic_int64 1\n"
"#define GL_EXT_shader_realtime_clock 1\n"
@ -1335,7 +1339,7 @@ void TParseVersions::int64Check(const TSourceLoc& loc, const char* op, bool buil
}
}
void TParseVersions::fcoopmatCheck(const TSourceLoc& loc, const char* op, bool builtIn)
void TParseVersions::fcoopmatCheckNV(const TSourceLoc& loc, const char* op, bool builtIn)
{
if (!builtIn) {
const char* const extensions[] = {E_GL_NV_cooperative_matrix};
@ -1343,13 +1347,21 @@ void TParseVersions::fcoopmatCheck(const TSourceLoc& loc, const char* op, bool b
}
}
void TParseVersions::intcoopmatCheck(const TSourceLoc& loc, const char* op, bool builtIn)
void TParseVersions::intcoopmatCheckNV(const TSourceLoc& loc, const char* op, bool builtIn)
{
if (!builtIn) {
const char* const extensions[] = {E_GL_NV_integer_cooperative_matrix};
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
}
}
void TParseVersions::coopmatCheck(const TSourceLoc& loc, const char* op, bool builtIn)
{
if (!builtIn) {
const char* const extensions[] = {E_GL_KHR_cooperative_matrix};
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
}
}
#endif // GLSLANG_WEB
// Call for any operation removed because SPIR-V is in use.
void TParseVersions::spvRemoved(const TSourceLoc& loc, const char* op)

View File

@ -174,6 +174,7 @@ const char* const E_GL_KHR_shader_subgroup_shuffle_relative = "GL_KHR_shader_sub
const char* const E_GL_KHR_shader_subgroup_clustered = "GL_KHR_shader_subgroup_clustered";
const char* const E_GL_KHR_shader_subgroup_quad = "GL_KHR_shader_subgroup_quad";
const char* const E_GL_KHR_memory_scope_semantics = "GL_KHR_memory_scope_semantics";
const char* const E_GL_KHR_cooperative_matrix = "GL_KHR_cooperative_matrix";
const char* const E_GL_EXT_shader_atomic_int64 = "GL_EXT_shader_atomic_int64";

View File

@ -129,7 +129,7 @@ using namespace glslang;
glslang::TArraySizes* arraySizes;
glslang::TIdentifierList* identifierList;
};
glslang::TArraySizes* typeParameters;
glslang::TTypeParameters* typeParameters;
} interm;
}
@ -211,6 +211,7 @@ GLSLANG_WEB_EXCLUDE_ON
%token <lex> ACCSTRUCTEXT
%token <lex> RAYQUERYEXT
%token <lex> FCOOPMATNV ICOOPMATNV UCOOPMATNV
%token <lex> COOPMAT
%token <lex> HITOBJECTNV HITOBJECTATTRNV
// combined image/sampler
@ -1108,7 +1109,7 @@ parameter_declaration
$$ = $2;
if ($1.qualifier.precision != EpqNone)
$$.param.type->getQualifier().precision = $1.qualifier.precision;
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMat());
parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type);
@ -1120,7 +1121,7 @@ parameter_declaration
parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMat());
}
//
// Without name
@ -1129,7 +1130,7 @@ parameter_declaration
$$ = $2;
if ($1.qualifier.precision != EpqNone)
$$.param.type->getQualifier().precision = $1.qualifier.precision;
parseContext.precisionQualifierCheck($1.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
parseContext.precisionQualifierCheck($1.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMat());
parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type);
@ -1140,7 +1141,7 @@ parameter_declaration
parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMat());
}
;
@ -1217,7 +1218,7 @@ fully_specified_type
parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
}
parseContext.precisionQualifierCheck($$.loc, $$.basicType, $$.qualifier);
parseContext.precisionQualifierCheck($$.loc, $$.basicType, $$.qualifier, $$.isCoopmat());
}
| type_qualifier type_specifier {
parseContext.globalQualifierFixCheck($1.loc, $1.qualifier, false, &$2);
@ -1234,7 +1235,7 @@ fully_specified_type
parseContext.checkNoShaderLayouts($2.loc, $1.shaderQualifiers);
$2.shaderQualifiers.merge($1.shaderQualifiers);
parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier);
parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier, $2.isCoopmat());
$$ = $2;
@ -1716,6 +1717,8 @@ type_specifier
$$ = $1;
$$.qualifier.precision = parseContext.getDefaultPrecision($$);
$$.typeParameters = $2;
parseContext.coopMatTypeParametersCheck($1.loc, $$);
}
| type_specifier_nonarray type_parameter_specifier_opt array_specifier {
parseContext.arrayOfArrayVersionCheck($3.loc, $3.arraySizes);
@ -1723,6 +1726,7 @@ type_specifier
$$.qualifier.precision = parseContext.getDefaultPrecision($$);
$$.typeParameters = $2;
$$.arraySizes = $3.arraySizes;
parseContext.coopMatTypeParametersCheck($1.loc, $$);
}
;
@ -1769,19 +1773,25 @@ type_parameter_specifier
;
type_parameter_specifier_list
: unary_expression {
$$ = new TArraySizes;
: type_specifier {
$$ = new TTypeParameters;
$$->arraySizes = new TArraySizes;
$$->basicType = $1.basicType;
}
| unary_expression {
$$ = new TTypeParameters;
$$->arraySizes = new TArraySizes;
TArraySize size;
parseContext.arraySizeCheck($1->getLoc(), $1, size, "type parameter");
$$->addInnerSize(size);
parseContext.arraySizeCheck($1->getLoc(), $1, size, "type parameter", true);
$$->arraySizes->addInnerSize(size);
}
| type_parameter_specifier_list COMMA unary_expression {
$$ = $1;
TArraySize size;
parseContext.arraySizeCheck($3->getLoc(), $3, size, "type parameter");
$$->addInnerSize(size);
parseContext.arraySizeCheck($3->getLoc(), $3, size, "type parameter", true);
$$->arraySizes->addInnerSize(size);
}
;
@ -3521,22 +3531,32 @@ GLSLANG_WEB_EXCLUDE_ON
$$.sampler.setSubpass(EbtUint, true);
}
| FCOOPMATNV {
parseContext.fcoopmatCheck($1.loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel());
parseContext.fcoopmatCheckNV($1.loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat;
$$.coopmat = true;
$$.coopmatNV = true;
$$.coopmatKHR = false;
}
| ICOOPMATNV {
parseContext.intcoopmatCheck($1.loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel());
parseContext.intcoopmatCheckNV($1.loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt;
$$.coopmat = true;
$$.coopmatNV = true;
$$.coopmatKHR = false;
}
| UCOOPMATNV {
parseContext.intcoopmatCheck($1.loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel());
parseContext.intcoopmatCheckNV($1.loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtUint;
$$.coopmat = true;
$$.coopmatNV = true;
$$.coopmatKHR = false;
}
| COOPMAT {
parseContext.coopmatCheck($1.loc, "coopmat", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtCoopmat;
$$.coopmatNV = false;
$$.coopmatKHR = true;
}
| spirv_type_specifier {
parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier");
@ -3634,7 +3654,7 @@ struct_declaration
$$ = $2;
parseContext.voidErrorCheck($1.loc, (*$2)[0].type->getFieldName(), $1.basicType);
parseContext.precisionQualifierCheck($1.loc, $1.basicType, $1.qualifier);
parseContext.precisionQualifierCheck($1.loc, $1.basicType, $1.qualifier, $1.isCoopmat());
for (unsigned int i = 0; i < $$->size(); ++i) {
TType type($1);
@ -3658,7 +3678,7 @@ struct_declaration
parseContext.memberQualifierCheck($1);
parseContext.voidErrorCheck($2.loc, (*$3)[0].type->getFieldName(), $2.basicType);
parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier);
parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier, $2.isCoopmat());
for (unsigned int i = 0; i < $$->size(); ++i) {
TType type($2);

View File

@ -129,7 +129,7 @@ using namespace glslang;
glslang::TArraySizes* arraySizes;
glslang::TIdentifierList* identifierList;
};
glslang::TArraySizes* typeParameters;
glslang::TTypeParameters* typeParameters;
} interm;
}
@ -211,6 +211,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> ACCSTRUCTEXT
%token <lex> RAYQUERYEXT
%token <lex> FCOOPMATNV ICOOPMATNV UCOOPMATNV
%token <lex> COOPMAT
%token <lex> HITOBJECTNV HITOBJECTATTRNV
// combined image/sampler
@ -1108,7 +1109,7 @@ parameter_declaration
$$ = $2;
if ($1.qualifier.precision != EpqNone)
$$.param.type->getQualifier().precision = $1.qualifier.precision;
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMat());
parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type);
@ -1120,7 +1121,7 @@ parameter_declaration
parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMat());
}
//
// Without name
@ -1129,7 +1130,7 @@ parameter_declaration
$$ = $2;
if ($1.qualifier.precision != EpqNone)
$$.param.type->getQualifier().precision = $1.qualifier.precision;
parseContext.precisionQualifierCheck($1.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
parseContext.precisionQualifierCheck($1.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMat());
parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type);
@ -1140,7 +1141,7 @@ parameter_declaration
parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMat());
}
;
@ -1217,7 +1218,7 @@ fully_specified_type
parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
}
parseContext.precisionQualifierCheck($$.loc, $$.basicType, $$.qualifier);
parseContext.precisionQualifierCheck($$.loc, $$.basicType, $$.qualifier, $$.isCoopmat());
}
| type_qualifier type_specifier {
parseContext.globalQualifierFixCheck($1.loc, $1.qualifier, false, &$2);
@ -1234,7 +1235,7 @@ fully_specified_type
parseContext.checkNoShaderLayouts($2.loc, $1.shaderQualifiers);
$2.shaderQualifiers.merge($1.shaderQualifiers);
parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier);
parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier, $2.isCoopmat());
$$ = $2;
@ -1716,6 +1717,8 @@ type_specifier
$$ = $1;
$$.qualifier.precision = parseContext.getDefaultPrecision($$);
$$.typeParameters = $2;
parseContext.coopMatTypeParametersCheck($1.loc, $$);
}
| type_specifier_nonarray type_parameter_specifier_opt array_specifier {
parseContext.arrayOfArrayVersionCheck($3.loc, $3.arraySizes);
@ -1723,6 +1726,7 @@ type_specifier
$$.qualifier.precision = parseContext.getDefaultPrecision($$);
$$.typeParameters = $2;
$$.arraySizes = $3.arraySizes;
parseContext.coopMatTypeParametersCheck($1.loc, $$);
}
;
@ -1769,19 +1773,25 @@ type_parameter_specifier
;
type_parameter_specifier_list
: unary_expression {
$$ = new TArraySizes;
: type_specifier {
$$ = new TTypeParameters;
$$->arraySizes = new TArraySizes;
$$->basicType = $1.basicType;
}
| unary_expression {
$$ = new TTypeParameters;
$$->arraySizes = new TArraySizes;
TArraySize size;
parseContext.arraySizeCheck($1->getLoc(), $1, size, "type parameter");
$$->addInnerSize(size);
parseContext.arraySizeCheck($1->getLoc(), $1, size, "type parameter", true);
$$->arraySizes->addInnerSize(size);
}
| type_parameter_specifier_list COMMA unary_expression {
$$ = $1;
TArraySize size;
parseContext.arraySizeCheck($3->getLoc(), $3, size, "type parameter");
$$->addInnerSize(size);
parseContext.arraySizeCheck($3->getLoc(), $3, size, "type parameter", true);
$$->arraySizes->addInnerSize(size);
}
;
@ -3521,22 +3531,32 @@ type_specifier_nonarray
$$.sampler.setSubpass(EbtUint, true);
}
| FCOOPMATNV {
parseContext.fcoopmatCheck($1.loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel());
parseContext.fcoopmatCheckNV($1.loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtFloat;
$$.coopmat = true;
$$.coopmatNV = true;
$$.coopmatKHR = false;
}
| ICOOPMATNV {
parseContext.intcoopmatCheck($1.loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel());
parseContext.intcoopmatCheckNV($1.loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtInt;
$$.coopmat = true;
$$.coopmatNV = true;
$$.coopmatKHR = false;
}
| UCOOPMATNV {
parseContext.intcoopmatCheck($1.loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel());
parseContext.intcoopmatCheckNV($1.loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtUint;
$$.coopmat = true;
$$.coopmatNV = true;
$$.coopmatKHR = false;
}
| COOPMAT {
parseContext.coopmatCheck($1.loc, "coopmat", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtCoopmat;
$$.coopmatNV = false;
$$.coopmatKHR = true;
}
| spirv_type_specifier {
parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier");
@ -3634,7 +3654,7 @@ struct_declaration
$$ = $2;
parseContext.voidErrorCheck($1.loc, (*$2)[0].type->getFieldName(), $1.basicType);
parseContext.precisionQualifierCheck($1.loc, $1.basicType, $1.qualifier);
parseContext.precisionQualifierCheck($1.loc, $1.basicType, $1.qualifier, $1.isCoopmat());
for (unsigned int i = 0; i < $$->size(); ++i) {
TType type($1);
@ -3658,7 +3678,7 @@ struct_declaration
parseContext.memberQualifierCheck($1);
parseContext.voidErrorCheck($2.loc, (*$3)[0].type->getFieldName(), $2.basicType);
parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier);
parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier, $2.isCoopmat());
for (unsigned int i = 0; i < $$->size(); ++i) {
TType type($2);

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
/* A Bison parser, made by GNU Bison 3.7.4. */
/* A Bison parser, made by GNU Bison 3.8.2. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
@ -16,7 +16,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@ -217,304 +217,305 @@ extern int yydebug;
FCOOPMATNV = 418, /* FCOOPMATNV */
ICOOPMATNV = 419, /* ICOOPMATNV */
UCOOPMATNV = 420, /* UCOOPMATNV */
HITOBJECTNV = 421, /* HITOBJECTNV */
HITOBJECTATTRNV = 422, /* HITOBJECTATTRNV */
SAMPLERCUBEARRAY = 423, /* SAMPLERCUBEARRAY */
SAMPLERCUBEARRAYSHADOW = 424, /* SAMPLERCUBEARRAYSHADOW */
ISAMPLERCUBEARRAY = 425, /* ISAMPLERCUBEARRAY */
USAMPLERCUBEARRAY = 426, /* USAMPLERCUBEARRAY */
SAMPLER1D = 427, /* SAMPLER1D */
SAMPLER1DARRAY = 428, /* SAMPLER1DARRAY */
SAMPLER1DARRAYSHADOW = 429, /* SAMPLER1DARRAYSHADOW */
ISAMPLER1D = 430, /* ISAMPLER1D */
SAMPLER1DSHADOW = 431, /* SAMPLER1DSHADOW */
SAMPLER2DRECT = 432, /* SAMPLER2DRECT */
SAMPLER2DRECTSHADOW = 433, /* SAMPLER2DRECTSHADOW */
ISAMPLER2DRECT = 434, /* ISAMPLER2DRECT */
USAMPLER2DRECT = 435, /* USAMPLER2DRECT */
SAMPLERBUFFER = 436, /* SAMPLERBUFFER */
ISAMPLERBUFFER = 437, /* ISAMPLERBUFFER */
USAMPLERBUFFER = 438, /* USAMPLERBUFFER */
SAMPLER2DMS = 439, /* SAMPLER2DMS */
ISAMPLER2DMS = 440, /* ISAMPLER2DMS */
USAMPLER2DMS = 441, /* USAMPLER2DMS */
SAMPLER2DMSARRAY = 442, /* SAMPLER2DMSARRAY */
ISAMPLER2DMSARRAY = 443, /* ISAMPLER2DMSARRAY */
USAMPLER2DMSARRAY = 444, /* USAMPLER2DMSARRAY */
SAMPLEREXTERNALOES = 445, /* SAMPLEREXTERNALOES */
SAMPLEREXTERNAL2DY2YEXT = 446, /* SAMPLEREXTERNAL2DY2YEXT */
ISAMPLER1DARRAY = 447, /* ISAMPLER1DARRAY */
USAMPLER1D = 448, /* USAMPLER1D */
USAMPLER1DARRAY = 449, /* USAMPLER1DARRAY */
F16SAMPLER1D = 450, /* F16SAMPLER1D */
F16SAMPLER2D = 451, /* F16SAMPLER2D */
F16SAMPLER3D = 452, /* F16SAMPLER3D */
F16SAMPLER2DRECT = 453, /* F16SAMPLER2DRECT */
F16SAMPLERCUBE = 454, /* F16SAMPLERCUBE */
F16SAMPLER1DARRAY = 455, /* F16SAMPLER1DARRAY */
F16SAMPLER2DARRAY = 456, /* F16SAMPLER2DARRAY */
F16SAMPLERCUBEARRAY = 457, /* F16SAMPLERCUBEARRAY */
F16SAMPLERBUFFER = 458, /* F16SAMPLERBUFFER */
F16SAMPLER2DMS = 459, /* F16SAMPLER2DMS */
F16SAMPLER2DMSARRAY = 460, /* F16SAMPLER2DMSARRAY */
F16SAMPLER1DSHADOW = 461, /* F16SAMPLER1DSHADOW */
F16SAMPLER2DSHADOW = 462, /* F16SAMPLER2DSHADOW */
F16SAMPLER1DARRAYSHADOW = 463, /* F16SAMPLER1DARRAYSHADOW */
F16SAMPLER2DARRAYSHADOW = 464, /* F16SAMPLER2DARRAYSHADOW */
F16SAMPLER2DRECTSHADOW = 465, /* F16SAMPLER2DRECTSHADOW */
F16SAMPLERCUBESHADOW = 466, /* F16SAMPLERCUBESHADOW */
F16SAMPLERCUBEARRAYSHADOW = 467, /* F16SAMPLERCUBEARRAYSHADOW */
IMAGE1D = 468, /* IMAGE1D */
IIMAGE1D = 469, /* IIMAGE1D */
UIMAGE1D = 470, /* UIMAGE1D */
IMAGE2D = 471, /* IMAGE2D */
IIMAGE2D = 472, /* IIMAGE2D */
UIMAGE2D = 473, /* UIMAGE2D */
IMAGE3D = 474, /* IMAGE3D */
IIMAGE3D = 475, /* IIMAGE3D */
UIMAGE3D = 476, /* UIMAGE3D */
IMAGE2DRECT = 477, /* IMAGE2DRECT */
IIMAGE2DRECT = 478, /* IIMAGE2DRECT */
UIMAGE2DRECT = 479, /* UIMAGE2DRECT */
IMAGECUBE = 480, /* IMAGECUBE */
IIMAGECUBE = 481, /* IIMAGECUBE */
UIMAGECUBE = 482, /* UIMAGECUBE */
IMAGEBUFFER = 483, /* IMAGEBUFFER */
IIMAGEBUFFER = 484, /* IIMAGEBUFFER */
UIMAGEBUFFER = 485, /* UIMAGEBUFFER */
IMAGE1DARRAY = 486, /* IMAGE1DARRAY */
IIMAGE1DARRAY = 487, /* IIMAGE1DARRAY */
UIMAGE1DARRAY = 488, /* UIMAGE1DARRAY */
IMAGE2DARRAY = 489, /* IMAGE2DARRAY */
IIMAGE2DARRAY = 490, /* IIMAGE2DARRAY */
UIMAGE2DARRAY = 491, /* UIMAGE2DARRAY */
IMAGECUBEARRAY = 492, /* IMAGECUBEARRAY */
IIMAGECUBEARRAY = 493, /* IIMAGECUBEARRAY */
UIMAGECUBEARRAY = 494, /* UIMAGECUBEARRAY */
IMAGE2DMS = 495, /* IMAGE2DMS */
IIMAGE2DMS = 496, /* IIMAGE2DMS */
UIMAGE2DMS = 497, /* UIMAGE2DMS */
IMAGE2DMSARRAY = 498, /* IMAGE2DMSARRAY */
IIMAGE2DMSARRAY = 499, /* IIMAGE2DMSARRAY */
UIMAGE2DMSARRAY = 500, /* UIMAGE2DMSARRAY */
F16IMAGE1D = 501, /* F16IMAGE1D */
F16IMAGE2D = 502, /* F16IMAGE2D */
F16IMAGE3D = 503, /* F16IMAGE3D */
F16IMAGE2DRECT = 504, /* F16IMAGE2DRECT */
F16IMAGECUBE = 505, /* F16IMAGECUBE */
F16IMAGE1DARRAY = 506, /* F16IMAGE1DARRAY */
F16IMAGE2DARRAY = 507, /* F16IMAGE2DARRAY */
F16IMAGECUBEARRAY = 508, /* F16IMAGECUBEARRAY */
F16IMAGEBUFFER = 509, /* F16IMAGEBUFFER */
F16IMAGE2DMS = 510, /* F16IMAGE2DMS */
F16IMAGE2DMSARRAY = 511, /* F16IMAGE2DMSARRAY */
I64IMAGE1D = 512, /* I64IMAGE1D */
U64IMAGE1D = 513, /* U64IMAGE1D */
I64IMAGE2D = 514, /* I64IMAGE2D */
U64IMAGE2D = 515, /* U64IMAGE2D */
I64IMAGE3D = 516, /* I64IMAGE3D */
U64IMAGE3D = 517, /* U64IMAGE3D */
I64IMAGE2DRECT = 518, /* I64IMAGE2DRECT */
U64IMAGE2DRECT = 519, /* U64IMAGE2DRECT */
I64IMAGECUBE = 520, /* I64IMAGECUBE */
U64IMAGECUBE = 521, /* U64IMAGECUBE */
I64IMAGEBUFFER = 522, /* I64IMAGEBUFFER */
U64IMAGEBUFFER = 523, /* U64IMAGEBUFFER */
I64IMAGE1DARRAY = 524, /* I64IMAGE1DARRAY */
U64IMAGE1DARRAY = 525, /* U64IMAGE1DARRAY */
I64IMAGE2DARRAY = 526, /* I64IMAGE2DARRAY */
U64IMAGE2DARRAY = 527, /* U64IMAGE2DARRAY */
I64IMAGECUBEARRAY = 528, /* I64IMAGECUBEARRAY */
U64IMAGECUBEARRAY = 529, /* U64IMAGECUBEARRAY */
I64IMAGE2DMS = 530, /* I64IMAGE2DMS */
U64IMAGE2DMS = 531, /* U64IMAGE2DMS */
I64IMAGE2DMSARRAY = 532, /* I64IMAGE2DMSARRAY */
U64IMAGE2DMSARRAY = 533, /* U64IMAGE2DMSARRAY */
TEXTURECUBEARRAY = 534, /* TEXTURECUBEARRAY */
ITEXTURECUBEARRAY = 535, /* ITEXTURECUBEARRAY */
UTEXTURECUBEARRAY = 536, /* UTEXTURECUBEARRAY */
TEXTURE1D = 537, /* TEXTURE1D */
ITEXTURE1D = 538, /* ITEXTURE1D */
UTEXTURE1D = 539, /* UTEXTURE1D */
TEXTURE1DARRAY = 540, /* TEXTURE1DARRAY */
ITEXTURE1DARRAY = 541, /* ITEXTURE1DARRAY */
UTEXTURE1DARRAY = 542, /* UTEXTURE1DARRAY */
TEXTURE2DRECT = 543, /* TEXTURE2DRECT */
ITEXTURE2DRECT = 544, /* ITEXTURE2DRECT */
UTEXTURE2DRECT = 545, /* UTEXTURE2DRECT */
TEXTUREBUFFER = 546, /* TEXTUREBUFFER */
ITEXTUREBUFFER = 547, /* ITEXTUREBUFFER */
UTEXTUREBUFFER = 548, /* UTEXTUREBUFFER */
TEXTURE2DMS = 549, /* TEXTURE2DMS */
ITEXTURE2DMS = 550, /* ITEXTURE2DMS */
UTEXTURE2DMS = 551, /* UTEXTURE2DMS */
TEXTURE2DMSARRAY = 552, /* TEXTURE2DMSARRAY */
ITEXTURE2DMSARRAY = 553, /* ITEXTURE2DMSARRAY */
UTEXTURE2DMSARRAY = 554, /* UTEXTURE2DMSARRAY */
F16TEXTURE1D = 555, /* F16TEXTURE1D */
F16TEXTURE2D = 556, /* F16TEXTURE2D */
F16TEXTURE3D = 557, /* F16TEXTURE3D */
F16TEXTURE2DRECT = 558, /* F16TEXTURE2DRECT */
F16TEXTURECUBE = 559, /* F16TEXTURECUBE */
F16TEXTURE1DARRAY = 560, /* F16TEXTURE1DARRAY */
F16TEXTURE2DARRAY = 561, /* F16TEXTURE2DARRAY */
F16TEXTURECUBEARRAY = 562, /* F16TEXTURECUBEARRAY */
F16TEXTUREBUFFER = 563, /* F16TEXTUREBUFFER */
F16TEXTURE2DMS = 564, /* F16TEXTURE2DMS */
F16TEXTURE2DMSARRAY = 565, /* F16TEXTURE2DMSARRAY */
SUBPASSINPUT = 566, /* SUBPASSINPUT */
SUBPASSINPUTMS = 567, /* SUBPASSINPUTMS */
ISUBPASSINPUT = 568, /* ISUBPASSINPUT */
ISUBPASSINPUTMS = 569, /* ISUBPASSINPUTMS */
USUBPASSINPUT = 570, /* USUBPASSINPUT */
USUBPASSINPUTMS = 571, /* USUBPASSINPUTMS */
F16SUBPASSINPUT = 572, /* F16SUBPASSINPUT */
F16SUBPASSINPUTMS = 573, /* F16SUBPASSINPUTMS */
SPIRV_INSTRUCTION = 574, /* SPIRV_INSTRUCTION */
SPIRV_EXECUTION_MODE = 575, /* SPIRV_EXECUTION_MODE */
SPIRV_EXECUTION_MODE_ID = 576, /* SPIRV_EXECUTION_MODE_ID */
SPIRV_DECORATE = 577, /* SPIRV_DECORATE */
SPIRV_DECORATE_ID = 578, /* SPIRV_DECORATE_ID */
SPIRV_DECORATE_STRING = 579, /* SPIRV_DECORATE_STRING */
SPIRV_TYPE = 580, /* SPIRV_TYPE */
SPIRV_STORAGE_CLASS = 581, /* SPIRV_STORAGE_CLASS */
SPIRV_BY_REFERENCE = 582, /* SPIRV_BY_REFERENCE */
SPIRV_LITERAL = 583, /* SPIRV_LITERAL */
ATTACHMENTEXT = 584, /* ATTACHMENTEXT */
IATTACHMENTEXT = 585, /* IATTACHMENTEXT */
UATTACHMENTEXT = 586, /* UATTACHMENTEXT */
LEFT_OP = 587, /* LEFT_OP */
RIGHT_OP = 588, /* RIGHT_OP */
INC_OP = 589, /* INC_OP */
DEC_OP = 590, /* DEC_OP */
LE_OP = 591, /* LE_OP */
GE_OP = 592, /* GE_OP */
EQ_OP = 593, /* EQ_OP */
NE_OP = 594, /* NE_OP */
AND_OP = 595, /* AND_OP */
OR_OP = 596, /* OR_OP */
XOR_OP = 597, /* XOR_OP */
MUL_ASSIGN = 598, /* MUL_ASSIGN */
DIV_ASSIGN = 599, /* DIV_ASSIGN */
ADD_ASSIGN = 600, /* ADD_ASSIGN */
MOD_ASSIGN = 601, /* MOD_ASSIGN */
LEFT_ASSIGN = 602, /* LEFT_ASSIGN */
RIGHT_ASSIGN = 603, /* RIGHT_ASSIGN */
AND_ASSIGN = 604, /* AND_ASSIGN */
XOR_ASSIGN = 605, /* XOR_ASSIGN */
OR_ASSIGN = 606, /* OR_ASSIGN */
SUB_ASSIGN = 607, /* SUB_ASSIGN */
STRING_LITERAL = 608, /* STRING_LITERAL */
LEFT_PAREN = 609, /* LEFT_PAREN */
RIGHT_PAREN = 610, /* RIGHT_PAREN */
LEFT_BRACKET = 611, /* LEFT_BRACKET */
RIGHT_BRACKET = 612, /* RIGHT_BRACKET */
LEFT_BRACE = 613, /* LEFT_BRACE */
RIGHT_BRACE = 614, /* RIGHT_BRACE */
DOT = 615, /* DOT */
COMMA = 616, /* COMMA */
COLON = 617, /* COLON */
EQUAL = 618, /* EQUAL */
SEMICOLON = 619, /* SEMICOLON */
BANG = 620, /* BANG */
DASH = 621, /* DASH */
TILDE = 622, /* TILDE */
PLUS = 623, /* PLUS */
STAR = 624, /* STAR */
SLASH = 625, /* SLASH */
PERCENT = 626, /* PERCENT */
LEFT_ANGLE = 627, /* LEFT_ANGLE */
RIGHT_ANGLE = 628, /* RIGHT_ANGLE */
VERTICAL_BAR = 629, /* VERTICAL_BAR */
CARET = 630, /* CARET */
AMPERSAND = 631, /* AMPERSAND */
QUESTION = 632, /* QUESTION */
INVARIANT = 633, /* INVARIANT */
HIGH_PRECISION = 634, /* HIGH_PRECISION */
MEDIUM_PRECISION = 635, /* MEDIUM_PRECISION */
LOW_PRECISION = 636, /* LOW_PRECISION */
PRECISION = 637, /* PRECISION */
PACKED = 638, /* PACKED */
RESOURCE = 639, /* RESOURCE */
SUPERP = 640, /* SUPERP */
FLOATCONSTANT = 641, /* FLOATCONSTANT */
INTCONSTANT = 642, /* INTCONSTANT */
UINTCONSTANT = 643, /* UINTCONSTANT */
BOOLCONSTANT = 644, /* BOOLCONSTANT */
IDENTIFIER = 645, /* IDENTIFIER */
TYPE_NAME = 646, /* TYPE_NAME */
CENTROID = 647, /* CENTROID */
IN = 648, /* IN */
OUT = 649, /* OUT */
INOUT = 650, /* INOUT */
STRUCT = 651, /* STRUCT */
VOID = 652, /* VOID */
WHILE = 653, /* WHILE */
BREAK = 654, /* BREAK */
CONTINUE = 655, /* CONTINUE */
DO = 656, /* DO */
ELSE = 657, /* ELSE */
FOR = 658, /* FOR */
IF = 659, /* IF */
DISCARD = 660, /* DISCARD */
RETURN = 661, /* RETURN */
SWITCH = 662, /* SWITCH */
CASE = 663, /* CASE */
DEFAULT = 664, /* DEFAULT */
TERMINATE_INVOCATION = 665, /* TERMINATE_INVOCATION */
TERMINATE_RAY = 666, /* TERMINATE_RAY */
IGNORE_INTERSECTION = 667, /* IGNORE_INTERSECTION */
UNIFORM = 668, /* UNIFORM */
SHARED = 669, /* SHARED */
BUFFER = 670, /* BUFFER */
TILEIMAGEEXT = 671, /* TILEIMAGEEXT */
FLAT = 672, /* FLAT */
SMOOTH = 673, /* SMOOTH */
LAYOUT = 674, /* LAYOUT */
DOUBLECONSTANT = 675, /* DOUBLECONSTANT */
INT16CONSTANT = 676, /* INT16CONSTANT */
UINT16CONSTANT = 677, /* UINT16CONSTANT */
FLOAT16CONSTANT = 678, /* FLOAT16CONSTANT */
INT32CONSTANT = 679, /* INT32CONSTANT */
UINT32CONSTANT = 680, /* UINT32CONSTANT */
INT64CONSTANT = 681, /* INT64CONSTANT */
UINT64CONSTANT = 682, /* UINT64CONSTANT */
SUBROUTINE = 683, /* SUBROUTINE */
DEMOTE = 684, /* DEMOTE */
PAYLOADNV = 685, /* PAYLOADNV */
PAYLOADINNV = 686, /* PAYLOADINNV */
HITATTRNV = 687, /* HITATTRNV */
CALLDATANV = 688, /* CALLDATANV */
CALLDATAINNV = 689, /* CALLDATAINNV */
PAYLOADEXT = 690, /* PAYLOADEXT */
PAYLOADINEXT = 691, /* PAYLOADINEXT */
HITATTREXT = 692, /* HITATTREXT */
CALLDATAEXT = 693, /* CALLDATAEXT */
CALLDATAINEXT = 694, /* CALLDATAINEXT */
PATCH = 695, /* PATCH */
SAMPLE = 696, /* SAMPLE */
NONUNIFORM = 697, /* NONUNIFORM */
COHERENT = 698, /* COHERENT */
VOLATILE = 699, /* VOLATILE */
RESTRICT = 700, /* RESTRICT */
READONLY = 701, /* READONLY */
WRITEONLY = 702, /* WRITEONLY */
DEVICECOHERENT = 703, /* DEVICECOHERENT */
QUEUEFAMILYCOHERENT = 704, /* QUEUEFAMILYCOHERENT */
WORKGROUPCOHERENT = 705, /* WORKGROUPCOHERENT */
SUBGROUPCOHERENT = 706, /* SUBGROUPCOHERENT */
NONPRIVATE = 707, /* NONPRIVATE */
SHADERCALLCOHERENT = 708, /* SHADERCALLCOHERENT */
NOPERSPECTIVE = 709, /* NOPERSPECTIVE */
EXPLICITINTERPAMD = 710, /* EXPLICITINTERPAMD */
PERVERTEXEXT = 711, /* PERVERTEXEXT */
PERVERTEXNV = 712, /* PERVERTEXNV */
PERPRIMITIVENV = 713, /* PERPRIMITIVENV */
PERVIEWNV = 714, /* PERVIEWNV */
PERTASKNV = 715, /* PERTASKNV */
PERPRIMITIVEEXT = 716, /* PERPRIMITIVEEXT */
TASKPAYLOADWORKGROUPEXT = 717, /* TASKPAYLOADWORKGROUPEXT */
PRECISE = 718 /* PRECISE */
COOPMAT = 421, /* COOPMAT */
HITOBJECTNV = 422, /* HITOBJECTNV */
HITOBJECTATTRNV = 423, /* HITOBJECTATTRNV */
SAMPLERCUBEARRAY = 424, /* SAMPLERCUBEARRAY */
SAMPLERCUBEARRAYSHADOW = 425, /* SAMPLERCUBEARRAYSHADOW */
ISAMPLERCUBEARRAY = 426, /* ISAMPLERCUBEARRAY */
USAMPLERCUBEARRAY = 427, /* USAMPLERCUBEARRAY */
SAMPLER1D = 428, /* SAMPLER1D */
SAMPLER1DARRAY = 429, /* SAMPLER1DARRAY */
SAMPLER1DARRAYSHADOW = 430, /* SAMPLER1DARRAYSHADOW */
ISAMPLER1D = 431, /* ISAMPLER1D */
SAMPLER1DSHADOW = 432, /* SAMPLER1DSHADOW */
SAMPLER2DRECT = 433, /* SAMPLER2DRECT */
SAMPLER2DRECTSHADOW = 434, /* SAMPLER2DRECTSHADOW */
ISAMPLER2DRECT = 435, /* ISAMPLER2DRECT */
USAMPLER2DRECT = 436, /* USAMPLER2DRECT */
SAMPLERBUFFER = 437, /* SAMPLERBUFFER */
ISAMPLERBUFFER = 438, /* ISAMPLERBUFFER */
USAMPLERBUFFER = 439, /* USAMPLERBUFFER */
SAMPLER2DMS = 440, /* SAMPLER2DMS */
ISAMPLER2DMS = 441, /* ISAMPLER2DMS */
USAMPLER2DMS = 442, /* USAMPLER2DMS */
SAMPLER2DMSARRAY = 443, /* SAMPLER2DMSARRAY */
ISAMPLER2DMSARRAY = 444, /* ISAMPLER2DMSARRAY */
USAMPLER2DMSARRAY = 445, /* USAMPLER2DMSARRAY */
SAMPLEREXTERNALOES = 446, /* SAMPLEREXTERNALOES */
SAMPLEREXTERNAL2DY2YEXT = 447, /* SAMPLEREXTERNAL2DY2YEXT */
ISAMPLER1DARRAY = 448, /* ISAMPLER1DARRAY */
USAMPLER1D = 449, /* USAMPLER1D */
USAMPLER1DARRAY = 450, /* USAMPLER1DARRAY */
F16SAMPLER1D = 451, /* F16SAMPLER1D */
F16SAMPLER2D = 452, /* F16SAMPLER2D */
F16SAMPLER3D = 453, /* F16SAMPLER3D */
F16SAMPLER2DRECT = 454, /* F16SAMPLER2DRECT */
F16SAMPLERCUBE = 455, /* F16SAMPLERCUBE */
F16SAMPLER1DARRAY = 456, /* F16SAMPLER1DARRAY */
F16SAMPLER2DARRAY = 457, /* F16SAMPLER2DARRAY */
F16SAMPLERCUBEARRAY = 458, /* F16SAMPLERCUBEARRAY */
F16SAMPLERBUFFER = 459, /* F16SAMPLERBUFFER */
F16SAMPLER2DMS = 460, /* F16SAMPLER2DMS */
F16SAMPLER2DMSARRAY = 461, /* F16SAMPLER2DMSARRAY */
F16SAMPLER1DSHADOW = 462, /* F16SAMPLER1DSHADOW */
F16SAMPLER2DSHADOW = 463, /* F16SAMPLER2DSHADOW */
F16SAMPLER1DARRAYSHADOW = 464, /* F16SAMPLER1DARRAYSHADOW */
F16SAMPLER2DARRAYSHADOW = 465, /* F16SAMPLER2DARRAYSHADOW */
F16SAMPLER2DRECTSHADOW = 466, /* F16SAMPLER2DRECTSHADOW */
F16SAMPLERCUBESHADOW = 467, /* F16SAMPLERCUBESHADOW */
F16SAMPLERCUBEARRAYSHADOW = 468, /* F16SAMPLERCUBEARRAYSHADOW */
IMAGE1D = 469, /* IMAGE1D */
IIMAGE1D = 470, /* IIMAGE1D */
UIMAGE1D = 471, /* UIMAGE1D */
IMAGE2D = 472, /* IMAGE2D */
IIMAGE2D = 473, /* IIMAGE2D */
UIMAGE2D = 474, /* UIMAGE2D */
IMAGE3D = 475, /* IMAGE3D */
IIMAGE3D = 476, /* IIMAGE3D */
UIMAGE3D = 477, /* UIMAGE3D */
IMAGE2DRECT = 478, /* IMAGE2DRECT */
IIMAGE2DRECT = 479, /* IIMAGE2DRECT */
UIMAGE2DRECT = 480, /* UIMAGE2DRECT */
IMAGECUBE = 481, /* IMAGECUBE */
IIMAGECUBE = 482, /* IIMAGECUBE */
UIMAGECUBE = 483, /* UIMAGECUBE */
IMAGEBUFFER = 484, /* IMAGEBUFFER */
IIMAGEBUFFER = 485, /* IIMAGEBUFFER */
UIMAGEBUFFER = 486, /* UIMAGEBUFFER */
IMAGE1DARRAY = 487, /* IMAGE1DARRAY */
IIMAGE1DARRAY = 488, /* IIMAGE1DARRAY */
UIMAGE1DARRAY = 489, /* UIMAGE1DARRAY */
IMAGE2DARRAY = 490, /* IMAGE2DARRAY */
IIMAGE2DARRAY = 491, /* IIMAGE2DARRAY */
UIMAGE2DARRAY = 492, /* UIMAGE2DARRAY */
IMAGECUBEARRAY = 493, /* IMAGECUBEARRAY */
IIMAGECUBEARRAY = 494, /* IIMAGECUBEARRAY */
UIMAGECUBEARRAY = 495, /* UIMAGECUBEARRAY */
IMAGE2DMS = 496, /* IMAGE2DMS */
IIMAGE2DMS = 497, /* IIMAGE2DMS */
UIMAGE2DMS = 498, /* UIMAGE2DMS */
IMAGE2DMSARRAY = 499, /* IMAGE2DMSARRAY */
IIMAGE2DMSARRAY = 500, /* IIMAGE2DMSARRAY */
UIMAGE2DMSARRAY = 501, /* UIMAGE2DMSARRAY */
F16IMAGE1D = 502, /* F16IMAGE1D */
F16IMAGE2D = 503, /* F16IMAGE2D */
F16IMAGE3D = 504, /* F16IMAGE3D */
F16IMAGE2DRECT = 505, /* F16IMAGE2DRECT */
F16IMAGECUBE = 506, /* F16IMAGECUBE */
F16IMAGE1DARRAY = 507, /* F16IMAGE1DARRAY */
F16IMAGE2DARRAY = 508, /* F16IMAGE2DARRAY */
F16IMAGECUBEARRAY = 509, /* F16IMAGECUBEARRAY */
F16IMAGEBUFFER = 510, /* F16IMAGEBUFFER */
F16IMAGE2DMS = 511, /* F16IMAGE2DMS */
F16IMAGE2DMSARRAY = 512, /* F16IMAGE2DMSARRAY */
I64IMAGE1D = 513, /* I64IMAGE1D */
U64IMAGE1D = 514, /* U64IMAGE1D */
I64IMAGE2D = 515, /* I64IMAGE2D */
U64IMAGE2D = 516, /* U64IMAGE2D */
I64IMAGE3D = 517, /* I64IMAGE3D */
U64IMAGE3D = 518, /* U64IMAGE3D */
I64IMAGE2DRECT = 519, /* I64IMAGE2DRECT */
U64IMAGE2DRECT = 520, /* U64IMAGE2DRECT */
I64IMAGECUBE = 521, /* I64IMAGECUBE */
U64IMAGECUBE = 522, /* U64IMAGECUBE */
I64IMAGEBUFFER = 523, /* I64IMAGEBUFFER */
U64IMAGEBUFFER = 524, /* U64IMAGEBUFFER */
I64IMAGE1DARRAY = 525, /* I64IMAGE1DARRAY */
U64IMAGE1DARRAY = 526, /* U64IMAGE1DARRAY */
I64IMAGE2DARRAY = 527, /* I64IMAGE2DARRAY */
U64IMAGE2DARRAY = 528, /* U64IMAGE2DARRAY */
I64IMAGECUBEARRAY = 529, /* I64IMAGECUBEARRAY */
U64IMAGECUBEARRAY = 530, /* U64IMAGECUBEARRAY */
I64IMAGE2DMS = 531, /* I64IMAGE2DMS */
U64IMAGE2DMS = 532, /* U64IMAGE2DMS */
I64IMAGE2DMSARRAY = 533, /* I64IMAGE2DMSARRAY */
U64IMAGE2DMSARRAY = 534, /* U64IMAGE2DMSARRAY */
TEXTURECUBEARRAY = 535, /* TEXTURECUBEARRAY */
ITEXTURECUBEARRAY = 536, /* ITEXTURECUBEARRAY */
UTEXTURECUBEARRAY = 537, /* UTEXTURECUBEARRAY */
TEXTURE1D = 538, /* TEXTURE1D */
ITEXTURE1D = 539, /* ITEXTURE1D */
UTEXTURE1D = 540, /* UTEXTURE1D */
TEXTURE1DARRAY = 541, /* TEXTURE1DARRAY */
ITEXTURE1DARRAY = 542, /* ITEXTURE1DARRAY */
UTEXTURE1DARRAY = 543, /* UTEXTURE1DARRAY */
TEXTURE2DRECT = 544, /* TEXTURE2DRECT */
ITEXTURE2DRECT = 545, /* ITEXTURE2DRECT */
UTEXTURE2DRECT = 546, /* UTEXTURE2DRECT */
TEXTUREBUFFER = 547, /* TEXTUREBUFFER */
ITEXTUREBUFFER = 548, /* ITEXTUREBUFFER */
UTEXTUREBUFFER = 549, /* UTEXTUREBUFFER */
TEXTURE2DMS = 550, /* TEXTURE2DMS */
ITEXTURE2DMS = 551, /* ITEXTURE2DMS */
UTEXTURE2DMS = 552, /* UTEXTURE2DMS */
TEXTURE2DMSARRAY = 553, /* TEXTURE2DMSARRAY */
ITEXTURE2DMSARRAY = 554, /* ITEXTURE2DMSARRAY */
UTEXTURE2DMSARRAY = 555, /* UTEXTURE2DMSARRAY */
F16TEXTURE1D = 556, /* F16TEXTURE1D */
F16TEXTURE2D = 557, /* F16TEXTURE2D */
F16TEXTURE3D = 558, /* F16TEXTURE3D */
F16TEXTURE2DRECT = 559, /* F16TEXTURE2DRECT */
F16TEXTURECUBE = 560, /* F16TEXTURECUBE */
F16TEXTURE1DARRAY = 561, /* F16TEXTURE1DARRAY */
F16TEXTURE2DARRAY = 562, /* F16TEXTURE2DARRAY */
F16TEXTURECUBEARRAY = 563, /* F16TEXTURECUBEARRAY */
F16TEXTUREBUFFER = 564, /* F16TEXTUREBUFFER */
F16TEXTURE2DMS = 565, /* F16TEXTURE2DMS */
F16TEXTURE2DMSARRAY = 566, /* F16TEXTURE2DMSARRAY */
SUBPASSINPUT = 567, /* SUBPASSINPUT */
SUBPASSINPUTMS = 568, /* SUBPASSINPUTMS */
ISUBPASSINPUT = 569, /* ISUBPASSINPUT */
ISUBPASSINPUTMS = 570, /* ISUBPASSINPUTMS */
USUBPASSINPUT = 571, /* USUBPASSINPUT */
USUBPASSINPUTMS = 572, /* USUBPASSINPUTMS */
F16SUBPASSINPUT = 573, /* F16SUBPASSINPUT */
F16SUBPASSINPUTMS = 574, /* F16SUBPASSINPUTMS */
SPIRV_INSTRUCTION = 575, /* SPIRV_INSTRUCTION */
SPIRV_EXECUTION_MODE = 576, /* SPIRV_EXECUTION_MODE */
SPIRV_EXECUTION_MODE_ID = 577, /* SPIRV_EXECUTION_MODE_ID */
SPIRV_DECORATE = 578, /* SPIRV_DECORATE */
SPIRV_DECORATE_ID = 579, /* SPIRV_DECORATE_ID */
SPIRV_DECORATE_STRING = 580, /* SPIRV_DECORATE_STRING */
SPIRV_TYPE = 581, /* SPIRV_TYPE */
SPIRV_STORAGE_CLASS = 582, /* SPIRV_STORAGE_CLASS */
SPIRV_BY_REFERENCE = 583, /* SPIRV_BY_REFERENCE */
SPIRV_LITERAL = 584, /* SPIRV_LITERAL */
ATTACHMENTEXT = 585, /* ATTACHMENTEXT */
IATTACHMENTEXT = 586, /* IATTACHMENTEXT */
UATTACHMENTEXT = 587, /* UATTACHMENTEXT */
LEFT_OP = 588, /* LEFT_OP */
RIGHT_OP = 589, /* RIGHT_OP */
INC_OP = 590, /* INC_OP */
DEC_OP = 591, /* DEC_OP */
LE_OP = 592, /* LE_OP */
GE_OP = 593, /* GE_OP */
EQ_OP = 594, /* EQ_OP */
NE_OP = 595, /* NE_OP */
AND_OP = 596, /* AND_OP */
OR_OP = 597, /* OR_OP */
XOR_OP = 598, /* XOR_OP */
MUL_ASSIGN = 599, /* MUL_ASSIGN */
DIV_ASSIGN = 600, /* DIV_ASSIGN */
ADD_ASSIGN = 601, /* ADD_ASSIGN */
MOD_ASSIGN = 602, /* MOD_ASSIGN */
LEFT_ASSIGN = 603, /* LEFT_ASSIGN */
RIGHT_ASSIGN = 604, /* RIGHT_ASSIGN */
AND_ASSIGN = 605, /* AND_ASSIGN */
XOR_ASSIGN = 606, /* XOR_ASSIGN */
OR_ASSIGN = 607, /* OR_ASSIGN */
SUB_ASSIGN = 608, /* SUB_ASSIGN */
STRING_LITERAL = 609, /* STRING_LITERAL */
LEFT_PAREN = 610, /* LEFT_PAREN */
RIGHT_PAREN = 611, /* RIGHT_PAREN */
LEFT_BRACKET = 612, /* LEFT_BRACKET */
RIGHT_BRACKET = 613, /* RIGHT_BRACKET */
LEFT_BRACE = 614, /* LEFT_BRACE */
RIGHT_BRACE = 615, /* RIGHT_BRACE */
DOT = 616, /* DOT */
COMMA = 617, /* COMMA */
COLON = 618, /* COLON */
EQUAL = 619, /* EQUAL */
SEMICOLON = 620, /* SEMICOLON */
BANG = 621, /* BANG */
DASH = 622, /* DASH */
TILDE = 623, /* TILDE */
PLUS = 624, /* PLUS */
STAR = 625, /* STAR */
SLASH = 626, /* SLASH */
PERCENT = 627, /* PERCENT */
LEFT_ANGLE = 628, /* LEFT_ANGLE */
RIGHT_ANGLE = 629, /* RIGHT_ANGLE */
VERTICAL_BAR = 630, /* VERTICAL_BAR */
CARET = 631, /* CARET */
AMPERSAND = 632, /* AMPERSAND */
QUESTION = 633, /* QUESTION */
INVARIANT = 634, /* INVARIANT */
HIGH_PRECISION = 635, /* HIGH_PRECISION */
MEDIUM_PRECISION = 636, /* MEDIUM_PRECISION */
LOW_PRECISION = 637, /* LOW_PRECISION */
PRECISION = 638, /* PRECISION */
PACKED = 639, /* PACKED */
RESOURCE = 640, /* RESOURCE */
SUPERP = 641, /* SUPERP */
FLOATCONSTANT = 642, /* FLOATCONSTANT */
INTCONSTANT = 643, /* INTCONSTANT */
UINTCONSTANT = 644, /* UINTCONSTANT */
BOOLCONSTANT = 645, /* BOOLCONSTANT */
IDENTIFIER = 646, /* IDENTIFIER */
TYPE_NAME = 647, /* TYPE_NAME */
CENTROID = 648, /* CENTROID */
IN = 649, /* IN */
OUT = 650, /* OUT */
INOUT = 651, /* INOUT */
STRUCT = 652, /* STRUCT */
VOID = 653, /* VOID */
WHILE = 654, /* WHILE */
BREAK = 655, /* BREAK */
CONTINUE = 656, /* CONTINUE */
DO = 657, /* DO */
ELSE = 658, /* ELSE */
FOR = 659, /* FOR */
IF = 660, /* IF */
DISCARD = 661, /* DISCARD */
RETURN = 662, /* RETURN */
SWITCH = 663, /* SWITCH */
CASE = 664, /* CASE */
DEFAULT = 665, /* DEFAULT */
TERMINATE_INVOCATION = 666, /* TERMINATE_INVOCATION */
TERMINATE_RAY = 667, /* TERMINATE_RAY */
IGNORE_INTERSECTION = 668, /* IGNORE_INTERSECTION */
UNIFORM = 669, /* UNIFORM */
SHARED = 670, /* SHARED */
BUFFER = 671, /* BUFFER */
TILEIMAGEEXT = 672, /* TILEIMAGEEXT */
FLAT = 673, /* FLAT */
SMOOTH = 674, /* SMOOTH */
LAYOUT = 675, /* LAYOUT */
DOUBLECONSTANT = 676, /* DOUBLECONSTANT */
INT16CONSTANT = 677, /* INT16CONSTANT */
UINT16CONSTANT = 678, /* UINT16CONSTANT */
FLOAT16CONSTANT = 679, /* FLOAT16CONSTANT */
INT32CONSTANT = 680, /* INT32CONSTANT */
UINT32CONSTANT = 681, /* UINT32CONSTANT */
INT64CONSTANT = 682, /* INT64CONSTANT */
UINT64CONSTANT = 683, /* UINT64CONSTANT */
SUBROUTINE = 684, /* SUBROUTINE */
DEMOTE = 685, /* DEMOTE */
PAYLOADNV = 686, /* PAYLOADNV */
PAYLOADINNV = 687, /* PAYLOADINNV */
HITATTRNV = 688, /* HITATTRNV */
CALLDATANV = 689, /* CALLDATANV */
CALLDATAINNV = 690, /* CALLDATAINNV */
PAYLOADEXT = 691, /* PAYLOADEXT */
PAYLOADINEXT = 692, /* PAYLOADINEXT */
HITATTREXT = 693, /* HITATTREXT */
CALLDATAEXT = 694, /* CALLDATAEXT */
CALLDATAINEXT = 695, /* CALLDATAINEXT */
PATCH = 696, /* PATCH */
SAMPLE = 697, /* SAMPLE */
NONUNIFORM = 698, /* NONUNIFORM */
COHERENT = 699, /* COHERENT */
VOLATILE = 700, /* VOLATILE */
RESTRICT = 701, /* RESTRICT */
READONLY = 702, /* READONLY */
WRITEONLY = 703, /* WRITEONLY */
DEVICECOHERENT = 704, /* DEVICECOHERENT */
QUEUEFAMILYCOHERENT = 705, /* QUEUEFAMILYCOHERENT */
WORKGROUPCOHERENT = 706, /* WORKGROUPCOHERENT */
SUBGROUPCOHERENT = 707, /* SUBGROUPCOHERENT */
NONPRIVATE = 708, /* NONPRIVATE */
SHADERCALLCOHERENT = 709, /* SHADERCALLCOHERENT */
NOPERSPECTIVE = 710, /* NOPERSPECTIVE */
EXPLICITINTERPAMD = 711, /* EXPLICITINTERPAMD */
PERVERTEXEXT = 712, /* PERVERTEXEXT */
PERVERTEXNV = 713, /* PERVERTEXNV */
PERPRIMITIVENV = 714, /* PERPRIMITIVENV */
PERVIEWNV = 715, /* PERVIEWNV */
PERTASKNV = 716, /* PERTASKNV */
PERPRIMITIVEEXT = 717, /* PERPRIMITIVEEXT */
TASKPAYLOADWORKGROUPEXT = 718, /* TASKPAYLOADWORKGROUPEXT */
PRECISE = 719 /* PRECISE */
};
typedef enum yytokentype yytoken_kind_t;
#endif
@ -559,10 +560,10 @@ union YYSTYPE
glslang::TArraySizes* arraySizes;
glslang::TIdentifierList* identifierList;
};
glslang::TArraySizes* typeParameters;
glslang::TTypeParameters* typeParameters;
} interm;
#line 566 "MachineIndependent/glslang_tab.cpp.h"
#line 567 "MachineIndependent/glslang_tab.cpp.h"
};
typedef union YYSTYPE YYSTYPE;
@ -572,6 +573,8 @@ typedef union YYSTYPE YYSTYPE;
int yyparse (glslang::TParseContext* pParseContext);
#endif /* !YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED */

View File

@ -809,7 +809,8 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
case EOpConstructStruct: out.debug << "Construct structure"; break;
case EOpConstructTextureSampler: out.debug << "Construct combined texture-sampler"; break;
case EOpConstructReference: out.debug << "Construct reference"; break;
case EOpConstructCooperativeMatrix: out.debug << "Construct cooperative matrix"; break;
case EOpConstructCooperativeMatrixNV: out.debug << "Construct cooperative matrix NV"; break;
case EOpConstructCooperativeMatrixKHR: out.debug << "Construct cooperative matrix KHR"; break;
case EOpConstructAccStruct: out.debug << "Construct acceleration structure"; break;
case EOpLessThan: out.debug << "Compare Less Than"; break;
@ -1103,9 +1104,12 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
case EOpRayQueryGetIntersectionWorldToObject: out.debug << "rayQueryGetIntersectionWorldToObjectEXT"; break;
case EOpRayQueryGetIntersectionTriangleVertexPositionsEXT: out.debug << "rayQueryGetIntersectionTriangleVertexPositionsEXT"; break;
case EOpCooperativeMatrixLoad: out.debug << "Load cooperative matrix"; break;
case EOpCooperativeMatrixStore: out.debug << "Store cooperative matrix"; break;
case EOpCooperativeMatrixMulAdd: out.debug << "MulAdd cooperative matrices"; break;
case EOpCooperativeMatrixLoad: out.debug << "Load cooperative matrix KHR"; break;
case EOpCooperativeMatrixStore: out.debug << "Store cooperative matrix KHR"; break;
case EOpCooperativeMatrixMulAdd: out.debug << "MulAdd cooperative matrices KHR"; break;
case EOpCooperativeMatrixLoadNV: out.debug << "Load cooperative matrix NV"; break;
case EOpCooperativeMatrixStoreNV: out.debug << "Store cooperative matrix NV"; break;
case EOpCooperativeMatrixMulAddNV: out.debug << "MulAdd cooperative matrices NV"; break;
case EOpIsHelperInvocation: out.debug << "IsHelperInvocation"; break;
case EOpDebugPrintf: out.debug << "Debug printf"; break;

View File

@ -162,8 +162,9 @@ public:
virtual void explicitInt32Check(const TSourceLoc&, const char* op, bool builtIn = false);
virtual void explicitFloat32Check(const TSourceLoc&, const char* op, bool builtIn = false);
virtual void explicitFloat64Check(const TSourceLoc&, const char* op, bool builtIn = false);
virtual void fcoopmatCheck(const TSourceLoc&, const char* op, bool builtIn = false);
virtual void intcoopmatCheck(const TSourceLoc&, const char *op, bool builtIn = false);
virtual void fcoopmatCheckNV(const TSourceLoc&, const char* op, bool builtIn = false);
virtual void intcoopmatCheckNV(const TSourceLoc&, const char *op, bool builtIn = false);
virtual void coopmatCheck(const TSourceLoc&, const char* op, bool builtIn = false);
bool relaxedErrors() const { return (messages & EShMsgRelaxedErrors) != 0; }
bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; }
bool isForwardCompatible() const { return forwardCompatible; }

View File

@ -345,6 +345,12 @@ INSTANTIATE_TEST_SUITE_P(
"spv.conversion.frag",
"spv.coopmat.comp",
"spv.coopmat_Error.comp",
"spv.coopmatKHR.comp",
"spv.coopmatKHR_arithmetic.comp",
"spv.coopmatKHR_arithmeticError.comp",
"spv.coopmatKHR_Error.comp",
"spv.coopmatKHR_constructor.comp",
"spv.coopmatKHR_constructorError.comp",
"spv.dataOut.frag",
"spv.dataOutIndirect.frag",
"spv.dataOutIndirect.vert",