Updated glslang.

This commit is contained in:
Бранимир Караџић 2019-06-22 04:09:45 -07:00
parent 66ee3e0ff0
commit 5de3e44573
22 changed files with 2350 additions and 572 deletions

View File

@ -138,7 +138,7 @@ protected:
spv::LoopControlMask TranslateLoopControl(const glslang::TIntermLoop&, std::vector<unsigned int>& operands) const; spv::LoopControlMask TranslateLoopControl(const glslang::TIntermLoop&, std::vector<unsigned int>& operands) const;
spv::StorageClass TranslateStorageClass(const glslang::TType&); spv::StorageClass TranslateStorageClass(const glslang::TType&);
void addIndirectionIndexCapabilities(const glslang::TType& baseType, const glslang::TType& indexType); void addIndirectionIndexCapabilities(const glslang::TType& baseType, const glslang::TType& indexType);
spv::Id createSpvVariable(const glslang::TIntermSymbol*); spv::Id createSpvVariable(const glslang::TIntermSymbol*, spv::Id forcedType);
spv::Id getSampledType(const glslang::TSampler&); spv::Id getSampledType(const glslang::TSampler&);
spv::Id getInvertedSwizzleType(const glslang::TIntermTyped&); spv::Id getInvertedSwizzleType(const glslang::TIntermTyped&);
spv::Id createInvertedSwizzle(spv::Decoration precision, const glslang::TIntermTyped&, spv::Id parentResult); spv::Id createInvertedSwizzle(spv::Decoration precision, const glslang::TIntermTyped&, spv::Id parentResult);
@ -169,7 +169,7 @@ protected:
void makeGlobalInitializers(const glslang::TIntermSequence&); void makeGlobalInitializers(const glslang::TIntermSequence&);
void visitFunctions(const glslang::TIntermSequence&); void visitFunctions(const glslang::TIntermSequence&);
void handleFunctionEntry(const glslang::TIntermAggregate* node); void handleFunctionEntry(const glslang::TIntermAggregate* node);
void translateArguments(const glslang::TIntermAggregate& node, std::vector<spv::Id>& arguments); void translateArguments(const glslang::TIntermAggregate& node, std::vector<spv::Id>& arguments, spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags);
void translateArguments(glslang::TIntermUnary& node, std::vector<spv::Id>& arguments); void translateArguments(glslang::TIntermUnary& node, std::vector<spv::Id>& arguments);
spv::Id createImageTextureFunctionCall(glslang::TIntermOperator* node); spv::Id createImageTextureFunctionCall(glslang::TIntermOperator* node);
spv::Id handleUserFunctionCall(const glslang::TIntermAggregate*); spv::Id handleUserFunctionCall(const glslang::TIntermAggregate*);
@ -178,14 +178,14 @@ protected:
glslang::TBasicType typeProxy, bool reduceComparison = true); glslang::TBasicType typeProxy, bool reduceComparison = true);
spv::Id createBinaryMatrixOperation(spv::Op, OpDecorations&, spv::Id typeId, spv::Id left, spv::Id right); spv::Id createBinaryMatrixOperation(spv::Op, OpDecorations&, spv::Id typeId, spv::Id left, spv::Id right);
spv::Id createUnaryOperation(glslang::TOperator op, OpDecorations&, spv::Id typeId, spv::Id operand, spv::Id createUnaryOperation(glslang::TOperator op, OpDecorations&, spv::Id typeId, spv::Id operand,
glslang::TBasicType typeProxy); glslang::TBasicType typeProxy, const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags);
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); 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 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, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy); spv::Id createAtomicOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy, const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags);
spv::Id createInvocationsOperation(glslang::TOperator op, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy); spv::Id createInvocationsOperation(glslang::TOperator op, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy);
spv::Id CreateInvocationsVectorOperation(spv::Op op, spv::GroupOperation groupOperation, spv::Id typeId, std::vector<spv::Id>& operands); spv::Id CreateInvocationsVectorOperation(spv::Op op, spv::GroupOperation groupOperation, spv::Id typeId, std::vector<spv::Id>& operands);
spv::Id createSubgroupOperation(glslang::TOperator op, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy); spv::Id createSubgroupOperation(glslang::TOperator op, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy);
@ -208,6 +208,8 @@ protected:
if (builder.getSpvVersion() < glslang::EShTargetSpv_1_3) if (builder.getSpvVersion() < glslang::EShTargetSpv_1_3)
builder.addExtension(ext); builder.addExtension(ext);
} }
std::pair<spv::Id, spv::Id> getForcedType(spv::BuiltIn, const glslang::TType&);
spv::Id translateForcedType(spv::Id object);
glslang::SpvOptions& options; glslang::SpvOptions& options;
spv::Function* shaderEntry; spv::Function* shaderEntry;
@ -224,6 +226,7 @@ protected:
bool linkageOnly; // true when visiting the set of objects in the AST present only for establishing interface, whether or not they were statically used bool linkageOnly; // true when visiting the set of objects in the AST present only for establishing interface, whether or not they were statically used
std::set<spv::Id> iOSet; // all input/output variables from either static use or declaration of interface std::set<spv::Id> iOSet; // all input/output variables from either static use or declaration of interface
const glslang::TIntermediate* glslangIntermediate; const glslang::TIntermediate* glslangIntermediate;
bool nanMinMaxClamp; // true if use NMin/NMax/NClamp instead of FMin/FMax/FClamp
spv::Id stdBuiltins; spv::Id stdBuiltins;
std::unordered_map<const char*, spv::Id> extBuiltinMap; std::unordered_map<const char*, spv::Id> extBuiltinMap;
@ -237,6 +240,10 @@ protected:
std::unordered_map<std::string, const glslang::TIntermSymbol*> counterOriginator; std::unordered_map<std::string, const glslang::TIntermSymbol*> counterOriginator;
// Map pointee types for EbtReference to their forward pointers // Map pointee types for EbtReference to their forward pointers
std::map<const glslang::TType *, spv::Id> forwardPointers; std::map<const glslang::TType *, spv::Id> forwardPointers;
// Type forcing, for when SPIR-V wants a different type than the AST,
// requiring local translation to and from SPIR-V type on every access.
// Maps <builtin-variable-id -> AST-required-type-id>
std::unordered_map<spv::Id, spv::Id> forceType;
}; };
// //
@ -732,27 +739,27 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
case glslang::EbvSubGroupEqMask: case glslang::EbvSubGroupEqMask:
builder.addExtension(spv::E_SPV_KHR_shader_ballot); builder.addExtension(spv::E_SPV_KHR_shader_ballot);
builder.addCapability(spv::CapabilitySubgroupBallotKHR); builder.addCapability(spv::CapabilitySubgroupBallotKHR);
return spv::BuiltInSubgroupEqMaskKHR; return spv::BuiltInSubgroupEqMask;
case glslang::EbvSubGroupGeMask: case glslang::EbvSubGroupGeMask:
builder.addExtension(spv::E_SPV_KHR_shader_ballot); builder.addExtension(spv::E_SPV_KHR_shader_ballot);
builder.addCapability(spv::CapabilitySubgroupBallotKHR); builder.addCapability(spv::CapabilitySubgroupBallotKHR);
return spv::BuiltInSubgroupGeMaskKHR; return spv::BuiltInSubgroupGeMask;
case glslang::EbvSubGroupGtMask: case glslang::EbvSubGroupGtMask:
builder.addExtension(spv::E_SPV_KHR_shader_ballot); builder.addExtension(spv::E_SPV_KHR_shader_ballot);
builder.addCapability(spv::CapabilitySubgroupBallotKHR); builder.addCapability(spv::CapabilitySubgroupBallotKHR);
return spv::BuiltInSubgroupGtMaskKHR; return spv::BuiltInSubgroupGtMask;
case glslang::EbvSubGroupLeMask: case glslang::EbvSubGroupLeMask:
builder.addExtension(spv::E_SPV_KHR_shader_ballot); builder.addExtension(spv::E_SPV_KHR_shader_ballot);
builder.addCapability(spv::CapabilitySubgroupBallotKHR); builder.addCapability(spv::CapabilitySubgroupBallotKHR);
return spv::BuiltInSubgroupLeMaskKHR; return spv::BuiltInSubgroupLeMask;
case glslang::EbvSubGroupLtMask: case glslang::EbvSubGroupLtMask:
builder.addExtension(spv::E_SPV_KHR_shader_ballot); builder.addExtension(spv::E_SPV_KHR_shader_ballot);
builder.addCapability(spv::CapabilitySubgroupBallotKHR); builder.addCapability(spv::CapabilitySubgroupBallotKHR);
return spv::BuiltInSubgroupLtMaskKHR; return spv::BuiltInSubgroupLtMask;
case glslang::EbvNumSubgroups: case glslang::EbvNumSubgroups:
builder.addCapability(spv::CapabilityGroupNonUniform); builder.addCapability(spv::CapabilityGroupNonUniform);
@ -794,6 +801,7 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
builder.addCapability(spv::CapabilityGroupNonUniform); builder.addCapability(spv::CapabilityGroupNonUniform);
builder.addCapability(spv::CapabilityGroupNonUniformBallot); builder.addCapability(spv::CapabilityGroupNonUniformBallot);
return spv::BuiltInSubgroupLtMask; return spv::BuiltInSubgroupLtMask;
#ifdef AMD_EXTENSIONS #ifdef AMD_EXTENSIONS
case glslang::EbvBaryCoordNoPersp: case glslang::EbvBaryCoordNoPersp:
builder.addExtension(spv::E_SPV_AMD_shader_explicit_vertex_parameter); builder.addExtension(spv::E_SPV_AMD_shader_explicit_vertex_parameter);
@ -1313,7 +1321,8 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl
sequenceDepth(0), logger(buildLogger), sequenceDepth(0), logger(buildLogger),
builder(spvVersion, (glslang::GetKhronosToolId() << 16) | glslang::GetSpirvGeneratorVersion(), logger), builder(spvVersion, (glslang::GetKhronosToolId() << 16) | glslang::GetSpirvGeneratorVersion(), logger),
inEntryPoint(false), entryPointTerminated(false), linkageOnly(false), inEntryPoint(false), entryPointTerminated(false), linkageOnly(false),
glslangIntermediate(glslangIntermediate) glslangIntermediate(glslangIntermediate),
nanMinMaxClamp(glslangIntermediate->getNanMinMaxClamp())
{ {
spv::ExecutionModel executionModel = TranslateExecutionModel(glslangIntermediate->getStage()); spv::ExecutionModel executionModel = TranslateExecutionModel(glslangIntermediate->getStage());
@ -1618,8 +1627,8 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol)
// Formal function parameters were mapped during makeFunctions(). // Formal function parameters were mapped during makeFunctions().
spv::Id id = getSymbolId(symbol); spv::Id id = getSymbolId(symbol);
// Include all "static use" and "linkage only" interface variables on the OpEntryPoint instruction
if (builder.isPointer(id)) { if (builder.isPointer(id)) {
// Include all "static use" and "linkage only" interface variables on the OpEntryPoint instruction
// Consider adding to the OpEntryPoint interface list. // Consider adding to the OpEntryPoint interface list.
// Only looking at structures if they have at least one member. // Only looking at structures if they have at least one member.
if (!symbol->getType().isStruct() || symbol->getType().getStruct()->size() > 0) { if (!symbol->getType().isStruct() || symbol->getType().getStruct()->size() > 0) {
@ -1631,6 +1640,14 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol)
iOSet.insert(id); iOSet.insert(id);
} }
} }
// If the SPIR-V type is required to be different than the AST type,
// translate now from the SPIR-V type to the AST type, for the consuming
// operation.
// Note this turns it from an l-value to an r-value.
// Currently, all symbols needing this are inputs; avoid the map lookup when non-input.
if (symbol->getType().getQualifier().storage == glslang::EvqVaryingIn)
id = translateForcedType(id);
} }
// Only process non-linkage-only nodes for generating actual static uses // Only process non-linkage-only nodes for generating actual static uses
@ -1648,8 +1665,10 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol)
// See comments in handleUserFunctionCall(). // See comments in handleUserFunctionCall().
// B) Specialization constants (normal constants don't even come in as a variable), // B) Specialization constants (normal constants don't even come in as a variable),
// These are also pure R-values. // These are also pure R-values.
// C) R-Values from type translation, see above call to translateForcedType()
glslang::TQualifier qualifier = symbol->getQualifier(); glslang::TQualifier qualifier = symbol->getQualifier();
if (qualifier.isSpecConstant() || rValueParameters.find(symbol->getId()) != rValueParameters.end()) if (qualifier.isSpecConstant() || rValueParameters.find(symbol->getId()) != rValueParameters.end() ||
!builder.isPointerType(builder.getTypeId(id)))
builder.setAccessChainRValue(id); builder.setAccessChainRValue(id);
else else
builder.setAccessChainLValue(id); builder.setAccessChainLValue(id);
@ -1906,6 +1925,71 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T
} }
} }
// Figure out what, if any, type changes are needed when accessing a specific built-in.
// Returns <the type SPIR-V requires for declarion, the type to translate to on use>.
// Also see comment for 'forceType', regarding tracking SPIR-V-required types.
std::pair<spv::Id, spv::Id> TGlslangToSpvTraverser::getForcedType(spv::BuiltIn builtIn,
const glslang::TType& glslangType)
{
switch(builtIn)
{
case spv::BuiltInSubgroupEqMask:
case spv::BuiltInSubgroupGeMask:
case spv::BuiltInSubgroupGtMask:
case spv::BuiltInSubgroupLeMask:
case spv::BuiltInSubgroupLtMask: {
// these require changing a 64-bit scaler -> a vector of 32-bit components
if (glslangType.isVector())
break;
std::pair<spv::Id, spv::Id> ret(builder.makeVectorType(builder.makeUintType(32), 4),
builder.makeUintType(64));
return ret;
}
default:
break;
}
std::pair<spv::Id, spv::Id> ret(spv::NoType, spv::NoType);
return ret;
}
// For an object previously identified (see getForcedType() and forceType)
// as needing type translations, do the translation needed for a load, turning
// an L-value into in R-value.
spv::Id TGlslangToSpvTraverser::translateForcedType(spv::Id object)
{
const auto forceIt = forceType.find(object);
if (forceIt == forceType.end())
return object;
spv::Id desiredTypeId = forceIt->second;
spv::Id objectTypeId = builder.getTypeId(object);
assert(builder.isPointerType(objectTypeId));
objectTypeId = builder.getContainedTypeId(objectTypeId);
if (builder.isVectorType(objectTypeId) &&
builder.getScalarTypeWidth(builder.getContainedTypeId(objectTypeId)) == 32) {
if (builder.getScalarTypeWidth(desiredTypeId) == 64) {
// handle 32-bit v.xy* -> 64-bit
builder.clearAccessChain();
builder.setAccessChainLValue(object);
object = builder.accessChainLoad(spv::NoPrecision, spv::DecorationMax, objectTypeId);
std::vector<spv::Id> components;
components.push_back(builder.createCompositeExtract(object, builder.getContainedTypeId(objectTypeId), 0));
components.push_back(builder.createCompositeExtract(object, builder.getContainedTypeId(objectTypeId), 1));
spv::Id vecType = builder.makeVectorType(builder.getContainedTypeId(objectTypeId), 2);
return builder.createUnaryOp(spv::OpBitcast, desiredTypeId,
builder.createCompositeConstruct(vecType, components));
} else {
logger->missingFunctionality("forcing 32-bit vector type to non 64-bit scalar");
}
} else {
logger->missingFunctionality("forcing non 32-bit vector type");
}
return object;
}
bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TIntermUnary* node) bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TIntermUnary* node)
{ {
builder.setLine(node->getLoc().line, node->getLoc().getFilename()); builder.setLine(node->getLoc().line, node->getLoc().getFilename());
@ -1981,19 +2065,26 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
invertedType = getInvertedSwizzleType(*node->getOperand()); invertedType = getInvertedSwizzleType(*node->getOperand());
builder.clearAccessChain(); builder.clearAccessChain();
TIntermNode *operandNode;
if (invertedType != spv::NoType) if (invertedType != spv::NoType)
node->getOperand()->getAsBinaryNode()->getLeft()->traverse(this); operandNode = node->getOperand()->getAsBinaryNode()->getLeft();
else else
node->getOperand()->traverse(this); operandNode = node->getOperand();
operandNode->traverse(this);
spv::Id operand = spv::NoResult; spv::Id operand = spv::NoResult;
spv::Builder::AccessChain::CoherentFlags lvalueCoherentFlags;
if (node->getOp() == glslang::EOpAtomicCounterIncrement || if (node->getOp() == glslang::EOpAtomicCounterIncrement ||
node->getOp() == glslang::EOpAtomicCounterDecrement || node->getOp() == glslang::EOpAtomicCounterDecrement ||
node->getOp() == glslang::EOpAtomicCounter || node->getOp() == glslang::EOpAtomicCounter ||
node->getOp() == glslang::EOpInterpolateAtCentroid) node->getOp() == glslang::EOpInterpolateAtCentroid) {
operand = builder.accessChainGetLValue(); // Special case l-value operands operand = builder.accessChainGetLValue(); // Special case l-value operands
else lvalueCoherentFlags = builder.getAccessChain().coherentFlags;
lvalueCoherentFlags |= TranslateCoherent(operandNode->getAsTyped()->getType());
} else
operand = accessChainLoad(node->getOperand()->getType()); operand = accessChainLoad(node->getOperand()->getType());
OpDecorations decorations = { TranslatePrecisionDecoration(node->getOperationPrecision()), OpDecorations decorations = { TranslatePrecisionDecoration(node->getOperationPrecision()),
@ -2006,7 +2097,7 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
// if not, then possibly an operation // if not, then possibly an operation
if (! result) if (! result)
result = createUnaryOperation(node->getOp(), decorations, resultType(), operand, node->getOperand()->getBasicType()); result = createUnaryOperation(node->getOp(), decorations, resultType(), operand, node->getOperand()->getBasicType(), lvalueCoherentFlags);
if (result) { if (result) {
if (invertedType) { if (invertedType) {
@ -2113,6 +2204,8 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
bool noReturnValue = false; bool noReturnValue = false;
bool atomic = false; bool atomic = false;
spv::Builder::AccessChain::CoherentFlags lvalueCoherentFlags;
assert(node->getOp()); assert(node->getOp());
spv::Decoration precision = TranslatePrecisionDecoration(node->getOperationPrecision()); spv::Decoration precision = TranslatePrecisionDecoration(node->getOperationPrecision());
@ -2310,7 +2403,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
{ {
builder.setLine(node->getLoc().line, node->getLoc().getFilename()); builder.setLine(node->getLoc().line, node->getLoc().getFilename());
std::vector<spv::Id> arguments; std::vector<spv::Id> arguments;
translateArguments(*node, arguments); translateArguments(*node, arguments, lvalueCoherentFlags);
spv::Id constructed; spv::Id constructed;
if (node->getOp() == glslang::EOpConstructTextureSampler) if (node->getOp() == glslang::EOpConstructTextureSampler)
constructed = builder.createOp(spv::OpSampledImage, resultType(), arguments); constructed = builder.createOp(spv::OpSampledImage, resultType(), arguments);
@ -2602,9 +2695,11 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
} }
} }
if (lvalue) if (lvalue) {
operands.push_back(builder.accessChainGetLValue()); operands.push_back(builder.accessChainGetLValue());
else { lvalueCoherentFlags = builder.getAccessChain().coherentFlags;
lvalueCoherentFlags |= TranslateCoherent(glslangOperands[arg]->getAsTyped()->getType());
} else {
builder.setLine(node->getLoc().line, node->getLoc().getFilename()); builder.setLine(node->getLoc().line, node->getLoc().getFilename());
operands.push_back(accessChainLoad(glslangOperands[arg]->getAsTyped()->getType())); operands.push_back(accessChainLoad(glslangOperands[arg]->getAsTyped()->getType()));
} }
@ -2639,7 +2734,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
result = 0; result = 0;
} else if (atomic) { } else if (atomic) {
// Handle all atomics // Handle all atomics
result = createAtomicOperation(node->getOp(), precision, resultType(), operands, node->getBasicType()); result = createAtomicOperation(node->getOp(), precision, resultType(), operands, node->getBasicType(), lvalueCoherentFlags);
} else { } else {
// Pass through to generic operations. // Pass through to generic operations.
switch (glslangOperands.size()) { switch (glslangOperands.size()) {
@ -2654,7 +2749,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
result = createUnaryOperation( result = createUnaryOperation(
node->getOp(), decorations, node->getOp(), decorations,
resultType(), operands.front(), resultType(), operands.front(),
glslangOperands[0]->getAsTyped()->getBasicType()); glslangOperands[0]->getAsTyped()->getBasicType(), lvalueCoherentFlags);
} }
break; break;
default: default:
@ -3024,7 +3119,7 @@ bool TGlslangToSpvTraverser::visitBranch(glslang::TVisit /* visit */, glslang::T
return false; return false;
} }
spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol* node) spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol* node, spv::Id forcedType)
{ {
// First, steer off constants, which are not SPIR-V variables, but // First, steer off constants, which are not SPIR-V variables, but
// can still have a mapping to a SPIR-V Id. // can still have a mapping to a SPIR-V Id.
@ -3037,7 +3132,8 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol*
// Now, handle actual variables // Now, handle actual variables
spv::StorageClass storageClass = TranslateStorageClass(node->getType()); spv::StorageClass storageClass = TranslateStorageClass(node->getType());
spv::Id spvType = convertGlslangToSpvType(node->getType()); spv::Id spvType = forcedType == spv::NoType ? convertGlslangToSpvType(node->getType())
: forcedType;
const bool contains16BitType = node->getType().containsBasicType(glslang::EbtFloat16) || const bool contains16BitType = node->getType().containsBasicType(glslang::EbtFloat16) ||
node->getType().containsBasicType(glslang::EbtInt16) || node->getType().containsBasicType(glslang::EbtInt16) ||
@ -3066,6 +3162,11 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol*
builder.addCapability(spv::CapabilityStorageUniformBufferBlock16); builder.addCapability(spv::CapabilityStorageUniformBufferBlock16);
break; break;
default: default:
if (node->getType().containsBasicType(glslang::EbtFloat16))
builder.addCapability(spv::CapabilityFloat16);
if (node->getType().containsBasicType(glslang::EbtInt16) ||
node->getType().containsBasicType(glslang::EbtUint16))
builder.addCapability(spv::CapabilityInt16);
break; break;
} }
} }
@ -3082,6 +3183,8 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol*
} else if (storageClass == spv::StorageClassStorageBuffer) { } else if (storageClass == spv::StorageClassStorageBuffer) {
builder.addExtension(spv::E_SPV_KHR_8bit_storage); builder.addExtension(spv::E_SPV_KHR_8bit_storage);
builder.addCapability(spv::CapabilityStorageBuffer8BitAccess); builder.addCapability(spv::CapabilityStorageBuffer8BitAccess);
} else {
builder.addCapability(spv::CapabilityInt8);
} }
} }
@ -4014,6 +4117,16 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF
symbolValues[parameters[p]->getAsSymbolNode()->getId()] = function->getParamId(p); symbolValues[parameters[p]->getAsSymbolNode()->getId()] = function->getParamId(p);
// give a name too // give a name too
builder.addName(function->getParamId(p), parameters[p]->getAsSymbolNode()->getName().c_str()); builder.addName(function->getParamId(p), parameters[p]->getAsSymbolNode()->getName().c_str());
const glslang::TType& paramType = parameters[p]->getAsTyped()->getType();
if (paramType.containsBasicType(glslang::EbtInt8) ||
paramType.containsBasicType(glslang::EbtUint8))
builder.addCapability(spv::CapabilityInt8);
if (paramType.containsBasicType(glslang::EbtInt16) ||
paramType.containsBasicType(glslang::EbtUint16))
builder.addCapability(spv::CapabilityInt16);
if (paramType.containsBasicType(glslang::EbtFloat16))
builder.addCapability(spv::CapabilityFloat16);
} }
} }
} }
@ -4052,7 +4165,7 @@ void TGlslangToSpvTraverser::handleFunctionEntry(const glslang::TIntermAggregate
builder.setBuildPoint(functionBlock); builder.setBuildPoint(functionBlock);
} }
void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& node, std::vector<spv::Id>& arguments) void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& node, std::vector<spv::Id>& arguments, spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags)
{ {
const glslang::TIntermSequence& glslangArguments = node.getSequence(); const glslang::TIntermSequence& glslangArguments = node.getSequence();
@ -4210,9 +4323,11 @@ void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate&
break; break;
} }
if (lvalue) if (lvalue) {
arguments.push_back(builder.accessChainGetLValue()); arguments.push_back(builder.accessChainGetLValue());
else lvalueCoherentFlags = builder.getAccessChain().coherentFlags;
lvalueCoherentFlags |= TranslateCoherent(glslangArguments[i]->getAsTyped()->getType());
} else
arguments.push_back(accessChainLoad(glslangArguments[i]->getAsTyped()->getType())); arguments.push_back(accessChainLoad(glslangArguments[i]->getAsTyped()->getType()));
} }
} }
@ -4253,9 +4368,11 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
return spv::ImageOperandsMaskNone; return spv::ImageOperandsMaskNone;
}; };
spv::Builder::AccessChain::CoherentFlags lvalueCoherentFlags;
std::vector<spv::Id> arguments; std::vector<spv::Id> arguments;
if (node->getAsAggregate()) if (node->getAsAggregate())
translateArguments(*node->getAsAggregate(), arguments); translateArguments(*node->getAsAggregate(), arguments, lvalueCoherentFlags);
else else
translateArguments(*node->getAsUnaryNode(), arguments); translateArguments(*node->getAsUnaryNode(), arguments);
spv::Decoration precision = TranslatePrecisionDecoration(node->getOperationPrecision()); spv::Decoration precision = TranslatePrecisionDecoration(node->getOperationPrecision());
@ -4536,7 +4653,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
for (; opIt != arguments.end(); ++opIt) for (; opIt != arguments.end(); ++opIt)
operands.push_back(*opIt); operands.push_back(*opIt);
return createAtomicOperation(node->getOp(), precision, resultType(), operands, node->getBasicType()); return createAtomicOperation(node->getOp(), precision, resultType(), operands, node->getBasicType(), lvalueCoherentFlags);
} }
} }
@ -5292,7 +5409,7 @@ spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, OpDecora
} }
spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDecorations& decorations, spv::Id typeId, spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDecorations& decorations, spv::Id typeId,
spv::Id operand, glslang::TBasicType typeProxy) spv::Id operand, glslang::TBasicType typeProxy, const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags)
{ {
spv::Op unaryOp = spv::OpNop; spv::Op unaryOp = spv::OpNop;
int extBuiltins = -1; int extBuiltins = -1;
@ -5563,7 +5680,7 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe
// Handle all of the atomics in one place, in createAtomicOperation() // Handle all of the atomics in one place, in createAtomicOperation()
std::vector<spv::Id> operands; std::vector<spv::Id> operands;
operands.push_back(operand); operands.push_back(operand);
return createAtomicOperation(op, decorations.precision, typeId, operands, typeProxy); return createAtomicOperation(op, decorations.precision, typeId, operands, typeProxy, lvalueCoherentFlags);
} }
case glslang::EOpBitFieldReverse: case glslang::EOpBitFieldReverse:
@ -6171,7 +6288,7 @@ spv::Id TGlslangToSpvTraverser::makeSmearedConstant(spv::Id constant, int vector
} }
// For glslang ops that map to SPV atomic opCodes // For glslang ops that map to SPV atomic opCodes
spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv::Decoration /*precision*/, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy) spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv::Decoration /*precision*/, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy, const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags)
{ {
spv::Op opCode = spv::OpNop; spv::Op opCode = spv::OpNop;
@ -6257,7 +6374,7 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv
scopeId = builder.makeUintConstant(spv::ScopeDevice); scopeId = builder.makeUintConstant(spv::ScopeDevice);
} }
// semantics default to relaxed // semantics default to relaxed
spv::Id semanticsId = builder.makeUintConstant(spv::MemorySemanticsMaskNone); spv::Id semanticsId = builder.makeUintConstant(lvalueCoherentFlags.volatil ? spv::MemorySemanticsVolatileMask : spv::MemorySemanticsMaskNone);
spv::Id semanticsId2 = semanticsId; spv::Id semanticsId2 = semanticsId;
pointerId = operands[0]; pointerId = operands[0];
@ -6287,7 +6404,10 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv
// Check for capabilities // Check for capabilities
unsigned semanticsImmediate = builder.getConstantScalar(semanticsId) | builder.getConstantScalar(semanticsId2); unsigned semanticsImmediate = builder.getConstantScalar(semanticsId) | builder.getConstantScalar(semanticsId2);
if (semanticsImmediate & (spv::MemorySemanticsMakeAvailableKHRMask | spv::MemorySemanticsMakeVisibleKHRMask | spv::MemorySemanticsOutputMemoryKHRMask)) { if (semanticsImmediate & (spv::MemorySemanticsMakeAvailableKHRMask |
spv::MemorySemanticsMakeVisibleKHRMask |
spv::MemorySemanticsOutputMemoryKHRMask |
spv::MemorySemanticsVolatileMask)) {
builder.addCapability(spv::CapabilityVulkanMemoryModelKHR); builder.addCapability(spv::CapabilityVulkanMemoryModelKHR);
} }
@ -6979,7 +7099,7 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
switch (op) { switch (op) {
case glslang::EOpMin: case glslang::EOpMin:
if (isFloat) if (isFloat)
libCall = spv::GLSLstd450FMin; libCall = nanMinMaxClamp ? spv::GLSLstd450NMin : spv::GLSLstd450FMin;
else if (isUnsigned) else if (isUnsigned)
libCall = spv::GLSLstd450UMin; libCall = spv::GLSLstd450UMin;
else else
@ -6991,7 +7111,7 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
break; break;
case glslang::EOpMax: case glslang::EOpMax:
if (isFloat) if (isFloat)
libCall = spv::GLSLstd450FMax; libCall = nanMinMaxClamp ? spv::GLSLstd450NMax : spv::GLSLstd450FMax;
else if (isUnsigned) else if (isUnsigned)
libCall = spv::GLSLstd450UMax; libCall = spv::GLSLstd450UMax;
else else
@ -7010,7 +7130,7 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
case glslang::EOpClamp: case glslang::EOpClamp:
if (isFloat) if (isFloat)
libCall = spv::GLSLstd450FClamp; libCall = nanMinMaxClamp ? spv::GLSLstd450NClamp : spv::GLSLstd450FClamp;
else if (isUnsigned) else if (isUnsigned)
libCall = spv::GLSLstd450UClamp; libCall = spv::GLSLstd450UClamp;
else else
@ -7229,7 +7349,10 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
unsigned int memoryScope = builder.getConstantScalar(operands[1]); unsigned int memoryScope = builder.getConstantScalar(operands[1]);
unsigned int semantics = builder.getConstantScalar(operands[2]) | builder.getConstantScalar(operands[3]); unsigned int semantics = builder.getConstantScalar(operands[2]) | builder.getConstantScalar(operands[3]);
builder.createControlBarrier((spv::Scope)executionScope, (spv::Scope)memoryScope, (spv::MemorySemanticsMask)semantics); builder.createControlBarrier((spv::Scope)executionScope, (spv::Scope)memoryScope, (spv::MemorySemanticsMask)semantics);
if (semantics & (spv::MemorySemanticsMakeAvailableKHRMask | spv::MemorySemanticsMakeVisibleKHRMask | spv::MemorySemanticsOutputMemoryKHRMask)) { if (semantics & (spv::MemorySemanticsMakeAvailableKHRMask |
spv::MemorySemanticsMakeVisibleKHRMask |
spv::MemorySemanticsOutputMemoryKHRMask |
spv::MemorySemanticsVolatileMask)) {
builder.addCapability(spv::CapabilityVulkanMemoryModelKHR); builder.addCapability(spv::CapabilityVulkanMemoryModelKHR);
} }
if (glslangIntermediate->usingVulkanMemoryModel() && (executionScope == spv::ScopeDevice || memoryScope == spv::ScopeDevice)) { if (glslangIntermediate->usingVulkanMemoryModel() && (executionScope == spv::ScopeDevice || memoryScope == spv::ScopeDevice)) {
@ -7246,7 +7369,10 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
unsigned int memoryScope = builder.getConstantScalar(operands[0]); unsigned int memoryScope = builder.getConstantScalar(operands[0]);
unsigned int semantics = builder.getConstantScalar(operands[1]) | builder.getConstantScalar(operands[2]); unsigned int semantics = builder.getConstantScalar(operands[1]) | builder.getConstantScalar(operands[2]);
builder.createMemoryBarrier((spv::Scope)memoryScope, (spv::MemorySemanticsMask)semantics); builder.createMemoryBarrier((spv::Scope)memoryScope, (spv::MemorySemanticsMask)semantics);
if (semantics & (spv::MemorySemanticsMakeAvailableKHRMask | spv::MemorySemanticsMakeVisibleKHRMask | spv::MemorySemanticsOutputMemoryKHRMask)) { if (semantics & (spv::MemorySemanticsMakeAvailableKHRMask |
spv::MemorySemanticsMakeVisibleKHRMask |
spv::MemorySemanticsOutputMemoryKHRMask |
spv::MemorySemanticsVolatileMask)) {
builder.addCapability(spv::CapabilityVulkanMemoryModelKHR); builder.addCapability(spv::CapabilityVulkanMemoryModelKHR);
} }
if (glslangIntermediate->usingVulkanMemoryModel() && memoryScope == spv::ScopeDevice) { if (glslangIntermediate->usingVulkanMemoryModel() && memoryScope == spv::ScopeDevice) {
@ -7500,8 +7626,12 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
} }
// it was not found, create it // it was not found, create it
id = createSpvVariable(symbol); spv::BuiltIn builtIn = TranslateBuiltInDecoration(symbol->getQualifier().builtIn, false);
auto forcedType = getForcedType(builtIn, symbol->getType());
id = createSpvVariable(symbol, forcedType.first);
symbolValues[symbol->getId()] = id; symbolValues[symbol->getId()] = id;
if (forcedType.second != spv::NoType)
forceType[id] = forcedType.second;
if (symbol->getBasicType() != glslang::EbtBlock) { if (symbol->getBasicType() != glslang::EbtBlock) {
builder.addDecoration(id, TranslatePrecisionDecoration(symbol->getType())); builder.addDecoration(id, TranslatePrecisionDecoration(symbol->getType()));
@ -7561,10 +7691,10 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
builder.addDecoration(id, memory[i]); builder.addDecoration(id, memory[i]);
} }
// built-in variable decorations // add built-in variable decoration
spv::BuiltIn builtIn = TranslateBuiltInDecoration(symbol->getQualifier().builtIn, false); if (builtIn != spv::BuiltInMax) {
if (builtIn != spv::BuiltInMax)
builder.addDecoration(id, spv::DecorationBuiltIn, (int)builtIn); builder.addDecoration(id, spv::DecorationBuiltIn, (int)builtIn);
}
// nonuniform // nonuniform
builder.addDecoration(id, TranslateNonUniformDecoration(symbol->getType().getQualifier())); builder.addDecoration(id, TranslateNonUniformDecoration(symbol->getType().getQualifier()));

View File

@ -648,6 +648,9 @@ static void GLSLstd450GetDebugNames(const char** names)
names[GLSLstd450InterpolateAtCentroid] = "InterpolateAtCentroid"; names[GLSLstd450InterpolateAtCentroid] = "InterpolateAtCentroid";
names[GLSLstd450InterpolateAtSample] = "InterpolateAtSample"; names[GLSLstd450InterpolateAtSample] = "InterpolateAtSample";
names[GLSLstd450InterpolateAtOffset] = "InterpolateAtOffset"; names[GLSLstd450InterpolateAtOffset] = "InterpolateAtOffset";
names[GLSLstd450NMin] = "NMin";
names[GLSLstd450NMax] = "NMax";
names[GLSLstd450NClamp] = "NClamp";
} }
#ifdef AMD_EXTENSIONS #ifdef AMD_EXTENSIONS

View File

@ -632,6 +632,7 @@ enum MemorySemanticsShift {
MemorySemanticsOutputMemoryKHRShift = 12, MemorySemanticsOutputMemoryKHRShift = 12,
MemorySemanticsMakeAvailableKHRShift = 13, MemorySemanticsMakeAvailableKHRShift = 13,
MemorySemanticsMakeVisibleKHRShift = 14, MemorySemanticsMakeVisibleKHRShift = 14,
MemorySemanticsVolatileShift = 15,
MemorySemanticsMax = 0x7fffffff, MemorySemanticsMax = 0x7fffffff,
}; };
@ -649,7 +650,8 @@ enum MemorySemanticsMask {
MemorySemanticsImageMemoryMask = 0x00000800, MemorySemanticsImageMemoryMask = 0x00000800,
MemorySemanticsOutputMemoryKHRMask = 0x00001000, MemorySemanticsOutputMemoryKHRMask = 0x00001000,
MemorySemanticsMakeAvailableKHRMask = 0x00002000, MemorySemanticsMakeAvailableKHRMask = 0x00002000,
MemorySemanticsMakeVisibleKHRMask = 0x00004000, MemorySemanticsMakeVisibleKHRMask = 0x00004000,
MemorySemanticsVolatileMask = 0x00008000,
}; };
enum MemoryAccessShift { enum MemoryAccessShift {

View File

@ -104,6 +104,7 @@ enum TOptions {
bool targetHlslFunctionality1 = false; bool targetHlslFunctionality1 = false;
bool SpvToolsDisassembler = false; bool SpvToolsDisassembler = false;
bool SpvToolsValidate = false; bool SpvToolsValidate = false;
bool NaNClamp = false;
// //
// Return codes from main/exit(). // Return codes from main/exit().
@ -522,6 +523,8 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
} else if (lowerword == "keep-uncalled" || // synonyms } else if (lowerword == "keep-uncalled" || // synonyms
lowerword == "ku") { lowerword == "ku") {
Options |= EOptionKeepUncalled; Options |= EOptionKeepUncalled;
} else if (lowerword == "nan-clamp") {
NaNClamp = true;
} else if (lowerword == "no-storage-format" || // synonyms } else if (lowerword == "no-storage-format" || // synonyms
lowerword == "nsf") { lowerword == "nsf") {
Options |= EOptionNoStorageFormat; Options |= EOptionNoStorageFormat;
@ -981,6 +984,7 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
shader->setFlattenUniformArrays((Options & EOptionFlattenUniformArrays) != 0); shader->setFlattenUniformArrays((Options & EOptionFlattenUniformArrays) != 0);
shader->setNoStorageFormat((Options & EOptionNoStorageFormat) != 0); shader->setNoStorageFormat((Options & EOptionNoStorageFormat) != 0);
shader->setNanMinMaxClamp(NaNClamp);
shader->setResourceSetBinding(baseResourceSetBinding[compUnit.stage]); shader->setResourceSetBinding(baseResourceSetBinding[compUnit.stage]);
if (Options & EOptionHlslIoMapping) if (Options & EOptionHlslIoMapping)
@ -1533,9 +1537,11 @@ void usage()
" works independently of source language\n" " works independently of source language\n"
" --hlsl-iomap perform IO mapping in HLSL register space\n" " --hlsl-iomap perform IO mapping in HLSL register space\n"
" --hlsl-enable-16bit-types allow 16-bit types in SPIR-V for HLSL\n" " --hlsl-enable-16bit-types allow 16-bit types in SPIR-V for HLSL\n"
" --hlsl-dx9-compatible interprets sampler declarations as a texture/sampler combo like DirectX9 would." " --hlsl-dx9-compatible interprets sampler declarations as a\n"
" texture/sampler combo like DirectX9 would.\n"
" --invert-y | --iy invert position.Y output in vertex shader\n" " --invert-y | --iy invert position.Y output in vertex shader\n"
" --keep-uncalled | --ku don't eliminate uncalled functions\n" " --keep-uncalled | --ku don't eliminate uncalled functions\n"
" --nan-clamp favor non-NaN operand in min, max, and clamp\n"
" --no-storage-format | --nsf use Unknown image format\n" " --no-storage-format | --nsf use Unknown image format\n"
" --reflect-strict-array-suffix use strict array suffix rules when\n" " --reflect-strict-array-suffix use strict array suffix rules when\n"
" reflecting\n" " reflecting\n"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,62 @@
spv.functionParameterTypes.frag
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 34
Capability Shader
Capability Float16
Capability Int64
Capability Int16
Capability Int8
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginUpperLeft
Source GLSL 460
SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float16"
SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int16"
SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int64"
SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int8"
Name 4 "main"
Name 29 "f(i81;u81;i161;u161;i641;u641;f161;"
Name 22 "i8"
Name 23 "u8"
Name 24 "i16"
Name 25 "u16"
Name 26 "i64"
Name 27 "u64"
Name 28 "f16"
2: TypeVoid
3: TypeFunction 2
6: TypeInt 8 1
7: TypePointer Function 6(int8_t)
8: TypeInt 8 0
9: TypePointer Function 8(int8_t)
10: TypeInt 16 1
11: TypePointer Function 10(int16_t)
12: TypeInt 16 0
13: TypePointer Function 12(int16_t)
14: TypeInt 64 1
15: TypePointer Function 14(int64_t)
16: TypeInt 64 0
17: TypePointer Function 16(int64_t)
18: TypeFloat 16
19: TypePointer Function 18(float16_t)
20: TypeInt 32 1
21: TypeFunction 20(int) 7(ptr) 9(ptr) 11(ptr) 13(ptr) 15(ptr) 17(ptr) 19(ptr)
31: 20(int) Constant 0
4(main): 2 Function None 3
5: Label
Return
FunctionEnd
29(f(i81;u81;i161;u161;i641;u641;f161;): 20(int) Function None 21
22(i8): 7(ptr) FunctionParameter
23(u8): 9(ptr) FunctionParameter
24(i16): 11(ptr) FunctionParameter
25(u16): 13(ptr) FunctionParameter
26(i64): 15(ptr) FunctionParameter
27(u64): 17(ptr) FunctionParameter
28(f16): 19(ptr) FunctionParameter
30: Label
ReturnValue 31
FunctionEnd

View File

@ -1,7 +1,7 @@
spv.memoryScopeSemantics.comp spv.memoryScopeSemantics.comp
// Module Version 10300 // Module Version 10300
// Generated by (magic number): 80007 // Generated by (magic number): 80007
// Id's are bound by 148 // Id's are bound by 163
Capability Shader Capability Shader
Capability Int64 Capability Int64
@ -23,59 +23,66 @@ spv.memoryScopeSemantics.comp
Name 23 "atomu" Name 23 "atomu"
Name 24 "value" Name 24 "value"
Name 36 "imagei" Name 36 "imagei"
Name 45 "imageu" Name 46 "imageu"
Name 65 "BufferU" Name 66 "BufferU"
MemberName 65(BufferU) 0 "x" MemberName 66(BufferU) 0 "x"
Name 67 "bufferu" Name 68 "bufferu"
Name 72 "y" Name 73 "y"
Name 77 "BufferI" Name 78 "BufferI"
MemberName 77(BufferI) 0 "x" MemberName 78(BufferI) 0 "x"
Name 79 "bufferi" Name 80 "bufferi"
Name 83 "A" Name 84 "A"
MemberName 83(A) 0 "x" MemberName 84(A) 0 "x"
Name 84 "BufferJ" Name 85 "BufferJ"
MemberName 84(BufferJ) 0 "a" MemberName 85(BufferJ) 0 "a"
Name 87 "bufferj" Name 88 "bufferj"
Name 98 "BufferK" Name 99 "BufferK"
MemberName 98(BufferK) 0 "x" MemberName 99(BufferK) 0 "x"
Name 100 "bufferk" Name 101 "bufferk"
Name 110 "imagej" Name 111 "imagej"
Name 122 "samp" Name 123 "samp"
Name 133 "atomu64" Name 134 "atomu64"
Name 138 "atomi64" Name 139 "atomi64"
Name 143 "BufferL" Name 144 "BufferL"
MemberName 143(BufferL) 0 "x" MemberName 144(BufferL) 0 "x"
Name 145 "bufferl" Name 146 "bufferl"
Name 151 "BufferM"
MemberName 151(BufferM) 0 "x"
Name 153 "bufferm"
Decorate 36(imagei) DescriptorSet 0 Decorate 36(imagei) DescriptorSet 0
Decorate 36(imagei) Binding 1 Decorate 36(imagei) Binding 1
Decorate 45(imageu) DescriptorSet 0 Decorate 46(imageu) DescriptorSet 0
Decorate 45(imageu) Binding 0 Decorate 46(imageu) Binding 0
MemberDecorate 65(BufferU) 0 Offset 0 MemberDecorate 66(BufferU) 0 Offset 0
Decorate 65(BufferU) Block Decorate 66(BufferU) Block
Decorate 67(bufferu) DescriptorSet 0 Decorate 68(bufferu) DescriptorSet 0
Decorate 67(bufferu) Binding 2 Decorate 68(bufferu) Binding 2
MemberDecorate 77(BufferI) 0 Offset 0 MemberDecorate 78(BufferI) 0 Offset 0
Decorate 77(BufferI) Block Decorate 78(BufferI) Block
Decorate 79(bufferi) DescriptorSet 0 Decorate 80(bufferi) DescriptorSet 0
Decorate 79(bufferi) Binding 3 Decorate 80(bufferi) Binding 3
Decorate 82 ArrayStride 4 Decorate 83 ArrayStride 4
MemberDecorate 83(A) 0 Offset 0 MemberDecorate 84(A) 0 Offset 0
MemberDecorate 84(BufferJ) 0 Offset 0 MemberDecorate 85(BufferJ) 0 Offset 0
Decorate 84(BufferJ) Block Decorate 85(BufferJ) Block
Decorate 87(bufferj) DescriptorSet 0 Decorate 88(bufferj) DescriptorSet 0
Decorate 87(bufferj) Binding 4 Decorate 88(bufferj) Binding 4
MemberDecorate 98(BufferK) 0 Offset 0 MemberDecorate 99(BufferK) 0 Offset 0
Decorate 98(BufferK) Block Decorate 99(BufferK) Block
Decorate 100(bufferk) DescriptorSet 0 Decorate 101(bufferk) DescriptorSet 0
Decorate 100(bufferk) Binding 7 Decorate 101(bufferk) Binding 7
Decorate 110(imagej) DescriptorSet 0 Decorate 111(imagej) DescriptorSet 0
Decorate 110(imagej) Binding 5 Decorate 111(imagej) Binding 5
Decorate 122(samp) DescriptorSet 0 Decorate 123(samp) DescriptorSet 0
Decorate 122(samp) Binding 6 Decorate 123(samp) Binding 6
MemberDecorate 143(BufferL) 0 Offset 0 MemberDecorate 144(BufferL) 0 Offset 0
Decorate 143(BufferL) Block Decorate 144(BufferL) Block
Decorate 145(bufferl) DescriptorSet 0 Decorate 146(bufferl) DescriptorSet 0
Decorate 145(bufferl) Binding 8 Decorate 146(bufferl) Binding 8
MemberDecorate 151(BufferM) 0 Offset 0
Decorate 151(BufferM) Block
Decorate 153(bufferm) DescriptorSet 0
Decorate 153(bufferm) Binding 9
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
@ -106,67 +113,72 @@ spv.memoryScopeSemantics.comp
38: 6(int) Constant 0 38: 6(int) Constant 0
39: 37(ivec2) ConstantComposite 38 38 39: 37(ivec2) ConstantComposite 38 38
40: TypePointer Image 6(int) 40: TypePointer Image 6(int)
43: TypeImage 15(int) 2D nonsampled format:R32ui 42: 15(int) Constant 32768
44: TypePointer UniformConstant 43 44: TypeImage 15(int) 2D nonsampled format:R32ui
45(imageu): 44(ptr) Variable UniformConstant 45: TypePointer UniformConstant 44
46: 15(int) Constant 3 46(imageu): 45(ptr) Variable UniformConstant
47: TypePointer Image 15(int) 47: 15(int) Constant 3
50: 15(int) Constant 4 48: TypePointer Image 15(int)
52: 15(int) Constant 7 51: 15(int) Constant 4
57: 6(int) Constant 7 53: 15(int) Constant 7
61: 15(int) Constant 10 58: 6(int) Constant 7
63: 15(int) Constant 322 62: 15(int) Constant 10
65(BufferU): TypeStruct 15(int) 64: 15(int) Constant 322
66: TypePointer StorageBuffer 65(BufferU) 66(BufferU): TypeStruct 15(int)
67(bufferu): 66(ptr) Variable StorageBuffer 67: TypePointer StorageBuffer 66(BufferU)
68: TypePointer StorageBuffer 15(int) 68(bufferu): 67(ptr) Variable StorageBuffer
70: 15(int) Constant 1 69: TypePointer StorageBuffer 15(int)
77(BufferI): TypeStruct 15(int) 71: 15(int) Constant 1
78: TypePointer StorageBuffer 77(BufferI) 78(BufferI): TypeStruct 15(int)
79(bufferi): 78(ptr) Variable StorageBuffer 79: TypePointer StorageBuffer 78(BufferI)
82: TypeArray 15(int) 26 80(bufferi): 79(ptr) Variable StorageBuffer
83(A): TypeStruct 82 83: TypeArray 15(int) 26
84(BufferJ): TypeStruct 83(A) 84(A): TypeStruct 83
85: TypeArray 84(BufferJ) 26 85(BufferJ): TypeStruct 84(A)
86: TypePointer StorageBuffer 85 86: TypeArray 85(BufferJ) 26
87(bufferj): 86(ptr) Variable StorageBuffer 87: TypePointer StorageBuffer 86
94: TypePointer StorageBuffer 83(A) 88(bufferj): 87(ptr) Variable StorageBuffer
98(BufferK): TypeStruct 15(int) 95: TypePointer StorageBuffer 84(A)
99: TypePointer Uniform 98(BufferK) 99(BufferK): TypeStruct 15(int)
100(bufferk): 99(ptr) Variable Uniform 100: TypePointer Uniform 99(BufferK)
101: TypePointer Uniform 15(int) 101(bufferk): 100(ptr) Variable Uniform
106: TypeVector 6(int) 4 102: TypePointer Uniform 15(int)
108: TypeArray 34 26 107: TypeVector 6(int) 4
109: TypePointer UniformConstant 108 109: TypeArray 34 26
110(imagej): 109(ptr) Variable UniformConstant 110: TypePointer UniformConstant 109
116: 106(ivec4) ConstantComposite 38 38 38 38 111(imagej): 110(ptr) Variable UniformConstant
117: TypeFloat 32 117: 107(ivec4) ConstantComposite 38 38 38 38
118: TypeImage 117(float) 2D sampled format:Unknown 118: TypeFloat 32
119: TypeSampledImage 118 119: TypeImage 118(float) 2D sampled format:Unknown
120: TypeArray 119 26 120: TypeSampledImage 119
121: TypePointer UniformConstant 120 121: TypeArray 120 26
122(samp): 121(ptr) Variable UniformConstant 122: TypePointer UniformConstant 121
123: TypePointer UniformConstant 119 123(samp): 122(ptr) Variable UniformConstant
126: TypeVector 117(float) 2 124: TypePointer UniformConstant 120
127: 117(float) Constant 0 127: TypeVector 118(float) 2
128: 126(fvec2) ConstantComposite 127 127 128: 118(float) Constant 0
129: TypeVector 117(float) 4 129: 127(fvec2) ConstantComposite 128 128
131: TypeInt 64 0 130: TypeVector 118(float) 4
132: TypePointer Workgroup 131(int64_t) 132: TypeInt 64 0
133(atomu64): 132(ptr) Variable Workgroup 133: TypePointer Workgroup 132(int64_t)
134:131(int64_t) Constant 7 0 134(atomu64): 133(ptr) Variable Workgroup
136: TypeInt 64 1 135:132(int64_t) Constant 7 0
137: TypePointer Workgroup 136(int64_t) 137: TypeInt 64 1
138(atomi64): 137(ptr) Variable Workgroup 138: TypePointer Workgroup 137(int64_t)
139:136(int64_t) Constant 10 0 139(atomi64): 138(ptr) Variable Workgroup
143(BufferL): TypeStruct 15(int) 140:137(int64_t) Constant 10 0
144: TypePointer StorageBuffer 143(BufferL) 144(BufferL): TypeStruct 15(int)
145(bufferl): 144(ptr) Variable StorageBuffer 145: TypePointer StorageBuffer 144(BufferL)
146(bufferl): 145(ptr) Variable StorageBuffer
151(BufferM): TypeStruct 15(int)
152: TypePointer StorageBuffer 151(BufferM)
153(bufferm): 152(ptr) Variable StorageBuffer
161: 6(int) Constant 32768
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
8(origi): 7(ptr) Variable Function 8(origi): 7(ptr) Variable Function
21(origu): 20(ptr) Variable Function 21(origu): 20(ptr) Variable Function
72(y): 20(ptr) Variable Function 73(y): 20(ptr) Variable Function
19: 6(int) AtomicIAdd 10(atomi) 12 18 11 19: 6(int) AtomicIAdd 10(atomi) 12 18 11
Store 8(origi) 19 Store 8(origi) 19
25: 15(int) Load 24(value) MakePointerVisibleKHR NonPrivatePointerKHR 26 25: 15(int) Load 24(value) MakePointerVisibleKHR NonPrivatePointerKHR 26
@ -177,77 +189,87 @@ spv.memoryScopeSemantics.comp
32: 15(int) Load 24(value) MakePointerVisibleKHR NonPrivatePointerKHR 26 32: 15(int) Load 24(value) MakePointerVisibleKHR NonPrivatePointerKHR 26
AtomicStore 23(atomu) 12 33 32 AtomicStore 23(atomu) 12 33 32
41: 40(ptr) ImageTexelPointer 36(imagei) 39 17 41: 40(ptr) ImageTexelPointer 36(imagei) 39 17
42: 6(int) AtomicLoad 41 12 30 43: 6(int) AtomicLoad 41 12 30
Store 8(origi) 42 Store 8(origi) 43
48: 47(ptr) ImageTexelPointer 45(imageu) 39 17 49: 48(ptr) ImageTexelPointer 46(imageu) 39 17
49: 15(int) AtomicIAdd 48 12 30 46 50: 15(int) AtomicIAdd 49 12 30 47
Store 21(origu) 49 Store 21(origu) 50
51: 47(ptr) ImageTexelPointer 45(imageu) 39 17 52: 48(ptr) ImageTexelPointer 46(imageu) 39 17
AtomicStore 51 12 33 50 AtomicStore 52 12 33 51
53: 15(int) AtomicOr 23(atomu) 12 17 52 54: 15(int) AtomicOr 23(atomu) 12 17 53
Store 21(origu) 53
54: 15(int) AtomicXor 23(atomu) 12 17 52
Store 21(origu) 54 Store 21(origu) 54
55: 15(int) Load 24(value) MakePointerVisibleKHR NonPrivatePointerKHR 26 55: 15(int) AtomicXor 23(atomu) 12 17 53
56: 15(int) AtomicUMin 23(atomu) 12 17 55 Store 21(origu) 55
Store 21(origu) 56 56: 15(int) Load 24(value) MakePointerVisibleKHR NonPrivatePointerKHR 26
58: 6(int) AtomicSMax 10(atomi) 12 17 57 57: 15(int) AtomicUMin 23(atomu) 12 17 56
Store 8(origi) 58 Store 21(origu) 57
59: 6(int) Load 8(origi) 59: 6(int) AtomicSMax 10(atomi) 12 17 58
60: 6(int) AtomicExchange 10(atomi) 12 17 59 Store 8(origi) 59
Store 8(origi) 60 60: 6(int) Load 8(origi)
62: 15(int) Load 24(value) MakePointerVisibleKHR NonPrivatePointerKHR 26 61: 6(int) AtomicExchange 10(atomi) 12 17 60
64: 15(int) AtomicCompareExchange 23(atomu) 12 63 63 62 61 Store 8(origi) 61
Store 21(origu) 64 63: 15(int) Load 24(value) MakePointerVisibleKHR NonPrivatePointerKHR 26
69: 68(ptr) AccessChain 67(bufferu) 38 65: 15(int) AtomicCompareExchange 23(atomu) 12 64 64 63 62
71: 15(int) AtomicIAdd 69 12 18 70 Store 21(origu) 65
70: 69(ptr) AccessChain 68(bufferu) 38
72: 15(int) AtomicIAdd 70 12 18 71
MemoryBarrier 26 18 MemoryBarrier 26 18
ControlBarrier 26 26 63 ControlBarrier 26 26 64
ControlBarrier 26 26 17 ControlBarrier 26 26 17
73: 68(ptr) AccessChain 67(bufferu) 38 74: 69(ptr) AccessChain 68(bufferu) 38
74: 15(int) Load 73 MakePointerVisibleKHR NonPrivatePointerKHR 26 75: 15(int) Load 74 MakePointerVisibleKHR NonPrivatePointerKHR 26
Store 72(y) 74 Store 73(y) 75
75: 15(int) Load 72(y) 76: 15(int) Load 73(y)
76: 68(ptr) AccessChain 67(bufferu) 38 77: 69(ptr) AccessChain 68(bufferu) 38
Store 76 75 MakePointerAvailableKHR NonPrivatePointerKHR 26 Store 77 76 MakePointerAvailableKHR NonPrivatePointerKHR 26
80: 68(ptr) AccessChain 79(bufferi) 38 81: 69(ptr) AccessChain 80(bufferi) 38
81: 15(int) Load 80 MakePointerVisibleKHR NonPrivatePointerKHR 16 82: 15(int) Load 81 MakePointerVisibleKHR NonPrivatePointerKHR 16
Store 72(y) 81 Store 73(y) 82
88: 68(ptr) AccessChain 87(bufferj) 38 38 38 12 89: 69(ptr) AccessChain 88(bufferj) 38 38 38 12
89: 15(int) Load 88 Volatile MakePointerVisibleKHR NonPrivatePointerKHR 16 90: 15(int) Load 89 Volatile MakePointerVisibleKHR NonPrivatePointerKHR 16
Store 72(y) 89 Store 73(y) 90
90: 15(int) Load 72(y) 91: 15(int) Load 73(y)
91: 68(ptr) AccessChain 79(bufferi) 38 92: 69(ptr) AccessChain 80(bufferi) 38
Store 91 90 MakePointerAvailableKHR NonPrivatePointerKHR 16 Store 92 91 MakePointerAvailableKHR NonPrivatePointerKHR 16
92: 15(int) Load 72(y) 93: 15(int) Load 73(y)
93: 68(ptr) AccessChain 87(bufferj) 38 38 38 12 94: 69(ptr) AccessChain 88(bufferj) 38 38 38 12
Store 93 92 Volatile MakePointerAvailableKHR NonPrivatePointerKHR 16 Store 94 93 Volatile MakePointerAvailableKHR NonPrivatePointerKHR 16
95: 94(ptr) AccessChain 87(bufferj) 12 38 96: 95(ptr) AccessChain 88(bufferj) 12 38
96: 83(A) Load 95 Volatile MakePointerVisibleKHR NonPrivatePointerKHR 16 97: 84(A) Load 96 Volatile MakePointerVisibleKHR NonPrivatePointerKHR 16
97: 94(ptr) AccessChain 87(bufferj) 38 38 98: 95(ptr) AccessChain 88(bufferj) 38 38
Store 97 96 Volatile MakePointerAvailableKHR NonPrivatePointerKHR 16 Store 98 97 Volatile MakePointerAvailableKHR NonPrivatePointerKHR 16
102: 101(ptr) AccessChain 100(bufferk) 38 103: 102(ptr) AccessChain 101(bufferk) 38
103: 15(int) Load 102 NonPrivatePointerKHR 104: 15(int) Load 103 NonPrivatePointerKHR
104: 68(ptr) AccessChain 79(bufferi) 38 105: 69(ptr) AccessChain 80(bufferi) 38
Store 104 103 MakePointerAvailableKHR NonPrivatePointerKHR 16 Store 105 104 MakePointerAvailableKHR NonPrivatePointerKHR 16
105: 34 Load 36(imagei) 106: 34 Load 36(imagei)
107: 106(ivec4) ImageRead 105 39 MakeTexelVisibleKHR NonPrivateTexelKHR VolatileTexelKHR 16 108: 107(ivec4) ImageRead 106 39 MakeTexelVisibleKHR NonPrivateTexelKHR VolatileTexelKHR 16
111: 35(ptr) AccessChain 110(imagej) 38 112: 35(ptr) AccessChain 111(imagej) 38
112: 34 Load 111 113: 34 Load 112
113: 106(ivec4) ImageRead 112 39 NonPrivateTexelKHR 114: 107(ivec4) ImageRead 113 39 NonPrivateTexelKHR
114: 35(ptr) AccessChain 110(imagej) 12 115: 35(ptr) AccessChain 111(imagej) 12
115: 34 Load 114 116: 34 Load 115
ImageWrite 115 39 116 NonPrivateTexelKHR ImageWrite 116 39 117 NonPrivateTexelKHR
124: 123(ptr) AccessChain 122(samp) 38 125: 124(ptr) AccessChain 123(samp) 38
125: 119 Load 124 126: 120 Load 125
130: 129(fvec4) ImageSampleExplicitLod 125 128 Lod NonPrivateTexelKHR 127 131: 130(fvec4) ImageSampleExplicitLod 126 129 Lod NonPrivateTexelKHR 128
135:131(int64_t) AtomicUMax 133(atomu64) 12 17 134 136:132(int64_t) AtomicUMax 134(atomu64) 12 17 135
Store 133(atomu64) 135 MakePointerAvailableKHR NonPrivatePointerKHR 26 Store 134(atomu64) 136 MakePointerAvailableKHR NonPrivatePointerKHR 26
140:131(int64_t) Load 133(atomu64) MakePointerVisibleKHR NonPrivatePointerKHR 26 141:132(int64_t) Load 134(atomu64) MakePointerVisibleKHR NonPrivatePointerKHR 26
141:136(int64_t) Bitcast 140 142:137(int64_t) Bitcast 141
142:136(int64_t) AtomicCompareExchange 138(atomi64) 12 63 63 141 139 143:137(int64_t) AtomicCompareExchange 139(atomi64) 12 64 64 142 140
146: 68(ptr) AccessChain 145(bufferl) 38 147: 69(ptr) AccessChain 146(bufferl) 38
147: 15(int) Load 146 Volatile MakePointerVisibleKHR NonPrivatePointerKHR 16 148: 15(int) Load 147 Volatile MakePointerVisibleKHR NonPrivatePointerKHR 16
Store 72(y) 147 Store 73(y) 148
149: 69(ptr) AccessChain 146(bufferl) 38
150: 15(int) AtomicIAdd 149 16 42 71
154: 69(ptr) AccessChain 153(bufferm) 38
155: 15(int) AtomicOr 154 16 42 26
156: 40(ptr) ImageTexelPointer 36(imagei) 39 17
157: 6(int) AtomicIAdd 156 16 42 11
158: 69(ptr) AccessChain 68(bufferu) 38
159: 15(int) AtomicIAdd 158 12 17 51
160: 69(ptr) AccessChain 68(bufferu) 38
162: 15(int) AtomicIAdd 160 12 42 16
Return Return
FunctionEnd FunctionEnd

View File

@ -11,7 +11,9 @@ ERROR: 0:23: 'atomicAdd' : Semantics must not include multiple of gl_SemanticsRe
ERROR: 0:24: 'atomicCompSwap' : semUnequal must not be gl_SemanticsRelease or gl_SemanticsAcquireRelease ERROR: 0:24: 'atomicCompSwap' : semUnequal must not be gl_SemanticsRelease or gl_SemanticsAcquireRelease
ERROR: 0:25: 'memoryBarrier' : gl_SemanticsMakeVisible requires gl_SemanticsAcquire or gl_SemanticsAcquireRelease ERROR: 0:25: 'memoryBarrier' : gl_SemanticsMakeVisible requires gl_SemanticsAcquire or gl_SemanticsAcquireRelease
ERROR: 0:26: 'memoryBarrier' : gl_SemanticsMakeAvailable requires gl_SemanticsRelease or gl_SemanticsAcquireRelease ERROR: 0:26: 'memoryBarrier' : gl_SemanticsMakeAvailable requires gl_SemanticsRelease or gl_SemanticsAcquireRelease
ERROR: 12 compilation errors. No code generated. ERROR: 0:27: 'memoryBarrier' : gl_SemanticsVolatile must not be used with memoryBarrier or controlBarrier
ERROR: 0:28: 'atomicCompSwap' : semEqual and semUnequal must either both include gl_SemanticsVolatile or neither
ERROR: 14 compilation errors. No code generated.
SPIR-V is not generated for failed compile or link SPIR-V is not generated for failed compile or link

View File

@ -0,0 +1,54 @@
spv.privateVariableTypes.frag
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 27
Capability Shader
Capability Float16
Capability Int64
Capability Int16
Capability Int8
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginUpperLeft
Source GLSL 460
SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float16"
SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int16"
SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int64"
SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int8"
Name 4 "main"
Name 8 "i8"
Name 11 "u8"
Name 14 "i16"
Name 17 "u16"
Name 20 "i64"
Name 23 "u64"
Name 26 "f16"
2: TypeVoid
3: TypeFunction 2
6: TypeInt 8 1
7: TypePointer Private 6(int8_t)
8(i8): 7(ptr) Variable Private
9: TypeInt 8 0
10: TypePointer Private 9(int8_t)
11(u8): 10(ptr) Variable Private
12: TypeInt 16 1
13: TypePointer Private 12(int16_t)
14(i16): 13(ptr) Variable Private
15: TypeInt 16 0
16: TypePointer Private 15(int16_t)
17(u16): 16(ptr) Variable Private
18: TypeInt 64 1
19: TypePointer Private 18(int64_t)
20(i64): 19(ptr) Variable Private
21: TypeInt 64 0
22: TypePointer Private 21(int64_t)
23(u64): 22(ptr) Variable Private
24: TypeFloat 16
25: TypePointer Private 24(float16_t)
26(f16): 25(ptr) Variable Private
4(main): 2 Function None 3
5: Label
Return
FunctionEnd

View File

@ -1,8 +1,7 @@
spv.shaderBallot.comp spv.shaderBallot.comp
Validation failed
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80007 // Generated by (magic number): 80007
// Id's are bound by 298 // Id's are bound by 318
Capability Shader Capability Shader
Capability Int64 Capability Int64
@ -10,7 +9,7 @@ Validation failed
Extension "SPV_KHR_shader_ballot" Extension "SPV_KHR_shader_ballot"
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "main" 10 12 21 23 26 29 32 EntryPoint GLCompute 4 "main" 10 12 22 29 36 43 50
ExecutionMode 4 LocalSize 8 8 1 ExecutionMode 4 LocalSize 8 8 1
Source GLSL 450 Source GLSL 450
SourceExtension "GL_ARB_gpu_shader_int64" SourceExtension "GL_ARB_gpu_shader_int64"
@ -20,30 +19,30 @@ Validation failed
Name 10 "gl_SubGroupInvocationARB" Name 10 "gl_SubGroupInvocationARB"
Name 12 "gl_SubGroupSizeARB" Name 12 "gl_SubGroupSizeARB"
Name 19 "relMask" Name 19 "relMask"
Name 21 "gl_SubGroupEqMaskARB" Name 22 "gl_SubGroupEqMaskARB"
Name 23 "gl_SubGroupGeMaskARB" Name 29 "gl_SubGroupGeMaskARB"
Name 26 "gl_SubGroupGtMaskARB" Name 36 "gl_SubGroupGtMaskARB"
Name 29 "gl_SubGroupLeMaskARB" Name 43 "gl_SubGroupLeMaskARB"
Name 32 "gl_SubGroupLtMaskARB" Name 50 "gl_SubGroupLtMaskARB"
Name 52 "Buffers" Name 72 "Buffers"
MemberName 52(Buffers) 0 "f4" MemberName 72(Buffers) 0 "f4"
MemberName 52(Buffers) 1 "i4" MemberName 72(Buffers) 1 "i4"
MemberName 52(Buffers) 2 "u4" MemberName 72(Buffers) 2 "u4"
Name 55 "data" Name 75 "data"
Decorate 10(gl_SubGroupInvocationARB) BuiltIn SubgroupLocalInvocationId Decorate 10(gl_SubGroupInvocationARB) BuiltIn SubgroupLocalInvocationId
Decorate 12(gl_SubGroupSizeARB) BuiltIn SubgroupSize Decorate 12(gl_SubGroupSizeARB) BuiltIn SubgroupSize
Decorate 21(gl_SubGroupEqMaskARB) BuiltIn SubgroupEqMaskKHR Decorate 22(gl_SubGroupEqMaskARB) BuiltIn SubgroupEqMaskKHR
Decorate 23(gl_SubGroupGeMaskARB) BuiltIn SubgroupGeMaskKHR Decorate 29(gl_SubGroupGeMaskARB) BuiltIn SubgroupGeMaskKHR
Decorate 26(gl_SubGroupGtMaskARB) BuiltIn SubgroupGtMaskKHR Decorate 36(gl_SubGroupGtMaskARB) BuiltIn SubgroupGtMaskKHR
Decorate 29(gl_SubGroupLeMaskARB) BuiltIn SubgroupLeMaskKHR Decorate 43(gl_SubGroupLeMaskARB) BuiltIn SubgroupLeMaskKHR
Decorate 32(gl_SubGroupLtMaskARB) BuiltIn SubgroupLtMaskKHR Decorate 50(gl_SubGroupLtMaskARB) BuiltIn SubgroupLtMaskKHR
MemberDecorate 52(Buffers) 0 Offset 0 MemberDecorate 72(Buffers) 0 Offset 0
MemberDecorate 52(Buffers) 1 Offset 16 MemberDecorate 72(Buffers) 1 Offset 16
MemberDecorate 52(Buffers) 2 Offset 32 MemberDecorate 72(Buffers) 2 Offset 32
Decorate 52(Buffers) BufferBlock Decorate 72(Buffers) BufferBlock
Decorate 55(data) DescriptorSet 0 Decorate 75(data) DescriptorSet 0
Decorate 55(data) Binding 0 Decorate 75(data) Binding 0
Decorate 297 BuiltIn WorkgroupSize Decorate 317 BuiltIn WorkgroupSize
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 0 6: TypeInt 32 0
@ -54,43 +53,43 @@ Validation failed
15: 6(int) Constant 4 15: 6(int) Constant 4
17: TypeInt 64 0 17: TypeInt 64 0
18: TypePointer Function 17(int64_t) 18: TypePointer Function 17(int64_t)
20: TypePointer Input 17(int64_t) 20: TypeVector 6(int) 4
21(gl_SubGroupEqMaskARB): 20(ptr) Variable Input 21: TypePointer Input 20(ivec4)
23(gl_SubGroupGeMaskARB): 20(ptr) Variable Input 22(gl_SubGroupEqMaskARB): 21(ptr) Variable Input
26(gl_SubGroupGtMaskARB): 20(ptr) Variable Input 26: TypeVector 6(int) 2
29(gl_SubGroupLeMaskARB): 20(ptr) Variable Input 29(gl_SubGroupGeMaskARB): 21(ptr) Variable Input
32(gl_SubGroupLtMaskARB): 20(ptr) Variable Input 36(gl_SubGroupGtMaskARB): 21(ptr) Variable Input
36: TypeBool 43(gl_SubGroupLeMaskARB): 21(ptr) Variable Input
37: 36(bool) ConstantTrue 50(gl_SubGroupLtMaskARB): 21(ptr) Variable Input
38: TypeVector 6(int) 4 58: TypeBool
42: TypeVector 6(int) 2 59: 58(bool) ConstantTrue
48: TypeFloat 32 68: TypeFloat 32
49: TypeVector 48(float) 4 69: TypeVector 68(float) 4
50: TypeInt 32 1 70: TypeInt 32 1
51: TypeVector 50(int) 4 71: TypeVector 70(int) 4
52(Buffers): TypeStruct 49(fvec4) 51(ivec4) 38(ivec4) 72(Buffers): TypeStruct 69(fvec4) 71(ivec4) 20(ivec4)
53: TypeArray 52(Buffers) 15 73: TypeArray 72(Buffers) 15
54: TypePointer Uniform 53 74: TypePointer Uniform 73
55(data): 54(ptr) Variable Uniform 75(data): 74(ptr) Variable Uniform
57: 50(int) Constant 0 77: 70(int) Constant 0
58: 6(int) Constant 0 78: 6(int) Constant 0
59: TypePointer Uniform 48(float) 79: TypePointer Uniform 68(float)
66: 50(int) Constant 1 86: 70(int) Constant 1
67: TypeVector 48(float) 2 87: TypeVector 68(float) 2
68: TypePointer Uniform 49(fvec4) 88: TypePointer Uniform 69(fvec4)
82: 50(int) Constant 2 102: 70(int) Constant 2
83: TypeVector 48(float) 3 103: TypeVector 68(float) 3
99: 50(int) Constant 3 119: 70(int) Constant 3
114: TypePointer Uniform 50(int) 134: TypePointer Uniform 70(int)
121: TypeVector 50(int) 2 141: TypeVector 70(int) 2
122: TypePointer Uniform 51(ivec4) 142: TypePointer Uniform 71(ivec4)
136: TypeVector 50(int) 3 156: TypeVector 70(int) 3
166: TypePointer Uniform 6(int) 186: TypePointer Uniform 6(int)
173: TypePointer Uniform 38(ivec4) 193: TypePointer Uniform 20(ivec4)
187: TypeVector 6(int) 3 207: TypeVector 6(int) 3
295: 6(int) Constant 8 315: 6(int) Constant 8
296: 6(int) Constant 1 316: 6(int) Constant 1
297: 187(ivec3) ConstantComposite 295 295 296 317: 207(ivec3) ConstantComposite 315 315 316
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
8(invocation): 7(ptr) Variable Function 8(invocation): 7(ptr) Variable Function
@ -100,275 +99,295 @@ Validation failed
14: 6(int) IAdd 11 13 14: 6(int) IAdd 11 13
16: 6(int) UMod 14 15 16: 6(int) UMod 14 15
Store 8(invocation) 16 Store 8(invocation) 16
22: 17(int64_t) Load 21(gl_SubGroupEqMaskARB) 23: 20(ivec4) Load 22(gl_SubGroupEqMaskARB)
24: 17(int64_t) Load 23(gl_SubGroupGeMaskARB) 24: 6(int) CompositeExtract 23 0
25: 17(int64_t) IAdd 22 24 25: 6(int) CompositeExtract 23 1
27: 17(int64_t) Load 26(gl_SubGroupGtMaskARB) 27: 26(ivec2) CompositeConstruct 24 25
28: 17(int64_t) IAdd 25 27 28: 17(int64_t) Bitcast 27
30: 17(int64_t) Load 29(gl_SubGroupLeMaskARB) 30: 20(ivec4) Load 29(gl_SubGroupGeMaskARB)
31: 17(int64_t) IAdd 28 30 31: 6(int) CompositeExtract 30 0
33: 17(int64_t) Load 32(gl_SubGroupLtMaskARB) 32: 6(int) CompositeExtract 30 1
34: 17(int64_t) IAdd 31 33 33: 26(ivec2) CompositeConstruct 31 32
Store 19(relMask) 34 34: 17(int64_t) Bitcast 33
35: 17(int64_t) Load 19(relMask) 35: 17(int64_t) IAdd 28 34
39: 38(ivec4) SubgroupBallotKHR 37 37: 20(ivec4) Load 36(gl_SubGroupGtMaskARB)
40: 6(int) CompositeExtract 39 0 38: 6(int) CompositeExtract 37 0
41: 6(int) CompositeExtract 39 1 39: 6(int) CompositeExtract 37 1
43: 42(ivec2) CompositeConstruct 40 41 40: 26(ivec2) CompositeConstruct 38 39
44: 17(int64_t) Bitcast 43 41: 17(int64_t) Bitcast 40
45: 36(bool) IEqual 35 44 42: 17(int64_t) IAdd 35 41
SelectionMerge 47 None 44: 20(ivec4) Load 43(gl_SubGroupLeMaskARB)
BranchConditional 45 46 216 45: 6(int) CompositeExtract 44 0
46: Label 46: 6(int) CompositeExtract 44 1
56: 6(int) Load 8(invocation) 47: 26(ivec2) CompositeConstruct 45 46
60: 59(ptr) AccessChain 55(data) 57 57 58 48: 17(int64_t) Bitcast 47
61: 48(float) Load 60 49: 17(int64_t) IAdd 42 48
62: 6(int) Load 8(invocation) 51: 20(ivec4) Load 50(gl_SubGroupLtMaskARB)
63: 48(float) SubgroupReadInvocationKHR 61 62 52: 6(int) CompositeExtract 51 0
64: 59(ptr) AccessChain 55(data) 56 57 58 53: 6(int) CompositeExtract 51 1
Store 64 63 54: 26(ivec2) CompositeConstruct 52 53
65: 6(int) Load 8(invocation) 55: 17(int64_t) Bitcast 54
69: 68(ptr) AccessChain 55(data) 66 57 56: 17(int64_t) IAdd 49 55
70: 49(fvec4) Load 69 Store 19(relMask) 56
71: 67(fvec2) VectorShuffle 70 70 0 1 57: 17(int64_t) Load 19(relMask)
72: 6(int) Load 8(invocation) 60: 20(ivec4) SubgroupBallotKHR 59
73: 48(float) CompositeExtract 71 0 61: 6(int) CompositeExtract 60 0
74: 48(float) SubgroupReadInvocationKHR 73 72 62: 6(int) CompositeExtract 60 1
75: 48(float) CompositeExtract 71 1 63: 26(ivec2) CompositeConstruct 61 62
76: 48(float) SubgroupReadInvocationKHR 75 72 64: 17(int64_t) Bitcast 63
77: 67(fvec2) CompositeConstruct 74 76 65: 58(bool) IEqual 57 64
78: 68(ptr) AccessChain 55(data) 65 57 SelectionMerge 67 None
79: 49(fvec4) Load 78 BranchConditional 65 66 236
80: 49(fvec4) VectorShuffle 79 77 4 5 2 3 66: Label
Store 78 80 76: 6(int) Load 8(invocation)
81: 6(int) Load 8(invocation) 80: 79(ptr) AccessChain 75(data) 77 77 78
84: 68(ptr) AccessChain 55(data) 82 57 81: 68(float) Load 80
85: 49(fvec4) Load 84 82: 6(int) Load 8(invocation)
86: 83(fvec3) VectorShuffle 85 85 0 1 2 83: 68(float) SubgroupReadInvocationKHR 81 82
87: 6(int) Load 8(invocation) 84: 79(ptr) AccessChain 75(data) 76 77 78
88: 48(float) CompositeExtract 86 0 Store 84 83
89: 48(float) SubgroupReadInvocationKHR 88 87 85: 6(int) Load 8(invocation)
90: 48(float) CompositeExtract 86 1 89: 88(ptr) AccessChain 75(data) 86 77
91: 48(float) SubgroupReadInvocationKHR 90 87 90: 69(fvec4) Load 89
92: 48(float) CompositeExtract 86 2 91: 87(fvec2) VectorShuffle 90 90 0 1
93: 48(float) SubgroupReadInvocationKHR 92 87 92: 6(int) Load 8(invocation)
94: 83(fvec3) CompositeConstruct 89 91 93 93: 68(float) CompositeExtract 91 0
95: 68(ptr) AccessChain 55(data) 81 57 94: 68(float) SubgroupReadInvocationKHR 93 92
96: 49(fvec4) Load 95 95: 68(float) CompositeExtract 91 1
97: 49(fvec4) VectorShuffle 96 94 4 5 6 3 96: 68(float) SubgroupReadInvocationKHR 95 92
Store 95 97 97: 87(fvec2) CompositeConstruct 94 96
98: 6(int) Load 8(invocation) 98: 88(ptr) AccessChain 75(data) 85 77
100: 68(ptr) AccessChain 55(data) 99 57 99: 69(fvec4) Load 98
101: 49(fvec4) Load 100 100: 69(fvec4) VectorShuffle 99 97 4 5 2 3
102: 6(int) Load 8(invocation) Store 98 100
103: 48(float) CompositeExtract 101 0 101: 6(int) Load 8(invocation)
104: 48(float) SubgroupReadInvocationKHR 103 102 104: 88(ptr) AccessChain 75(data) 102 77
105: 48(float) CompositeExtract 101 1 105: 69(fvec4) Load 104
106: 48(float) SubgroupReadInvocationKHR 105 102 106: 103(fvec3) VectorShuffle 105 105 0 1 2
107: 48(float) CompositeExtract 101 2 107: 6(int) Load 8(invocation)
108: 48(float) SubgroupReadInvocationKHR 107 102 108: 68(float) CompositeExtract 106 0
109: 48(float) CompositeExtract 101 3 109: 68(float) SubgroupReadInvocationKHR 108 107
110: 48(float) SubgroupReadInvocationKHR 109 102 110: 68(float) CompositeExtract 106 1
111: 49(fvec4) CompositeConstruct 104 106 108 110 111: 68(float) SubgroupReadInvocationKHR 110 107
112: 68(ptr) AccessChain 55(data) 98 57 112: 68(float) CompositeExtract 106 2
Store 112 111 113: 68(float) SubgroupReadInvocationKHR 112 107
113: 6(int) Load 8(invocation) 114: 103(fvec3) CompositeConstruct 109 111 113
115: 114(ptr) AccessChain 55(data) 57 66 58 115: 88(ptr) AccessChain 75(data) 101 77
116: 50(int) Load 115 116: 69(fvec4) Load 115
117: 6(int) Load 8(invocation) 117: 69(fvec4) VectorShuffle 116 114 4 5 6 3
118: 50(int) SubgroupReadInvocationKHR 116 117 Store 115 117
119: 114(ptr) AccessChain 55(data) 113 66 58 118: 6(int) Load 8(invocation)
Store 119 118 120: 88(ptr) AccessChain 75(data) 119 77
120: 6(int) Load 8(invocation) 121: 69(fvec4) Load 120
123: 122(ptr) AccessChain 55(data) 66 66 122: 6(int) Load 8(invocation)
124: 51(ivec4) Load 123 123: 68(float) CompositeExtract 121 0
125: 121(ivec2) VectorShuffle 124 124 0 1 124: 68(float) SubgroupReadInvocationKHR 123 122
126: 6(int) Load 8(invocation) 125: 68(float) CompositeExtract 121 1
127: 50(int) CompositeExtract 125 0 126: 68(float) SubgroupReadInvocationKHR 125 122
128: 50(int) SubgroupReadInvocationKHR 127 126 127: 68(float) CompositeExtract 121 2
129: 50(int) CompositeExtract 125 1 128: 68(float) SubgroupReadInvocationKHR 127 122
130: 50(int) SubgroupReadInvocationKHR 129 126 129: 68(float) CompositeExtract 121 3
131: 121(ivec2) CompositeConstruct 128 130 130: 68(float) SubgroupReadInvocationKHR 129 122
132: 122(ptr) AccessChain 55(data) 120 66 131: 69(fvec4) CompositeConstruct 124 126 128 130
133: 51(ivec4) Load 132 132: 88(ptr) AccessChain 75(data) 118 77
134: 51(ivec4) VectorShuffle 133 131 4 5 2 3 Store 132 131
Store 132 134 133: 6(int) Load 8(invocation)
135: 6(int) Load 8(invocation) 135: 134(ptr) AccessChain 75(data) 77 86 78
137: 122(ptr) AccessChain 55(data) 82 66 136: 70(int) Load 135
138: 51(ivec4) Load 137 137: 6(int) Load 8(invocation)
139: 136(ivec3) VectorShuffle 138 138 0 1 2 138: 70(int) SubgroupReadInvocationKHR 136 137
139: 134(ptr) AccessChain 75(data) 133 86 78
Store 139 138
140: 6(int) Load 8(invocation) 140: 6(int) Load 8(invocation)
141: 50(int) CompositeExtract 139 0 143: 142(ptr) AccessChain 75(data) 86 86
142: 50(int) SubgroupReadInvocationKHR 141 140 144: 71(ivec4) Load 143
143: 50(int) CompositeExtract 139 1 145: 141(ivec2) VectorShuffle 144 144 0 1
144: 50(int) SubgroupReadInvocationKHR 143 140 146: 6(int) Load 8(invocation)
145: 50(int) CompositeExtract 139 2 147: 70(int) CompositeExtract 145 0
146: 50(int) SubgroupReadInvocationKHR 145 140 148: 70(int) SubgroupReadInvocationKHR 147 146
147: 136(ivec3) CompositeConstruct 142 144 146 149: 70(int) CompositeExtract 145 1
148: 122(ptr) AccessChain 55(data) 135 66 150: 70(int) SubgroupReadInvocationKHR 149 146
149: 51(ivec4) Load 148 151: 141(ivec2) CompositeConstruct 148 150
150: 51(ivec4) VectorShuffle 149 147 4 5 6 3 152: 142(ptr) AccessChain 75(data) 140 86
Store 148 150 153: 71(ivec4) Load 152
151: 6(int) Load 8(invocation) 154: 71(ivec4) VectorShuffle 153 151 4 5 2 3
152: 122(ptr) AccessChain 55(data) 99 66 Store 152 154
153: 51(ivec4) Load 152 155: 6(int) Load 8(invocation)
154: 6(int) Load 8(invocation) 157: 142(ptr) AccessChain 75(data) 102 86
155: 50(int) CompositeExtract 153 0 158: 71(ivec4) Load 157
156: 50(int) SubgroupReadInvocationKHR 155 154 159: 156(ivec3) VectorShuffle 158 158 0 1 2
157: 50(int) CompositeExtract 153 1 160: 6(int) Load 8(invocation)
158: 50(int) SubgroupReadInvocationKHR 157 154 161: 70(int) CompositeExtract 159 0
159: 50(int) CompositeExtract 153 2 162: 70(int) SubgroupReadInvocationKHR 161 160
160: 50(int) SubgroupReadInvocationKHR 159 154 163: 70(int) CompositeExtract 159 1
161: 50(int) CompositeExtract 153 3 164: 70(int) SubgroupReadInvocationKHR 163 160
162: 50(int) SubgroupReadInvocationKHR 161 154 165: 70(int) CompositeExtract 159 2
163: 51(ivec4) CompositeConstruct 156 158 160 162 166: 70(int) SubgroupReadInvocationKHR 165 160
164: 122(ptr) AccessChain 55(data) 151 66 167: 156(ivec3) CompositeConstruct 162 164 166
Store 164 163 168: 142(ptr) AccessChain 75(data) 155 86
165: 6(int) Load 8(invocation) 169: 71(ivec4) Load 168
167: 166(ptr) AccessChain 55(data) 57 82 58 170: 71(ivec4) VectorShuffle 169 167 4 5 6 3
168: 6(int) Load 167 Store 168 170
169: 6(int) Load 8(invocation) 171: 6(int) Load 8(invocation)
170: 6(int) SubgroupReadInvocationKHR 168 169 172: 142(ptr) AccessChain 75(data) 119 86
171: 166(ptr) AccessChain 55(data) 165 82 58 173: 71(ivec4) Load 172
Store 171 170 174: 6(int) Load 8(invocation)
172: 6(int) Load 8(invocation) 175: 70(int) CompositeExtract 173 0
174: 173(ptr) AccessChain 55(data) 66 82 176: 70(int) SubgroupReadInvocationKHR 175 174
175: 38(ivec4) Load 174 177: 70(int) CompositeExtract 173 1
176: 42(ivec2) VectorShuffle 175 175 0 1 178: 70(int) SubgroupReadInvocationKHR 177 174
177: 6(int) Load 8(invocation) 179: 70(int) CompositeExtract 173 2
178: 6(int) CompositeExtract 176 0 180: 70(int) SubgroupReadInvocationKHR 179 174
179: 6(int) SubgroupReadInvocationKHR 178 177 181: 70(int) CompositeExtract 173 3
180: 6(int) CompositeExtract 176 1 182: 70(int) SubgroupReadInvocationKHR 181 174
181: 6(int) SubgroupReadInvocationKHR 180 177 183: 71(ivec4) CompositeConstruct 176 178 180 182
182: 42(ivec2) CompositeConstruct 179 181 184: 142(ptr) AccessChain 75(data) 171 86
183: 173(ptr) AccessChain 55(data) 172 82 Store 184 183
184: 38(ivec4) Load 183 185: 6(int) Load 8(invocation)
185: 38(ivec4) VectorShuffle 184 182 4 5 2 3 187: 186(ptr) AccessChain 75(data) 77 102 78
Store 183 185 188: 6(int) Load 187
186: 6(int) Load 8(invocation) 189: 6(int) Load 8(invocation)
188: 173(ptr) AccessChain 55(data) 82 82 190: 6(int) SubgroupReadInvocationKHR 188 189
189: 38(ivec4) Load 188 191: 186(ptr) AccessChain 75(data) 185 102 78
190: 187(ivec3) VectorShuffle 189 189 0 1 2 Store 191 190
191: 6(int) Load 8(invocation) 192: 6(int) Load 8(invocation)
192: 6(int) CompositeExtract 190 0 194: 193(ptr) AccessChain 75(data) 86 102
193: 6(int) SubgroupReadInvocationKHR 192 191 195: 20(ivec4) Load 194
194: 6(int) CompositeExtract 190 1 196: 26(ivec2) VectorShuffle 195 195 0 1
195: 6(int) SubgroupReadInvocationKHR 194 191 197: 6(int) Load 8(invocation)
196: 6(int) CompositeExtract 190 2 198: 6(int) CompositeExtract 196 0
197: 6(int) SubgroupReadInvocationKHR 196 191 199: 6(int) SubgroupReadInvocationKHR 198 197
198: 187(ivec3) CompositeConstruct 193 195 197 200: 6(int) CompositeExtract 196 1
199: 173(ptr) AccessChain 55(data) 186 82 201: 6(int) SubgroupReadInvocationKHR 200 197
200: 38(ivec4) Load 199 202: 26(ivec2) CompositeConstruct 199 201
201: 38(ivec4) VectorShuffle 200 198 4 5 6 3 203: 193(ptr) AccessChain 75(data) 192 102
Store 199 201 204: 20(ivec4) Load 203
202: 6(int) Load 8(invocation) 205: 20(ivec4) VectorShuffle 204 202 4 5 2 3
203: 173(ptr) AccessChain 55(data) 99 82 Store 203 205
204: 38(ivec4) Load 203 206: 6(int) Load 8(invocation)
205: 6(int) Load 8(invocation) 208: 193(ptr) AccessChain 75(data) 102 102
206: 6(int) CompositeExtract 204 0 209: 20(ivec4) Load 208
207: 6(int) SubgroupReadInvocationKHR 206 205 210: 207(ivec3) VectorShuffle 209 209 0 1 2
208: 6(int) CompositeExtract 204 1 211: 6(int) Load 8(invocation)
209: 6(int) SubgroupReadInvocationKHR 208 205 212: 6(int) CompositeExtract 210 0
210: 6(int) CompositeExtract 204 2 213: 6(int) SubgroupReadInvocationKHR 212 211
211: 6(int) SubgroupReadInvocationKHR 210 205 214: 6(int) CompositeExtract 210 1
212: 6(int) CompositeExtract 204 3 215: 6(int) SubgroupReadInvocationKHR 214 211
213: 6(int) SubgroupReadInvocationKHR 212 205 216: 6(int) CompositeExtract 210 2
214: 38(ivec4) CompositeConstruct 207 209 211 213 217: 6(int) SubgroupReadInvocationKHR 216 211
215: 173(ptr) AccessChain 55(data) 202 82 218: 207(ivec3) CompositeConstruct 213 215 217
Store 215 214 219: 193(ptr) AccessChain 75(data) 206 102
Branch 47 220: 20(ivec4) Load 219
216: Label 221: 20(ivec4) VectorShuffle 220 218 4 5 6 3
217: 6(int) Load 8(invocation) Store 219 221
218: 59(ptr) AccessChain 55(data) 57 57 58
219: 48(float) Load 218
220: 48(float) SubgroupFirstInvocationKHR 219
221: 59(ptr) AccessChain 55(data) 217 57 58
Store 221 220
222: 6(int) Load 8(invocation) 222: 6(int) Load 8(invocation)
223: 68(ptr) AccessChain 55(data) 66 57 223: 193(ptr) AccessChain 75(data) 119 102
224: 49(fvec4) Load 223 224: 20(ivec4) Load 223
225: 67(fvec2) VectorShuffle 224 224 0 1 225: 6(int) Load 8(invocation)
226: 67(fvec2) SubgroupFirstInvocationKHR 225 226: 6(int) CompositeExtract 224 0
227: 68(ptr) AccessChain 55(data) 222 57 227: 6(int) SubgroupReadInvocationKHR 226 225
228: 49(fvec4) Load 227 228: 6(int) CompositeExtract 224 1
229: 49(fvec4) VectorShuffle 228 226 4 5 2 3 229: 6(int) SubgroupReadInvocationKHR 228 225
Store 227 229 230: 6(int) CompositeExtract 224 2
230: 6(int) Load 8(invocation) 231: 6(int) SubgroupReadInvocationKHR 230 225
231: 68(ptr) AccessChain 55(data) 82 57 232: 6(int) CompositeExtract 224 3
232: 49(fvec4) Load 231 233: 6(int) SubgroupReadInvocationKHR 232 225
233: 83(fvec3) VectorShuffle 232 232 0 1 2 234: 20(ivec4) CompositeConstruct 227 229 231 233
234: 83(fvec3) SubgroupFirstInvocationKHR 233 235: 193(ptr) AccessChain 75(data) 222 102
235: 68(ptr) AccessChain 55(data) 230 57 Store 235 234
236: 49(fvec4) Load 235 Branch 67
237: 49(fvec4) VectorShuffle 236 234 4 5 6 3 236: Label
Store 235 237 237: 6(int) Load 8(invocation)
238: 6(int) Load 8(invocation) 238: 79(ptr) AccessChain 75(data) 77 77 78
239: 68(ptr) AccessChain 55(data) 99 57 239: 68(float) Load 238
240: 49(fvec4) Load 239 240: 68(float) SubgroupFirstInvocationKHR 239
241: 49(fvec4) SubgroupFirstInvocationKHR 240 241: 79(ptr) AccessChain 75(data) 237 77 78
242: 68(ptr) AccessChain 55(data) 238 57 Store 241 240
Store 242 241 242: 6(int) Load 8(invocation)
243: 6(int) Load 8(invocation) 243: 88(ptr) AccessChain 75(data) 86 77
244: 114(ptr) AccessChain 55(data) 57 66 58 244: 69(fvec4) Load 243
245: 50(int) Load 244 245: 87(fvec2) VectorShuffle 244 244 0 1
246: 50(int) SubgroupFirstInvocationKHR 245 246: 87(fvec2) SubgroupFirstInvocationKHR 245
247: 114(ptr) AccessChain 55(data) 243 66 58 247: 88(ptr) AccessChain 75(data) 242 77
Store 247 246 248: 69(fvec4) Load 247
248: 6(int) Load 8(invocation) 249: 69(fvec4) VectorShuffle 248 246 4 5 2 3
249: 122(ptr) AccessChain 55(data) 66 66 Store 247 249
250: 51(ivec4) Load 249 250: 6(int) Load 8(invocation)
251: 121(ivec2) VectorShuffle 250 250 0 1 251: 88(ptr) AccessChain 75(data) 102 77
252: 121(ivec2) SubgroupFirstInvocationKHR 251 252: 69(fvec4) Load 251
253: 122(ptr) AccessChain 55(data) 248 66 253: 103(fvec3) VectorShuffle 252 252 0 1 2
254: 51(ivec4) Load 253 254: 103(fvec3) SubgroupFirstInvocationKHR 253
255: 51(ivec4) VectorShuffle 254 252 4 5 2 3 255: 88(ptr) AccessChain 75(data) 250 77
Store 253 255 256: 69(fvec4) Load 255
256: 6(int) Load 8(invocation) 257: 69(fvec4) VectorShuffle 256 254 4 5 6 3
257: 122(ptr) AccessChain 55(data) 82 66 Store 255 257
258: 51(ivec4) Load 257 258: 6(int) Load 8(invocation)
259: 136(ivec3) VectorShuffle 258 258 0 1 2 259: 88(ptr) AccessChain 75(data) 119 77
260: 136(ivec3) SubgroupFirstInvocationKHR 259 260: 69(fvec4) Load 259
261: 122(ptr) AccessChain 55(data) 256 66 261: 69(fvec4) SubgroupFirstInvocationKHR 260
262: 51(ivec4) Load 261 262: 88(ptr) AccessChain 75(data) 258 77
263: 51(ivec4) VectorShuffle 262 260 4 5 6 3 Store 262 261
Store 261 263 263: 6(int) Load 8(invocation)
264: 6(int) Load 8(invocation) 264: 134(ptr) AccessChain 75(data) 77 86 78
265: 122(ptr) AccessChain 55(data) 99 66 265: 70(int) Load 264
266: 51(ivec4) Load 265 266: 70(int) SubgroupFirstInvocationKHR 265
267: 51(ivec4) SubgroupFirstInvocationKHR 266 267: 134(ptr) AccessChain 75(data) 263 86 78
268: 122(ptr) AccessChain 55(data) 264 66 Store 267 266
Store 268 267 268: 6(int) Load 8(invocation)
269: 6(int) Load 8(invocation) 269: 142(ptr) AccessChain 75(data) 86 86
270: 166(ptr) AccessChain 55(data) 57 82 58 270: 71(ivec4) Load 269
271: 6(int) Load 270 271: 141(ivec2) VectorShuffle 270 270 0 1
272: 6(int) SubgroupFirstInvocationKHR 271 272: 141(ivec2) SubgroupFirstInvocationKHR 271
273: 166(ptr) AccessChain 55(data) 269 82 58 273: 142(ptr) AccessChain 75(data) 268 86
Store 273 272 274: 71(ivec4) Load 273
274: 6(int) Load 8(invocation) 275: 71(ivec4) VectorShuffle 274 272 4 5 2 3
275: 173(ptr) AccessChain 55(data) 66 82 Store 273 275
276: 38(ivec4) Load 275 276: 6(int) Load 8(invocation)
277: 42(ivec2) VectorShuffle 276 276 0 1 277: 142(ptr) AccessChain 75(data) 102 86
278: 42(ivec2) SubgroupFirstInvocationKHR 277 278: 71(ivec4) Load 277
279: 173(ptr) AccessChain 55(data) 274 82 279: 156(ivec3) VectorShuffle 278 278 0 1 2
280: 38(ivec4) Load 279 280: 156(ivec3) SubgroupFirstInvocationKHR 279
281: 38(ivec4) VectorShuffle 280 278 4 5 2 3 281: 142(ptr) AccessChain 75(data) 276 86
Store 279 281 282: 71(ivec4) Load 281
282: 6(int) Load 8(invocation) 283: 71(ivec4) VectorShuffle 282 280 4 5 6 3
283: 173(ptr) AccessChain 55(data) 82 82 Store 281 283
284: 38(ivec4) Load 283 284: 6(int) Load 8(invocation)
285: 187(ivec3) VectorShuffle 284 284 0 1 2 285: 142(ptr) AccessChain 75(data) 119 86
286: 187(ivec3) SubgroupFirstInvocationKHR 285 286: 71(ivec4) Load 285
287: 173(ptr) AccessChain 55(data) 282 82 287: 71(ivec4) SubgroupFirstInvocationKHR 286
288: 38(ivec4) Load 287 288: 142(ptr) AccessChain 75(data) 284 86
289: 38(ivec4) VectorShuffle 288 286 4 5 6 3 Store 288 287
Store 287 289 289: 6(int) Load 8(invocation)
290: 6(int) Load 8(invocation) 290: 186(ptr) AccessChain 75(data) 77 102 78
291: 173(ptr) AccessChain 55(data) 99 82 291: 6(int) Load 290
292: 38(ivec4) Load 291 292: 6(int) SubgroupFirstInvocationKHR 291
293: 38(ivec4) SubgroupFirstInvocationKHR 292 293: 186(ptr) AccessChain 75(data) 289 102 78
294: 173(ptr) AccessChain 55(data) 290 82 Store 293 292
Store 294 293 294: 6(int) Load 8(invocation)
Branch 47 295: 193(ptr) AccessChain 75(data) 86 102
47: Label 296: 20(ivec4) Load 295
297: 26(ivec2) VectorShuffle 296 296 0 1
298: 26(ivec2) SubgroupFirstInvocationKHR 297
299: 193(ptr) AccessChain 75(data) 294 102
300: 20(ivec4) Load 299
301: 20(ivec4) VectorShuffle 300 298 4 5 2 3
Store 299 301
302: 6(int) Load 8(invocation)
303: 193(ptr) AccessChain 75(data) 102 102
304: 20(ivec4) Load 303
305: 207(ivec3) VectorShuffle 304 304 0 1 2
306: 207(ivec3) SubgroupFirstInvocationKHR 305
307: 193(ptr) AccessChain 75(data) 302 102
308: 20(ivec4) Load 307
309: 20(ivec4) VectorShuffle 308 306 4 5 6 3
Store 307 309
310: 6(int) Load 8(invocation)
311: 193(ptr) AccessChain 75(data) 119 102
312: 20(ivec4) Load 311
313: 20(ivec4) SubgroupFirstInvocationKHR 312
314: 193(ptr) AccessChain 75(data) 310 102
Store 314 313
Branch 67
67: Label
Return Return
FunctionEnd FunctionEnd

View File

@ -239,6 +239,13 @@ $EXE -D -E hlsl.pp.expand.frag > $TARGETDIR/hlsl.pp.expand.frag.out 2> $TARGETDI
diff -b $BASEDIR/hlsl.pp.expand.frag.out $TARGETDIR/hlsl.pp.expand.frag.out || HASERROR=1 diff -b $BASEDIR/hlsl.pp.expand.frag.out $TARGETDIR/hlsl.pp.expand.frag.out || HASERROR=1
diff -b $BASEDIR/hlsl.pp.expand.frag.err $TARGETDIR/hlsl.pp.expand.frag.err || HASERROR=1 diff -b $BASEDIR/hlsl.pp.expand.frag.err $TARGETDIR/hlsl.pp.expand.frag.err || HASERROR=1
#
# Test --nan-clamp
#
echo "Testing nan-clamp"
$EXE --nan-clamp -H --aml --amb spv.400.frag > $TARGETDIR/spv.400.frag.nanclamp.out
diff -b $BASEDIR/spv.400.frag.nanclamp.out $TARGETDIR/spv.400.frag.nanclamp.out || HASERROR=1
# #
# Final checking # Final checking
# #

View File

@ -0,0 +1,20 @@
#version 460 core
#extension GL_EXT_shader_explicit_arithmetic_types_int64 : enable
#extension GL_EXT_shader_explicit_arithmetic_types_int8 : enable
#extension GL_EXT_shader_explicit_arithmetic_types_int16 : enable
#extension GL_EXT_shader_explicit_arithmetic_types_float16 : enable
int f(int8_t i8,
uint8_t u8,
int16_t i16,
uint16_t u16,
int64_t i64,
uint64_t u64,
float16_t f16)
{
return 0;
}
void main()
{
}

View File

@ -19,6 +19,7 @@ layout (binding = 7) nonprivate uniform BufferK { uint x; } bufferk;
shared uint64_t atomu64; shared uint64_t atomu64;
shared int64_t atomi64; shared int64_t atomi64;
layout (binding = 8) volatile buffer BufferL { uint x; } bufferl; layout (binding = 8) volatile buffer BufferL { uint x; } bufferl;
layout (binding = 9) buffer BufferM { volatile uint x; } bufferm;
void main() void main()
@ -60,5 +61,10 @@ void main()
atomicCompSwap(atomi64, int64_t(10), int64_t(atomu64), gl_ScopeDevice, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire); atomicCompSwap(atomi64, int64_t(10), int64_t(atomu64), gl_ScopeDevice, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire);
y = bufferl.x; y = bufferl.x;
atomicAdd(bufferl.x, 1);
atomicOr(bufferm.x, 2);
imageAtomicAdd(imagei, ivec2(0,0), 3);
atomicAdd(bufferu.x, 4u, gl_ScopeDevice, 0, 0);
atomicAdd(bufferu.x, 5u, gl_ScopeDevice, 0, gl_SemanticsVolatile);
} }

View File

@ -24,5 +24,7 @@ void main()
uint origu = atomicCompSwap(atomu, 10u, value, gl_ScopeDevice, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquireRelease); uint origu = atomicCompSwap(atomu, 10u, value, gl_ScopeDevice, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquireRelease);
memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer, gl_SemanticsRelease | gl_SemanticsMakeVisible); memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer, gl_SemanticsRelease | gl_SemanticsMakeVisible);
memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer, gl_SemanticsAcquire | gl_SemanticsMakeAvailable); memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer, gl_SemanticsAcquire | gl_SemanticsMakeAvailable);
memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer, gl_SemanticsRelease | gl_SemanticsVolatile);
atomicCompSwap(bufferi.x, 10u, 10u, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsAcquire | gl_SemanticsVolatile, gl_StorageSemanticsBuffer, gl_SemanticsAcquire);
} }

