|
@@ -173,7 +173,7 @@ protected:
|
|
|
spv::LinkageType convertGlslangLinkageToSpv(glslang::TLinkType glslangLinkType);
|
|
spv::LinkageType convertGlslangLinkageToSpv(glslang::TLinkType glslangLinkType);
|
|
|
void decorateStructType(const glslang::TType&, const glslang::TTypeList* glslangStruct, glslang::TLayoutPacking,
|
|
void decorateStructType(const glslang::TType&, const glslang::TTypeList* glslangStruct, glslang::TLayoutPacking,
|
|
|
const glslang::TQualifier&, spv::Id, const std::vector<spv::Id>& spvMembers);
|
|
const glslang::TQualifier&, spv::Id, const std::vector<spv::Id>& spvMembers);
|
|
|
- spv::Id makeArraySizeId(const glslang::TArraySizes&, int dim, bool allowZero = false);
|
|
|
|
|
|
|
+ spv::Id makeArraySizeId(const glslang::TArraySizes&, int dim, bool allowZero = false, bool boolType = false);
|
|
|
spv::Id accessChainLoad(const glslang::TType& type);
|
|
spv::Id accessChainLoad(const glslang::TType& type);
|
|
|
void accessChainStore(const glslang::TType& type, spv::Id rvalue);
|
|
void accessChainStore(const glslang::TType& type, spv::Id rvalue);
|
|
|
void multiTypeStore(const glslang::TType&, spv::Id rValue);
|
|
void multiTypeStore(const glslang::TType&, spv::Id rValue);
|
|
@@ -209,8 +209,9 @@ protected:
|
|
|
spv::Id createUnaryMatrixOperation(spv::Op op, OpDecorations&, spv::Id typeId, spv::Id operand,
|
|
spv::Id createUnaryMatrixOperation(spv::Op op, OpDecorations&, spv::Id typeId, spv::Id operand,
|
|
|
glslang::TBasicType typeProxy);
|
|
glslang::TBasicType typeProxy);
|
|
|
spv::Id createConversion(glslang::TOperator op, OpDecorations&, spv::Id destTypeId, spv::Id operand,
|
|
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 destType);
|
|
|
|
|
|
|
+ glslang::TBasicType resultBasicType, glslang::TBasicType operandBasicType);
|
|
|
|
|
+ spv::Id createIntWidthConversion(spv::Id operand, int vectorSize, spv::Id destType,
|
|
|
|
|
+ glslang::TBasicType resultBasicType, glslang::TBasicType operandBasicType);
|
|
|
spv::Id makeSmearedConstant(spv::Id constant, int vectorSize);
|
|
spv::Id makeSmearedConstant(spv::Id constant, int vectorSize);
|
|
|
spv::Id createAtomicOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId,
|
|
spv::Id createAtomicOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId,
|
|
|
std::vector<spv::Id>& operands, glslang::TBasicType typeProxy,
|
|
std::vector<spv::Id>& operands, glslang::TBasicType typeProxy,
|
|
@@ -2040,6 +2041,10 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol)
|
|
|
builder.setDebugSourceLocation(symbol->getLoc().line, symbol->getLoc().getFilename());
|
|
builder.setDebugSourceLocation(symbol->getLoc().line, symbol->getLoc().getFilename());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (symbol->getBasicType() == glslang::EbtFunction) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder);
|
|
SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder);
|
|
|
if (symbol->getType().isStruct())
|
|
if (symbol->getType().isStruct())
|
|
|
glslangTypeToIdMap[symbol->getType().getStruct()] = symbol->getId();
|
|
glslangTypeToIdMap[symbol->getType().getStruct()] = symbol->getId();
|
|
@@ -2682,9 +2687,18 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
|
|
|
TranslateNonUniformDecoration(node->getType().getQualifier()) };
|
|
TranslateNonUniformDecoration(node->getType().getQualifier()) };
|
|
|
|
|
|
|
|
// it could be a conversion
|
|
// it could be a conversion
|
|
|
- if (! result)
|
|
|
|
|
|
|
+ if (! result) {
|
|
|
result = createConversion(node->getOp(), decorations, resultType(), operand,
|
|
result = createConversion(node->getOp(), decorations, resultType(), operand,
|
|
|
- node->getOperand()->getBasicType());
|
|
|
|
|
|
|
+ node->getType().getBasicType(), node->getOperand()->getBasicType());
|
|
|
|
|
+ if (result) {
|
|
|
|
|
+ if (node->getType().isCoopMatKHR() && node->getOperand()->getAsTyped()->getType().isCoopMatKHR() &&
|
|
|
|
|
+ !node->getAsTyped()->getType().sameCoopMatUse(node->getOperand()->getAsTyped()->getType())) {
|
|
|
|
|
+ // Conversions that change use need CapabilityCooperativeMatrixConversionsNV
|
|
|
|
|
+ builder.addCapability(spv::CapabilityCooperativeMatrixConversionsNV);
|
|
|
|
|
+ builder.addExtension(spv::E_SPV_NV_cooperative_matrix2);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// if not, then possibly an operation
|
|
// if not, then possibly an operation
|
|
|
if (! result)
|
|
if (! result)
|
|
@@ -2806,6 +2820,18 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
|
|
|
builder.createNoResultOp(spv::OpHitObjectRecordEmptyNV, operand);
|
|
builder.createNoResultOp(spv::OpHitObjectRecordEmptyNV, operand);
|
|
|
return false;
|
|
return false;
|
|
|
|
|
|
|
|
|
|
+ case glslang::EOpCreateTensorLayoutNV:
|
|
|
|
|
+ result = builder.createOp(spv::OpCreateTensorLayoutNV, resultType(), std::vector<spv::Id>{});
|
|
|
|
|
+ builder.clearAccessChain();
|
|
|
|
|
+ builder.setAccessChainRValue(result);
|
|
|
|
|
+ return false;
|
|
|
|
|
+
|
|
|
|
|
+ case glslang::EOpCreateTensorViewNV:
|
|
|
|
|
+ result = builder.createOp(spv::OpCreateTensorViewNV, resultType(), std::vector<spv::Id>{});
|
|
|
|
|
+ builder.clearAccessChain();
|
|
|
|
|
+ builder.setAccessChainRValue(result);
|
|
|
|
|
+ return false;
|
|
|
|
|
+
|
|
|
default:
|
|
default:
|
|
|
logger->missingFunctionality("unknown glslang unary");
|
|
logger->missingFunctionality("unknown glslang unary");
|
|
|
return true; // pick up operand as placeholder result
|
|
return true; // pick up operand as placeholder result
|
|
@@ -3131,6 +3157,11 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
|
|
constructed = arguments[0];
|
|
constructed = arguments[0];
|
|
|
} else
|
|
} else
|
|
|
constructed = builder.createOp(spv::OpSampledImage, resultType(), arguments);
|
|
constructed = builder.createOp(spv::OpSampledImage, resultType(), arguments);
|
|
|
|
|
+ } else if (node->getOp() == glslang::EOpConstructCooperativeMatrixKHR &&
|
|
|
|
|
+ node->getType().isCoopMatKHR() && node->getSequence()[0]->getAsTyped()->getType().isCoopMatKHR()) {
|
|
|
|
|
+ builder.addCapability(spv::CapabilityCooperativeMatrixConversionsNV);
|
|
|
|
|
+ builder.addExtension(spv::E_SPV_NV_cooperative_matrix2);
|
|
|
|
|
+ constructed = builder.createCooperativeMatrixConversion(resultType(), arguments[0]);
|
|
|
} else if (node->getOp() == glslang::EOpConstructStruct ||
|
|
} else if (node->getOp() == glslang::EOpConstructStruct ||
|
|
|
node->getOp() == glslang::EOpConstructCooperativeMatrixNV ||
|
|
node->getOp() == glslang::EOpConstructCooperativeMatrixNV ||
|
|
|
node->getOp() == glslang::EOpConstructCooperativeMatrixKHR ||
|
|
node->getOp() == glslang::EOpConstructCooperativeMatrixKHR ||
|
|
@@ -3315,6 +3346,11 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
|
|
case glslang::EOpCooperativeMatrixStore:
|
|
case glslang::EOpCooperativeMatrixStore:
|
|
|
case glslang::EOpCooperativeMatrixLoadNV:
|
|
case glslang::EOpCooperativeMatrixLoadNV:
|
|
|
case glslang::EOpCooperativeMatrixStoreNV:
|
|
case glslang::EOpCooperativeMatrixStoreNV:
|
|
|
|
|
+ case glslang::EOpCooperativeMatrixLoadTensorNV:
|
|
|
|
|
+ case glslang::EOpCooperativeMatrixStoreTensorNV:
|
|
|
|
|
+ case glslang::EOpCooperativeMatrixReduceNV:
|
|
|
|
|
+ case glslang::EOpCooperativeMatrixPerElementOpNV:
|
|
|
|
|
+ case glslang::EOpCooperativeMatrixTransposeNV:
|
|
|
noReturnValue = true;
|
|
noReturnValue = true;
|
|
|
break;
|
|
break;
|
|
|
case glslang::EOpBeginInvocationInterlock:
|
|
case glslang::EOpBeginInvocationInterlock:
|
|
@@ -3561,14 +3597,22 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
|
|
break;
|
|
break;
|
|
|
case glslang::EOpCooperativeMatrixLoad:
|
|
case glslang::EOpCooperativeMatrixLoad:
|
|
|
case glslang::EOpCooperativeMatrixLoadNV:
|
|
case glslang::EOpCooperativeMatrixLoadNV:
|
|
|
|
|
+ case glslang::EOpCooperativeMatrixLoadTensorNV:
|
|
|
if (arg == 0 || arg == 1)
|
|
if (arg == 0 || arg == 1)
|
|
|
lvalue = true;
|
|
lvalue = true;
|
|
|
break;
|
|
break;
|
|
|
case glslang::EOpCooperativeMatrixStore:
|
|
case glslang::EOpCooperativeMatrixStore:
|
|
|
case glslang::EOpCooperativeMatrixStoreNV:
|
|
case glslang::EOpCooperativeMatrixStoreNV:
|
|
|
|
|
+ case glslang::EOpCooperativeMatrixStoreTensorNV:
|
|
|
if (arg == 1)
|
|
if (arg == 1)
|
|
|
lvalue = true;
|
|
lvalue = true;
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case glslang::EOpCooperativeMatrixReduceNV:
|
|
|
|
|
+ case glslang::EOpCooperativeMatrixPerElementOpNV:
|
|
|
|
|
+ case glslang::EOpCooperativeMatrixTransposeNV:
|
|
|
|
|
+ if (arg == 0)
|
|
|
|
|
+ lvalue = true;
|
|
|
|
|
+ break;
|
|
|
case glslang::EOpSpirvInst:
|
|
case glslang::EOpSpirvInst:
|
|
|
if (glslangOperands[arg]->getAsTyped()->getQualifier().isSpirvByReference())
|
|
if (glslangOperands[arg]->getAsTyped()->getQualifier().isSpirvByReference())
|
|
|
lvalue = true;
|
|
lvalue = true;
|
|
@@ -3594,7 +3638,9 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
|
|
if (node->getOp() == glslang::EOpCooperativeMatrixLoad ||
|
|
if (node->getOp() == glslang::EOpCooperativeMatrixLoad ||
|
|
|
node->getOp() == glslang::EOpCooperativeMatrixStore ||
|
|
node->getOp() == glslang::EOpCooperativeMatrixStore ||
|
|
|
node->getOp() == glslang::EOpCooperativeMatrixLoadNV ||
|
|
node->getOp() == glslang::EOpCooperativeMatrixLoadNV ||
|
|
|
- node->getOp() == glslang::EOpCooperativeMatrixStoreNV) {
|
|
|
|
|
|
|
+ node->getOp() == glslang::EOpCooperativeMatrixStoreNV ||
|
|
|
|
|
+ node->getOp() == glslang::EOpCooperativeMatrixLoadTensorNV ||
|
|
|
|
|
+ node->getOp() == glslang::EOpCooperativeMatrixStoreTensorNV) {
|
|
|
|
|
|
|
|
if (arg == 1) {
|
|
if (arg == 1) {
|
|
|
// fold "element" parameter into the access chain
|
|
// fold "element" parameter into the access chain
|
|
@@ -3616,10 +3662,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
|
|
|
|
|
|
|
int memoryAccess = TranslateMemoryAccess(coherentFlags);
|
|
int memoryAccess = TranslateMemoryAccess(coherentFlags);
|
|
|
if (node->getOp() == glslang::EOpCooperativeMatrixLoad ||
|
|
if (node->getOp() == glslang::EOpCooperativeMatrixLoad ||
|
|
|
- node->getOp() == glslang::EOpCooperativeMatrixLoadNV)
|
|
|
|
|
|
|
+ node->getOp() == glslang::EOpCooperativeMatrixLoadNV ||
|
|
|
|
|
+ node->getOp() == glslang::EOpCooperativeMatrixLoadTensorNV)
|
|
|
memoryAccess &= ~spv::MemoryAccessMakePointerAvailableKHRMask;
|
|
memoryAccess &= ~spv::MemoryAccessMakePointerAvailableKHRMask;
|
|
|
if (node->getOp() == glslang::EOpCooperativeMatrixStore ||
|
|
if (node->getOp() == glslang::EOpCooperativeMatrixStore ||
|
|
|
- node->getOp() == glslang::EOpCooperativeMatrixStoreNV)
|
|
|
|
|
|
|
+ node->getOp() == glslang::EOpCooperativeMatrixStoreNV ||
|
|
|
|
|
+ node->getOp() == glslang::EOpCooperativeMatrixStoreTensorNV)
|
|
|
memoryAccess &= ~spv::MemoryAccessMakePointerVisibleKHRMask;
|
|
memoryAccess &= ~spv::MemoryAccessMakePointerVisibleKHRMask;
|
|
|
if (builder.getStorageClass(builder.getAccessChain().base) ==
|
|
if (builder.getStorageClass(builder.getAccessChain().base) ==
|
|
|
spv::StorageClassPhysicalStorageBufferEXT) {
|
|
spv::StorageClassPhysicalStorageBufferEXT) {
|
|
@@ -3706,6 +3754,10 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
|
|
} else if (glslangOperands[arg]->getAsTyped()->getQualifier().isSpirvLiteral()) {
|
|
} else if (glslangOperands[arg]->getAsTyped()->getQualifier().isSpirvLiteral()) {
|
|
|
// Will be translated to a literal value, make a placeholder here
|
|
// Will be translated to a literal value, make a placeholder here
|
|
|
operands.push_back(spv::NoResult);
|
|
operands.push_back(spv::NoResult);
|
|
|
|
|
+ } else if (glslangOperands[arg]->getAsTyped()->getBasicType() == glslang::EbtFunction) {
|
|
|
|
|
+ spv::Function* function = functionMap[glslangOperands[arg]->getAsSymbolNode()->getMangledName().c_str()];
|
|
|
|
|
+ assert(function);
|
|
|
|
|
+ operands.push_back(function->getId());
|
|
|
} else {
|
|
} else {
|
|
|
operands.push_back(accessChainLoad(glslangOperands[arg]->getAsTyped()->getType()));
|
|
operands.push_back(accessChainLoad(glslangOperands[arg]->getAsTyped()->getType()));
|
|
|
}
|
|
}
|
|
@@ -3713,8 +3765,45 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename());
|
|
builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename());
|
|
|
- if (node->getOp() == glslang::EOpCooperativeMatrixLoad ||
|
|
|
|
|
- node->getOp() == glslang::EOpCooperativeMatrixLoadNV) {
|
|
|
|
|
|
|
+ if (node->getOp() == glslang::EOpCooperativeMatrixLoadTensorNV) {
|
|
|
|
|
+ std::vector<spv::IdImmediate> idImmOps;
|
|
|
|
|
+
|
|
|
|
|
+ builder.addCapability(spv::CapabilityCooperativeMatrixTensorAddressingNV);
|
|
|
|
|
+ builder.addExtension(spv::E_SPV_NV_cooperative_matrix2);
|
|
|
|
|
+
|
|
|
|
|
+ spv::Id object = builder.createLoad(operands[0], spv::NoPrecision);
|
|
|
|
|
+
|
|
|
|
|
+ idImmOps.push_back(spv::IdImmediate(true, operands[1])); // Pointer
|
|
|
|
|
+ idImmOps.push_back(spv::IdImmediate(true, object)); // Object
|
|
|
|
|
+ idImmOps.push_back(spv::IdImmediate(true, operands[2])); // tensorLayout
|
|
|
|
|
+
|
|
|
|
|
+ idImmOps.insert(idImmOps.end(), memoryAccessOperands.begin(), memoryAccessOperands.end()); // memoryaccess
|
|
|
|
|
+
|
|
|
|
|
+ // initialize tensor operands to zero, then OR in flags based on the operands
|
|
|
|
|
+ size_t tensorOpIdx = idImmOps.size();
|
|
|
|
|
+ idImmOps.push_back(spv::IdImmediate(false, 0));
|
|
|
|
|
+
|
|
|
|
|
+ for (uint32_t i = 3; i < operands.size(); ++i) {
|
|
|
|
|
+ if (builder.isTensorView(operands[i])) {
|
|
|
|
|
+ idImmOps[tensorOpIdx].word |= spv::TensorAddressingOperandsTensorViewMask;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // must be the decode func
|
|
|
|
|
+ idImmOps[tensorOpIdx].word |= spv::TensorAddressingOperandsDecodeFuncMask;
|
|
|
|
|
+ builder.addCapability(spv::CapabilityCooperativeMatrixBlockLoadsNV);
|
|
|
|
|
+ }
|
|
|
|
|
+ idImmOps.push_back(spv::IdImmediate(true, operands[i])); // tensorView or decodeFunc
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 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::OpCooperativeMatrixLoadTensorNV, typeId, idImmOps);
|
|
|
|
|
+ // store the result to the pointer (out param 'm')
|
|
|
|
|
+ builder.createStore(result, operands[0]);
|
|
|
|
|
+ result = 0;
|
|
|
|
|
+ } else if (node->getOp() == glslang::EOpCooperativeMatrixLoad ||
|
|
|
|
|
+ node->getOp() == glslang::EOpCooperativeMatrixLoadNV) {
|
|
|
std::vector<spv::IdImmediate> idImmOps;
|
|
std::vector<spv::IdImmediate> idImmOps;
|
|
|
|
|
|
|
|
idImmOps.push_back(spv::IdImmediate(true, operands[1])); // buf
|
|
idImmOps.push_back(spv::IdImmediate(true, operands[1])); // buf
|
|
@@ -3742,6 +3831,28 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
|
|
// store the result to the pointer (out param 'm')
|
|
// store the result to the pointer (out param 'm')
|
|
|
builder.createStore(result, operands[0]);
|
|
builder.createStore(result, operands[0]);
|
|
|
result = 0;
|
|
result = 0;
|
|
|
|
|
+ } else if (node->getOp() == glslang::EOpCooperativeMatrixStoreTensorNV) {
|
|
|
|
|
+ std::vector<spv::IdImmediate> idImmOps;
|
|
|
|
|
+
|
|
|
|
|
+ idImmOps.push_back(spv::IdImmediate(true, operands[1])); // buf
|
|
|
|
|
+ idImmOps.push_back(spv::IdImmediate(true, operands[0])); // object
|
|
|
|
|
+
|
|
|
|
|
+ builder.addCapability(spv::CapabilityCooperativeMatrixTensorAddressingNV);
|
|
|
|
|
+ builder.addExtension(spv::E_SPV_NV_cooperative_matrix2);
|
|
|
|
|
+
|
|
|
|
|
+ idImmOps.push_back(spv::IdImmediate(true, operands[2])); // tensorLayout
|
|
|
|
|
+
|
|
|
|
|
+ idImmOps.insert(idImmOps.end(), memoryAccessOperands.begin(), memoryAccessOperands.end()); // memoryaccess
|
|
|
|
|
+
|
|
|
|
|
+ if (operands.size() > 3) {
|
|
|
|
|
+ idImmOps.push_back(spv::IdImmediate(false, spv::TensorAddressingOperandsTensorViewMask));
|
|
|
|
|
+ idImmOps.push_back(spv::IdImmediate(true, operands[3])); // tensorView
|
|
|
|
|
+ } else {
|
|
|
|
|
+ idImmOps.push_back(spv::IdImmediate(false, 0));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ builder.createNoResultOp(spv::OpCooperativeMatrixStoreTensorNV, idImmOps);
|
|
|
|
|
+ result = 0;
|
|
|
} else if (node->getOp() == glslang::EOpCooperativeMatrixStore ||
|
|
} else if (node->getOp() == glslang::EOpCooperativeMatrixStore ||
|
|
|
node->getOp() == glslang::EOpCooperativeMatrixStoreNV) {
|
|
node->getOp() == glslang::EOpCooperativeMatrixStoreNV) {
|
|
|
std::vector<spv::IdImmediate> idImmOps;
|
|
std::vector<spv::IdImmediate> idImmOps;
|
|
@@ -3810,6 +3921,43 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
|
|
idImmOps.push_back(spv::IdImmediate(false, matrixOperands));
|
|
idImmOps.push_back(spv::IdImmediate(false, matrixOperands));
|
|
|
|
|
|
|
|
result = builder.createOp(spv::OpCooperativeMatrixMulAddKHR, resultType(), idImmOps);
|
|
result = builder.createOp(spv::OpCooperativeMatrixMulAddKHR, resultType(), idImmOps);
|
|
|
|
|
+ } else if (node->getOp() == glslang::EOpCooperativeMatrixReduceNV) {
|
|
|
|
|
+ builder.addCapability(spv::CapabilityCooperativeMatrixReductionsNV);
|
|
|
|
|
+ builder.addExtension(spv::E_SPV_NV_cooperative_matrix2);
|
|
|
|
|
+
|
|
|
|
|
+ spv::Op opcode = spv::OpCooperativeMatrixReduceNV;
|
|
|
|
|
+ unsigned mask = glslangOperands[2]->getAsConstantUnion()->getConstArray()[0].getUConst();
|
|
|
|
|
+
|
|
|
|
|
+ spv::Id typeId = builder.getContainedTypeId(builder.getTypeId(operands[0]));
|
|
|
|
|
+ assert(builder.isCooperativeMatrixType(typeId));
|
|
|
|
|
+
|
|
|
|
|
+ result = builder.createCooperativeMatrixReduce(opcode, typeId, operands[1], mask, operands[3]);
|
|
|
|
|
+ // store the result to the pointer (out param 'm')
|
|
|
|
|
+ builder.createStore(result, operands[0]);
|
|
|
|
|
+ result = 0;
|
|
|
|
|
+ } else if (node->getOp() == glslang::EOpCooperativeMatrixPerElementOpNV) {
|
|
|
|
|
+ builder.addCapability(spv::CapabilityCooperativeMatrixPerElementOperationsNV);
|
|
|
|
|
+ builder.addExtension(spv::E_SPV_NV_cooperative_matrix2);
|
|
|
|
|
+
|
|
|
|
|
+ spv::Id typeId = builder.getContainedTypeId(builder.getTypeId(operands[0]));
|
|
|
|
|
+ assert(builder.isCooperativeMatrixType(typeId));
|
|
|
|
|
+
|
|
|
|
|
+ result = builder.createCooperativeMatrixPerElementOp(typeId, operands);
|
|
|
|
|
+ // store the result to the pointer
|
|
|
|
|
+ builder.createStore(result, operands[0]);
|
|
|
|
|
+ result = 0;
|
|
|
|
|
+ } else if (node->getOp() == glslang::EOpCooperativeMatrixTransposeNV) {
|
|
|
|
|
+
|
|
|
|
|
+ builder.addCapability(spv::CapabilityCooperativeMatrixConversionsNV);
|
|
|
|
|
+ builder.addExtension(spv::E_SPV_NV_cooperative_matrix2);
|
|
|
|
|
+
|
|
|
|
|
+ spv::Id typeId = builder.getContainedTypeId(builder.getTypeId(operands[0]));
|
|
|
|
|
+ assert(builder.isCooperativeMatrixType(typeId));
|
|
|
|
|
+
|
|
|
|
|
+ result = builder.createUnaryOp(spv::OpCooperativeMatrixTransposeNV, typeId, operands[1]);
|
|
|
|
|
+ // store the result to the pointer
|
|
|
|
|
+ builder.createStore(result, operands[0]);
|
|
|
|
|
+ result = 0;
|
|
|
} else if (atomic) {
|
|
} else if (atomic) {
|
|
|
// Handle all atomics
|
|
// Handle all atomics
|
|
|
glslang::TBasicType typeProxy = (node->getOp() == glslang::EOpAtomicStore)
|
|
glslang::TBasicType typeProxy = (node->getOp() == glslang::EOpAtomicStore)
|
|
@@ -4691,6 +4839,32 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
|
|
|
|
|
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
+ case glslang::EbtTensorLayoutNV:
|
|
|
|
|
+ {
|
|
|
|
|
+ builder.addCapability(spv::CapabilityTensorAddressingNV);
|
|
|
|
|
+ builder.addExtension(spv::E_SPV_NV_tensor_addressing);
|
|
|
|
|
+
|
|
|
|
|
+ std::vector<spv::IdImmediate> operands;
|
|
|
|
|
+ for (uint32_t i = 0; i < 2; ++i) {
|
|
|
|
|
+ operands.push_back({true, makeArraySizeId(*type.getTypeParameters()->arraySizes, i, true)});
|
|
|
|
|
+ }
|
|
|
|
|
+ spvType = builder.makeGenericType(spv::OpTypeTensorLayoutNV, operands);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ case glslang::EbtTensorViewNV:
|
|
|
|
|
+ {
|
|
|
|
|
+ builder.addCapability(spv::CapabilityTensorAddressingNV);
|
|
|
|
|
+ builder.addExtension(spv::E_SPV_NV_tensor_addressing);
|
|
|
|
|
+
|
|
|
|
|
+ uint32_t dim = type.getTypeParameters()->arraySizes->getDimSize(0);
|
|
|
|
|
+ assert(dim >= 1 && dim <= 5);
|
|
|
|
|
+ std::vector<spv::IdImmediate> operands;
|
|
|
|
|
+ for (uint32_t i = 0; i < dim + 2; ++i) {
|
|
|
|
|
+ operands.push_back({true, makeArraySizeId(*type.getTypeParameters()->arraySizes, i, true, i==1)});
|
|
|
|
|
+ }
|
|
|
|
|
+ spvType = builder.makeGenericType(spv::OpTypeTensorViewNV, operands);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
default:
|
|
default:
|
|
|
assert(0);
|
|
assert(0);
|
|
|
break;
|
|
break;
|
|
@@ -5113,7 +5287,7 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type,
|
|
|
// This is not quite trivial, because of specialization constants.
|
|
// This is not quite trivial, because of specialization constants.
|
|
|
// Sometimes, a raw constant is turned into an Id, and sometimes
|
|
// Sometimes, a raw constant is turned into an Id, and sometimes
|
|
|
// a specialization constant expression is.
|
|
// a specialization constant expression is.
|
|
|
-spv::Id TGlslangToSpvTraverser::makeArraySizeId(const glslang::TArraySizes& arraySizes, int dim, bool allowZero)
|
|
|
|
|
|
|
+spv::Id TGlslangToSpvTraverser::makeArraySizeId(const glslang::TArraySizes& arraySizes, int dim, bool allowZero, bool boolType)
|
|
|
{
|
|
{
|
|
|
// First, see if this is sized with a node, meaning a specialization constant:
|
|
// First, see if this is sized with a node, meaning a specialization constant:
|
|
|
glslang::TIntermTyped* specNode = arraySizes.getDimNode(dim);
|
|
glslang::TIntermTyped* specNode = arraySizes.getDimNode(dim);
|
|
@@ -5131,7 +5305,11 @@ spv::Id TGlslangToSpvTraverser::makeArraySizeId(const glslang::TArraySizes& arra
|
|
|
if (!allowZero)
|
|
if (!allowZero)
|
|
|
assert(size > 0);
|
|
assert(size > 0);
|
|
|
|
|
|
|
|
- return builder.makeUintConstant(size);
|
|
|
|
|
|
|
+ if (boolType) {
|
|
|
|
|
+ return builder.makeBoolConstant(size);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return builder.makeUintConstant(size);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Wrap the builder's accessChainLoad to:
|
|
// Wrap the builder's accessChainLoad to:
|
|
@@ -7485,73 +7663,22 @@ spv::Id TGlslangToSpvTraverser::createUnaryMatrixOperation(spv::Op op, OpDecorat
|
|
|
// for the signedness conversion.
|
|
// for the signedness conversion.
|
|
|
// destType is the final type that will be converted to, but this function
|
|
// destType is the final type that will be converted to, but this function
|
|
|
// may only be doing part of that conversion.
|
|
// may only be doing part of that conversion.
|
|
|
-spv::Id TGlslangToSpvTraverser::createIntWidthConversion(glslang::TOperator op, spv::Id operand, int vectorSize, spv::Id destType)
|
|
|
|
|
|
|
+spv::Id TGlslangToSpvTraverser::createIntWidthConversion(spv::Id operand, int vectorSize, spv::Id destType,
|
|
|
|
|
+ glslang::TBasicType resultBasicType, glslang::TBasicType operandBasicType)
|
|
|
{
|
|
{
|
|
|
// Get the result type width, based on the type to convert to.
|
|
// Get the result type width, based on the type to convert to.
|
|
|
- int width = 32;
|
|
|
|
|
- switch(op) {
|
|
|
|
|
- case glslang::EOpConvInt16ToUint8:
|
|
|
|
|
- case glslang::EOpConvIntToUint8:
|
|
|
|
|
- case glslang::EOpConvInt64ToUint8:
|
|
|
|
|
- case glslang::EOpConvUint16ToInt8:
|
|
|
|
|
- case glslang::EOpConvUintToInt8:
|
|
|
|
|
- case glslang::EOpConvUint64ToInt8:
|
|
|
|
|
- width = 8;
|
|
|
|
|
- break;
|
|
|
|
|
- case glslang::EOpConvInt8ToUint16:
|
|
|
|
|
- case glslang::EOpConvIntToUint16:
|
|
|
|
|
- case glslang::EOpConvInt64ToUint16:
|
|
|
|
|
- case glslang::EOpConvUint8ToInt16:
|
|
|
|
|
- case glslang::EOpConvUintToInt16:
|
|
|
|
|
- case glslang::EOpConvUint64ToInt16:
|
|
|
|
|
- width = 16;
|
|
|
|
|
- break;
|
|
|
|
|
- case glslang::EOpConvInt8ToUint:
|
|
|
|
|
- case glslang::EOpConvInt16ToUint:
|
|
|
|
|
- case glslang::EOpConvInt64ToUint:
|
|
|
|
|
- case glslang::EOpConvUint8ToInt:
|
|
|
|
|
- case glslang::EOpConvUint16ToInt:
|
|
|
|
|
- case glslang::EOpConvUint64ToInt:
|
|
|
|
|
- width = 32;
|
|
|
|
|
- break;
|
|
|
|
|
- case glslang::EOpConvInt8ToUint64:
|
|
|
|
|
- case glslang::EOpConvInt16ToUint64:
|
|
|
|
|
- case glslang::EOpConvIntToUint64:
|
|
|
|
|
- case glslang::EOpConvUint8ToInt64:
|
|
|
|
|
- case glslang::EOpConvUint16ToInt64:
|
|
|
|
|
- case glslang::EOpConvUintToInt64:
|
|
|
|
|
- width = 64;
|
|
|
|
|
- break;
|
|
|
|
|
-
|
|
|
|
|
- default:
|
|
|
|
|
- assert(false && "Default missing");
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ int width = GetNumBits(resultBasicType);
|
|
|
|
|
|
|
|
// Get the conversion operation and result type,
|
|
// Get the conversion operation and result type,
|
|
|
// based on the target width, but the source type.
|
|
// based on the target width, but the source type.
|
|
|
spv::Id type = spv::NoType;
|
|
spv::Id type = spv::NoType;
|
|
|
spv::Op convOp = spv::OpNop;
|
|
spv::Op convOp = spv::OpNop;
|
|
|
- switch(op) {
|
|
|
|
|
- case glslang::EOpConvInt8ToUint16:
|
|
|
|
|
- case glslang::EOpConvInt8ToUint:
|
|
|
|
|
- case glslang::EOpConvInt8ToUint64:
|
|
|
|
|
- case glslang::EOpConvInt16ToUint8:
|
|
|
|
|
- case glslang::EOpConvInt16ToUint:
|
|
|
|
|
- case glslang::EOpConvInt16ToUint64:
|
|
|
|
|
- case glslang::EOpConvIntToUint8:
|
|
|
|
|
- case glslang::EOpConvIntToUint16:
|
|
|
|
|
- case glslang::EOpConvIntToUint64:
|
|
|
|
|
- case glslang::EOpConvInt64ToUint8:
|
|
|
|
|
- case glslang::EOpConvInt64ToUint16:
|
|
|
|
|
- case glslang::EOpConvInt64ToUint:
|
|
|
|
|
|
|
+ if (isTypeSignedInt(operandBasicType)) {
|
|
|
convOp = spv::OpSConvert;
|
|
convOp = spv::OpSConvert;
|
|
|
type = builder.makeIntType(width);
|
|
type = builder.makeIntType(width);
|
|
|
- break;
|
|
|
|
|
- default:
|
|
|
|
|
|
|
+ } else {
|
|
|
convOp = spv::OpUConvert;
|
|
convOp = spv::OpUConvert;
|
|
|
type = builder.makeUintType(width);
|
|
type = builder.makeUintType(width);
|
|
|
- break;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (vectorSize > 0)
|
|
if (vectorSize > 0)
|
|
@@ -7566,7 +7693,7 @@ spv::Id TGlslangToSpvTraverser::createIntWidthConversion(glslang::TOperator op,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, OpDecorations& decorations, spv::Id destType,
|
|
spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, OpDecorations& decorations, spv::Id destType,
|
|
|
- spv::Id operand, glslang::TBasicType typeProxy)
|
|
|
|
|
|
|
+ spv::Id operand, glslang::TBasicType resultBasicType, glslang::TBasicType operandBasicType)
|
|
|
{
|
|
{
|
|
|
spv::Op convOp = spv::OpNop;
|
|
spv::Op convOp = spv::OpNop;
|
|
|
spv::Id zero = 0;
|
|
spv::Id zero = 0;
|
|
@@ -7574,317 +7701,124 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, OpDecora
|
|
|
|
|
|
|
|
int vectorSize = builder.isVectorType(destType) ? builder.getNumTypeComponents(destType) : 0;
|
|
int vectorSize = builder.isVectorType(destType) ? builder.getNumTypeComponents(destType) : 0;
|
|
|
|
|
|
|
|
- switch (op) {
|
|
|
|
|
- case glslang::EOpConvIntToBool:
|
|
|
|
|
- case glslang::EOpConvUintToBool:
|
|
|
|
|
- zero = builder.makeUintConstant(0);
|
|
|
|
|
- zero = makeSmearedConstant(zero, vectorSize);
|
|
|
|
|
- return builder.createBinOp(spv::OpINotEqual, destType, operand, zero);
|
|
|
|
|
- case glslang::EOpConvFloatToBool:
|
|
|
|
|
- zero = builder.makeFloatConstant(0.0F);
|
|
|
|
|
- zero = makeSmearedConstant(zero, vectorSize);
|
|
|
|
|
- return builder.createBinOp(spv::OpFUnordNotEqual, destType, operand, zero);
|
|
|
|
|
- case glslang::EOpConvBoolToFloat:
|
|
|
|
|
- convOp = spv::OpSelect;
|
|
|
|
|
- zero = builder.makeFloatConstant(0.0F);
|
|
|
|
|
- one = builder.makeFloatConstant(1.0F);
|
|
|
|
|
- break;
|
|
|
|
|
-
|
|
|
|
|
- case glslang::EOpConvBoolToInt:
|
|
|
|
|
- case glslang::EOpConvBoolToInt64:
|
|
|
|
|
- if (op == glslang::EOpConvBoolToInt64) {
|
|
|
|
|
- zero = builder.makeInt64Constant(0);
|
|
|
|
|
- one = builder.makeInt64Constant(1);
|
|
|
|
|
- } else {
|
|
|
|
|
- zero = builder.makeIntConstant(0);
|
|
|
|
|
- one = builder.makeIntConstant(1);
|
|
|
|
|
|
|
+ if (IsOpNumericConv(op)) {
|
|
|
|
|
+ if (isTypeSignedInt(operandBasicType) && isTypeFloat(resultBasicType)) {
|
|
|
|
|
+ convOp = spv::OpConvertSToF;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (isTypeUnsignedInt(operandBasicType) && isTypeFloat(resultBasicType)) {
|
|
|
|
|
+ convOp = spv::OpConvertUToF;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (isTypeFloat(operandBasicType) && isTypeSignedInt(resultBasicType)) {
|
|
|
|
|
+ convOp = spv::OpConvertFToS;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (isTypeFloat(operandBasicType) && isTypeUnsignedInt(resultBasicType)) {
|
|
|
|
|
+ convOp = spv::OpConvertFToU;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (isTypeSignedInt(operandBasicType) && isTypeSignedInt(resultBasicType)) {
|
|
|
|
|
+ convOp = spv::OpSConvert;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (isTypeUnsignedInt(operandBasicType) && isTypeUnsignedInt(resultBasicType)) {
|
|
|
|
|
+ convOp = spv::OpUConvert;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (isTypeFloat(operandBasicType) && isTypeFloat(resultBasicType)) {
|
|
|
|
|
+ convOp = spv::OpFConvert;
|
|
|
|
|
+ if (builder.isMatrixType(destType))
|
|
|
|
|
+ return createUnaryMatrixOperation(convOp, decorations, destType, operand, operandBasicType);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (isTypeInt(operandBasicType) && isTypeInt(resultBasicType) &&
|
|
|
|
|
+ isTypeUnsignedInt(operandBasicType) != isTypeUnsignedInt(resultBasicType)) {
|
|
|
|
|
|
|
|
- convOp = spv::OpSelect;
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ if (GetNumBits(operandBasicType) != GetNumBits(resultBasicType)) {
|
|
|
|
|
+ // OpSConvert/OpUConvert + OpBitCast
|
|
|
|
|
+ operand = createIntWidthConversion(operand, vectorSize, destType, resultBasicType, operandBasicType);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- case glslang::EOpConvBoolToUint:
|
|
|
|
|
- case glslang::EOpConvBoolToUint64:
|
|
|
|
|
- if (op == glslang::EOpConvBoolToUint64) {
|
|
|
|
|
- zero = builder.makeUint64Constant(0);
|
|
|
|
|
- one = builder.makeUint64Constant(1);
|
|
|
|
|
- } else {
|
|
|
|
|
- zero = builder.makeUintConstant(0);
|
|
|
|
|
- one = builder.makeUintConstant(1);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- convOp = spv::OpSelect;
|
|
|
|
|
- break;
|
|
|
|
|
-
|
|
|
|
|
- case glslang::EOpConvInt8ToFloat16:
|
|
|
|
|
- case glslang::EOpConvInt8ToFloat:
|
|
|
|
|
- case glslang::EOpConvInt8ToDouble:
|
|
|
|
|
- case glslang::EOpConvInt16ToFloat16:
|
|
|
|
|
- case glslang::EOpConvInt16ToFloat:
|
|
|
|
|
- case glslang::EOpConvInt16ToDouble:
|
|
|
|
|
- case glslang::EOpConvIntToFloat16:
|
|
|
|
|
- case glslang::EOpConvIntToFloat:
|
|
|
|
|
- case glslang::EOpConvIntToDouble:
|
|
|
|
|
- case glslang::EOpConvInt64ToFloat:
|
|
|
|
|
- case glslang::EOpConvInt64ToDouble:
|
|
|
|
|
- case glslang::EOpConvInt64ToFloat16:
|
|
|
|
|
- convOp = spv::OpConvertSToF;
|
|
|
|
|
- break;
|
|
|
|
|
-
|
|
|
|
|
- case glslang::EOpConvUint8ToFloat16:
|
|
|
|
|
- case glslang::EOpConvUint8ToFloat:
|
|
|
|
|
- case glslang::EOpConvUint8ToDouble:
|
|
|
|
|
- case glslang::EOpConvUint16ToFloat16:
|
|
|
|
|
- case glslang::EOpConvUint16ToFloat:
|
|
|
|
|
- case glslang::EOpConvUint16ToDouble:
|
|
|
|
|
- case glslang::EOpConvUintToFloat16:
|
|
|
|
|
- case glslang::EOpConvUintToFloat:
|
|
|
|
|
- case glslang::EOpConvUintToDouble:
|
|
|
|
|
- case glslang::EOpConvUint64ToFloat:
|
|
|
|
|
- case glslang::EOpConvUint64ToDouble:
|
|
|
|
|
- case glslang::EOpConvUint64ToFloat16:
|
|
|
|
|
- convOp = spv::OpConvertUToF;
|
|
|
|
|
- break;
|
|
|
|
|
-
|
|
|
|
|
- case glslang::EOpConvFloat16ToInt8:
|
|
|
|
|
- case glslang::EOpConvFloatToInt8:
|
|
|
|
|
- case glslang::EOpConvDoubleToInt8:
|
|
|
|
|
- case glslang::EOpConvFloat16ToInt16:
|
|
|
|
|
- case glslang::EOpConvFloatToInt16:
|
|
|
|
|
- case glslang::EOpConvDoubleToInt16:
|
|
|
|
|
- case glslang::EOpConvFloat16ToInt:
|
|
|
|
|
- case glslang::EOpConvFloatToInt:
|
|
|
|
|
- case glslang::EOpConvDoubleToInt:
|
|
|
|
|
- case glslang::EOpConvFloat16ToInt64:
|
|
|
|
|
- case glslang::EOpConvFloatToInt64:
|
|
|
|
|
- case glslang::EOpConvDoubleToInt64:
|
|
|
|
|
- convOp = spv::OpConvertFToS;
|
|
|
|
|
- break;
|
|
|
|
|
-
|
|
|
|
|
- case glslang::EOpConvUint8ToInt8:
|
|
|
|
|
- case glslang::EOpConvInt8ToUint8:
|
|
|
|
|
- case glslang::EOpConvUint16ToInt16:
|
|
|
|
|
- case glslang::EOpConvInt16ToUint16:
|
|
|
|
|
- case glslang::EOpConvUintToInt:
|
|
|
|
|
- case glslang::EOpConvIntToUint:
|
|
|
|
|
- case glslang::EOpConvUint64ToInt64:
|
|
|
|
|
- case glslang::EOpConvInt64ToUint64:
|
|
|
|
|
- if (builder.isInSpecConstCodeGenMode()) {
|
|
|
|
|
- // Build zero scalar or vector for OpIAdd.
|
|
|
|
|
- if(op == glslang::EOpConvUint8ToInt8 || op == glslang::EOpConvInt8ToUint8) {
|
|
|
|
|
- zero = builder.makeUint8Constant(0);
|
|
|
|
|
- } else if (op == glslang::EOpConvUint16ToInt16 || op == glslang::EOpConvInt16ToUint16) {
|
|
|
|
|
- zero = builder.makeUint16Constant(0);
|
|
|
|
|
- } else if (op == glslang::EOpConvUint64ToInt64 || op == glslang::EOpConvInt64ToUint64) {
|
|
|
|
|
- zero = builder.makeUint64Constant(0);
|
|
|
|
|
|
|
+ if (builder.isInSpecConstCodeGenMode()) {
|
|
|
|
|
+ uint32_t bits = GetNumBits(resultBasicType);
|
|
|
|
|
+ spv::Id zeroType = builder.makeUintType(bits);
|
|
|
|
|
+ if (bits == 64) {
|
|
|
|
|
+ zero = builder.makeInt64Constant(zeroType, 0, false);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ zero = builder.makeIntConstant(zeroType, 0, false);
|
|
|
|
|
+ }
|
|
|
|
|
+ zero = makeSmearedConstant(zero, vectorSize);
|
|
|
|
|
+ // Use OpIAdd, instead of OpBitcast to do the conversion when
|
|
|
|
|
+ // generating for OpSpecConstantOp instruction.
|
|
|
|
|
+ return builder.createBinOp(spv::OpIAdd, destType, operand, zero);
|
|
|
|
|
+ }
|
|
|
|
|
+ // For normal run-time conversion instruction, use OpBitcast.
|
|
|
|
|
+ convOp = spv::OpBitcast;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (resultBasicType == glslang::EbtBool) {
|
|
|
|
|
+ uint32_t bits = GetNumBits(operandBasicType);
|
|
|
|
|
+ if (isTypeInt(operandBasicType)) {
|
|
|
|
|
+ spv::Id zeroType = builder.makeUintType(bits);
|
|
|
|
|
+ if (bits == 64) {
|
|
|
|
|
+ zero = builder.makeInt64Constant(zeroType, 0, false);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ zero = builder.makeIntConstant(zeroType, 0, false);
|
|
|
|
|
+ }
|
|
|
|
|
+ zero = makeSmearedConstant(zero, vectorSize);
|
|
|
|
|
+ return builder.createBinOp(spv::OpINotEqual, destType, operand, zero);
|
|
|
} else {
|
|
} else {
|
|
|
- zero = builder.makeUintConstant(0);
|
|
|
|
|
|
|
+ assert(isTypeFloat(operandBasicType));
|
|
|
|
|
+ if (bits == 64) {
|
|
|
|
|
+ zero = builder.makeDoubleConstant(0.0);
|
|
|
|
|
+ } else if (bits == 32) {
|
|
|
|
|
+ zero = builder.makeFloatConstant(0.0);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ assert(bits == 16);
|
|
|
|
|
+ zero = builder.makeFloat16Constant(0.0);
|
|
|
|
|
+ }
|
|
|
|
|
+ zero = makeSmearedConstant(zero, vectorSize);
|
|
|
|
|
+ return builder.createBinOp(spv::OpFUnordNotEqual, destType, operand, zero);
|
|
|
}
|
|
}
|
|
|
- zero = makeSmearedConstant(zero, vectorSize);
|
|
|
|
|
- // Use OpIAdd, instead of OpBitcast to do the conversion when
|
|
|
|
|
- // generating for OpSpecConstantOp instruction.
|
|
|
|
|
- return builder.createBinOp(spv::OpIAdd, destType, operand, zero);
|
|
|
|
|
- }
|
|
|
|
|
- // For normal run-time conversion instruction, use OpBitcast.
|
|
|
|
|
- convOp = spv::OpBitcast;
|
|
|
|
|
- break;
|
|
|
|
|
-
|
|
|
|
|
- case glslang::EOpConvFloat16ToUint8:
|
|
|
|
|
- case glslang::EOpConvFloatToUint8:
|
|
|
|
|
- case glslang::EOpConvDoubleToUint8:
|
|
|
|
|
- case glslang::EOpConvFloat16ToUint16:
|
|
|
|
|
- case glslang::EOpConvFloatToUint16:
|
|
|
|
|
- case glslang::EOpConvDoubleToUint16:
|
|
|
|
|
- case glslang::EOpConvFloat16ToUint:
|
|
|
|
|
- case glslang::EOpConvFloatToUint:
|
|
|
|
|
- case glslang::EOpConvDoubleToUint:
|
|
|
|
|
- case glslang::EOpConvFloatToUint64:
|
|
|
|
|
- case glslang::EOpConvDoubleToUint64:
|
|
|
|
|
- case glslang::EOpConvFloat16ToUint64:
|
|
|
|
|
- convOp = spv::OpConvertFToU;
|
|
|
|
|
- break;
|
|
|
|
|
-
|
|
|
|
|
- case glslang::EOpConvInt8ToBool:
|
|
|
|
|
- case glslang::EOpConvUint8ToBool:
|
|
|
|
|
- zero = builder.makeUint8Constant(0);
|
|
|
|
|
- zero = makeSmearedConstant(zero, vectorSize);
|
|
|
|
|
- return builder.createBinOp(spv::OpINotEqual, destType, operand, zero);
|
|
|
|
|
- case glslang::EOpConvInt16ToBool:
|
|
|
|
|
- case glslang::EOpConvUint16ToBool:
|
|
|
|
|
- zero = builder.makeUint16Constant(0);
|
|
|
|
|
- zero = makeSmearedConstant(zero, vectorSize);
|
|
|
|
|
- return builder.createBinOp(spv::OpINotEqual, destType, operand, zero);
|
|
|
|
|
- case glslang::EOpConvInt64ToBool:
|
|
|
|
|
- case glslang::EOpConvUint64ToBool:
|
|
|
|
|
- zero = builder.makeUint64Constant(0);
|
|
|
|
|
- zero = makeSmearedConstant(zero, vectorSize);
|
|
|
|
|
- return builder.createBinOp(spv::OpINotEqual, destType, operand, zero);
|
|
|
|
|
- case glslang::EOpConvDoubleToBool:
|
|
|
|
|
- zero = builder.makeDoubleConstant(0.0);
|
|
|
|
|
- zero = makeSmearedConstant(zero, vectorSize);
|
|
|
|
|
- return builder.createBinOp(spv::OpFUnordNotEqual, destType, operand, zero);
|
|
|
|
|
- case glslang::EOpConvFloat16ToBool:
|
|
|
|
|
- zero = builder.makeFloat16Constant(0.0F);
|
|
|
|
|
- zero = makeSmearedConstant(zero, vectorSize);
|
|
|
|
|
- return builder.createBinOp(spv::OpFUnordNotEqual, destType, operand, zero);
|
|
|
|
|
- case glslang::EOpConvBoolToDouble:
|
|
|
|
|
- convOp = spv::OpSelect;
|
|
|
|
|
- zero = builder.makeDoubleConstant(0.0);
|
|
|
|
|
- one = builder.makeDoubleConstant(1.0);
|
|
|
|
|
- break;
|
|
|
|
|
- case glslang::EOpConvBoolToFloat16:
|
|
|
|
|
- convOp = spv::OpSelect;
|
|
|
|
|
- zero = builder.makeFloat16Constant(0.0F);
|
|
|
|
|
- one = builder.makeFloat16Constant(1.0F);
|
|
|
|
|
- break;
|
|
|
|
|
- case glslang::EOpConvBoolToInt8:
|
|
|
|
|
- zero = builder.makeInt8Constant(0);
|
|
|
|
|
- one = builder.makeInt8Constant(1);
|
|
|
|
|
- convOp = spv::OpSelect;
|
|
|
|
|
- break;
|
|
|
|
|
- case glslang::EOpConvBoolToUint8:
|
|
|
|
|
- zero = builder.makeUint8Constant(0);
|
|
|
|
|
- one = builder.makeUint8Constant(1);
|
|
|
|
|
- convOp = spv::OpSelect;
|
|
|
|
|
- break;
|
|
|
|
|
- case glslang::EOpConvBoolToInt16:
|
|
|
|
|
- zero = builder.makeInt16Constant(0);
|
|
|
|
|
- one = builder.makeInt16Constant(1);
|
|
|
|
|
- convOp = spv::OpSelect;
|
|
|
|
|
- break;
|
|
|
|
|
- case glslang::EOpConvBoolToUint16:
|
|
|
|
|
- zero = builder.makeUint16Constant(0);
|
|
|
|
|
- one = builder.makeUint16Constant(1);
|
|
|
|
|
- convOp = spv::OpSelect;
|
|
|
|
|
- break;
|
|
|
|
|
- case glslang::EOpConvDoubleToFloat:
|
|
|
|
|
- case glslang::EOpConvFloatToDouble:
|
|
|
|
|
- case glslang::EOpConvDoubleToFloat16:
|
|
|
|
|
- case glslang::EOpConvFloat16ToDouble:
|
|
|
|
|
- case glslang::EOpConvFloatToFloat16:
|
|
|
|
|
- case glslang::EOpConvFloat16ToFloat:
|
|
|
|
|
- convOp = spv::OpFConvert;
|
|
|
|
|
- if (builder.isMatrixType(destType))
|
|
|
|
|
- return createUnaryMatrixOperation(convOp, decorations, destType, operand, typeProxy);
|
|
|
|
|
- break;
|
|
|
|
|
-
|
|
|
|
|
- case glslang::EOpConvInt8ToInt16:
|
|
|
|
|
- case glslang::EOpConvInt8ToInt:
|
|
|
|
|
- case glslang::EOpConvInt8ToInt64:
|
|
|
|
|
- case glslang::EOpConvInt16ToInt8:
|
|
|
|
|
- case glslang::EOpConvInt16ToInt:
|
|
|
|
|
- case glslang::EOpConvInt16ToInt64:
|
|
|
|
|
- case glslang::EOpConvIntToInt8:
|
|
|
|
|
- case glslang::EOpConvIntToInt16:
|
|
|
|
|
- case glslang::EOpConvIntToInt64:
|
|
|
|
|
- case glslang::EOpConvInt64ToInt8:
|
|
|
|
|
- case glslang::EOpConvInt64ToInt16:
|
|
|
|
|
- case glslang::EOpConvInt64ToInt:
|
|
|
|
|
- convOp = spv::OpSConvert;
|
|
|
|
|
- break;
|
|
|
|
|
-
|
|
|
|
|
- case glslang::EOpConvUint8ToUint16:
|
|
|
|
|
- case glslang::EOpConvUint8ToUint:
|
|
|
|
|
- case glslang::EOpConvUint8ToUint64:
|
|
|
|
|
- case glslang::EOpConvUint16ToUint8:
|
|
|
|
|
- case glslang::EOpConvUint16ToUint:
|
|
|
|
|
- case glslang::EOpConvUint16ToUint64:
|
|
|
|
|
- case glslang::EOpConvUintToUint8:
|
|
|
|
|
- case glslang::EOpConvUintToUint16:
|
|
|
|
|
- case glslang::EOpConvUintToUint64:
|
|
|
|
|
- case glslang::EOpConvUint64ToUint8:
|
|
|
|
|
- case glslang::EOpConvUint64ToUint16:
|
|
|
|
|
- case glslang::EOpConvUint64ToUint:
|
|
|
|
|
- convOp = spv::OpUConvert;
|
|
|
|
|
- break;
|
|
|
|
|
-
|
|
|
|
|
- case glslang::EOpConvInt8ToUint16:
|
|
|
|
|
- case glslang::EOpConvInt8ToUint:
|
|
|
|
|
- case glslang::EOpConvInt8ToUint64:
|
|
|
|
|
- case glslang::EOpConvInt16ToUint8:
|
|
|
|
|
- case glslang::EOpConvInt16ToUint:
|
|
|
|
|
- case glslang::EOpConvInt16ToUint64:
|
|
|
|
|
- case glslang::EOpConvIntToUint8:
|
|
|
|
|
- case glslang::EOpConvIntToUint16:
|
|
|
|
|
- case glslang::EOpConvIntToUint64:
|
|
|
|
|
- case glslang::EOpConvInt64ToUint8:
|
|
|
|
|
- case glslang::EOpConvInt64ToUint16:
|
|
|
|
|
- case glslang::EOpConvInt64ToUint:
|
|
|
|
|
- case glslang::EOpConvUint8ToInt16:
|
|
|
|
|
- case glslang::EOpConvUint8ToInt:
|
|
|
|
|
- case glslang::EOpConvUint8ToInt64:
|
|
|
|
|
- case glslang::EOpConvUint16ToInt8:
|
|
|
|
|
- case glslang::EOpConvUint16ToInt:
|
|
|
|
|
- case glslang::EOpConvUint16ToInt64:
|
|
|
|
|
- case glslang::EOpConvUintToInt8:
|
|
|
|
|
- case glslang::EOpConvUintToInt16:
|
|
|
|
|
- case glslang::EOpConvUintToInt64:
|
|
|
|
|
- case glslang::EOpConvUint64ToInt8:
|
|
|
|
|
- case glslang::EOpConvUint64ToInt16:
|
|
|
|
|
- case glslang::EOpConvUint64ToInt:
|
|
|
|
|
- // OpSConvert/OpUConvert + OpBitCast
|
|
|
|
|
- operand = createIntWidthConversion(op, operand, vectorSize, destType);
|
|
|
|
|
-
|
|
|
|
|
- if (builder.isInSpecConstCodeGenMode()) {
|
|
|
|
|
- // Build zero scalar or vector for OpIAdd.
|
|
|
|
|
- switch(op) {
|
|
|
|
|
- case glslang::EOpConvInt16ToUint8:
|
|
|
|
|
- case glslang::EOpConvIntToUint8:
|
|
|
|
|
- case glslang::EOpConvInt64ToUint8:
|
|
|
|
|
- case glslang::EOpConvUint16ToInt8:
|
|
|
|
|
- case glslang::EOpConvUintToInt8:
|
|
|
|
|
- case glslang::EOpConvUint64ToInt8:
|
|
|
|
|
- zero = builder.makeUint8Constant(0);
|
|
|
|
|
- break;
|
|
|
|
|
- case glslang::EOpConvInt8ToUint16:
|
|
|
|
|
- case glslang::EOpConvIntToUint16:
|
|
|
|
|
- case glslang::EOpConvInt64ToUint16:
|
|
|
|
|
- case glslang::EOpConvUint8ToInt16:
|
|
|
|
|
- case glslang::EOpConvUintToInt16:
|
|
|
|
|
- case glslang::EOpConvUint64ToInt16:
|
|
|
|
|
- zero = builder.makeUint16Constant(0);
|
|
|
|
|
- break;
|
|
|
|
|
- case glslang::EOpConvInt8ToUint:
|
|
|
|
|
- case glslang::EOpConvInt16ToUint:
|
|
|
|
|
- case glslang::EOpConvInt64ToUint:
|
|
|
|
|
- case glslang::EOpConvUint8ToInt:
|
|
|
|
|
- case glslang::EOpConvUint16ToInt:
|
|
|
|
|
- case glslang::EOpConvUint64ToInt:
|
|
|
|
|
- zero = builder.makeUintConstant(0);
|
|
|
|
|
- break;
|
|
|
|
|
- case glslang::EOpConvInt8ToUint64:
|
|
|
|
|
- case glslang::EOpConvInt16ToUint64:
|
|
|
|
|
- case glslang::EOpConvIntToUint64:
|
|
|
|
|
- case glslang::EOpConvUint8ToInt64:
|
|
|
|
|
- case glslang::EOpConvUint16ToInt64:
|
|
|
|
|
- case glslang::EOpConvUintToInt64:
|
|
|
|
|
- zero = builder.makeUint64Constant(0);
|
|
|
|
|
- break;
|
|
|
|
|
- default:
|
|
|
|
|
- assert(false && "Default missing");
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ if (operandBasicType == glslang::EbtBool) {
|
|
|
|
|
+ uint32_t bits = GetNumBits(resultBasicType);
|
|
|
|
|
+ convOp = spv::OpSelect;
|
|
|
|
|
+ if (isTypeInt(resultBasicType)) {
|
|
|
|
|
+ spv::Id zeroType = isTypeSignedInt(resultBasicType) ? builder.makeIntType(bits) : builder.makeUintType(bits);
|
|
|
|
|
+ if (bits == 64) {
|
|
|
|
|
+ zero = builder.makeInt64Constant(zeroType, 0, false);
|
|
|
|
|
+ one = builder.makeInt64Constant(zeroType, 1, false);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ zero = builder.makeIntConstant(zeroType, 0, false);
|
|
|
|
|
+ one = builder.makeIntConstant(zeroType, 1, false);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ assert(isTypeFloat(resultBasicType));
|
|
|
|
|
+ if (bits == 64) {
|
|
|
|
|
+ zero = builder.makeDoubleConstant(0.0);
|
|
|
|
|
+ one = builder.makeDoubleConstant(1.0);
|
|
|
|
|
+ } else if (bits == 32) {
|
|
|
|
|
+ zero = builder.makeFloatConstant(0.0);
|
|
|
|
|
+ one = builder.makeFloatConstant(1.0);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ assert(bits == 16);
|
|
|
|
|
+ zero = builder.makeFloat16Constant(0.0);
|
|
|
|
|
+ one = builder.makeFloat16Constant(1.0);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- zero = makeSmearedConstant(zero, vectorSize);
|
|
|
|
|
- // Use OpIAdd, instead of OpBitcast to do the conversion when
|
|
|
|
|
- // generating for OpSpecConstantOp instruction.
|
|
|
|
|
- return builder.createBinOp(spv::OpIAdd, destType, operand, zero);
|
|
|
|
|
}
|
|
}
|
|
|
- // For normal run-time conversion instruction, use OpBitcast.
|
|
|
|
|
- convOp = spv::OpBitcast;
|
|
|
|
|
- break;
|
|
|
|
|
- case glslang::EOpConvUint64ToPtr:
|
|
|
|
|
- convOp = spv::OpConvertUToPtr;
|
|
|
|
|
- break;
|
|
|
|
|
- case glslang::EOpConvPtrToUint64:
|
|
|
|
|
- convOp = spv::OpConvertPtrToU;
|
|
|
|
|
- break;
|
|
|
|
|
- case glslang::EOpConvPtrToUvec2:
|
|
|
|
|
- case glslang::EOpConvUvec2ToPtr:
|
|
|
|
|
- convOp = spv::OpBitcast;
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- default:
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ if (convOp == spv::OpNop) {
|
|
|
|
|
+ switch (op) {
|
|
|
|
|
+ case glslang::EOpConvUint64ToPtr:
|
|
|
|
|
+ convOp = spv::OpConvertUToPtr;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case glslang::EOpConvPtrToUint64:
|
|
|
|
|
+ convOp = spv::OpConvertPtrToU;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case glslang::EOpConvPtrToUvec2:
|
|
|
|
|
+ case glslang::EOpConvUvec2ToPtr:
|
|
|
|
|
+ convOp = spv::OpBitcast;
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
|
|
+ default:
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
spv::Id result = 0;
|
|
spv::Id result = 0;
|
|
@@ -8805,7 +8739,13 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
|
|
|
builder.promoteScalar(precision, operands.front(), operands.back());
|
|
builder.promoteScalar(precision, operands.front(), operands.back());
|
|
|
break;
|
|
break;
|
|
|
case glslang::EOpModf:
|
|
case glslang::EOpModf:
|
|
|
- libCall = spv::GLSLstd450Modf;
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ libCall = spv::GLSLstd450ModfStruct;
|
|
|
|
|
+ assert(builder.isFloatType(builder.getScalarTypeId(typeId0)));
|
|
|
|
|
+ // The returned struct has two members of the same type as the first argument
|
|
|
|
|
+ typeId = builder.makeStructResultType(typeId0, typeId0);
|
|
|
|
|
+ consumedOperands = 1;
|
|
|
|
|
+ }
|
|
|
break;
|
|
break;
|
|
|
case glslang::EOpMax:
|
|
case glslang::EOpMax:
|
|
|
if (isFloat)
|
|
if (isFloat)
|
|
@@ -9373,6 +9313,34 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
|
|
|
addImageProcessing2QCOMDecoration(operands[0], true);
|
|
addImageProcessing2QCOMDecoration(operands[0], true);
|
|
|
addImageProcessing2QCOMDecoration(operands[2], true);
|
|
addImageProcessing2QCOMDecoration(operands[2], true);
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case glslang::EOpCreateTensorLayoutNV:
|
|
|
|
|
+ return builder.createOp(spv::OpCreateTensorLayoutNV, typeId, std::vector<spv::Id>{});
|
|
|
|
|
+ case glslang::EOpCreateTensorViewNV:
|
|
|
|
|
+ return builder.createOp(spv::OpCreateTensorViewNV, typeId, std::vector<spv::Id>{});
|
|
|
|
|
+ case glslang::EOpTensorLayoutSetBlockSizeNV:
|
|
|
|
|
+ opCode = spv::OpTensorLayoutSetBlockSizeNV;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case glslang::EOpTensorLayoutSetDimensionNV:
|
|
|
|
|
+ opCode = spv::OpTensorLayoutSetDimensionNV;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case glslang::EOpTensorLayoutSetStrideNV:
|
|
|
|
|
+ opCode = spv::OpTensorLayoutSetStrideNV;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case glslang::EOpTensorLayoutSliceNV:
|
|
|
|
|
+ opCode = spv::OpTensorLayoutSliceNV;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case glslang::EOpTensorLayoutSetClampValueNV:
|
|
|
|
|
+ opCode = spv::OpTensorLayoutSetClampValueNV;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case glslang::EOpTensorViewSetDimensionNV:
|
|
|
|
|
+ opCode = spv::OpTensorViewSetDimensionNV;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case glslang::EOpTensorViewSetStrideNV:
|
|
|
|
|
+ opCode = spv::OpTensorViewSetStrideNV;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case glslang::EOpTensorViewSetClipNV:
|
|
|
|
|
+ opCode = spv::OpTensorViewSetClipNV;
|
|
|
|
|
+ break;
|
|
|
default:
|
|
default:
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
@@ -9428,6 +9396,13 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
|
|
|
builder.createStore(builder.createCompositeExtract(id, typeId0, 0), operands[3]);
|
|
builder.createStore(builder.createCompositeExtract(id, typeId0, 0), operands[3]);
|
|
|
builder.createStore(builder.createCompositeExtract(id, typeId0, 1), operands[2]);
|
|
builder.createStore(builder.createCompositeExtract(id, typeId0, 1), operands[2]);
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case glslang::EOpModf:
|
|
|
|
|
+ {
|
|
|
|
|
+ assert(operands.size() == 2);
|
|
|
|
|
+ builder.createStore(builder.createCompositeExtract(id, typeId0, 1), operands[1]);
|
|
|
|
|
+ id = builder.createCompositeExtract(id, typeId0, 0);
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
case glslang::EOpFrexp:
|
|
case glslang::EOpFrexp:
|
|
|
{
|
|
{
|
|
|
assert(operands.size() == 2);
|
|
assert(operands.size() == 2);
|
|
@@ -9672,6 +9647,10 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (symbol->getBasicType() == glslang::EbtFunction) {
|
|
|
|
|
+ return 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
id = createSpvVariable(symbol, forcedType.first);
|
|
id = createSpvVariable(symbol, forcedType.first);
|
|
|
|
|
|
|
|
if (mayNeedToReuseBuiltIn) {
|
|
if (mayNeedToReuseBuiltIn) {
|
|
@@ -10228,12 +10207,13 @@ bool TGlslangToSpvTraverser::isTrivial(const glslang::TIntermTyped* node)
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (IsOpNumericConv(node->getAsOperator()->getOp()) &&
|
|
|
|
|
+ node->getType().getBasicType() == glslang::EbtBool) {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
switch (node->getAsOperator()->getOp()) {
|
|
switch (node->getAsOperator()->getOp()) {
|
|
|
case glslang::EOpLogicalNot:
|
|
case glslang::EOpLogicalNot:
|
|
|
- case glslang::EOpConvIntToBool:
|
|
|
|
|
- case glslang::EOpConvUintToBool:
|
|
|
|
|
- case glslang::EOpConvFloatToBool:
|
|
|
|
|
- case glslang::EOpConvDoubleToBool:
|
|
|
|
|
case glslang::EOpEqual:
|
|
case glslang::EOpEqual:
|
|
|
case glslang::EOpNotEqual:
|
|
case glslang::EOpNotEqual:
|
|
|
case glslang::EOpLessThan:
|
|
case glslang::EOpLessThan:
|