View File

@ -0,0 +1,17 @@
#version 460 core
#extension GL_EXT_shader_explicit_arithmetic_types_int64 : enable
#extension GL_EXT_shader_explicit_arithmetic_types_int8 : enable
#extension GL_EXT_shader_explicit_arithmetic_types_int16 : enable
#extension GL_EXT_shader_explicit_arithmetic_types_float16 : enable
int8_t i8;
uint8_t u8;
int16_t i16;
uint16_t u16;
int64_t i64;
uint64_t u64;
float16_t f16;
void main()
{
}

View File

@ -1,3 +1,3 @@
// This header is generated by the make-revision script. // This header is generated by the make-revision script.
#define GLSLANG_PATCH_LEVEL 3226 #define GLSLANG_PATCH_LEVEL 3276

View File

@ -6309,6 +6309,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
commonBuiltins.append("const int gl_SemanticsAcquireRelease = 0x8;\n"); commonBuiltins.append("const int gl_SemanticsAcquireRelease = 0x8;\n");
commonBuiltins.append("const int gl_SemanticsMakeAvailable = 0x2000;\n"); commonBuiltins.append("const int gl_SemanticsMakeAvailable = 0x2000;\n");
commonBuiltins.append("const int gl_SemanticsMakeVisible = 0x4000;\n"); commonBuiltins.append("const int gl_SemanticsMakeVisible = 0x4000;\n");
commonBuiltins.append("const int gl_SemanticsVolatile = 0x8000;\n");
commonBuiltins.append("const int gl_StorageSemanticsNone = 0x0;\n"); commonBuiltins.append("const int gl_StorageSemanticsNone = 0x0;\n");
commonBuiltins.append("const int gl_StorageSemanticsBuffer = 0x40;\n"); commonBuiltins.append("const int gl_StorageSemanticsBuffer = 0x40;\n");
@ -7899,19 +7900,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setFunctionExtensions("readInvocationARB", 1, &E_GL_ARB_shader_ballot); symbolTable.setFunctionExtensions("readInvocationARB", 1, &E_GL_ARB_shader_ballot);
symbolTable.setFunctionExtensions("readFirstInvocationARB", 1, &E_GL_ARB_shader_ballot); symbolTable.setFunctionExtensions("readFirstInvocationARB", 1, &E_GL_ARB_shader_ballot);
BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable);
BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable);
BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable);
BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable);
BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable);
BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable);
if (spvVersion.vulkan > 0)
// Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan
SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable);
else
BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable);
if (version >= 430) { if (version >= 430) {
symbolTable.setFunctionExtensions("anyInvocationARB", 1, &E_GL_ARB_shader_group_vote); symbolTable.setFunctionExtensions("anyInvocationARB", 1, &E_GL_ARB_shader_group_vote);
symbolTable.setFunctionExtensions("allInvocationsARB", 1, &E_GL_ARB_shader_group_vote); symbolTable.setFunctionExtensions("allInvocationsARB", 1, &E_GL_ARB_shader_group_vote);
@ -8172,7 +8160,22 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview); symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview);
BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable); BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable);
} }
if (profile != EEsProfile) {
BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable);
BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable);
BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable);
BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable);
BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable);
BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable);
if (spvVersion.vulkan > 0)
// Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan
SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable);
else
BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable);
}
// GL_KHR_shader_subgroup // GL_KHR_shader_subgroup
if ((profile == EEsProfile && version >= 310) || if ((profile == EEsProfile && version >= 310) ||
(profile != EEsProfile && version >= 140)) { (profile != EEsProfile && version >= 140)) {
@ -8630,6 +8633,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setVariableExtensions("gl_SemanticsAcquireRelease", 1, &E_GL_KHR_memory_scope_semantics); symbolTable.setVariableExtensions("gl_SemanticsAcquireRelease", 1, &E_GL_KHR_memory_scope_semantics);
symbolTable.setVariableExtensions("gl_SemanticsMakeAvailable", 1, &E_GL_KHR_memory_scope_semantics); symbolTable.setVariableExtensions("gl_SemanticsMakeAvailable", 1, &E_GL_KHR_memory_scope_semantics);
symbolTable.setVariableExtensions("gl_SemanticsMakeVisible", 1, &E_GL_KHR_memory_scope_semantics); symbolTable.setVariableExtensions("gl_SemanticsMakeVisible", 1, &E_GL_KHR_memory_scope_semantics);
symbolTable.setVariableExtensions("gl_SemanticsVolatile", 1, &E_GL_KHR_memory_scope_semantics);
symbolTable.setVariableExtensions("gl_StorageSemanticsNone", 1, &E_GL_KHR_memory_scope_semantics); symbolTable.setVariableExtensions("gl_StorageSemanticsNone", 1, &E_GL_KHR_memory_scope_semantics);
symbolTable.setVariableExtensions("gl_StorageSemanticsBuffer", 1, &E_GL_KHR_memory_scope_semantics); symbolTable.setVariableExtensions("gl_StorageSemanticsBuffer", 1, &E_GL_KHR_memory_scope_semantics);

View File

@ -1641,6 +1641,7 @@ void TParseContext::memorySemanticsCheck(const TSourceLoc& loc, const TFunction&
const int gl_SemanticsAcquireRelease = 0x8; const int gl_SemanticsAcquireRelease = 0x8;
const int gl_SemanticsMakeAvailable = 0x2000; const int gl_SemanticsMakeAvailable = 0x2000;
const int gl_SemanticsMakeVisible = 0x4000; const int gl_SemanticsMakeVisible = 0x4000;
const int gl_SemanticsVolatile = 0x8000;
//const int gl_StorageSemanticsNone = 0x0; //const int gl_StorageSemanticsNone = 0x0;
const int gl_StorageSemanticsBuffer = 0x40; const int gl_StorageSemanticsBuffer = 0x40;
@ -1730,7 +1731,8 @@ void TParseContext::memorySemanticsCheck(const TSourceLoc& loc, const TFunction&
gl_SemanticsRelease | gl_SemanticsRelease |
gl_SemanticsAcquireRelease | gl_SemanticsAcquireRelease |
gl_SemanticsMakeAvailable | gl_SemanticsMakeAvailable |
gl_SemanticsMakeVisible))) { gl_SemanticsMakeVisible |
gl_SemanticsVolatile))) {
error(loc, "Invalid semantics value", fnCandidate.getName().c_str(), ""); error(loc, "Invalid semantics value", fnCandidate.getName().c_str(), "");
} }
if (((storageClassSemantics | storageClassSemantics2) & ~(gl_StorageSemanticsBuffer | if (((storageClassSemantics | storageClassSemantics2) & ~(gl_StorageSemanticsBuffer |
@ -1782,7 +1784,16 @@ void TParseContext::memorySemanticsCheck(const TSourceLoc& loc, const TFunction&
error(loc, "gl_SemanticsMakeVisible requires gl_SemanticsAcquire or gl_SemanticsAcquireRelease", error(loc, "gl_SemanticsMakeVisible requires gl_SemanticsAcquire or gl_SemanticsAcquireRelease",
fnCandidate.getName().c_str(), ""); fnCandidate.getName().c_str(), "");
} }
if ((semantics & gl_SemanticsVolatile) &&
(callNode.getOp() == EOpMemoryBarrier || callNode.getOp() == EOpBarrier)) {
error(loc, "gl_SemanticsVolatile must not be used with memoryBarrier or controlBarrier",
fnCandidate.getName().c_str(), "");
}
if ((callNode.getOp() == EOpAtomicCompSwap || callNode.getOp() == EOpImageAtomicCompSwap) &&
((semantics ^ semantics2) & gl_SemanticsVolatile)) {
error(loc, "semEqual and semUnequal must either both include gl_SemanticsVolatile or neither",
fnCandidate.getName().c_str(), "");
}
} }

View File

@ -1791,6 +1791,7 @@ void TShader::setUniformLocationBase(int base)
void TShader::setHlslIoMapping(bool hlslIoMap) { intermediate->setHlslIoMapping(hlslIoMap); } void TShader::setHlslIoMapping(bool hlslIoMap) { intermediate->setHlslIoMapping(hlslIoMap); }
void TShader::setFlattenUniformArrays(bool flatten) { intermediate->setFlattenUniformArrays(flatten); } void TShader::setFlattenUniformArrays(bool flatten) { intermediate->setFlattenUniformArrays(flatten); }
void TShader::setNoStorageFormat(bool useUnknownFormat) { intermediate->setNoStorageFormat(useUnknownFormat); } void TShader::setNoStorageFormat(bool useUnknownFormat) { intermediate->setNoStorageFormat(useUnknownFormat); }
void TShader::setNanMinMaxClamp(bool useNonNan) { intermediate->setNanMinMaxClamp(useNonNan); }
void TShader::setResourceSetBinding(const std::vector<std::string>& base) { intermediate->setResourceSetBinding(base); } void TShader::setResourceSetBinding(const std::vector<std::string>& base) { intermediate->setResourceSetBinding(base); }
void TShader::setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode) { intermediate->setTextureSamplerTransformMode(mode); } void TShader::setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode) { intermediate->setTextureSamplerTransformMode(mode); }

View File

@ -266,7 +266,8 @@ public:
needToLegalize(false), needToLegalize(false),
binaryDoubleOutput(false), binaryDoubleOutput(false),
usePhysicalStorageBuffer(false), usePhysicalStorageBuffer(false),
uniformLocationBase(0) uniformLocationBase(0),
nanMinMaxClamp(false)
{ {
localSize[0] = 1; localSize[0] = 1;
localSize[1] = 1; localSize[1] = 1;
@ -767,6 +768,9 @@ public:
void setUniformLocationBase(int base) { uniformLocationBase = base; } void setUniformLocationBase(int base) { uniformLocationBase = base; }
int getUniformLocationBase() const { return uniformLocationBase; } int getUniformLocationBase() const { return uniformLocationBase; }
void setNanMinMaxClamp(bool setting) { nanMinMaxClamp = setting; }
bool getNanMinMaxClamp() const { return nanMinMaxClamp; }
void setNeedsLegalization() { needToLegalize = true; } void setNeedsLegalization() { needToLegalize = true; }
bool needsLegalization() const { return needToLegalize; } bool needsLegalization() const { return needToLegalize; }
@ -900,6 +904,7 @@ protected:
std::unordered_map<std::string, int> uniformLocationOverrides; std::unordered_map<std::string, int> uniformLocationOverrides;
int uniformLocationBase; int uniformLocationBase;
bool nanMinMaxClamp; // true if desiring min/max/clamp to favor non-NaN over NaN
private: private:
void operator=(TIntermediate&); // prevent assignments void operator=(TIntermediate&); // prevent assignments

View File

@ -435,6 +435,7 @@ public:
void setHlslIoMapping(bool hlslIoMap); void setHlslIoMapping(bool hlslIoMap);
void setFlattenUniformArrays(bool flatten); void setFlattenUniformArrays(bool flatten);
void setNoStorageFormat(bool useUnknownFormat); void setNoStorageFormat(bool useUnknownFormat);
void setNanMinMaxClamp(bool nanMinMaxClamp);
void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode); void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode);
// For setting up the environment (cleared to nothingness in the constructor). // For setting up the environment (cleared to nothingness in the constructor).

View File

@ -325,6 +325,7 @@ INSTANTIATE_TEST_CASE_P(
"spv.functionCall.frag", "spv.functionCall.frag",
"spv.functionNestedOpaque.vert", "spv.functionNestedOpaque.vert",
"spv.functionSemantics.frag", "spv.functionSemantics.frag",
"spv.functionParameterTypes.frag",
"spv.GeometryShaderPassthrough.geom", "spv.GeometryShaderPassthrough.geom",
"spv.interpOps.frag", "spv.interpOps.frag",
"spv.int64.frag", "spv.int64.frag",
@ -353,6 +354,7 @@ INSTANTIATE_TEST_CASE_P(
"spv.precision.frag", "spv.precision.frag",
"spv.precisionNonESSamp.frag", "spv.precisionNonESSamp.frag",
"spv.prepost.frag", "spv.prepost.frag",
"spv.privateVariableTypes.frag",
"spv.qualifiers.vert", "spv.qualifiers.vert",
"spv.sample.frag", "spv.sample.frag",
"spv.sampleId.frag", "spv.sampleId.frag",