Merge branch 'master' into kg15

This commit is contained in:
greg-lunarg 2018-03-26 12:20:43 -06:00 committed by GitHub
commit 0b46c1edbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
58 changed files with 3615 additions and 3113 deletions

View File

@ -126,6 +126,9 @@ public:
void dumpSpv(std::vector<unsigned int>& out); void dumpSpv(std::vector<unsigned int>& out);
protected: protected:
TGlslangToSpvTraverser(TGlslangToSpvTraverser&);
TGlslangToSpvTraverser& operator=(TGlslangToSpvTraverser&);
spv::Decoration TranslateInterpolationDecoration(const glslang::TQualifier& qualifier); spv::Decoration TranslateInterpolationDecoration(const glslang::TQualifier& qualifier);
spv::Decoration TranslateAuxiliaryStorageDecoration(const glslang::TQualifier& qualifier); spv::Decoration TranslateAuxiliaryStorageDecoration(const glslang::TQualifier& qualifier);
spv::BuiltIn TranslateBuiltInDecoration(glslang::TBuiltInVariable, bool memberDeclaration); spv::BuiltIn TranslateBuiltInDecoration(glslang::TBuiltInVariable, bool memberDeclaration);
@ -153,7 +156,8 @@ protected:
glslang::TLayoutPacking getExplicitLayout(const glslang::TType& type) const; glslang::TLayoutPacking getExplicitLayout(const glslang::TType& type) const;
int getArrayStride(const glslang::TType& arrayType, glslang::TLayoutPacking, glslang::TLayoutMatrix); int getArrayStride(const glslang::TType& arrayType, glslang::TLayoutPacking, glslang::TLayoutMatrix);
int getMatrixStride(const glslang::TType& matrixType, glslang::TLayoutPacking, glslang::TLayoutMatrix); int getMatrixStride(const glslang::TType& matrixType, glslang::TLayoutPacking, glslang::TLayoutMatrix);
void updateMemberOffset(const glslang::TType& structType, const glslang::TType& memberType, int& currentOffset, int& nextOffset, glslang::TLayoutPacking, glslang::TLayoutMatrix); void updateMemberOffset(const glslang::TType& structType, const glslang::TType& memberType, int& currentOffset,
int& nextOffset, glslang::TLayoutPacking, glslang::TLayoutMatrix);
void declareUseOfStructMember(const glslang::TTypeList& members, int glslangMember); void declareUseOfStructMember(const glslang::TTypeList& members, int glslangMember);
bool isShaderEntryPoint(const glslang::TIntermAggregate* node); bool isShaderEntryPoint(const glslang::TIntermAggregate* node);
@ -182,10 +186,6 @@ protected:
spv::Id createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy); spv::Id createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy);
spv::Id createNoArgOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId); spv::Id createNoArgOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId);
spv::Id getSymbolId(const glslang::TIntermSymbol* node); spv::Id getSymbolId(const glslang::TIntermSymbol* node);
void addDecoration(spv::Id id, spv::Decoration dec);
void addDecoration(spv::Id id, spv::Decoration dec, unsigned value);
void addMemberDecoration(spv::Id id, int member, spv::Decoration dec);
void addMemberDecoration(spv::Id id, int member, spv::Decoration dec, unsigned value);
spv::Id createSpvConstant(const glslang::TIntermTyped&); spv::Id createSpvConstant(const glslang::TIntermTyped&);
spv::Id createSpvConstantFromConstUnionArray(const glslang::TType& type, const glslang::TConstUnionArray&, int& nextConst, bool specConstant); spv::Id createSpvConstantFromConstUnionArray(const glslang::TType& type, const glslang::TConstUnionArray&, int& nextConst, bool specConstant);
bool isTrivialLeaf(const glslang::TIntermTyped* node); bool isTrivialLeaf(const glslang::TIntermTyped* node);
@ -222,8 +222,10 @@ protected:
std::unordered_set<int> rValueParameters; // set of formal function parameters passed as rValues, rather than a pointer std::unordered_set<int> rValueParameters; // set of formal function parameters passed as rValues, rather than a pointer
std::unordered_map<std::string, spv::Function*> functionMap; std::unordered_map<std::string, spv::Function*> functionMap;
std::unordered_map<const glslang::TTypeList*, spv::Id> structMap[glslang::ElpCount][glslang::ElmCount]; std::unordered_map<const glslang::TTypeList*, spv::Id> structMap[glslang::ElpCount][glslang::ElmCount];
std::unordered_map<const glslang::TTypeList*, std::vector<int> > memberRemapper; // for mapping glslang block indices to spv indices (e.g., due to hidden members) // for mapping glslang block indices to spv indices (e.g., due to hidden members):
std::unordered_map<const glslang::TTypeList*, std::vector<int> > memberRemapper;
std::stack<bool> breakForLoop; // false means break for switch std::stack<bool> breakForLoop; // false means break for switch
std::unordered_map<std::string, const glslang::TIntermSymbol*> counterOriginator;
}; };
// //
@ -1195,6 +1197,36 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol)
else else
builder.setAccessChainLValue(id); builder.setAccessChainLValue(id);
} }
// Process linkage-only nodes for any special additional interface work.
if (linkageOnly) {
if (glslangIntermediate->getHlslFunctionality1()) {
// Map implicit counter buffers to their originating buffers, which should have been
// seen by now, given earlier pruning of unused counters, and preservation of order
// of declaration.
if (symbol->getType().getQualifier().isUniformOrBuffer()) {
if (!glslangIntermediate->hasCounterBufferName(symbol->getName())) {
// Save possible originating buffers for counter buffers, keyed by
// making the potential counter-buffer name.
std::string keyName = symbol->getName().c_str();
keyName = glslangIntermediate->addCounterBufferName(keyName);
counterOriginator[keyName] = symbol;
} else {
// Handle a counter buffer, by finding the saved originating buffer.
std::string keyName = symbol->getName().c_str();
auto it = counterOriginator.find(keyName);
if (it != counterOriginator.end()) {
id = getSymbolId(it->second);
if (id != spv::NoResult) {
spv::Id counterId = getSymbolId(symbol);
if (counterId != spv::NoResult)
builder.addDecorationId(id, spv::DecorationHlslCounterBufferGOOGLE, counterId);
}
}
}
}
}
}
} }
bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::TIntermBinary* node) bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::TIntermBinary* node)
@ -2709,89 +2741,102 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type,
InheritQualifiers(memberQualifier, qualifier); InheritQualifiers(memberQualifier, qualifier);
// using -1 above to indicate a hidden member // using -1 above to indicate a hidden member
if (member >= 0) { if (member < 0)
builder.addMemberName(spvType, member, glslangMember.getFieldName().c_str()); continue;
addMemberDecoration(spvType, member, TranslateLayoutDecoration(glslangMember, memberQualifier.layoutMatrix));
addMemberDecoration(spvType, member, TranslatePrecisionDecoration(glslangMember)); builder.addMemberName(spvType, member, glslangMember.getFieldName().c_str());
// Add interpolation and auxiliary storage decorations only to top-level members of Input and Output storage classes builder.addMemberDecoration(spvType, member,
if (type.getQualifier().storage == glslang::EvqVaryingIn || TranslateLayoutDecoration(glslangMember, memberQualifier.layoutMatrix));
type.getQualifier().storage == glslang::EvqVaryingOut) { builder.addMemberDecoration(spvType, member, TranslatePrecisionDecoration(glslangMember));
if (type.getBasicType() == glslang::EbtBlock || // Add interpolation and auxiliary storage decorations only to
glslangIntermediate->getSource() == glslang::EShSourceHlsl) { // top-level members of Input and Output storage classes
addMemberDecoration(spvType, member, TranslateInterpolationDecoration(memberQualifier)); if (type.getQualifier().storage == glslang::EvqVaryingIn ||
addMemberDecoration(spvType, member, TranslateAuxiliaryStorageDecoration(memberQualifier)); type.getQualifier().storage == glslang::EvqVaryingOut) {
} if (type.getBasicType() == glslang::EbtBlock ||
glslangIntermediate->getSource() == glslang::EShSourceHlsl) {
builder.addMemberDecoration(spvType, member, TranslateInterpolationDecoration(memberQualifier));
builder.addMemberDecoration(spvType, member, TranslateAuxiliaryStorageDecoration(memberQualifier));
} }
addMemberDecoration(spvType, member, TranslateInvariantDecoration(memberQualifier)); }
builder.addMemberDecoration(spvType, member, TranslateInvariantDecoration(memberQualifier));
if (type.getBasicType() == glslang::EbtBlock && if (type.getBasicType() == glslang::EbtBlock &&
qualifier.storage == glslang::EvqBuffer) { qualifier.storage == glslang::EvqBuffer) {
// Add memory decorations only to top-level members of shader storage block // Add memory decorations only to top-level members of shader storage block
std::vector<spv::Decoration> memory; std::vector<spv::Decoration> memory;
TranslateMemoryDecoration(memberQualifier, memory); TranslateMemoryDecoration(memberQualifier, memory);
for (unsigned int i = 0; i < memory.size(); ++i) for (unsigned int i = 0; i < memory.size(); ++i)
addMemberDecoration(spvType, member, memory[i]); builder.addMemberDecoration(spvType, member, memory[i]);
} }
// Location assignment was already completed correctly by the front end, // Location assignment was already completed correctly by the front end,
// just track whether a member needs to be decorated. // just track whether a member needs to be decorated.
// Ignore member locations if the container is an array, as that's // Ignore member locations if the container is an array, as that's
// ill-specified and decisions have been made to not allow this. // ill-specified and decisions have been made to not allow this.
if (! type.isArray() && memberQualifier.hasLocation()) if (! type.isArray() && memberQualifier.hasLocation())
builder.addMemberDecoration(spvType, member, spv::DecorationLocation, memberQualifier.layoutLocation); builder.addMemberDecoration(spvType, member, spv::DecorationLocation, memberQualifier.layoutLocation);
if (qualifier.hasLocation()) // track for upcoming inheritance if (qualifier.hasLocation()) // track for upcoming inheritance
locationOffset += glslangIntermediate->computeTypeLocationSize( locationOffset += glslangIntermediate->computeTypeLocationSize(
glslangMember, glslangIntermediate->getStage()); glslangMember, glslangIntermediate->getStage());
// component, XFB, others // component, XFB, others
if (glslangMember.getQualifier().hasComponent()) if (glslangMember.getQualifier().hasComponent())
builder.addMemberDecoration(spvType, member, spv::DecorationComponent, glslangMember.getQualifier().layoutComponent); builder.addMemberDecoration(spvType, member, spv::DecorationComponent,
if (glslangMember.getQualifier().hasXfbOffset()) glslangMember.getQualifier().layoutComponent);
builder.addMemberDecoration(spvType, member, spv::DecorationOffset, glslangMember.getQualifier().layoutXfbOffset); if (glslangMember.getQualifier().hasXfbOffset())
else if (explicitLayout != glslang::ElpNone) { builder.addMemberDecoration(spvType, member, spv::DecorationOffset,
// figure out what to do with offset, which is accumulating glslangMember.getQualifier().layoutXfbOffset);
int nextOffset; else if (explicitLayout != glslang::ElpNone) {
updateMemberOffset(type, glslangMember, offset, nextOffset, explicitLayout, memberQualifier.layoutMatrix); // figure out what to do with offset, which is accumulating
if (offset >= 0) int nextOffset;
builder.addMemberDecoration(spvType, member, spv::DecorationOffset, offset); updateMemberOffset(type, glslangMember, offset, nextOffset, explicitLayout, memberQualifier.layoutMatrix);
offset = nextOffset; if (offset >= 0)
} builder.addMemberDecoration(spvType, member, spv::DecorationOffset, offset);
offset = nextOffset;
}
if (glslangMember.isMatrix() && explicitLayout != glslang::ElpNone) if (glslangMember.isMatrix() && explicitLayout != glslang::ElpNone)
builder.addMemberDecoration(spvType, member, spv::DecorationMatrixStride, getMatrixStride(glslangMember, explicitLayout, memberQualifier.layoutMatrix)); builder.addMemberDecoration(spvType, member, spv::DecorationMatrixStride,
getMatrixStride(glslangMember, explicitLayout, memberQualifier.layoutMatrix));
// built-in variable decorations // built-in variable decorations
spv::BuiltIn builtIn = TranslateBuiltInDecoration(glslangMember.getQualifier().builtIn, true); spv::BuiltIn builtIn = TranslateBuiltInDecoration(glslangMember.getQualifier().builtIn, true);
if (builtIn != spv::BuiltInMax) if (builtIn != spv::BuiltInMax)
addMemberDecoration(spvType, member, spv::DecorationBuiltIn, (int)builtIn); builder.addMemberDecoration(spvType, member, spv::DecorationBuiltIn, (int)builtIn);
#ifdef NV_EXTENSIONS #ifdef NV_EXTENSIONS
if (builtIn == spv::BuiltInLayer) { if (builtIn == spv::BuiltInLayer) {
// SPV_NV_viewport_array2 extension // SPV_NV_viewport_array2 extension
if (glslangMember.getQualifier().layoutViewportRelative){ if (glslangMember.getQualifier().layoutViewportRelative){
addMemberDecoration(spvType, member, (spv::Decoration)spv::DecorationViewportRelativeNV); builder.addMemberDecoration(spvType, member, (spv::Decoration)spv::DecorationViewportRelativeNV);
builder.addCapability(spv::CapabilityShaderViewportMaskNV); builder.addCapability(spv::CapabilityShaderViewportMaskNV);
builder.addExtension(spv::E_SPV_NV_viewport_array2); builder.addExtension(spv::E_SPV_NV_viewport_array2);
}
if (glslangMember.getQualifier().layoutSecondaryViewportRelativeOffset != -2048){
addMemberDecoration(spvType, member, (spv::Decoration)spv::DecorationSecondaryViewportRelativeNV, glslangMember.getQualifier().layoutSecondaryViewportRelativeOffset);
builder.addCapability(spv::CapabilityShaderStereoViewNV);
builder.addExtension(spv::E_SPV_NV_stereo_view_rendering);
}
} }
if (glslangMember.getQualifier().layoutPassthrough) { if (glslangMember.getQualifier().layoutSecondaryViewportRelativeOffset != -2048){
addMemberDecoration(spvType, member, (spv::Decoration)spv::DecorationPassthroughNV); builder.addMemberDecoration(spvType, member,
builder.addCapability(spv::CapabilityGeometryShaderPassthroughNV); (spv::Decoration)spv::DecorationSecondaryViewportRelativeNV,
builder.addExtension(spv::E_SPV_NV_geometry_shader_passthrough); glslangMember.getQualifier().layoutSecondaryViewportRelativeOffset);
builder.addCapability(spv::CapabilityShaderStereoViewNV);
builder.addExtension(spv::E_SPV_NV_stereo_view_rendering);
} }
}
if (glslangMember.getQualifier().layoutPassthrough) {
builder.addMemberDecoration(spvType, member, (spv::Decoration)spv::DecorationPassthroughNV);
builder.addCapability(spv::CapabilityGeometryShaderPassthroughNV);
builder.addExtension(spv::E_SPV_NV_geometry_shader_passthrough);
}
#endif #endif
if (glslangIntermediate->getHlslFunctionality1() && memberQualifier.semanticName != nullptr) {
builder.addExtension("SPV_GOOGLE_hlsl_functionality1");
builder.addMemberDecoration(spvType, member, (spv::Decoration)spv::DecorationHlslSemanticGOOGLE,
memberQualifier.semanticName);
} }
} }
// Decorate the structure // Decorate the structure
addDecoration(spvType, TranslateLayoutDecoration(type, qualifier.layoutMatrix)); builder.addDecoration(spvType, TranslateLayoutDecoration(type, qualifier.layoutMatrix));
addDecoration(spvType, TranslateBlockDecoration(type, glslangIntermediate->usingStorageBuffer())); builder.addDecoration(spvType, TranslateBlockDecoration(type, glslangIntermediate->usingStorageBuffer()));
if (type.getQualifier().hasStream() && glslangIntermediate->isMultiStream()) { if (type.getQualifier().hasStream() && glslangIntermediate->isMultiStream()) {
builder.addCapability(spv::CapabilityGeometryStreams); builder.addCapability(spv::CapabilityGeometryStreams);
builder.addDecoration(spvType, spv::DecorationStream, type.getQualifier().layoutStream); builder.addDecoration(spvType, spv::DecorationStream, type.getQualifier().layoutStream);
@ -4037,7 +4082,7 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv
builder.promoteScalar(precision, left, right); builder.promoteScalar(precision, left, right);
spv::Id result = builder.createBinOp(binOp, typeId, left, right); spv::Id result = builder.createBinOp(binOp, typeId, left, right);
addDecoration(result, noContraction); builder.addDecoration(result, noContraction);
return builder.setPrecision(result, precision); return builder.setPrecision(result, precision);
} }
@ -4107,7 +4152,7 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv
if (binOp != spv::OpNop) { if (binOp != spv::OpNop) {
spv::Id result = builder.createBinOp(binOp, typeId, left, right); spv::Id result = builder.createBinOp(binOp, typeId, left, right);
addDecoration(result, noContraction); builder.addDecoration(result, noContraction);
return builder.setPrecision(result, precision); return builder.setPrecision(result, precision);
} }
@ -4137,7 +4182,8 @@ spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, spv::Dec
case spv::OpFDiv: case spv::OpFDiv:
if (builder.isMatrix(left) && builder.isScalar(right)) { if (builder.isMatrix(left) && builder.isScalar(right)) {
// turn matrix / scalar into a multiply... // turn matrix / scalar into a multiply...
right = builder.createBinOp(spv::OpFDiv, builder.getTypeId(right), builder.makeFloatConstant(1.0F), right); spv::Id resultType = builder.getTypeId(right);
right = builder.createBinOp(spv::OpFDiv, resultType, builder.makeFpConstant(resultType, 1.0), right);
op = spv::OpMatrixTimesScalar; op = spv::OpMatrixTimesScalar;
} else } else
firstClass = false; firstClass = false;
@ -4166,7 +4212,7 @@ spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, spv::Dec
if (firstClass) { if (firstClass) {
spv::Id result = builder.createBinOp(op, typeId, left, right); spv::Id result = builder.createBinOp(op, typeId, left, right);
addDecoration(result, noContraction); builder.addDecoration(result, noContraction);
return builder.setPrecision(result, precision); return builder.setPrecision(result, precision);
} }
@ -4205,7 +4251,7 @@ spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, spv::Dec
spv::Id leftVec = leftMat ? builder.createCompositeExtract( left, vecType, indexes) : smearVec; spv::Id leftVec = leftMat ? builder.createCompositeExtract( left, vecType, indexes) : smearVec;
spv::Id rightVec = rightMat ? builder.createCompositeExtract(right, vecType, indexes) : smearVec; spv::Id rightVec = rightMat ? builder.createCompositeExtract(right, vecType, indexes) : smearVec;
spv::Id result = builder.createBinOp(op, vecType, leftVec, rightVec); spv::Id result = builder.createBinOp(op, vecType, leftVec, rightVec);
addDecoration(result, noContraction); builder.addDecoration(result, noContraction);
results.push_back(builder.setPrecision(result, precision)); results.push_back(builder.setPrecision(result, precision));
} }
@ -4610,7 +4656,7 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv:
id = builder.createUnaryOp(unaryOp, typeId, operand); id = builder.createUnaryOp(unaryOp, typeId, operand);
} }
addDecoration(id, noContraction); builder.addDecoration(id, noContraction);
return builder.setPrecision(id, precision); return builder.setPrecision(id, precision);
} }
@ -4637,7 +4683,7 @@ spv::Id TGlslangToSpvTraverser::createUnaryMatrixOperation(spv::Op op, spv::Deco
indexes.push_back(c); indexes.push_back(c);
spv::Id srcVec = builder.createCompositeExtract(operand, srcVecType, indexes); spv::Id srcVec = builder.createCompositeExtract(operand, srcVecType, indexes);
spv::Id destVec = builder.createUnaryOp(op, destVecType, srcVec); spv::Id destVec = builder.createUnaryOp(op, destVecType, srcVec);
addDecoration(destVec, noContraction); builder.addDecoration(destVec, noContraction);
results.push_back(builder.setPrecision(destVec, precision)); results.push_back(builder.setPrecision(destVec, precision));
} }
@ -6146,11 +6192,11 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
symbolValues[symbol->getId()] = id; symbolValues[symbol->getId()] = id;
if (symbol->getBasicType() != glslang::EbtBlock) { if (symbol->getBasicType() != glslang::EbtBlock) {
addDecoration(id, TranslatePrecisionDecoration(symbol->getType())); builder.addDecoration(id, TranslatePrecisionDecoration(symbol->getType()));
addDecoration(id, TranslateInterpolationDecoration(symbol->getType().getQualifier())); builder.addDecoration(id, TranslateInterpolationDecoration(symbol->getType().getQualifier()));
addDecoration(id, TranslateAuxiliaryStorageDecoration(symbol->getType().getQualifier())); builder.addDecoration(id, TranslateAuxiliaryStorageDecoration(symbol->getType().getQualifier()));
if (symbol->getType().getQualifier().hasSpecConstantId()) if (symbol->getType().getQualifier().hasSpecConstantId())
addDecoration(id, spv::DecorationSpecId, symbol->getType().getQualifier().layoutSpecConstantId); builder.addDecoration(id, spv::DecorationSpecId, symbol->getType().getQualifier().layoutSpecConstantId);
if (symbol->getQualifier().hasIndex()) if (symbol->getQualifier().hasIndex())
builder.addDecoration(id, spv::DecorationIndex, symbol->getQualifier().layoutIndex); builder.addDecoration(id, spv::DecorationIndex, symbol->getQualifier().layoutIndex);
if (symbol->getQualifier().hasComponent()) if (symbol->getQualifier().hasComponent())
@ -6162,7 +6208,7 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
if (symbol->getQualifier().hasLocation()) if (symbol->getQualifier().hasLocation())
builder.addDecoration(id, spv::DecorationLocation, symbol->getQualifier().layoutLocation); builder.addDecoration(id, spv::DecorationLocation, symbol->getQualifier().layoutLocation);
addDecoration(id, TranslateInvariantDecoration(symbol->getType().getQualifier())); builder.addDecoration(id, TranslateInvariantDecoration(symbol->getType().getQualifier()));
if (symbol->getQualifier().hasStream() && glslangIntermediate->isMultiStream()) { if (symbol->getQualifier().hasStream() && glslangIntermediate->isMultiStream()) {
builder.addCapability(spv::CapabilityGeometryStreams); builder.addCapability(spv::CapabilityGeometryStreams);
builder.addDecoration(id, spv::DecorationStream, symbol->getQualifier().layoutStream); builder.addDecoration(id, spv::DecorationStream, symbol->getQualifier().layoutStream);
@ -6195,13 +6241,13 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
std::vector<spv::Decoration> memory; std::vector<spv::Decoration> memory;
TranslateMemoryDecoration(symbol->getType().getQualifier(), memory); TranslateMemoryDecoration(symbol->getType().getQualifier(), memory);
for (unsigned int i = 0; i < memory.size(); ++i) for (unsigned int i = 0; i < memory.size(); ++i)
addDecoration(id, memory[i]); builder.addDecoration(id, memory[i]);
} }
// built-in variable decorations // built-in variable decorations
spv::BuiltIn builtIn = TranslateBuiltInDecoration(symbol->getQualifier().builtIn, false); spv::BuiltIn builtIn = TranslateBuiltInDecoration(symbol->getQualifier().builtIn, false);
if (builtIn != spv::BuiltInMax) if (builtIn != spv::BuiltInMax)
addDecoration(id, spv::DecorationBuiltIn, (int)builtIn); builder.addDecoration(id, spv::DecorationBuiltIn, (int)builtIn);
#ifdef NV_EXTENSIONS #ifdef NV_EXTENSIONS
if (builtIn == spv::BuiltInSampleMask) { if (builtIn == spv::BuiltInSampleMask) {
@ -6211,7 +6257,7 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
decoration = (spv::Decoration)spv::DecorationOverrideCoverageNV; decoration = (spv::Decoration)spv::DecorationOverrideCoverageNV;
else else
decoration = (spv::Decoration)spv::DecorationMax; decoration = (spv::Decoration)spv::DecorationMax;
addDecoration(id, decoration); builder.addDecoration(id, decoration);
if (decoration != spv::DecorationMax) { if (decoration != spv::DecorationMax) {
builder.addExtension(spv::E_SPV_NV_sample_mask_override_coverage); builder.addExtension(spv::E_SPV_NV_sample_mask_override_coverage);
} }
@ -6219,55 +6265,34 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
else if (builtIn == spv::BuiltInLayer) { else if (builtIn == spv::BuiltInLayer) {
// SPV_NV_viewport_array2 extension // SPV_NV_viewport_array2 extension
if (symbol->getQualifier().layoutViewportRelative) { if (symbol->getQualifier().layoutViewportRelative) {
addDecoration(id, (spv::Decoration)spv::DecorationViewportRelativeNV); builder.addDecoration(id, (spv::Decoration)spv::DecorationViewportRelativeNV);
builder.addCapability(spv::CapabilityShaderViewportMaskNV); builder.addCapability(spv::CapabilityShaderViewportMaskNV);
builder.addExtension(spv::E_SPV_NV_viewport_array2); builder.addExtension(spv::E_SPV_NV_viewport_array2);
} }
if (symbol->getQualifier().layoutSecondaryViewportRelativeOffset != -2048) { if (symbol->getQualifier().layoutSecondaryViewportRelativeOffset != -2048) {
addDecoration(id, (spv::Decoration)spv::DecorationSecondaryViewportRelativeNV, symbol->getQualifier().layoutSecondaryViewportRelativeOffset); builder.addDecoration(id, (spv::Decoration)spv::DecorationSecondaryViewportRelativeNV,
symbol->getQualifier().layoutSecondaryViewportRelativeOffset);
builder.addCapability(spv::CapabilityShaderStereoViewNV); builder.addCapability(spv::CapabilityShaderStereoViewNV);
builder.addExtension(spv::E_SPV_NV_stereo_view_rendering); builder.addExtension(spv::E_SPV_NV_stereo_view_rendering);
} }
} }
if (symbol->getQualifier().layoutPassthrough) { if (symbol->getQualifier().layoutPassthrough) {
addDecoration(id, spv::DecorationPassthroughNV); builder.addDecoration(id, spv::DecorationPassthroughNV);
builder.addCapability(spv::CapabilityGeometryShaderPassthroughNV); builder.addCapability(spv::CapabilityGeometryShaderPassthroughNV);
builder.addExtension(spv::E_SPV_NV_geometry_shader_passthrough); builder.addExtension(spv::E_SPV_NV_geometry_shader_passthrough);
} }
#endif #endif
if (glslangIntermediate->getHlslFunctionality1() && symbol->getType().getQualifier().semanticName != nullptr) {
builder.addExtension("SPV_GOOGLE_hlsl_functionality1");
builder.addDecoration(id, (spv::Decoration)spv::DecorationHlslSemanticGOOGLE,
symbol->getType().getQualifier().semanticName);
}
return id; return id;
} }
// If 'dec' is valid, add no-operand decoration to an object
void TGlslangToSpvTraverser::addDecoration(spv::Id id, spv::Decoration dec)
{
if (dec != spv::DecorationMax)
builder.addDecoration(id, dec);
}
// If 'dec' is valid, add a one-operand decoration to an object
void TGlslangToSpvTraverser::addDecoration(spv::Id id, spv::Decoration dec, unsigned value)
{
if (dec != spv::DecorationMax)
builder.addDecoration(id, dec, value);
}
// If 'dec' is valid, add a no-operand decoration to a struct member
void TGlslangToSpvTraverser::addMemberDecoration(spv::Id id, int member, spv::Decoration dec)
{
if (dec != spv::DecorationMax)
builder.addMemberDecoration(id, (unsigned)member, dec);
}
// If 'dec' is valid, add a one-operand decoration to a struct member
void TGlslangToSpvTraverser::addMemberDecoration(spv::Id id, int member, spv::Decoration dec, unsigned value)
{
if (dec != spv::DecorationMax)
builder.addMemberDecoration(id, (unsigned)member, dec, value);
}
// Make a full tree of instructions to build a SPIR-V specialization constant, // Make a full tree of instructions to build a SPIR-V specialization constant,
// or regular constant if possible. // or regular constant if possible.
// //
@ -6300,8 +6325,10 @@ spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TIntermTyped& n
for (int dim = 0; dim < 3; ++dim) { for (int dim = 0; dim < 3; ++dim) {
bool specConst = (glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet); bool specConst = (glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet);
dimConstId.push_back(builder.makeUintConstant(glslangIntermediate->getLocalSize(dim), specConst)); dimConstId.push_back(builder.makeUintConstant(glslangIntermediate->getLocalSize(dim), specConst));
if (specConst) if (specConst) {
addDecoration(dimConstId.back(), spv::DecorationSpecId, glslangIntermediate->getLocalSizeSpecId(dim)); builder.addDecoration(dimConstId.back(), spv::DecorationSpecId,
glslangIntermediate->getLocalSizeSpecId(dim));
}
} }
return builder.makeCompositeConstant(builder.makeVectorType(builder.makeUintType(32), 3), dimConstId, true); return builder.makeCompositeConstant(builder.makeVectorType(builder.makeUintType(32), 3), dimConstId, true);
} }

View File

@ -848,6 +848,25 @@ Id Builder::makeFloat16Constant(float f16, bool specConstant)
return c->getResultId(); return c->getResultId();
} }
Id Builder::makeFpConstant(Id type, double d, bool specConstant)
{
assert(isFloatType(type));
switch (getScalarTypeWidth(type)) {
case 16:
return makeFloat16Constant(d, specConstant);
case 32:
return makeFloatConstant(d, specConstant);
case 64:
return makeDoubleConstant(d, specConstant);
default:
break;
}
assert(false);
return NoResult;
}
Id Builder::findCompositeConstant(Op typeClass, const std::vector<Id>& comps) Id Builder::findCompositeConstant(Op typeClass, const std::vector<Id>& comps)
{ {
Instruction* constant = 0; Instruction* constant = 0;
@ -993,6 +1012,7 @@ void Builder::addDecoration(Id id, Decoration decoration, int num)
{ {
if (decoration == spv::DecorationMax) if (decoration == spv::DecorationMax)
return; return;
Instruction* dec = new Instruction(OpDecorate); Instruction* dec = new Instruction(OpDecorate);
dec->addIdOperand(id); dec->addIdOperand(id);
dec->addImmediateOperand(decoration); dec->addImmediateOperand(decoration);
@ -1002,8 +1022,37 @@ void Builder::addDecoration(Id id, Decoration decoration, int num)
decorations.push_back(std::unique_ptr<Instruction>(dec)); decorations.push_back(std::unique_ptr<Instruction>(dec));
} }
void Builder::addDecoration(Id id, Decoration decoration, const char* s)
{
if (decoration == spv::DecorationMax)
return;
Instruction* dec = new Instruction(OpDecorateStringGOOGLE);
dec->addIdOperand(id);
dec->addImmediateOperand(decoration);
dec->addStringOperand(s);
decorations.push_back(std::unique_ptr<Instruction>(dec));
}
void Builder::addDecorationId(Id id, Decoration decoration, Id idDecoration)
{
if (decoration == spv::DecorationMax)
return;
Instruction* dec = new Instruction(OpDecorateId);
dec->addIdOperand(id);
dec->addImmediateOperand(decoration);
dec->addIdOperand(idDecoration);
decorations.push_back(std::unique_ptr<Instruction>(dec));
}
void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decoration, int num) void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decoration, int num)
{ {
if (decoration == spv::DecorationMax)
return;
Instruction* dec = new Instruction(OpMemberDecorate); Instruction* dec = new Instruction(OpMemberDecorate);
dec->addIdOperand(id); dec->addIdOperand(id);
dec->addImmediateOperand(member); dec->addImmediateOperand(member);
@ -1014,6 +1063,20 @@ void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decorat
decorations.push_back(std::unique_ptr<Instruction>(dec)); decorations.push_back(std::unique_ptr<Instruction>(dec));
} }
void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decoration, const char *s)
{
if (decoration == spv::DecorationMax)
return;
Instruction* dec = new Instruction(OpMemberDecorateStringGOOGLE);
dec->addIdOperand(id);
dec->addImmediateOperand(member);
dec->addImmediateOperand(decoration);
dec->addStringOperand(s);
decorations.push_back(std::unique_ptr<Instruction>(dec));
}
// Comments in header // Comments in header
Function* Builder::makeEntryPoint(const char* entryPoint) Function* Builder::makeEntryPoint(const char* entryPoint)
{ {
@ -2530,7 +2593,7 @@ void Builder::remapDynamicSwizzle()
if (accessChain.component != NoResult && accessChain.swizzle.size() > 1) { if (accessChain.component != NoResult && accessChain.swizzle.size() > 1) {
// build a vector of the swizzle for the component to map into // build a vector of the swizzle for the component to map into
std::vector<Id> components; std::vector<Id> components;
for (int c = 0; c < accessChain.swizzle.size(); ++c) for (int c = 0; c < (int)accessChain.swizzle.size(); ++c)
components.push_back(makeUintConstant(accessChain.swizzle[c])); components.push_back(makeUintConstant(accessChain.swizzle[c]));
Id mapType = makeVectorType(makeUintType(32), (int)accessChain.swizzle.size()); Id mapType = makeVectorType(makeUintType(32), (int)accessChain.swizzle.size());
Id map = makeCompositeConstant(mapType, components); Id map = makeCompositeConstant(mapType, components);

View File

@ -226,6 +226,7 @@ public:
Id makeFloatConstant(float f, bool specConstant = false); Id makeFloatConstant(float f, bool specConstant = false);
Id makeDoubleConstant(double d, bool specConstant = false); Id makeDoubleConstant(double d, bool specConstant = false);
Id makeFloat16Constant(float f16, bool specConstant = false); Id makeFloat16Constant(float f16, bool specConstant = false);
Id makeFpConstant(Id type, double d, bool specConstant = false);
// Turn the array of constants into a proper spv constant of the requested type. // Turn the array of constants into a proper spv constant of the requested type.
Id makeCompositeConstant(Id type, const std::vector<Id>& comps, bool specConst = false); Id makeCompositeConstant(Id type, const std::vector<Id>& comps, bool specConst = false);
@ -236,7 +237,10 @@ public:
void addName(Id, const char* name); void addName(Id, const char* name);
void addMemberName(Id, int member, const char* name); void addMemberName(Id, int member, const char* name);
void addDecoration(Id, Decoration, int num = -1); void addDecoration(Id, Decoration, int num = -1);
void addDecoration(Id, Decoration, const char*);
void addDecorationId(Id id, Decoration, Id idDecoration);
void addMemberDecoration(Id, unsigned int member, Decoration, int num = -1); void addMemberDecoration(Id, unsigned int member, Decoration, int num = -1);
void addMemberDecoration(Id, unsigned int member, Decoration, const char*);
// At the end of what block do the next create*() instructions go? // At the end of what block do the next create*() instructions go?
void setBuildPoint(Block* bp) { buildPoint = bp; } void setBuildPoint(Block* bp) { buildPoint = bp; }

View File

@ -269,6 +269,9 @@ const char* DecorationString(int decoration)
case 5252: return "ViewportRelativeNV"; case 5252: return "ViewportRelativeNV";
case 5256: return "SecondaryViewportRelativeNV"; case 5256: return "SecondaryViewportRelativeNV";
#endif #endif
case DecorationHlslCounterBufferGOOGLE: return "DecorationHlslCounterBufferGOOGLE";
case DecorationHlslSemanticGOOGLE: return "DecorationHlslSemanticGOOGLE";
} }
} }
@ -1208,6 +1211,7 @@ const char* OpcodeString(int op)
case 320: return "OpImageSparseRead"; case 320: return "OpImageSparseRead";
case OpModuleProcessed: return "OpModuleProcessed"; case OpModuleProcessed: return "OpModuleProcessed";
case OpDecorateId: return "OpDecorateId";
case 333: return "OpGroupNonUniformElect"; case 333: return "OpGroupNonUniformElect";
case 334: return "OpGroupNonUniformAll"; case 334: return "OpGroupNonUniformAll";
@ -1265,6 +1269,9 @@ const char* OpcodeString(int op)
case 5012: return "OpFragmentFetchAMD"; case 5012: return "OpFragmentFetchAMD";
#endif #endif
case OpDecorateStringGOOGLE: return "OpDecorateStringGOOGLE";
case OpMemberDecorateStringGOOGLE: return "OpMemberDecorateStringGOOGLE";
case OpcodeCeiling: case OpcodeCeiling:
default: default:
return "Bad"; return "Bad";
@ -1356,7 +1363,10 @@ void Parameterize()
InstructionDesc[OpImageWrite].setResultAndType(false, false); InstructionDesc[OpImageWrite].setResultAndType(false, false);
InstructionDesc[OpDecorationGroup].setResultAndType(true, false); InstructionDesc[OpDecorationGroup].setResultAndType(true, false);
InstructionDesc[OpDecorate].setResultAndType(false, false); InstructionDesc[OpDecorate].setResultAndType(false, false);
InstructionDesc[OpDecorateId].setResultAndType(false, false);
InstructionDesc[OpDecorateStringGOOGLE].setResultAndType(false, false);
InstructionDesc[OpMemberDecorate].setResultAndType(false, false); InstructionDesc[OpMemberDecorate].setResultAndType(false, false);
InstructionDesc[OpMemberDecorateStringGOOGLE].setResultAndType(false, false);
InstructionDesc[OpGroupDecorate].setResultAndType(false, false); InstructionDesc[OpGroupDecorate].setResultAndType(false, false);
InstructionDesc[OpGroupMemberDecorate].setResultAndType(false, false); InstructionDesc[OpGroupMemberDecorate].setResultAndType(false, false);
InstructionDesc[OpName].setResultAndType(false, false); InstructionDesc[OpName].setResultAndType(false, false);
@ -1921,11 +1931,24 @@ void Parameterize()
InstructionDesc[OpDecorate].operands.push(OperandDecoration, ""); InstructionDesc[OpDecorate].operands.push(OperandDecoration, "");
InstructionDesc[OpDecorate].operands.push(OperandVariableLiterals, "See <<Decoration,'Decoration'>>."); InstructionDesc[OpDecorate].operands.push(OperandVariableLiterals, "See <<Decoration,'Decoration'>>.");
InstructionDesc[OpDecorateId].operands.push(OperandId, "'Target'");
InstructionDesc[OpDecorateId].operands.push(OperandDecoration, "");
InstructionDesc[OpDecorateId].operands.push(OperandVariableIds, "See <<Decoration,'Decoration'>>.");
InstructionDesc[OpDecorateStringGOOGLE].operands.push(OperandId, "'Target'");
InstructionDesc[OpDecorateStringGOOGLE].operands.push(OperandDecoration, "");
InstructionDesc[OpDecorateStringGOOGLE].operands.push(OperandLiteralString, "'Literal String'");
InstructionDesc[OpMemberDecorate].operands.push(OperandId, "'Structure Type'"); InstructionDesc[OpMemberDecorate].operands.push(OperandId, "'Structure Type'");
InstructionDesc[OpMemberDecorate].operands.push(OperandLiteralNumber, "'Member'"); InstructionDesc[OpMemberDecorate].operands.push(OperandLiteralNumber, "'Member'");
InstructionDesc[OpMemberDecorate].operands.push(OperandDecoration, ""); InstructionDesc[OpMemberDecorate].operands.push(OperandDecoration, "");
InstructionDesc[OpMemberDecorate].operands.push(OperandVariableLiterals, "See <<Decoration,'Decoration'>>."); InstructionDesc[OpMemberDecorate].operands.push(OperandVariableLiterals, "See <<Decoration,'Decoration'>>.");
InstructionDesc[OpMemberDecorateStringGOOGLE].operands.push(OperandId, "'Structure Type'");
InstructionDesc[OpMemberDecorateStringGOOGLE].operands.push(OperandLiteralNumber, "'Member'");
InstructionDesc[OpMemberDecorateStringGOOGLE].operands.push(OperandDecoration, "");
InstructionDesc[OpMemberDecorateStringGOOGLE].operands.push(OperandLiteralString, "'Literal String'");
InstructionDesc[OpGroupDecorate].operands.push(OperandId, "'Decoration Group'"); InstructionDesc[OpGroupDecorate].operands.push(OperandId, "'Decoration Group'");
InstructionDesc[OpGroupDecorate].operands.push(OperandVariableIds, "'Targets'"); InstructionDesc[OpGroupDecorate].operands.push(OperandVariableIds, "'Targets'");

View File

@ -101,6 +101,7 @@ enum TOptions {
EOptionInvertY = (1 << 30), EOptionInvertY = (1 << 30),
EOptionDumpBareVersion = (1 << 31), EOptionDumpBareVersion = (1 << 31),
}; };
bool targetHlslFunctionality1 = false;
// //
// Return codes from main/exit(). // Return codes from main/exit().
@ -159,9 +160,9 @@ const char* variableName = nullptr;
bool HlslEnable16BitTypes = false; bool HlslEnable16BitTypes = false;
std::vector<std::string> IncludeDirectoryList; std::vector<std::string> IncludeDirectoryList;
int ClientInputSemanticsVersion = 100; // maps to, say, #define VULKAN 100 int ClientInputSemanticsVersion = 100; // maps to, say, #define VULKAN 100
glslang::EshTargetClientVersion VulkanClientVersion = glslang::EShTargetClientVersion VulkanClientVersion =
glslang::EShTargetVulkan_1_0; // would map to, say, Vulkan 1.0 glslang::EShTargetVulkan_1_0; // would map to, say, Vulkan 1.0
glslang::EshTargetClientVersion OpenGLClientVersion = glslang::EShTargetClientVersion OpenGLClientVersion =
glslang::EShTargetOpenGL_450; // doesn't influence anything yet, but maps to OpenGL 4.50 glslang::EShTargetOpenGL_450; // doesn't influence anything yet, but maps to OpenGL 4.50
glslang::EShTargetLanguageVersion TargetVersion = glslang::EShTargetLanguageVersion TargetVersion =
glslang::EShTargetSpv_1_0; // maps to, say, SPIR-V 1.0 glslang::EShTargetSpv_1_0; // maps to, say, SPIR-V 1.0
@ -523,7 +524,7 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
setOpenGlSpv(); setOpenGlSpv();
OpenGLClientVersion = glslang::EShTargetOpenGL_450; OpenGLClientVersion = glslang::EShTargetOpenGL_450;
} else } else
Error("--target-env expected vulkan1.0, opengl, or hlsl-16bit-types"); Error("--target-env expected vulkan1.0, vulkan1.1, or opengl");
} }
bumpArg(); bumpArg();
} else if (lowerword == "variable-name" || // synonyms } else if (lowerword == "variable-name" || // synonyms
@ -613,6 +614,12 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
Error("no <name> provided for -e"); Error("no <name> provided for -e");
bumpArg(); bumpArg();
break; break;
case 'f':
if (strcmp(&argv[0][2], "hlsl_functionality1") == 0)
targetHlslFunctionality1 = true;
else
Error("-f: expected hlsl_functionality1");
break;
case 'g': case 'g':
Options |= EOptionDebug; Options |= EOptionDebug;
break; break;
@ -874,14 +881,15 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
: glslang::EShSourceGlsl, : glslang::EShSourceGlsl,
compUnit.stage, glslang::EShClientVulkan, ClientInputSemanticsVersion); compUnit.stage, glslang::EShClientVulkan, ClientInputSemanticsVersion);
shader->setEnvClient(glslang::EShClientVulkan, VulkanClientVersion); shader->setEnvClient(glslang::EShClientVulkan, VulkanClientVersion);
shader->setEnvTarget(glslang::EShTargetSpv, TargetVersion);
} else { } else {
shader->setEnvInput((Options & EOptionReadHlsl) ? glslang::EShSourceHlsl shader->setEnvInput((Options & EOptionReadHlsl) ? glslang::EShSourceHlsl
: glslang::EShSourceGlsl, : glslang::EShSourceGlsl,
compUnit.stage, glslang::EShClientOpenGL, ClientInputSemanticsVersion); compUnit.stage, glslang::EShClientOpenGL, ClientInputSemanticsVersion);
shader->setEnvClient(glslang::EShClientOpenGL, OpenGLClientVersion); shader->setEnvClient(glslang::EShClientOpenGL, OpenGLClientVersion);
shader->setEnvTarget(glslang::EshTargetSpv, TargetVersion);
} }
shader->setEnvTarget(glslang::EShTargetSpv, TargetVersion);
if (targetHlslFunctionality1)
shader->setEnvTargetHlslFunctionality1();
} }
shaders.push_back(shader); shaders.push_back(shader);
@ -1318,6 +1326,9 @@ void usage()
" -d default to desktop (#version 110) when there is no shader #version\n" " -d default to desktop (#version 110) when there is no shader #version\n"
" (default is ES version 100)\n" " (default is ES version 100)\n"
" -e <name> specify <name> as the entry-point name\n" " -e <name> specify <name> as the entry-point name\n"
" -f{hlsl_functionality1}\n"
" 'hlsl_functionality1' enables use of the\n"
" SPV_GOOGLE_hlsl_functionality1 extension\n"
" -g generate debug information\n" " -g generate debug information\n"
" -h print this usage message\n" " -h print this usage message\n"
" -i intermediate tree (glslang AST) is printed out\n" " -i intermediate tree (glslang AST) is printed out\n"
@ -1390,8 +1401,8 @@ void usage()
" set execution environment that emitted code\n" " set execution environment that emitted code\n"
" will execute in (as opposed to the language\n" " will execute in (as opposed to the language\n"
" semantics selected by --client) defaults:\n" " semantics selected by --client) defaults:\n"
" 'vulkan1.0' under '--client vulkan<ver>'\n" " 'vulkan1.0' under '--client vulkan<ver>'\n"
" 'opengl' under '--client opengl<ver>'\n" " 'opengl' under '--client opengl<ver>'\n"
" --variable-name <name> Creates a C header file that contains a\n" " --variable-name <name> Creates a C header file that contains a\n"
" uint32_t array named <name>\n" " uint32_t array named <name>\n"
" initialized with the shader binary code.\n" " initialized with the shader binary code.\n"

View File

@ -1,7 +1,7 @@
300.frag 300.frag
ERROR: 0:2: 'float' : type requires declaration of default precision qualifier ERROR: 0:2: 'float' : type requires declaration of default precision qualifier
ERROR: 0:30: 'noperspective' : Reserved word. ERROR: 0:30: 'noperspective' : Reserved word.
ERROR: 0:30: 'noperspective' : not supported with this profile: es ERROR: 0:30: 'noperspective' : not supported for this version or the enabled extensions
ERROR: 0:31: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: bads ERROR: 0:31: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: bads
ERROR: 0:32: 'uint' : cannot apply precision statement to this type; use 'float', 'int' or a sampler type ERROR: 0:32: 'uint' : cannot apply precision statement to this type; use 'float', 'int' or a sampler type
ERROR: 0:39: 'structure' : must be qualified as flat in ERROR: 0:39: 'structure' : must be qualified as flat in

View File

@ -105,7 +105,7 @@ ERROR: 0:346: 'centroid/sample/patch' : can't use auxiliary qualifier on a fragm
ERROR: 0:347: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output ERROR: 0:347: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output
ERROR: 0:348: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output ERROR: 0:348: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output
ERROR: 0:349: 'noperspective' : Reserved word. ERROR: 0:349: 'noperspective' : Reserved word.
ERROR: 0:349: 'noperspective' : not supported with this profile: es ERROR: 0:349: 'noperspective' : not supported for this version or the enabled extensions
ERROR: 0:349: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output ERROR: 0:349: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output
ERROR: 0:355: 'interpolateAtCentroid' : required extension not requested: GL_OES_shader_multisample_interpolation ERROR: 0:355: 'interpolateAtCentroid' : required extension not requested: GL_OES_shader_multisample_interpolation
ERROR: 0:356: 'interpolateAtSample' : required extension not requested: GL_OES_shader_multisample_interpolation ERROR: 0:356: 'interpolateAtSample' : required extension not requested: GL_OES_shader_multisample_interpolation

View File

@ -21,7 +21,7 @@ ERROR: 0:48: 'assign' : l-value required (can't modify a const)
ERROR: 0:51: 'patch' : cannot use interpolation qualifiers with patch ERROR: 0:51: 'patch' : cannot use interpolation qualifiers with patch
ERROR: 0:52: 'patch' : cannot use interpolation qualifiers with patch ERROR: 0:52: 'patch' : cannot use interpolation qualifiers with patch
ERROR: 0:53: 'noperspective' : Reserved word. ERROR: 0:53: 'noperspective' : Reserved word.
ERROR: 0:53: 'noperspective' : not supported with this profile: es ERROR: 0:53: 'noperspective' : not supported for this version or the enabled extensions
ERROR: 0:53: 'patch' : cannot use interpolation qualifiers with patch ERROR: 0:53: 'patch' : cannot use interpolation qualifiers with patch
ERROR: 0:54: 'sample' : Reserved word. ERROR: 0:54: 'sample' : Reserved word.
ERROR: 0:54: '' : can only have one auxiliary qualifier (centroid, patch, and sample) ERROR: 0:54: '' : can only have one auxiliary qualifier (centroid, patch, and sample)

View File

@ -23,7 +23,7 @@ ERROR: 0:157: 'centroid/sample/patch' : can't use auxiliary qualifier on a fragm
ERROR: 0:158: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output ERROR: 0:158: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output
ERROR: 0:159: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output ERROR: 0:159: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output
ERROR: 0:160: 'noperspective' : Reserved word. ERROR: 0:160: 'noperspective' : Reserved word.
ERROR: 0:160: 'noperspective' : not supported with this profile: es ERROR: 0:160: 'noperspective' : not supported for this version or the enabled extensions
ERROR: 0:160: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output ERROR: 0:160: 'flat/smooth/noperspective' : can't use interpolation qualifier on a fragment output
ERROR: 0:165: 'centroid/sample/patch' : can't use auxiliary qualifier on a fragment output ERROR: 0:165: 'centroid/sample/patch' : can't use auxiliary qualifier on a fragment output
ERROR: 0:180: 'interpolateAtCentroid' : no matching overloaded function found ERROR: 0:180: 'interpolateAtCentroid' : no matching overloaded function found

View File

@ -21,7 +21,7 @@ ERROR: 0:44: 'assign' : l-value required (can't modify a const)
ERROR: 0:47: 'patch' : cannot use interpolation qualifiers with patch ERROR: 0:47: 'patch' : cannot use interpolation qualifiers with patch
ERROR: 0:48: 'patch' : cannot use interpolation qualifiers with patch ERROR: 0:48: 'patch' : cannot use interpolation qualifiers with patch
ERROR: 0:49: 'noperspective' : Reserved word. ERROR: 0:49: 'noperspective' : Reserved word.
ERROR: 0:49: 'noperspective' : not supported with this profile: es ERROR: 0:49: 'noperspective' : not supported for this version or the enabled extensions
ERROR: 0:49: 'patch' : cannot use interpolation qualifiers with patch ERROR: 0:49: 'patch' : cannot use interpolation qualifiers with patch
ERROR: 0:50: '' : can only have one auxiliary qualifier (centroid, patch, and sample) ERROR: 0:50: '' : can only have one auxiliary qualifier (centroid, patch, and sample)
ERROR: 0:54: 'gl_PerVertex' : block already declared with size, can't redeclare as implicitly-sized ERROR: 0:54: 'gl_PerVertex' : block already declared with size, can't redeclare as implicitly-sized

View File

@ -0,0 +1,14 @@
cppRelaxSkipTokensErrors.vert
Shader version: 110
0:? Sequence
0:? Linker Objects
Linked vertex stage:
ERROR: Linking vertex stage: Missing entry point: Each stage requires one entry point
Shader version: 110
0:? Sequence
0:? Linker Objects

View File

@ -74,12 +74,11 @@ gl_FragCoord origin is upper left
0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) 0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1})
0:17 Constant: 0:17 Constant:
0:17 1 (const uint) 0:17 1 (const uint)
0:17 Convert int to bool ( temp bool) 0:17 Convert float to bool ( temp bool)
0:17 Convert float to int ( temp int) 0:17 condf: direct index for structure ( uniform float)
0:17 condf: direct index for structure ( uniform float) 0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1})
0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) 0:17 Constant:
0:17 Constant: 0:17 0 (const uint)
0:17 0 (const uint)
0:17 Convert float to bool ( temp bool) 0:17 Convert float to bool ( temp bool)
0:17 condf1: direct index for structure ( uniform 1-component vector of float) 0:17 condf1: direct index for structure ( uniform 1-component vector of float)
0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) 0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1})
@ -243,12 +242,11 @@ gl_FragCoord origin is upper left
0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) 0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1})
0:17 Constant: 0:17 Constant:
0:17 1 (const uint) 0:17 1 (const uint)
0:17 Convert int to bool ( temp bool) 0:17 Convert float to bool ( temp bool)
0:17 Convert float to int ( temp int) 0:17 condf: direct index for structure ( uniform float)
0:17 condf: direct index for structure ( uniform float) 0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1})
0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) 0:17 Constant:
0:17 Constant: 0:17 0 (const uint)
0:17 0 (const uint)
0:17 Convert float to bool ( temp bool) 0:17 Convert float to bool ( temp bool)
0:17 condf1: direct index for structure ( uniform 1-component vector of float) 0:17 condf1: direct index for structure ( uniform 1-component vector of float)
0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1}) 0:17 'anon@0' (layout( row_major std140) uniform block{ uniform float condf, uniform int condi, uniform 1-component vector of float condf1, uniform 1-component vector of int condi1})
@ -335,12 +333,12 @@ gl_FragCoord origin is upper left
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80006 // Generated by (magic number): 80006
// Id's are bound by 140 // Id's are bound by 139
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 138 EntryPoint Fragment 4 "main" 137
ExecutionMode 4 OriginUpperLeft ExecutionMode 4 OriginUpperLeft
Source HLSL 500 Source HLSL 500
Name 4 "main" Name 4 "main"
@ -352,17 +350,17 @@ gl_FragCoord origin is upper left
MemberName 16($Global) 2 "condf1" MemberName 16($Global) 2 "condf1"
MemberName 16($Global) 3 "condi1" MemberName 16($Global) 3 "condi1"
Name 18 "" Name 18 ""
Name 88 "f" Name 87 "f"
Name 101 "i" Name 100 "i"
Name 121 "g" Name 120 "g"
Name 138 "@entryPointOutput" Name 137 "@entryPointOutput"
MemberDecorate 16($Global) 0 Offset 0 MemberDecorate 16($Global) 0 Offset 0
MemberDecorate 16($Global) 1 Offset 4 MemberDecorate 16($Global) 1 Offset 4
MemberDecorate 16($Global) 2 Offset 8 MemberDecorate 16($Global) 2 Offset 8
MemberDecorate 16($Global) 3 Offset 12 MemberDecorate 16($Global) 3 Offset 12
Decorate 16($Global) Block Decorate 16($Global) Block
Decorate 18 DescriptorSet 0 Decorate 18 DescriptorSet 0
Decorate 138(@entryPointOutput) Location 0 Decorate 137(@entryPointOutput) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
@ -388,25 +386,25 @@ gl_FragCoord origin is upper left
53: 6(float) Constant 1077936128 53: 6(float) Constant 1077936128
57: 15(int) Constant 3 57: 15(int) Constant 3
64: 6(float) Constant 1082130432 64: 6(float) Constant 1082130432
83: 6(float) Constant 1084227584 82: 6(float) Constant 1084227584
87: TypePointer Function 6(float) 86: TypePointer Function 6(float)
100: TypePointer Function 15(int) 99: TypePointer Function 15(int)
125: 6(float) Constant 1088421888 124: 6(float) Constant 1088421888
126: 6(float) Constant 1090519040 125: 6(float) Constant 1090519040
137: TypePointer Output 7(fvec4) 136: TypePointer Output 7(fvec4)
138(@entryPointOutput): 137(ptr) Variable Output 137(@entryPointOutput): 136(ptr) Variable Output
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
139: 7(fvec4) FunctionCall 9(@main() 138: 7(fvec4) FunctionCall 9(@main()
Store 138(@entryPointOutput) 139 Store 137(@entryPointOutput) 138
Return Return
FunctionEnd FunctionEnd
9(@main(): 7(fvec4) Function None 8 9(@main(): 7(fvec4) Function None 8
10: Label 10: Label
12(a): 11(ptr) Variable Function 12(a): 11(ptr) Variable Function
88(f): 87(ptr) Variable Function 87(f): 86(ptr) Variable Function
101(i): 100(ptr) Variable Function 100(i): 99(ptr) Variable Function
121(g): 87(ptr) Variable Function 120(g): 86(ptr) Variable Function
Store 12(a) 14 Store 12(a) 14
21: 20(ptr) AccessChain 18 19 21: 20(ptr) AccessChain 18 19
22: 15(int) Load 21 22: 15(int) Load 21
@ -457,85 +455,84 @@ gl_FragCoord origin is upper left
70: 23(bool) INotEqual 69 25 70: 23(bool) INotEqual 69 25
71: 35(ptr) AccessChain 18 34 71: 35(ptr) AccessChain 18 34
72: 6(float) Load 71 72: 6(float) Load 71
73: 15(int) ConvertFToS 72 73: 23(bool) FOrdNotEqual 72 38
74: 23(bool) INotEqual 73 25 74: 23(bool) LogicalAnd 70 73
75: 23(bool) LogicalAnd 70 74 75: 35(ptr) AccessChain 18 46
76: 35(ptr) AccessChain 18 46 76: 6(float) Load 75
77: 6(float) Load 76 77: 23(bool) FOrdNotEqual 76 38
78: 23(bool) FOrdNotEqual 77 38 78: 23(bool) LogicalOr 74 77
79: 23(bool) LogicalOr 75 78 SelectionMerge 80 None
SelectionMerge 81 None BranchConditional 78 79 80
BranchConditional 79 80 81 79: Label
80: Label 81: 7(fvec4) Load 12(a)
82: 7(fvec4) Load 12(a) 83: 7(fvec4) CompositeConstruct 82 82 82 82
84: 7(fvec4) CompositeConstruct 83 83 83 83 84: 7(fvec4) FAdd 81 83
85: 7(fvec4) FAdd 82 84 ReturnValue 84
ReturnValue 85 80: Label
81: Label 88: 35(ptr) AccessChain 18 34
89: 35(ptr) AccessChain 18 34 89: 6(float) Load 88
90: 6(float) Load 89 Store 87(f) 89
Store 88(f) 90 Branch 90
Branch 91 90: Label
91: Label LoopMerge 92 93 None
LoopMerge 93 94 None Branch 94
Branch 95 94: Label
95: Label 95: 6(float) Load 87(f)
96: 6(float) Load 88(f) 96: 23(bool) FOrdNotEqual 95 38
97: 23(bool) FOrdNotEqual 96 38 BranchConditional 96 91 92
BranchConditional 97 92 93 91: Label
92: Label 97: 6(float) Load 87(f)
98: 6(float) Load 88(f) 98: 6(float) FSub 97 30
99: 6(float) FSub 98 30 Store 87(f) 98
Store 88(f) 99 Branch 93
Branch 94 93: Label
94: Label Branch 90
Branch 91 92: Label
93: Label 101: 20(ptr) AccessChain 18 19
102: 20(ptr) AccessChain 18 19 102: 15(int) Load 101
103: 15(int) Load 102 Store 100(i) 102
Store 101(i) 103 Branch 103
103: Label
LoopMerge 105 106 None
Branch 104 Branch 104
104: Label 104: Label
LoopMerge 106 107 None 107: 15(int) Load 100(i)
Branch 105 108: 15(int) ISub 107 19
105: Label Store 100(i) 108
108: 15(int) Load 101(i) Branch 106
109: 15(int) ISub 108 19
Store 101(i) 109
Branch 107
107: Label
110: 15(int) Load 101(i)
111: 23(bool) INotEqual 110 25
BranchConditional 111 104 106
106: Label 106: Label
Branch 112 109: 15(int) Load 100(i)
112: Label 110: 23(bool) INotEqual 109 25
LoopMerge 114 115 None BranchConditional 110 103 105
Branch 116 105: Label
116: Label Branch 111
117: 15(int) Load 101(i) 111: Label
118: 23(bool) INotEqual 117 25 LoopMerge 113 114 None
BranchConditional 118 113 114 Branch 115
113: Label 115: Label
119: 15(int) Load 101(i) 116: 15(int) Load 100(i)
120: 15(int) ISub 119 19 117: 23(bool) INotEqual 116 25
Store 101(i) 120 BranchConditional 117 112 113
Branch 115 112: Label
115: Label 118: 15(int) Load 100(i)
Branch 112 119: 15(int) ISub 118 19
114: Label Store 100(i) 119
122: 35(ptr) AccessChain 18 34 Branch 114
123: 6(float) Load 122 114: Label
124: 23(bool) FOrdNotEqual 123 38 Branch 111
127: 6(float) Select 124 125 126 113: Label
Store 121(g) 127 121: 35(ptr) AccessChain 18 34
128: 6(float) Load 121(g) 122: 6(float) Load 121
129: 7(fvec4) Load 12(a) 123: 23(bool) FOrdNotEqual 122 38
130: 7(fvec4) CompositeConstruct 128 128 128 128 126: 6(float) Select 123 124 125
131: 7(fvec4) FAdd 129 130 Store 120(g) 126
Store 12(a) 131 127: 6(float) Load 120(g)
132: 7(fvec4) Load 12(a) 128: 7(fvec4) Load 12(a)
133: 7(fvec4) CompositeConstruct 30 30 30 30 129: 7(fvec4) CompositeConstruct 127 127 127 127
134: 7(fvec4) FSub 132 133 130: 7(fvec4) FAdd 128 129
ReturnValue 134 Store 12(a) 130
131: 7(fvec4) Load 12(a)
132: 7(fvec4) CompositeConstruct 30 30 30 30
133: 7(fvec4) FSub 131 132
ReturnValue 133
FunctionEnd FunctionEnd

View File

@ -13,12 +13,11 @@ gl_FragCoord origin is upper left
0:13 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) 0:13 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4})
0:13 Constant: 0:13 Constant:
0:13 0 (const uint) 0:13 0 (const uint)
0:13 Convert int to bool ( temp bool) 0:13 Convert float to bool ( temp bool)
0:13 Convert float to int ( temp int) 0:13 fval: direct index for structure ( uniform float)
0:13 fval: direct index for structure ( uniform float) 0:13 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4})
0:13 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) 0:13 Constant:
0:13 Constant: 0:13 2 (const uint)
0:13 2 (const uint)
0:13 true case is null 0:13 true case is null
0:14 Test condition and select ( temp void) 0:14 Test condition and select ( temp void)
0:14 Condition 0:14 Condition
@ -28,12 +27,11 @@ gl_FragCoord origin is upper left
0:14 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) 0:14 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4})
0:14 Constant: 0:14 Constant:
0:14 0 (const uint) 0:14 0 (const uint)
0:14 Convert int to bool ( temp bool) 0:14 Convert float to bool ( temp bool)
0:14 Convert float to int ( temp int) 0:14 fval: direct index for structure ( uniform float)
0:14 fval: direct index for structure ( uniform float) 0:14 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4})
0:14 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) 0:14 Constant:
0:14 Constant: 0:14 2 (const uint)
0:14 2 (const uint)
0:14 true case is null 0:14 true case is null
0:17 move second child to first child ( temp 4-component vector of float) 0:17 move second child to first child ( temp 4-component vector of float)
0:17 Color: direct index for structure ( temp 4-component vector of float) 0:17 Color: direct index for structure ( temp 4-component vector of float)
@ -79,12 +77,11 @@ gl_FragCoord origin is upper left
0:13 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) 0:13 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4})
0:13 Constant: 0:13 Constant:
0:13 0 (const uint) 0:13 0 (const uint)
0:13 Convert int to bool ( temp bool) 0:13 Convert float to bool ( temp bool)
0:13 Convert float to int ( temp int) 0:13 fval: direct index for structure ( uniform float)
0:13 fval: direct index for structure ( uniform float) 0:13 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4})
0:13 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) 0:13 Constant:
0:13 Constant: 0:13 2 (const uint)
0:13 2 (const uint)
0:13 true case is null 0:13 true case is null
0:14 Test condition and select ( temp void) 0:14 Test condition and select ( temp void)
0:14 Condition 0:14 Condition
@ -94,12 +91,11 @@ gl_FragCoord origin is upper left
0:14 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) 0:14 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4})
0:14 Constant: 0:14 Constant:
0:14 0 (const uint) 0:14 0 (const uint)
0:14 Convert int to bool ( temp bool) 0:14 Convert float to bool ( temp bool)
0:14 Convert float to int ( temp int) 0:14 fval: direct index for structure ( uniform float)
0:14 fval: direct index for structure ( uniform float) 0:14 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4})
0:14 'anon@0' (layout( row_major std140) uniform block{ uniform int ival, uniform 4-component vector of int ival4, uniform float fval, uniform 4-component vector of float fval4}) 0:14 Constant:
0:14 Constant: 0:14 2 (const uint)
0:14 2 (const uint)
0:14 true case is null 0:14 true case is null
0:17 move second child to first child ( temp 4-component vector of float) 0:17 move second child to first child ( temp 4-component vector of float)
0:17 Color: direct index for structure ( temp 4-component vector of float) 0:17 Color: direct index for structure ( temp 4-component vector of float)
@ -129,12 +125,12 @@ gl_FragCoord origin is upper left
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80006 // Generated by (magic number): 80006
// Id's are bound by 57 // Id's are bound by 56
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 54 EntryPoint Fragment 4 "main" 53
ExecutionMode 4 OriginUpperLeft ExecutionMode 4 OriginUpperLeft
Source HLSL 500 Source HLSL 500
Name 4 "main" Name 4 "main"
@ -147,15 +143,15 @@ gl_FragCoord origin is upper left
MemberName 14($Global) 2 "fval" MemberName 14($Global) 2 "fval"
MemberName 14($Global) 3 "fval4" MemberName 14($Global) 3 "fval4"
Name 16 "" Name 16 ""
Name 45 "psout" Name 44 "psout"
Name 54 "@entryPointOutput.Color" Name 53 "@entryPointOutput.Color"
MemberDecorate 14($Global) 0 Offset 0 MemberDecorate 14($Global) 0 Offset 0
MemberDecorate 14($Global) 1 Offset 16 MemberDecorate 14($Global) 1 Offset 16
MemberDecorate 14($Global) 2 Offset 32 MemberDecorate 14($Global) 2 Offset 32
MemberDecorate 14($Global) 3 Offset 48 MemberDecorate 14($Global) 3 Offset 48
Decorate 14($Global) Block Decorate 14($Global) Block
Decorate 16 DescriptorSet 0 Decorate 16 DescriptorSet 0
Decorate 54(@entryPointOutput.Color) Location 0 Decorate 53(@entryPointOutput.Color) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
@ -174,29 +170,29 @@ gl_FragCoord origin is upper left
23: 22(int) Constant 0 23: 22(int) Constant 0
25: 12(int) Constant 2 25: 12(int) Constant 2
26: TypePointer Uniform 6(float) 26: TypePointer Uniform 6(float)
44: TypePointer Function 8(PS_OUTPUT) 29: 6(float) Constant 0
46: 6(float) Constant 1065353216 43: TypePointer Function 8(PS_OUTPUT)
47: 7(fvec4) ConstantComposite 46 46 46 46 45: 6(float) Constant 1065353216
48: TypePointer Function 7(fvec4) 46: 7(fvec4) ConstantComposite 45 45 45 45
53: TypePointer Output 7(fvec4) 47: TypePointer Function 7(fvec4)
54(@entryPointOutput.Color): 53(ptr) Variable Output 52: TypePointer Output 7(fvec4)
53(@entryPointOutput.Color): 52(ptr) Variable Output
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
55:8(PS_OUTPUT) FunctionCall 10(@main() 54:8(PS_OUTPUT) FunctionCall 10(@main()
56: 7(fvec4) CompositeExtract 55 0 55: 7(fvec4) CompositeExtract 54 0
Store 54(@entryPointOutput.Color) 56 Store 53(@entryPointOutput.Color) 55
Return Return
FunctionEnd FunctionEnd
10(@main():8(PS_OUTPUT) Function None 9 10(@main():8(PS_OUTPUT) Function None 9
11: Label 11: Label
45(psout): 44(ptr) Variable Function 44(psout): 43(ptr) Variable Function
19: 18(ptr) AccessChain 16 17 19: 18(ptr) AccessChain 16 17
20: 12(int) Load 19 20: 12(int) Load 19
24: 21(bool) INotEqual 20 23 24: 21(bool) INotEqual 20 23
27: 26(ptr) AccessChain 16 25 27: 26(ptr) AccessChain 16 25
28: 6(float) Load 27 28: 6(float) Load 27
29: 12(int) ConvertFToS 28 30: 21(bool) FOrdNotEqual 28 29
30: 21(bool) INotEqual 29 23
31: 21(bool) LogicalAnd 24 30 31: 21(bool) LogicalAnd 24 30
SelectionMerge 33 None SelectionMerge 33 None
BranchConditional 31 32 33 BranchConditional 31 32 33
@ -208,16 +204,15 @@ gl_FragCoord origin is upper left
36: 21(bool) INotEqual 35 23 36: 21(bool) INotEqual 35 23
37: 26(ptr) AccessChain 16 25 37: 26(ptr) AccessChain 16 25
38: 6(float) Load 37 38: 6(float) Load 37
39: 12(int) ConvertFToS 38 39: 21(bool) FOrdNotEqual 38 29
40: 21(bool) INotEqual 39 23 40: 21(bool) LogicalOr 36 39
41: 21(bool) LogicalOr 36 40 SelectionMerge 42 None
SelectionMerge 43 None BranchConditional 40 41 42
BranchConditional 41 42 43 41: Label
42: Label Branch 42
Branch 43 42: Label
43: Label 48: 47(ptr) AccessChain 44(psout) 17
49: 48(ptr) AccessChain 45(psout) 17 Store 48 46
Store 49 47 49:8(PS_OUTPUT) Load 44(psout)
50:8(PS_OUTPUT) Load 45(psout) ReturnValue 49
ReturnValue 50
FunctionEnd FunctionEnd

View File

@ -0,0 +1,125 @@
hlsl.structbuffer.incdec.frag
// Module Version 10000
// Generated by (magic number): 80006
// Id's are bound by 70
Capability Shader
Extension "SPV_GOOGLE_hlsl_functionality1"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 63 66
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
Name 12 "@main(u1;"
Name 11 "pos"
Name 16 "result"
Name 20 "sbuf_rw_i"
MemberName 20(sbuf_rw_i) 0 "@data"
Name 22 "sbuf_rw_i"
Name 26 "sbuf_rw_d"
Name 27 "sbuf_rw_nocounter"
Name 33 "c1"
Name 34 "sbuf_rw_i@count"
MemberName 34(sbuf_rw_i@count) 0 "@count"
Name 36 "sbuf_rw_i@count"
Name 42 "c2"
Name 43 "sbuf_rw_d@count"
Name 61 "pos"
Name 63 "pos"
Name 66 "@entryPointOutput"
Name 67 "param"
Decorate 19 ArrayStride 16
MemberDecorate 20(sbuf_rw_i) 0 Offset 0
Decorate 20(sbuf_rw_i) BufferBlock
Decorate 22(sbuf_rw_i) DescriptorSet 0
Decorate 26(sbuf_rw_d) DescriptorSet 0
Decorate 27(sbuf_rw_nocounter) DescriptorSet 0
MemberDecorate 34(sbuf_rw_i@count) 0 Offset 0
Decorate 34(sbuf_rw_i@count) BufferBlock
Decorate 36(sbuf_rw_i@count) DescriptorSet 0
Decorate 43(sbuf_rw_d@count) DescriptorSet 0
Decorate 63(pos) Flat
Decorate 63(pos) Location 0
DecorateStringGOOGLE 63(pos) DecorationHlslSemanticGOOGLE "FOO"
Decorate 66(@entryPointOutput) Location 0
DecorateStringGOOGLE 66(@entryPointOutput) DecorationHlslSemanticGOOGLE "SV_TARGET0"
DecorateId 22(sbuf_rw_i) DecorationHlslCounterBufferGOOGLE 36(sbuf_rw_i@count)
DecorateId 26(sbuf_rw_d) DecorationHlslCounterBufferGOOGLE 43(sbuf_rw_d@count)
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
7: TypePointer Function 6(int)
8: TypeFloat 32
9: TypeVector 8(float) 4
10: TypeFunction 9(fvec4) 7(ptr)
14: TypeVector 6(int) 4
15: TypePointer Function 14(ivec4)
17: 6(int) Constant 0
18: 14(ivec4) ConstantComposite 17 17 17 17
19: TypeRuntimeArray 14(ivec4)
20(sbuf_rw_i): TypeStruct 19
21: TypePointer Uniform 20(sbuf_rw_i)
22(sbuf_rw_i): 21(ptr) Variable Uniform
23: TypeInt 32 1
24: 23(int) Constant 0
25: 23(int) Constant 7
26(sbuf_rw_d): 21(ptr) Variable Uniform
27(sbuf_rw_nocounter): 21(ptr) Variable Uniform
28: 23(int) Constant 5
29: 6(int) Constant 2
30: 14(ivec4) ConstantComposite 29 29 29 29
31: TypePointer Uniform 14(ivec4)
34(sbuf_rw_i@count): TypeStruct 23(int)
35: TypePointer Uniform 34(sbuf_rw_i@count)
36(sbuf_rw_i@count): 35(ptr) Variable Uniform
37: TypePointer Uniform 23(int)
39: 23(int) Constant 1
40: 6(int) Constant 1
43(sbuf_rw_d@count): 35(ptr) Variable Uniform
45: 23(int) Constant 4294967295
62: TypePointer Input 6(int)
63(pos): 62(ptr) Variable Input
65: TypePointer Output 9(fvec4)
66(@entryPointOutput): 65(ptr) Variable Output
4(main): 2 Function None 3
5: Label
61(pos): 7(ptr) Variable Function
67(param): 7(ptr) Variable Function
64: 6(int) Load 63(pos)
Store 61(pos) 64
68: 6(int) Load 61(pos)
Store 67(param) 68
69: 9(fvec4) FunctionCall 12(@main(u1;) 67(param)
Store 66(@entryPointOutput) 69
Return
FunctionEnd
12(@main(u1;): 9(fvec4) Function None 10
11(pos): 7(ptr) FunctionParameter
13: Label
16(result): 15(ptr) Variable Function
33(c1): 7(ptr) Variable Function
42(c2): 7(ptr) Variable Function
Store 16(result) 18
32: 31(ptr) AccessChain 27(sbuf_rw_nocounter) 24 28
Store 32 30
38: 37(ptr) AccessChain 36(sbuf_rw_i@count) 24
41: 6(int) AtomicIAdd 38 40 17 39
Store 33(c1) 41
44: 37(ptr) AccessChain 43(sbuf_rw_d@count) 24
46: 6(int) AtomicIAdd 44 40 17 45
47: 6(int) IAdd 46 45
Store 42(c2) 47
48: 7(ptr) AccessChain 16(result) 17
49: 6(int) Load 48
50: 8(float) ConvertUToF 49
51: 7(ptr) AccessChain 16(result) 40
52: 6(int) Load 51
53: 8(float) ConvertUToF 52
54: 6(int) Load 33(c1)
55: 8(float) ConvertUToF 54
56: 6(int) Load 42(c2)
57: 8(float) ConvertUToF 56
58: 9(fvec4) CompositeConstruct 50 53 55 57
ReturnValue 58
FunctionEnd

View File

@ -0,0 +1,38 @@
nvShaderNoperspectiveInterpolation.frag
ERROR: 0:5: 'noperspective' : Reserved word.
ERROR: 0:5: 'noperspective' : not supported for this version or the enabled extensions
ERROR: 2 compilation errors. No code generated.
Shader version: 300
Requested GL_NV_shader_noperspective_interpolation
ERROR: node is still EOpNull!
0:13 Function Definition: main( ( global void)
0:13 Function Parameters:
0:14 Sequence
0:14 move second child to first child ( temp mediump 4-component vector of float)
0:14 'fragColor' ( out mediump 4-component vector of float)
0:14 'color' ( noperspective in mediump 4-component vector of float)
0:? Linker Objects
0:? 'bad' ( noperspective in mediump 4-component vector of float)
0:? 'color' ( noperspective in mediump 4-component vector of float)
0:? 'fragColor' ( out mediump 4-component vector of float)
Linked fragment stage:
Shader version: 300
Requested GL_NV_shader_noperspective_interpolation
ERROR: node is still EOpNull!
0:13 Function Definition: main( ( global void)
0:13 Function Parameters:
0:14 Sequence
0:14 move second child to first child ( temp mediump 4-component vector of float)
0:14 'fragColor' ( out mediump 4-component vector of float)
0:14 'color' ( noperspective in mediump 4-component vector of float)
0:? Linker Objects
0:? 'bad' ( noperspective in mediump 4-component vector of float)
0:? 'color' ( noperspective in mediump 4-component vector of float)
0:? 'fragColor' ( out mediump 4-component vector of float)

View File

@ -94,6 +94,7 @@ void main()
MemberDecorate 54(ubuf) 0 Offset 0 MemberDecorate 54(ubuf) 0 Offset 0
Decorate 54(ubuf) Block Decorate 54(ubuf) Block
Decorate 56 DescriptorSet 3 Decorate 56 DescriptorSet 3
Decorate 69(s2d) Location 0
Decorate 69(s2d) DescriptorSet 3 Decorate 69(s2d) DescriptorSet 3
3: TypeVoid 3: TypeVoid
4: TypeFunction 3 4: TypeFunction 3

View File

@ -97,6 +97,7 @@ void main()
Decorate 54(ubuf) Block Decorate 54(ubuf) Block
Decorate 56 DescriptorSet 3 Decorate 56 DescriptorSet 3
Decorate 56 Binding 0 Decorate 56 Binding 0
Decorate 69(s2d) Location 0
Decorate 69(s2d) DescriptorSet 3 Decorate 69(s2d) DescriptorSet 3
Decorate 69(s2d) Binding 1 Decorate 69(s2d) Binding 1
3: TypeVoid 3: TypeVoid

View File

@ -1,7 +1,7 @@
spv.int16.frag spv.int16.frag
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80006 // Generated by (magic number): 80006
// Id's are bound by 525 // Id's are bound by 523
Capability Shader Capability Shader
Capability Float16 Capability Float16
@ -55,48 +55,48 @@ spv.int16.frag
Name 220 "i" Name 220 "i"
Name 227 "uv" Name 227 "uv"
Name 243 "i64" Name 243 "i64"
Name 283 "b" Name 281 "b"
Name 345 "i16v" Name 343 "i16v"
Name 348 "i16" Name 346 "i16"
Name 358 "u16v" Name 356 "u16v"
Name 360 "u16" Name 358 "u16"
Name 430 "i32" Name 428 "i32"
Name 433 "i64" Name 431 "i64"
Name 436 "i16v4" Name 434 "i16v4"
Name 439 "u32" Name 437 "u32"
Name 440 "u16v2" Name 438 "u16v2"
Name 444 "u64" Name 442 "u64"
Name 447 "u16v4" Name 445 "u16v4"
Name 459 "bv" Name 457 "bv"
Name 520 "Block" Name 518 "Block"
MemberName 520(Block) 0 "i16" MemberName 518(Block) 0 "i16"
MemberName 520(Block) 1 "i16v2" MemberName 518(Block) 1 "i16v2"
MemberName 520(Block) 2 "i16v3" MemberName 518(Block) 2 "i16v3"
MemberName 520(Block) 3 "i16v4" MemberName 518(Block) 3 "i16v4"
MemberName 520(Block) 4 "u16" MemberName 518(Block) 4 "u16"
MemberName 520(Block) 5 "u16v2" MemberName 518(Block) 5 "u16v2"
MemberName 520(Block) 6 "u16v3" MemberName 518(Block) 6 "u16v3"
MemberName 520(Block) 7 "u16v4" MemberName 518(Block) 7 "u16v4"
Name 522 "block" Name 520 "block"
Name 523 "si16" Name 521 "si16"
Name 524 "su16" Name 522 "su16"
MemberDecorate 24(Uniforms) 0 Offset 0 MemberDecorate 24(Uniforms) 0 Offset 0
Decorate 24(Uniforms) Block Decorate 24(Uniforms) Block
Decorate 26 DescriptorSet 0 Decorate 26 DescriptorSet 0
Decorate 26 Binding 0 Decorate 26 Binding 0
MemberDecorate 520(Block) 0 Offset 0 MemberDecorate 518(Block) 0 Offset 0
MemberDecorate 520(Block) 1 Offset 4 MemberDecorate 518(Block) 1 Offset 4
MemberDecorate 520(Block) 2 Offset 8 MemberDecorate 518(Block) 2 Offset 8
MemberDecorate 520(Block) 3 Offset 16 MemberDecorate 518(Block) 3 Offset 16
MemberDecorate 520(Block) 4 Offset 24 MemberDecorate 518(Block) 4 Offset 24
MemberDecorate 520(Block) 5 Offset 28 MemberDecorate 518(Block) 5 Offset 28
MemberDecorate 520(Block) 6 Offset 32 MemberDecorate 518(Block) 6 Offset 32
MemberDecorate 520(Block) 7 Offset 40 MemberDecorate 518(Block) 7 Offset 40
Decorate 520(Block) Block Decorate 518(Block) Block
Decorate 522(block) DescriptorSet 0 Decorate 520(block) DescriptorSet 0
Decorate 522(block) Binding 1 Decorate 520(block) Binding 1
Decorate 523(si16) SpecId 100 Decorate 521(si16) SpecId 100
Decorate 524(su16) SpecId 101 Decorate 522(su16) SpecId 101
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
14: TypeInt 16 1 14: TypeInt 16 1
@ -171,28 +171,28 @@ spv.int16.frag
242: TypePointer Function 71(int) 242: TypePointer Function 71(int)
264: 17(int) Constant 1 264: 17(int) Constant 1
270: 17(int) Constant 2 270: 17(int) Constant 2
275: TypeVector 27(int) 3 276: TypeVector 27(int) 3
282: TypePointer Function 173(bool) 280: TypePointer Function 173(bool)
284: 17(int) Constant 0 282: 17(int) Constant 0
298: TypePointer Function 17(int) 296: TypePointer Function 17(int)
356: 52(ivec2) ConstantComposite 21 21 354: 52(ivec2) ConstantComposite 21 21
365: 193(ivec3) ConstantComposite 184 184 184 363: 193(ivec3) ConstantComposite 184 184 184
407: 173(bool) ConstantTrue 405: 173(bool) ConstantTrue
414: 173(bool) ConstantFalse 412: 173(bool) ConstantFalse
415: 174(bvec2) ConstantComposite 414 414 413: 174(bvec2) ConstantComposite 412 412
427: TypeVector 173(bool) 3 425: TypeVector 173(bool) 3
428: 427(bvec3) ConstantComposite 414 414 414 426: 425(bvec3) ConstantComposite 412 412 412
434: TypeVector 14(int) 4 432: TypeVector 14(int) 4
435: TypePointer Function 434(ivec4) 433: TypePointer Function 432(ivec4)
443: TypePointer Function 77(int) 441: TypePointer Function 77(int)
445: TypeVector 36(int) 4 443: TypeVector 36(int) 4
446: TypePointer Function 445(ivec4) 444: TypePointer Function 443(ivec4)
458: TypePointer Function 427(bvec3) 456: TypePointer Function 425(bvec3)
520(Block): TypeStruct 14(int) 52(ivec2) 197(ivec3) 434(ivec4) 36(int) 57(ivec2) 193(ivec3) 445(ivec4) 518(Block): TypeStruct 14(int) 52(ivec2) 197(ivec3) 432(ivec4) 36(int) 57(ivec2) 193(ivec3) 443(ivec4)
521: TypePointer Uniform 520(Block) 519: TypePointer Uniform 518(Block)
522(block): 521(ptr) Variable Uniform 520(block): 519(ptr) Variable Uniform
523(si16): 14(int) SpecConstant 4294967286 521(si16): 14(int) SpecConstant 4294967286
524(su16): 36(int) SpecConstant 20 522(su16): 36(int) SpecConstant 20
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
Return Return
@ -371,7 +371,7 @@ spv.int16.frag
220(i): 219(ptr) Variable Function 220(i): 219(ptr) Variable Function
227(uv): 226(ptr) Variable Function 227(uv): 226(ptr) Variable Function
243(i64): 242(ptr) Variable Function 243(i64): 242(ptr) Variable Function
283(b): 282(ptr) Variable Function 281(b): 280(ptr) Variable Function
196: 193(ivec3) Load 195(u16v) 196: 193(ivec3) Load 195(u16v)
198: 197(ivec3) CompositeConstruct 179 179 179 198: 197(ivec3) CompositeConstruct 179 179 179
199: 193(ivec3) IAdd 196 198 199: 193(ivec3) IAdd 196 198
@ -460,287 +460,285 @@ spv.int16.frag
273: 14(int) ShiftLeftLogical 269 272 273: 14(int) ShiftLeftLogical 269 272
Store 200(i16) 273 Store 200(i16) 273
274: 193(ivec3) Load 195(u16v) 274: 193(ivec3) Load 195(u16v)
276: 275(ivec3) UConvert 274 275: 27(int) Load 220(i)
277: 275(ivec3) Bitcast 276 277: 276(ivec3) CompositeConstruct 275 275 275
278: 27(int) Load 220(i) 278: 193(ivec3) ShiftLeftLogical 274 277
279: 275(ivec3) CompositeConstruct 278 278 278 279: 225(ivec3) UConvert 278
280: 275(ivec3) ShiftLeftLogical 277 279 Store 227(uv) 279
281: 225(ivec3) Bitcast 280 283: 37(ptr) AccessChain 195(u16v) 282
Store 227(uv) 281 284: 36(int) Load 283
285: 37(ptr) AccessChain 195(u16v) 284 285: 14(int) Load 200(i16)
286: 36(int) Load 285 286: 36(int) Bitcast 285
287: 14(int) Load 200(i16) 287: 173(bool) INotEqual 284 286
288: 36(int) Bitcast 287 Store 281(b) 287
289: 173(bool) INotEqual 286 288 288: 14(int) Load 200(i16)
Store 283(b) 289 289: 36(int) Bitcast 288
290: 14(int) Load 200(i16) 290: 37(ptr) AccessChain 195(u16v) 282
291: 36(int) Bitcast 290 291: 36(int) Load 290
292: 37(ptr) AccessChain 195(u16v) 284 292: 173(bool) IEqual 289 291
293: 36(int) Load 292 Store 281(b) 292
294: 173(bool) IEqual 291 293 293: 37(ptr) AccessChain 195(u16v) 282
Store 283(b) 294 294: 36(int) Load 293
295: 37(ptr) AccessChain 195(u16v) 284 295: 17(int) UConvert 294
296: 36(int) Load 295 297: 296(ptr) AccessChain 227(uv) 264
297: 17(int) UConvert 296 298: 17(int) Load 297
299: 298(ptr) AccessChain 227(uv) 264 299: 173(bool) UGreaterThan 295 298
300: 17(int) Load 299 Store 281(b) 299
301: 173(bool) UGreaterThan 297 300 300: 14(int) Load 200(i16)
Store 283(b) 301 301: 27(int) SConvert 300
302: 14(int) Load 200(i16) 302: 27(int) Load 220(i)
303: 27(int) SConvert 302 303: 173(bool) SLessThan 301 302
304: 27(int) Load 220(i) Store 281(b) 303
305: 173(bool) SLessThan 303 304 304: 37(ptr) AccessChain 195(u16v) 264
Store 283(b) 305 305: 36(int) Load 304
306: 37(ptr) AccessChain 195(u16v) 264 306: 17(int) UConvert 305
307: 36(int) Load 306 307: 296(ptr) AccessChain 227(uv) 282
308: 17(int) UConvert 307 308: 17(int) Load 307
309: 298(ptr) AccessChain 227(uv) 284 309: 173(bool) UGreaterThanEqual 306 308
310: 17(int) Load 309 Store 281(b) 309
311: 173(bool) UGreaterThanEqual 308 310 310: 14(int) Load 200(i16)
Store 283(b) 311 311: 27(int) SConvert 310
312: 14(int) Load 200(i16) 312: 27(int) Load 220(i)
313: 27(int) SConvert 312 313: 173(bool) SLessThanEqual 311 312
314: 27(int) Load 220(i) Store 281(b) 313
315: 173(bool) SLessThanEqual 313 314 314: 14(int) Load 200(i16)
Store 283(b) 315 315: 27(int) SConvert 314
316: 14(int) Load 200(i16) 316: 17(int) Bitcast 315
317: 27(int) SConvert 316 317: 225(ivec3) Load 227(uv)
318: 17(int) Bitcast 317 318: 225(ivec3) CompositeConstruct 316 316 316
319: 225(ivec3) Load 227(uv) 319: 225(ivec3) BitwiseOr 317 318
320: 225(ivec3) CompositeConstruct 318 318 318 Store 227(uv) 319
321: 225(ivec3) BitwiseOr 319 320 320: 14(int) Load 200(i16)
Store 227(uv) 321 321: 27(int) SConvert 320
322: 14(int) Load 200(i16) 322: 27(int) Load 220(i)
323: 27(int) SConvert 322 323: 27(int) BitwiseOr 321 322
324: 27(int) Load 220(i) Store 220(i) 323
325: 27(int) BitwiseOr 323 324 324: 14(int) Load 200(i16)
Store 220(i) 325 325: 71(int) SConvert 324
326: 14(int) Load 200(i16) 326: 71(int) Load 243(i64)
327: 71(int) SConvert 326 327: 71(int) BitwiseAnd 326 325
328: 71(int) Load 243(i64) Store 243(i64) 327
329: 71(int) BitwiseAnd 328 327 328: 193(ivec3) Load 195(u16v)
Store 243(i64) 329 329: 225(ivec3) UConvert 328
330: 193(ivec3) Load 195(u16v) 330: 225(ivec3) Load 227(uv)
331: 225(ivec3) UConvert 330 331: 225(ivec3) BitwiseAnd 329 330
332: 225(ivec3) Load 227(uv) Store 227(uv) 331
333: 225(ivec3) BitwiseAnd 331 332 332: 14(int) Load 200(i16)
Store 227(uv) 333 333: 27(int) SConvert 332
334: 14(int) Load 200(i16) 334: 17(int) Bitcast 333
335: 27(int) SConvert 334 335: 225(ivec3) Load 227(uv)
336: 17(int) Bitcast 335 336: 225(ivec3) CompositeConstruct 334 334 334
337: 225(ivec3) Load 227(uv) 337: 225(ivec3) BitwiseXor 335 336
338: 225(ivec3) CompositeConstruct 336 336 336 Store 227(uv) 337
339: 225(ivec3) BitwiseXor 337 338 338: 193(ivec3) Load 195(u16v)
Store 227(uv) 339 339: 14(int) Load 200(i16)
340: 193(ivec3) Load 195(u16v) 340: 36(int) Bitcast 339
341: 14(int) Load 200(i16) 341: 193(ivec3) CompositeConstruct 340 340 340
342: 36(int) Bitcast 341 342: 193(ivec3) BitwiseXor 338 341
343: 193(ivec3) CompositeConstruct 342 342 342 Store 195(u16v) 342
344: 193(ivec3) BitwiseXor 340 343
Store 195(u16v) 344
Return Return
FunctionEnd FunctionEnd
12(builtinFuncs(): 2 Function None 3 12(builtinFuncs(): 2 Function None 3
13: Label 13: Label
345(i16v): 53(ptr) Variable Function 343(i16v): 53(ptr) Variable Function
348(i16): 15(ptr) Variable Function 346(i16): 15(ptr) Variable Function
358(u16v): 194(ptr) Variable Function 356(u16v): 194(ptr) Variable Function
360(u16): 37(ptr) Variable Function 358(u16): 37(ptr) Variable Function
430(i32): 219(ptr) Variable Function 428(i32): 219(ptr) Variable Function
433(i64): 242(ptr) Variable Function 431(i64): 242(ptr) Variable Function
436(i16v4): 435(ptr) Variable Function 434(i16v4): 433(ptr) Variable Function
439(u32): 298(ptr) Variable Function 437(u32): 296(ptr) Variable Function
440(u16v2): 58(ptr) Variable Function 438(u16v2): 58(ptr) Variable Function
444(u64): 443(ptr) Variable Function 442(u64): 441(ptr) Variable Function
447(u16v4): 446(ptr) Variable Function 445(u16v4): 444(ptr) Variable Function
459(bv): 458(ptr) Variable Function 457(bv): 456(ptr) Variable Function
346: 52(ivec2) Load 345(i16v) 344: 52(ivec2) Load 343(i16v)
347: 52(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 346 345: 52(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 344
Store 345(i16v) 347 Store 343(i16v) 345
349: 14(int) Load 348(i16) 347: 14(int) Load 346(i16)
350: 14(int) ExtInst 1(GLSL.std.450) 7(SSign) 349 348: 14(int) ExtInst 1(GLSL.std.450) 7(SSign) 347
Store 348(i16) 350 Store 346(i16) 348
351: 52(ivec2) Load 345(i16v) 349: 52(ivec2) Load 343(i16v)
352: 14(int) Load 348(i16) 350: 14(int) Load 346(i16)
353: 52(ivec2) CompositeConstruct 352 352 351: 52(ivec2) CompositeConstruct 350 350
354: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 351 353 352: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 349 351
Store 345(i16v) 354 Store 343(i16v) 352
355: 52(ivec2) Load 345(i16v) 353: 52(ivec2) Load 343(i16v)
357: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 355 356 355: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 353 354
Store 345(i16v) 357 Store 343(i16v) 355
359: 193(ivec3) Load 358(u16v) 357: 193(ivec3) Load 356(u16v)
361: 36(int) Load 360(u16) 359: 36(int) Load 358(u16)
362: 193(ivec3) CompositeConstruct 361 361 361 360: 193(ivec3) CompositeConstruct 359 359 359
363: 193(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 359 362 361: 193(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 357 360
Store 358(u16v) 363 Store 356(u16v) 361
364: 193(ivec3) Load 358(u16v) 362: 193(ivec3) Load 356(u16v)
366: 193(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 364 365 364: 193(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 362 363
Store 358(u16v) 366 Store 356(u16v) 364
367: 52(ivec2) Load 345(i16v) 365: 52(ivec2) Load 343(i16v)
368: 14(int) Load 348(i16) 366: 14(int) Load 346(i16)
369: 52(ivec2) CompositeConstruct 368 368 367: 52(ivec2) CompositeConstruct 366 366
370: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 367 369 368: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 365 367
Store 345(i16v) 370 Store 343(i16v) 368
371: 52(ivec2) Load 345(i16v) 369: 52(ivec2) Load 343(i16v)
372: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 371 356 370: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 369 354
Store 345(i16v) 372 Store 343(i16v) 370
373: 193(ivec3) Load 358(u16v) 371: 193(ivec3) Load 356(u16v)
374: 36(int) Load 360(u16) 372: 36(int) Load 358(u16)
375: 193(ivec3) CompositeConstruct 374 374 374 373: 193(ivec3) CompositeConstruct 372 372 372
376: 193(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 373 375 374: 193(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 371 373
Store 358(u16v) 376 Store 356(u16v) 374
377: 193(ivec3) Load 358(u16v) 375: 193(ivec3) Load 356(u16v)
378: 193(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 377 365 376: 193(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 375 363
Store 358(u16v) 378 Store 356(u16v) 376
379: 52(ivec2) Load 345(i16v) 377: 52(ivec2) Load 343(i16v)
380: 14(int) Load 348(i16) 378: 14(int) Load 346(i16)
381: 14(int) SNegate 380 379: 14(int) SNegate 378
382: 14(int) Load 348(i16) 380: 14(int) Load 346(i16)
383: 52(ivec2) CompositeConstruct 381 381 381: 52(ivec2) CompositeConstruct 379 379
384: 52(ivec2) CompositeConstruct 382 382 382: 52(ivec2) CompositeConstruct 380 380
385: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 379 383 384 383: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 377 381 382
Store 345(i16v) 385 Store 343(i16v) 383
386: 52(ivec2) Load 345(i16v) 384: 52(ivec2) Load 343(i16v)
387: 52(ivec2) Load 345(i16v) 385: 52(ivec2) Load 343(i16v)
388: 52(ivec2) SNegate 387 386: 52(ivec2) SNegate 385
389: 52(ivec2) Load 345(i16v) 387: 52(ivec2) Load 343(i16v)
390: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 386 388 389 388: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 384 386 387
Store 345(i16v) 390 Store 343(i16v) 388
391: 193(ivec3) Load 358(u16v) 389: 193(ivec3) Load 356(u16v)
392: 36(int) Load 360(u16) 390: 36(int) Load 358(u16)
393: 36(int) SNegate 392 391: 36(int) SNegate 390
394: 36(int) Load 360(u16) 392: 36(int) Load 358(u16)
395: 193(ivec3) CompositeConstruct 393 393 393 393: 193(ivec3) CompositeConstruct 391 391 391
396: 193(ivec3) CompositeConstruct 394 394 394 394: 193(ivec3) CompositeConstruct 392 392 392
397: 193(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 391 395 396 395: 193(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 389 393 394
Store 358(u16v) 397 Store 356(u16v) 395
398: 193(ivec3) Load 358(u16v) 396: 193(ivec3) Load 356(u16v)
399: 193(ivec3) Load 358(u16v) 397: 193(ivec3) Load 356(u16v)
400: 193(ivec3) SNegate 399 398: 193(ivec3) SNegate 397
401: 193(ivec3) Load 358(u16v) 399: 193(ivec3) Load 356(u16v)
402: 193(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 398 400 401 400: 193(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 396 398 399
Store 358(u16v) 402 Store 356(u16v) 400
403: 15(ptr) AccessChain 345(i16v) 284 401: 15(ptr) AccessChain 343(i16v) 282
402: 14(int) Load 401
403: 15(ptr) AccessChain 343(i16v) 264
404: 14(int) Load 403 404: 14(int) Load 403
405: 15(ptr) AccessChain 345(i16v) 264 406: 14(int) Select 405 404 402
406: 14(int) Load 405 Store 346(i16) 406
408: 14(int) Select 407 406 404 407: 14(int) Load 346(i16)
Store 348(i16) 408 408: 52(ivec2) CompositeConstruct 407 407
409: 14(int) Load 348(i16) 409: 14(int) Load 346(i16)
410: 52(ivec2) CompositeConstruct 409 409 410: 14(int) SNegate 409
411: 14(int) Load 348(i16) 411: 52(ivec2) CompositeConstruct 410 410
412: 14(int) SNegate 411 414: 52(ivec2) Select 413 411 408
413: 52(ivec2) CompositeConstruct 412 412 Store 343(i16v) 414
416: 52(ivec2) Select 415 413 410 415: 37(ptr) AccessChain 356(u16v) 282
Store 345(i16v) 416 416: 36(int) Load 415
417: 37(ptr) AccessChain 358(u16v) 284 417: 37(ptr) AccessChain 356(u16v) 264
418: 36(int) Load 417 418: 36(int) Load 417
419: 37(ptr) AccessChain 358(u16v) 264 419: 36(int) Select 405 418 416
420: 36(int) Load 419 Store 358(u16) 419
421: 36(int) Select 407 420 418 420: 36(int) Load 358(u16)
Store 360(u16) 421 421: 193(ivec3) CompositeConstruct 420 420 420
422: 36(int) Load 360(u16) 422: 36(int) Load 358(u16)
423: 193(ivec3) CompositeConstruct 422 422 422 423: 36(int) SNegate 422
424: 36(int) Load 360(u16) 424: 193(ivec3) CompositeConstruct 423 423 423
425: 36(int) SNegate 424 427: 193(ivec3) Select 426 424 421
426: 193(ivec3) CompositeConstruct 425 425 425 Store 356(u16v) 427
429: 193(ivec3) Select 428 426 423 429: 52(ivec2) Load 343(i16v)
Store 358(u16v) 429 430: 27(int) Bitcast 429
431: 52(ivec2) Load 345(i16v) Store 428(i32) 430
432: 27(int) Bitcast 431 435: 432(ivec4) Load 434(i16v4)
Store 430(i32) 432 436: 71(int) Bitcast 435
437: 434(ivec4) Load 436(i16v4) Store 431(i64) 436
438: 71(int) Bitcast 437 439: 57(ivec2) Load 438(u16v2)
Store 433(i64) 438 440: 17(int) Bitcast 439
441: 57(ivec2) Load 440(u16v2) Store 437(u32) 440
442: 17(int) Bitcast 441 446: 443(ivec4) Load 445(u16v4)
Store 439(u32) 442 447: 77(int) Bitcast 446
448: 445(ivec4) Load 447(u16v4) Store 442(u64) 447
449: 77(int) Bitcast 448 448: 27(int) Load 428(i32)
Store 444(u64) 449 449: 52(ivec2) Bitcast 448
450: 27(int) Load 430(i32) Store 343(i16v) 449
451: 52(ivec2) Bitcast 450 450: 71(int) Load 431(i64)
Store 345(i16v) 451 451: 432(ivec4) Bitcast 450
452: 71(int) Load 433(i64) Store 434(i16v4) 451
453: 434(ivec4) Bitcast 452 452: 17(int) Load 437(u32)
Store 436(i16v4) 453 453: 57(ivec2) Bitcast 452
454: 17(int) Load 439(u32) Store 438(u16v2) 453
455: 57(ivec2) Bitcast 454 454: 77(int) Load 442(u64)
Store 440(u16v2) 455 455: 443(ivec4) Bitcast 454
456: 77(int) Load 444(u64) Store 445(u16v4) 455
457: 445(ivec4) Bitcast 456 458: 193(ivec3) Load 356(u16v)
Store 447(u16v4) 457 459: 36(int) Load 358(u16)
460: 193(ivec3) Load 358(u16v) 460: 193(ivec3) CompositeConstruct 459 459 459
461: 36(int) Load 360(u16) 461: 425(bvec3) ULessThan 458 460
462: 193(ivec3) CompositeConstruct 461 461 461 Store 457(bv) 461
463: 427(bvec3) ULessThan 460 462 462: 52(ivec2) Load 343(i16v)
Store 459(bv) 463 463: 14(int) Load 346(i16)
464: 52(ivec2) Load 345(i16v) 464: 52(ivec2) CompositeConstruct 463 463
465: 14(int) Load 348(i16) 465: 174(bvec2) SLessThan 462 464
466: 52(ivec2) CompositeConstruct 465 465 466: 425(bvec3) Load 457(bv)
467: 174(bvec2) SLessThan 464 466 467: 425(bvec3) VectorShuffle 466 465 3 4 2
468: 427(bvec3) Load 459(bv) Store 457(bv) 467
469: 427(bvec3) VectorShuffle 468 467 3 4 2 468: 193(ivec3) Load 356(u16v)
Store 459(bv) 469 469: 36(int) Load 358(u16)
470: 193(ivec3) Load 358(u16v) 470: 193(ivec3) CompositeConstruct 469 469 469
471: 36(int) Load 360(u16) 471: 425(bvec3) ULessThanEqual 468 470
472: 193(ivec3) CompositeConstruct 471 471 471 Store 457(bv) 471
473: 427(bvec3) ULessThanEqual 470 472 472: 52(ivec2) Load 343(i16v)
Store 459(bv) 473 473: 14(int) Load 346(i16)
474: 52(ivec2) Load 345(i16v) 474: 52(ivec2) CompositeConstruct 473 473
475: 14(int) Load 348(i16) 475: 174(bvec2) SLessThanEqual 472 474
476: 52(ivec2) CompositeConstruct 475 475 476: 425(bvec3) Load 457(bv)
477: 174(bvec2) SLessThanEqual 474 476 477: 425(bvec3) VectorShuffle 476 475 3 4 2
478: 427(bvec3) Load 459(bv) Store 457(bv) 477
479: 427(bvec3) VectorShuffle 478 477 3 4 2 478: 193(ivec3) Load 356(u16v)
Store 459(bv) 479 479: 36(int) Load 358(u16)
480: 193(ivec3) Load 358(u16v) 480: 193(ivec3) CompositeConstruct 479 479 479
481: 36(int) Load 360(u16) 481: 425(bvec3) UGreaterThan 478 480
482: 193(ivec3) CompositeConstruct 481 481 481 Store 457(bv) 481
483: 427(bvec3) UGreaterThan 480 482 482: 52(ivec2) Load 343(i16v)
Store 459(bv) 483 483: 14(int) Load 346(i16)
484: 52(ivec2) Load 345(i16v) 484: 52(ivec2) CompositeConstruct 483 483
485: 14(int) Load 348(i16) 485: 174(bvec2) SGreaterThan 482 484
486: 52(ivec2) CompositeConstruct 485 485 486: 425(bvec3) Load 457(bv)
487: 174(bvec2) SGreaterThan 484 486 487: 425(bvec3) VectorShuffle 486 485 3 4 2
488: 427(bvec3) Load 459(bv) Store 457(bv) 487
489: 427(bvec3) VectorShuffle 488 487 3 4 2 488: 193(ivec3) Load 356(u16v)
Store 459(bv) 489 489: 36(int) Load 358(u16)
490: 193(ivec3) Load 358(u16v) 490: 193(ivec3) CompositeConstruct 489 489 489
491: 36(int) Load 360(u16) 491: 425(bvec3) UGreaterThanEqual 488 490
492: 193(ivec3) CompositeConstruct 491 491 491 Store 457(bv) 491
493: 427(bvec3) UGreaterThanEqual 490 492 492: 52(ivec2) Load 343(i16v)
Store 459(bv) 493 493: 14(int) Load 346(i16)
494: 52(ivec2) Load 345(i16v) 494: 52(ivec2) CompositeConstruct 493 493
495: 14(int) Load 348(i16) 495: 174(bvec2) SGreaterThanEqual 492 494
496: 52(ivec2) CompositeConstruct 495 495 496: 425(bvec3) Load 457(bv)
497: 174(bvec2) SGreaterThanEqual 494 496 497: 425(bvec3) VectorShuffle 496 495 3 4 2
498: 427(bvec3) Load 459(bv) Store 457(bv) 497
499: 427(bvec3) VectorShuffle 498 497 3 4 2 498: 193(ivec3) Load 356(u16v)
Store 459(bv) 499 499: 36(int) Load 358(u16)
500: 193(ivec3) Load 358(u16v) 500: 193(ivec3) CompositeConstruct 499 499 499
501: 36(int) Load 360(u16) 501: 425(bvec3) IEqual 498 500
502: 193(ivec3) CompositeConstruct 501 501 501 Store 457(bv) 501
503: 427(bvec3) IEqual 500 502 502: 52(ivec2) Load 343(i16v)
Store 459(bv) 503 503: 14(int) Load 346(i16)
504: 52(ivec2) Load 345(i16v) 504: 52(ivec2) CompositeConstruct 503 503
505: 14(int) Load 348(i16) 505: 174(bvec2) IEqual 502 504
506: 52(ivec2) CompositeConstruct 505 505 506: 425(bvec3) Load 457(bv)
507: 174(bvec2) IEqual 504 506 507: 425(bvec3) VectorShuffle 506 505 3 4 2
508: 427(bvec3) Load 459(bv) Store 457(bv) 507
509: 427(bvec3) VectorShuffle 508 507 3 4 2 508: 193(ivec3) Load 356(u16v)
Store 459(bv) 509 509: 36(int) Load 358(u16)
510: 193(ivec3) Load 358(u16v) 510: 193(ivec3) CompositeConstruct 509 509 509
511: 36(int) Load 360(u16) 511: 425(bvec3) INotEqual 508 510
512: 193(ivec3) CompositeConstruct 511 511 511 Store 457(bv) 511
513: 427(bvec3) INotEqual 510 512 512: 52(ivec2) Load 343(i16v)
Store 459(bv) 513 513: 14(int) Load 346(i16)
514: 52(ivec2) Load 345(i16v) 514: 52(ivec2) CompositeConstruct 513 513
515: 14(int) Load 348(i16) 515: 174(bvec2) INotEqual 512 514
516: 52(ivec2) CompositeConstruct 515 515 516: 425(bvec3) Load 457(bv)
517: 174(bvec2) INotEqual 514 516 517: 425(bvec3) VectorShuffle 516 515 3 4 2
518: 427(bvec3) Load 459(bv) Store 457(bv) 517
519: 427(bvec3) VectorShuffle 518 517 3 4 2
Store 459(bv) 519
Return Return
FunctionEnd FunctionEnd

View File

@ -1,7 +1,7 @@
spv.int32.frag spv.int32.frag
// Module Version 10300 // Module Version 10300
// Generated by (magic number): 80006 // Generated by (magic number): 80006
// Id's are bound by 495 // Id's are bound by 493
Capability Shader Capability Shader
Capability Float16 Capability Float16
@ -52,54 +52,54 @@ spv.int32.frag
Name 210 "i" Name 210 "i"
Name 214 "uv" Name 214 "uv"
Name 227 "i64" Name 227 "i64"
Name 262 "b" Name 260 "b"
Name 314 "i32v" Name 312 "i32v"
Name 317 "i32" Name 315 "i32"
Name 327 "u32v" Name 325 "u32v"
Name 329 "u32" Name 327 "u32"
Name 401 "i8v4" Name 399 "i8v4"
Name 404 "i16v2" Name 402 "i16v2"
Name 409 "u8v4" Name 407 "u8v4"
Name 412 "u16v2" Name 410 "u16v2"
Name 415 "i64" Name 413 "i64"
Name 418 "u32v2" Name 416 "u32v2"
Name 420 "u64" Name 418 "u64"
Name 424 "bv" Name 422 "bv"
Name 487 "Block" Name 485 "Block"
MemberName 487(Block) 0 "i32" MemberName 485(Block) 0 "i32"
MemberName 487(Block) 1 "i32v2" MemberName 485(Block) 1 "i32v2"
MemberName 487(Block) 2 "i32v3" MemberName 485(Block) 2 "i32v3"
MemberName 487(Block) 3 "i32v4" MemberName 485(Block) 3 "i32v4"
MemberName 487(Block) 4 "u32" MemberName 485(Block) 4 "u32"
MemberName 487(Block) 5 "u32v2" MemberName 485(Block) 5 "u32v2"
MemberName 487(Block) 6 "u32v3" MemberName 485(Block) 6 "u32v3"
MemberName 487(Block) 7 "u32v4" MemberName 485(Block) 7 "u32v4"
Name 489 "block" Name 487 "block"
Name 490 "si32" Name 488 "si32"
Name 491 "su32" Name 489 "su32"
Name 492 "si" Name 490 "si"
Name 493 "su" Name 491 "su"
Name 494 "sb" Name 492 "sb"
MemberDecorate 27(Uniforms) 0 Offset 0 MemberDecorate 27(Uniforms) 0 Offset 0
Decorate 27(Uniforms) Block Decorate 27(Uniforms) Block
Decorate 29 DescriptorSet 0 Decorate 29 DescriptorSet 0
Decorate 29 Binding 0 Decorate 29 Binding 0
MemberDecorate 487(Block) 0 Offset 0 MemberDecorate 485(Block) 0 Offset 0
MemberDecorate 487(Block) 1 Offset 8 MemberDecorate 485(Block) 1 Offset 8
MemberDecorate 487(Block) 2 Offset 16 MemberDecorate 485(Block) 2 Offset 16
MemberDecorate 487(Block) 3 Offset 32 MemberDecorate 485(Block) 3 Offset 32
MemberDecorate 487(Block) 4 Offset 48 MemberDecorate 485(Block) 4 Offset 48
MemberDecorate 487(Block) 5 Offset 56 MemberDecorate 485(Block) 5 Offset 56
MemberDecorate 487(Block) 6 Offset 64 MemberDecorate 485(Block) 6 Offset 64
MemberDecorate 487(Block) 7 Offset 80 MemberDecorate 485(Block) 7 Offset 80
Decorate 487(Block) Block Decorate 485(Block) Block
Decorate 489(block) DescriptorSet 0 Decorate 487(block) DescriptorSet 0
Decorate 489(block) Binding 1 Decorate 487(block) Binding 1
Decorate 490(si32) SpecId 100 Decorate 488(si32) SpecId 100
Decorate 491(su32) SpecId 101 Decorate 489(su32) SpecId 101
Decorate 492(si) SpecId 102 Decorate 490(si) SpecId 102
Decorate 493(su) SpecId 103 Decorate 491(su) SpecId 103
Decorate 494(sb) SpecId 104 Decorate 492(sb) SpecId 104
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
14: TypeInt 32 0 14: TypeInt 32 0
@ -171,30 +171,30 @@ spv.int32.frag
188: TypeVector 18(int) 3 188: TypeVector 18(int) 3
226: TypePointer Function 57(int) 226: TypePointer Function 57(int)
251: 14(int) Constant 2 251: 14(int) Constant 2
261: TypePointer Function 165(bool) 259: TypePointer Function 165(bool)
325: 52(ivec2) ConstantComposite 24 24 323: 52(ivec2) ConstantComposite 24 24
334: 184(ivec3) ConstantComposite 175 175 175 332: 184(ivec3) ConstantComposite 175 175 175
376: 165(bool) ConstantTrue 374: 165(bool) ConstantTrue
383: 165(bool) ConstantFalse 381: 165(bool) ConstantFalse
384: 166(bvec2) ConstantComposite 383 383 382: 166(bvec2) ConstantComposite 381 381
396: TypeVector 165(bool) 3 394: TypeVector 165(bool) 3
397: 396(bvec3) ConstantComposite 383 383 383 395: 394(bvec3) ConstantComposite 381 381 381
399: TypeVector 91(int) 4 397: TypeVector 91(int) 4
400: TypePointer Function 399(ivec4) 398: TypePointer Function 397(ivec4)
407: TypeVector 120(int) 4 405: TypeVector 120(int) 4
408: TypePointer Function 407(ivec4) 406: TypePointer Function 405(ivec4)
419: TypePointer Function 63(int) 417: TypePointer Function 63(int)
423: TypePointer Function 396(bvec3) 421: TypePointer Function 394(bvec3)
485: TypeVector 18(int) 4 483: TypeVector 18(int) 4
486: TypeVector 14(int) 4 484: TypeVector 14(int) 4
487(Block): TypeStruct 18(int) 52(ivec2) 188(ivec3) 485(ivec4) 14(int) 49(ivec2) 184(ivec3) 486(ivec4) 485(Block): TypeStruct 18(int) 52(ivec2) 188(ivec3) 483(ivec4) 14(int) 49(ivec2) 184(ivec3) 484(ivec4)
488: TypePointer Uniform 487(Block) 486: TypePointer Uniform 485(Block)
489(block): 488(ptr) Variable Uniform 487(block): 486(ptr) Variable Uniform
490(si32): 18(int) SpecConstant 4294967286 488(si32): 18(int) SpecConstant 4294967286
491(su32): 14(int) SpecConstant 20 489(su32): 14(int) SpecConstant 20
492(si): 18(int) SpecConstant 4294967291 490(si): 18(int) SpecConstant 4294967291
493(su): 14(int) SpecConstant 4 491(su): 14(int) SpecConstant 4
494(sb): 165(bool) SpecConstantTrue 492(sb): 165(bool) SpecConstantTrue
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
Store 16(u32Max) 17 Store 16(u32Max) 17
@ -360,7 +360,7 @@ spv.int32.frag
210(i): 19(ptr) Variable Function 210(i): 19(ptr) Variable Function
214(uv): 185(ptr) Variable Function 214(uv): 185(ptr) Variable Function
227(i64): 226(ptr) Variable Function 227(i64): 226(ptr) Variable Function
262(b): 261(ptr) Variable Function 260(b): 259(ptr) Variable Function
187: 184(ivec3) Load 186(u32v) 187: 184(ivec3) Load 186(u32v)
189: 188(ivec3) CompositeConstruct 170 170 170 189: 188(ivec3) CompositeConstruct 170 170 170
190: 184(ivec3) IAdd 187 189 190: 184(ivec3) IAdd 187 189
@ -440,275 +440,273 @@ spv.int32.frag
250: 57(int) Load 227(i64) 250: 57(int) Load 227(i64)
252: 38(ptr) AccessChain 186(u32v) 251 252: 38(ptr) AccessChain 186(u32v) 251
253: 14(int) Load 252 253: 14(int) Load 252
254: 57(int) UConvert 253 254: 57(int) ShiftLeftLogical 250 253
255: 57(int) Bitcast 254 Store 227(i64) 254
256: 57(int) ShiftLeftLogical 250 255 255: 184(ivec3) Load 186(u32v)
Store 227(i64) 256 256: 18(int) Load 210(i)
257: 184(ivec3) Load 186(u32v) 257: 188(ivec3) CompositeConstruct 256 256 256
258: 18(int) Load 210(i) 258: 184(ivec3) ShiftLeftLogical 255 257
259: 188(ivec3) CompositeConstruct 258 258 258 Store 214(uv) 258
260: 184(ivec3) ShiftLeftLogical 257 259 261: 38(ptr) AccessChain 186(u32v) 175
Store 214(uv) 260 262: 14(int) Load 261
263: 38(ptr) AccessChain 186(u32v) 175 263: 18(int) Load 191(i32)
264: 14(int) Load 263 264: 14(int) Bitcast 263
265: 18(int) Load 191(i32) 265: 165(bool) INotEqual 262 264
266: 14(int) Bitcast 265 Store 260(b) 265
267: 165(bool) INotEqual 264 266 266: 18(int) Load 191(i32)
Store 262(b) 267 267: 14(int) Bitcast 266
268: 18(int) Load 191(i32) 268: 38(ptr) AccessChain 186(u32v) 175
269: 14(int) Bitcast 268 269: 14(int) Load 268
270: 38(ptr) AccessChain 186(u32v) 175 270: 165(bool) IEqual 267 269
271: 14(int) Load 270 Store 260(b) 270
272: 165(bool) IEqual 269 271 271: 38(ptr) AccessChain 186(u32v) 175
Store 262(b) 272 272: 14(int) Load 271
273: 38(ptr) AccessChain 186(u32v) 175 273: 38(ptr) AccessChain 214(uv) 176
274: 14(int) Load 273 274: 14(int) Load 273
275: 38(ptr) AccessChain 214(uv) 176 275: 165(bool) UGreaterThan 272 274
276: 14(int) Load 275 Store 260(b) 275
277: 165(bool) UGreaterThan 274 276 276: 18(int) Load 191(i32)
Store 262(b) 277 277: 18(int) Load 210(i)
278: 18(int) Load 191(i32) 278: 165(bool) SLessThan 276 277
279: 18(int) Load 210(i) Store 260(b) 278
280: 165(bool) SLessThan 278 279 279: 38(ptr) AccessChain 186(u32v) 176
Store 262(b) 280 280: 14(int) Load 279
281: 38(ptr) AccessChain 186(u32v) 176 281: 38(ptr) AccessChain 214(uv) 175
282: 14(int) Load 281 282: 14(int) Load 281
283: 38(ptr) AccessChain 214(uv) 175 283: 165(bool) UGreaterThanEqual 280 282
284: 14(int) Load 283 Store 260(b) 283
285: 165(bool) UGreaterThanEqual 282 284 284: 18(int) Load 191(i32)
Store 262(b) 285 285: 18(int) Load 210(i)
286: 18(int) Load 191(i32) 286: 165(bool) SLessThanEqual 284 285
287: 18(int) Load 210(i) Store 260(b) 286
288: 165(bool) SLessThanEqual 286 287 287: 18(int) Load 191(i32)
Store 262(b) 288 288: 14(int) Bitcast 287
289: 18(int) Load 191(i32) 289: 184(ivec3) Load 214(uv)
290: 14(int) Bitcast 289 290: 184(ivec3) CompositeConstruct 288 288 288
291: 184(ivec3) Load 214(uv) 291: 184(ivec3) BitwiseOr 289 290
292: 184(ivec3) CompositeConstruct 290 290 290 Store 214(uv) 291
293: 184(ivec3) BitwiseOr 291 292 292: 18(int) Load 191(i32)
Store 214(uv) 293 293: 18(int) Load 210(i)
294: 18(int) Load 191(i32) 294: 18(int) BitwiseOr 292 293
295: 18(int) Load 210(i) Store 210(i) 294
296: 18(int) BitwiseOr 294 295 295: 18(int) Load 191(i32)
Store 210(i) 296 296: 57(int) SConvert 295
297: 18(int) Load 191(i32) 297: 57(int) Load 227(i64)
298: 57(int) SConvert 297 298: 57(int) BitwiseAnd 297 296
299: 57(int) Load 227(i64) Store 227(i64) 298
300: 57(int) BitwiseAnd 299 298 299: 184(ivec3) Load 186(u32v)
Store 227(i64) 300 300: 184(ivec3) Load 214(uv)
301: 184(ivec3) Load 186(u32v) 301: 184(ivec3) BitwiseAnd 299 300
302: 184(ivec3) Load 214(uv) Store 214(uv) 301
303: 184(ivec3) BitwiseAnd 301 302 302: 18(int) Load 191(i32)
Store 214(uv) 303 303: 14(int) Bitcast 302
304: 18(int) Load 191(i32) 304: 184(ivec3) Load 214(uv)
305: 14(int) Bitcast 304 305: 184(ivec3) CompositeConstruct 303 303 303
306: 184(ivec3) Load 214(uv) 306: 184(ivec3) BitwiseXor 304 305
307: 184(ivec3) CompositeConstruct 305 305 305 Store 214(uv) 306
308: 184(ivec3) BitwiseXor 306 307 307: 184(ivec3) Load 186(u32v)
Store 214(uv) 308 308: 18(int) Load 191(i32)
309: 184(ivec3) Load 186(u32v) 309: 14(int) Bitcast 308
310: 18(int) Load 191(i32) 310: 184(ivec3) CompositeConstruct 309 309 309
311: 14(int) Bitcast 310 311: 184(ivec3) BitwiseXor 307 310
312: 184(ivec3) CompositeConstruct 311 311 311 Store 186(u32v) 311
313: 184(ivec3) BitwiseXor 309 312
Store 186(u32v) 313
Return Return
FunctionEnd FunctionEnd
12(builtinFuncs(): 2 Function None 3 12(builtinFuncs(): 2 Function None 3
13: Label 13: Label
314(i32v): 53(ptr) Variable Function 312(i32v): 53(ptr) Variable Function
317(i32): 19(ptr) Variable Function 315(i32): 19(ptr) Variable Function
327(u32v): 185(ptr) Variable Function 325(u32v): 185(ptr) Variable Function
329(u32): 38(ptr) Variable Function 327(u32): 38(ptr) Variable Function
401(i8v4): 400(ptr) Variable Function 399(i8v4): 398(ptr) Variable Function
404(i16v2): 102(ptr) Variable Function 402(i16v2): 102(ptr) Variable Function
409(u8v4): 408(ptr) Variable Function 407(u8v4): 406(ptr) Variable Function
412(u16v2): 131(ptr) Variable Function 410(u16v2): 131(ptr) Variable Function
415(i64): 226(ptr) Variable Function 413(i64): 226(ptr) Variable Function
418(u32v2): 50(ptr) Variable Function 416(u32v2): 50(ptr) Variable Function
420(u64): 419(ptr) Variable Function 418(u64): 417(ptr) Variable Function
424(bv): 423(ptr) Variable Function 422(bv): 421(ptr) Variable Function
315: 52(ivec2) Load 314(i32v) 313: 52(ivec2) Load 312(i32v)
316: 52(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 315 314: 52(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 313
Store 314(i32v) 316 Store 312(i32v) 314
318: 18(int) Load 317(i32) 316: 18(int) Load 315(i32)
319: 18(int) ExtInst 1(GLSL.std.450) 7(SSign) 318 317: 18(int) ExtInst 1(GLSL.std.450) 7(SSign) 316
Store 317(i32) 319 Store 315(i32) 317
320: 52(ivec2) Load 314(i32v) 318: 52(ivec2) Load 312(i32v)
321: 18(int) Load 317(i32) 319: 18(int) Load 315(i32)
322: 52(ivec2) CompositeConstruct 321 321 320: 52(ivec2) CompositeConstruct 319 319
323: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 320 322 321: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 318 320
Store 314(i32v) 323 Store 312(i32v) 321
324: 52(ivec2) Load 314(i32v) 322: 52(ivec2) Load 312(i32v)
326: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 324 325 324: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 322 323
Store 314(i32v) 326 Store 312(i32v) 324
328: 184(ivec3) Load 327(u32v) 326: 184(ivec3) Load 325(u32v)
330: 14(int) Load 329(u32) 328: 14(int) Load 327(u32)
331: 184(ivec3) CompositeConstruct 330 330 330 329: 184(ivec3) CompositeConstruct 328 328 328
332: 184(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 328 331 330: 184(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 326 329
Store 327(u32v) 332 Store 325(u32v) 330
333: 184(ivec3) Load 327(u32v) 331: 184(ivec3) Load 325(u32v)
335: 184(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 333 334 333: 184(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 331 332
Store 327(u32v) 335 Store 325(u32v) 333
336: 52(ivec2) Load 314(i32v) 334: 52(ivec2) Load 312(i32v)
337: 18(int) Load 317(i32) 335: 18(int) Load 315(i32)
338: 52(ivec2) CompositeConstruct 337 337 336: 52(ivec2) CompositeConstruct 335 335
339: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 336 338 337: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 334 336
Store 314(i32v) 339 Store 312(i32v) 337
340: 52(ivec2) Load 314(i32v) 338: 52(ivec2) Load 312(i32v)
341: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 340 325 339: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 338 323
Store 314(i32v) 341 Store 312(i32v) 339
342: 184(ivec3) Load 327(u32v) 340: 184(ivec3) Load 325(u32v)
343: 14(int) Load 329(u32) 341: 14(int) Load 327(u32)
344: 184(ivec3) CompositeConstruct 343 343 343 342: 184(ivec3) CompositeConstruct 341 341 341
345: 184(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 342 344 343: 184(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 340 342
Store 327(u32v) 345 Store 325(u32v) 343
346: 184(ivec3) Load 327(u32v) 344: 184(ivec3) Load 325(u32v)
347: 184(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 346 334 345: 184(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 344 332
Store 327(u32v) 347 Store 325(u32v) 345
348: 52(ivec2) Load 314(i32v) 346: 52(ivec2) Load 312(i32v)
349: 18(int) Load 317(i32) 347: 18(int) Load 315(i32)
350: 18(int) SNegate 349 348: 18(int) SNegate 347
351: 18(int) Load 317(i32) 349: 18(int) Load 315(i32)
352: 52(ivec2) CompositeConstruct 350 350 350: 52(ivec2) CompositeConstruct 348 348
353: 52(ivec2) CompositeConstruct 351 351 351: 52(ivec2) CompositeConstruct 349 349
354: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 348 352 353 352: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 346 350 351
Store 314(i32v) 354 Store 312(i32v) 352
355: 52(ivec2) Load 314(i32v) 353: 52(ivec2) Load 312(i32v)
356: 52(ivec2) Load 314(i32v) 354: 52(ivec2) Load 312(i32v)
357: 52(ivec2) SNegate 356 355: 52(ivec2) SNegate 354
358: 52(ivec2) Load 314(i32v) 356: 52(ivec2) Load 312(i32v)
359: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 355 357 358 357: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 353 355 356
Store 314(i32v) 359 Store 312(i32v) 357
360: 184(ivec3) Load 327(u32v) 358: 184(ivec3) Load 325(u32v)
361: 14(int) Load 329(u32) 359: 14(int) Load 327(u32)
362: 14(int) SNegate 361 360: 14(int) SNegate 359
363: 14(int) Load 329(u32) 361: 14(int) Load 327(u32)
364: 184(ivec3) CompositeConstruct 362 362 362 362: 184(ivec3) CompositeConstruct 360 360 360
365: 184(ivec3) CompositeConstruct 363 363 363 363: 184(ivec3) CompositeConstruct 361 361 361
366: 184(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 360 364 365 364: 184(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 358 362 363
Store 327(u32v) 366 Store 325(u32v) 364
367: 184(ivec3) Load 327(u32v) 365: 184(ivec3) Load 325(u32v)
368: 184(ivec3) Load 327(u32v) 366: 184(ivec3) Load 325(u32v)
369: 184(ivec3) SNegate 368 367: 184(ivec3) SNegate 366
370: 184(ivec3) Load 327(u32v) 368: 184(ivec3) Load 325(u32v)
371: 184(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 367 369 370 369: 184(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 365 367 368
Store 327(u32v) 371 Store 325(u32v) 369
372: 19(ptr) AccessChain 314(i32v) 175 370: 19(ptr) AccessChain 312(i32v) 175
371: 18(int) Load 370
372: 19(ptr) AccessChain 312(i32v) 176
373: 18(int) Load 372 373: 18(int) Load 372
374: 19(ptr) AccessChain 314(i32v) 176 375: 18(int) Select 374 373 371
375: 18(int) Load 374 Store 315(i32) 375
377: 18(int) Select 376 375 373 376: 18(int) Load 315(i32)
Store 317(i32) 377 377: 52(ivec2) CompositeConstruct 376 376
378: 18(int) Load 317(i32) 378: 18(int) Load 315(i32)
379: 52(ivec2) CompositeConstruct 378 378 379: 18(int) SNegate 378
380: 18(int) Load 317(i32) 380: 52(ivec2) CompositeConstruct 379 379
381: 18(int) SNegate 380 383: 52(ivec2) Select 382 380 377
382: 52(ivec2) CompositeConstruct 381 381 Store 312(i32v) 383
385: 52(ivec2) Select 384 382 379 384: 38(ptr) AccessChain 325(u32v) 175
Store 314(i32v) 385 385: 14(int) Load 384
386: 38(ptr) AccessChain 327(u32v) 175 386: 38(ptr) AccessChain 325(u32v) 176
387: 14(int) Load 386 387: 14(int) Load 386
388: 38(ptr) AccessChain 327(u32v) 176 388: 14(int) Select 374 387 385
389: 14(int) Load 388 Store 327(u32) 388
390: 14(int) Select 376 389 387 389: 14(int) Load 327(u32)
Store 329(u32) 390 390: 184(ivec3) CompositeConstruct 389 389 389
391: 14(int) Load 329(u32) 391: 14(int) Load 327(u32)
392: 184(ivec3) CompositeConstruct 391 391 391 392: 14(int) SNegate 391
393: 14(int) Load 329(u32) 393: 184(ivec3) CompositeConstruct 392 392 392
394: 14(int) SNegate 393 396: 184(ivec3) Select 395 393 390
395: 184(ivec3) CompositeConstruct 394 394 394 Store 325(u32v) 396
398: 184(ivec3) Select 397 395 392 400: 397(ivec4) Load 399(i8v4)
Store 327(u32v) 398 401: 18(int) Bitcast 400
402: 399(ivec4) Load 401(i8v4) Store 315(i32) 401
403: 18(int) Bitcast 402 403: 101(ivec2) Load 402(i16v2)
Store 317(i32) 403 404: 18(int) Bitcast 403
405: 101(ivec2) Load 404(i16v2) Store 315(i32) 404
406: 18(int) Bitcast 405 408: 405(ivec4) Load 407(u8v4)
Store 317(i32) 406 409: 14(int) Bitcast 408
410: 407(ivec4) Load 409(u8v4) Store 327(u32) 409
411: 14(int) Bitcast 410 411: 130(ivec2) Load 410(u16v2)
Store 329(u32) 411 412: 14(int) Bitcast 411
413: 130(ivec2) Load 412(u16v2) Store 327(u32) 412
414: 14(int) Bitcast 413 414: 57(int) Load 413(i64)
Store 329(u32) 414 415: 52(ivec2) Bitcast 414
416: 57(int) Load 415(i64) Store 312(i32v) 415
417: 52(ivec2) Bitcast 416 419: 63(int) Load 418(u64)
Store 314(i32v) 417 420: 49(ivec2) Bitcast 419
421: 63(int) Load 420(u64) Store 416(u32v2) 420
422: 49(ivec2) Bitcast 421 423: 184(ivec3) Load 325(u32v)
Store 418(u32v2) 422 424: 14(int) Load 327(u32)
425: 184(ivec3) Load 327(u32v) 425: 184(ivec3) CompositeConstruct 424 424 424
426: 14(int) Load 329(u32) 426: 394(bvec3) ULessThan 423 425
427: 184(ivec3) CompositeConstruct 426 426 426 Store 422(bv) 426
428: 396(bvec3) ULessThan 425 427 427: 52(ivec2) Load 312(i32v)
Store 424(bv) 428 428: 18(int) Load 315(i32)
429: 52(ivec2) Load 314(i32v) 429: 52(ivec2) CompositeConstruct 428 428
430: 18(int) Load 317(i32) 430: 166(bvec2) SLessThan 427 429
431: 52(ivec2) CompositeConstruct 430 430 431: 394(bvec3) Load 422(bv)
432: 166(bvec2) SLessThan 429 431 432: 394(bvec3) VectorShuffle 431 430 3 4 2
433: 396(bvec3) Load 424(bv) Store 422(bv) 432
434: 396(bvec3) VectorShuffle 433 432 3 4 2 433: 184(ivec3) Load 325(u32v)
Store 424(bv) 434 434: 14(int) Load 327(u32)
435: 184(ivec3) Load 327(u32v) 435: 184(ivec3) CompositeConstruct 434 434 434
436: 14(int) Load 329(u32) 436: 394(bvec3) ULessThanEqual 433 435
437: 184(ivec3) CompositeConstruct 436 436 436 Store 422(bv) 436
438: 396(bvec3) ULessThanEqual 435 437 437: 52(ivec2) Load 312(i32v)
Store 424(bv) 438 438: 18(int) Load 315(i32)
439: 52(ivec2) Load 314(i32v) 439: 52(ivec2) CompositeConstruct 438 438
440: 18(int) Load 317(i32) 440: 166(bvec2) SLessThanEqual 437 439
441: 52(ivec2) CompositeConstruct 440 440 441: 394(bvec3) Load 422(bv)
442: 166(bvec2) SLessThanEqual 439 441 442: 394(bvec3) VectorShuffle 441 440 3 4 2
443: 396(bvec3) Load 424(bv) Store 422(bv) 442
444: 396(bvec3) VectorShuffle 443 442 3 4 2 443: 184(ivec3) Load 325(u32v)
Store 424(bv) 444 444: 14(int) Load 327(u32)
445: 184(ivec3) Load 327(u32v) 445: 184(ivec3) CompositeConstruct 444 444 444
446: 14(int) Load 329(u32) 446: 394(bvec3) UGreaterThan 443 445
447: 184(ivec3) CompositeConstruct 446 446 446 Store 422(bv) 446
448: 396(bvec3) UGreaterThan 445 447 447: 52(ivec2) Load 312(i32v)
Store 424(bv) 448 448: 18(int) Load 315(i32)
449: 52(ivec2) Load 314(i32v) 449: 52(ivec2) CompositeConstruct 448 448
450: 18(int) Load 317(i32) 450: 166(bvec2) SGreaterThan 447 449
451: 52(ivec2) CompositeConstruct 450 450 451: 394(bvec3) Load 422(bv)
452: 166(bvec2) SGreaterThan 449 451 452: 394(bvec3) VectorShuffle 451 450 3 4 2
453: 396(bvec3) Load 424(bv) Store 422(bv) 452
454: 396(bvec3) VectorShuffle 453 452 3 4 2 453: 184(ivec3) Load 325(u32v)
Store 424(bv) 454 454: 14(int) Load 327(u32)
455: 184(ivec3) Load 327(u32v) 455: 184(ivec3) CompositeConstruct 454 454 454
456: 14(int) Load 329(u32) 456: 394(bvec3) UGreaterThanEqual 453 455
457: 184(ivec3) CompositeConstruct 456 456 456 Store 422(bv) 456
458: 396(bvec3) UGreaterThanEqual 455 457 457: 52(ivec2) Load 312(i32v)
Store 424(bv) 458 458: 18(int) Load 315(i32)
459: 52(ivec2) Load 314(i32v) 459: 52(ivec2) CompositeConstruct 458 458
460: 18(int) Load 317(i32) 460: 166(bvec2) SGreaterThanEqual 457 459
461: 52(ivec2) CompositeConstruct 460 460 461: 394(bvec3) Load 422(bv)
462: 166(bvec2) SGreaterThanEqual 459 461 462: 394(bvec3) VectorShuffle 461 460 3 4 2
463: 396(bvec3) Load 424(bv) Store 422(bv) 462
464: 396(bvec3) VectorShuffle 463 462 3 4 2 463: 184(ivec3) Load 325(u32v)
Store 424(bv) 464 464: 14(int) Load 327(u32)
465: 184(ivec3) Load 327(u32v) 465: 184(ivec3) CompositeConstruct 464 464 464
466: 14(int) Load 329(u32) 466: 394(bvec3) IEqual 463 465
467: 184(ivec3) CompositeConstruct 466 466 466 Store 422(bv) 466
468: 396(bvec3) IEqual 465 467 467: 52(ivec2) Load 312(i32v)
Store 424(bv) 468 468: 18(int) Load 315(i32)
469: 52(ivec2) Load 314(i32v) 469: 52(ivec2) CompositeConstruct 468 468
470: 18(int) Load 317(i32) 470: 166(bvec2) IEqual 467 469
471: 52(ivec2) CompositeConstruct 470 470 471: 394(bvec3) Load 422(bv)
472: 166(bvec2) IEqual 469 471 472: 394(bvec3) VectorShuffle 471 470 3 4 2
473: 396(bvec3) Load 424(bv) Store 422(bv) 472
474: 396(bvec3) VectorShuffle 473 472 3 4 2 473: 184(ivec3) Load 325(u32v)
Store 424(bv) 474 474: 14(int) Load 327(u32)
475: 184(ivec3) Load 327(u32v) 475: 184(ivec3) CompositeConstruct 474 474 474
476: 14(int) Load 329(u32) 476: 394(bvec3) INotEqual 473 475
477: 184(ivec3) CompositeConstruct 476 476 476 Store 422(bv) 476
478: 396(bvec3) INotEqual 475 477 477: 52(ivec2) Load 312(i32v)
Store 424(bv) 478 478: 18(int) Load 315(i32)
479: 52(ivec2) Load 314(i32v) 479: 52(ivec2) CompositeConstruct 478 478
480: 18(int) Load 317(i32) 480: 166(bvec2) INotEqual 477 479
481: 52(ivec2) CompositeConstruct 480 480 481: 394(bvec3) Load 422(bv)
482: 166(bvec2) INotEqual 479 481 482: 394(bvec3) VectorShuffle 481 480 3 4 2
483: 396(bvec3) Load 424(bv) Store 422(bv) 482
484: 396(bvec3) VectorShuffle 483 482 3 4 2
Store 424(bv) 484
Return Return
FunctionEnd FunctionEnd

View File

@ -1,7 +1,7 @@
spv.int64.frag spv.int64.frag
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80006 // Generated by (magic number): 80006
// Id's are bound by 483 // Id's are bound by 488
Capability Shader Capability Shader
Capability Float64 Capability Float64
@ -37,38 +37,38 @@ spv.int64.frag
Name 139 "i64" Name 139 "i64"
Name 159 "i" Name 159 "i"
Name 166 "uv" Name 166 "uv"
Name 221 "b" Name 226 "b"
Name 281 "i64v" Name 286 "i64v"
Name 284 "i64" Name 289 "i64"
Name 294 "u64v" Name 299 "u64v"
Name 296 "u64" Name 301 "u64"
Name 368 "dv" Name 373 "dv"
Name 387 "iv" Name 392 "iv"
Name 392 "uv" Name 397 "uv"
Name 396 "bv" Name 401 "bv"
Name 457 "Block" Name 462 "Block"
MemberName 457(Block) 0 "i64v" MemberName 462(Block) 0 "i64v"
MemberName 457(Block) 1 "u64" MemberName 462(Block) 1 "u64"
Name 459 "block" Name 464 "block"
Name 460 "si64" Name 465 "si64"
Name 461 "su64" Name 466 "su64"
Name 462 "si" Name 467 "si"
Name 463 "su" Name 468 "su"
Name 464 "sb" Name 469 "sb"
MemberDecorate 28(Uniforms) 0 Offset 0 MemberDecorate 28(Uniforms) 0 Offset 0
Decorate 28(Uniforms) Block Decorate 28(Uniforms) Block
Decorate 30 DescriptorSet 0 Decorate 30 DescriptorSet 0
Decorate 30 Binding 0 Decorate 30 Binding 0
MemberDecorate 457(Block) 0 Offset 0 MemberDecorate 462(Block) 0 Offset 0
MemberDecorate 457(Block) 1 Offset 24 MemberDecorate 462(Block) 1 Offset 24
Decorate 457(Block) Block Decorate 462(Block) Block
Decorate 459(block) DescriptorSet 0 Decorate 464(block) DescriptorSet 0
Decorate 459(block) Binding 1 Decorate 464(block) Binding 1
Decorate 460(si64) SpecId 100 Decorate 465(si64) SpecId 100
Decorate 461(su64) SpecId 101 Decorate 466(su64) SpecId 101
Decorate 462(si) SpecId 102 Decorate 467(si) SpecId 102
Decorate 463(su) SpecId 103 Decorate 468(su) SpecId 103
Decorate 464(sb) SpecId 104 Decorate 469(sb) SpecId 104
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
14: TypeInt 64 0 14: TypeInt 64 0
@ -128,52 +128,53 @@ spv.int64.frag
158: TypePointer Function 31(int) 158: TypePointer Function 31(int)
164: TypeVector 21(int) 3 164: TypeVector 21(int) 3
165: TypePointer Function 164(ivec3) 165: TypePointer Function 164(ivec3)
199: TypeVector 31(int) 3
203: 21(int) Constant 1 203: 21(int) Constant 1
204: TypePointer Function 21(int) 204: TypePointer Function 21(int)
212: 21(int) Constant 2 217: 21(int) Constant 2
220: TypePointer Function 55(bool) 225: TypePointer Function 55(bool)
222: 21(int) Constant 0 227: 21(int) Constant 0
292: 52(ivec2) ConstantComposite 25 25 297: 52(ivec2) ConstantComposite 25 25
301: 132(ivec3) ConstantComposite 69 69 69 306: 132(ivec3) ConstantComposite 69 69 69
343: 55(bool) ConstantTrue 348: 55(bool) ConstantTrue
350: 55(bool) ConstantFalse 355: 55(bool) ConstantFalse
351: 56(bvec2) ConstantComposite 350 350 356: 56(bvec2) ConstantComposite 355 355
363: TypeVector 55(bool) 3 368: TypeVector 55(bool) 3
364: 363(bvec3) ConstantComposite 350 350 350 369: 368(bvec3) ConstantComposite 355 355 355
366: TypeVector 94(float) 3 371: TypeVector 94(float) 3
367: TypePointer Function 366(fvec3) 372: TypePointer Function 371(fvec3)
372: TypePointer Function 94(float) 377: TypePointer Function 94(float)
383: 31(int) Constant 1 388: 31(int) Constant 1
384: 31(int) Constant 2 389: 31(int) Constant 2
385: 74(ivec2) ConstantComposite 383 384 390: 74(ivec2) ConstantComposite 388 389
390: 81(ivec2) ConstantComposite 212 22 395: 81(ivec2) ConstantComposite 217 22
395: TypePointer Function 363(bvec3) 400: TypePointer Function 368(bvec3)
457(Block): TypeStruct 136(ivec3) 14(int) 462(Block): TypeStruct 136(ivec3) 14(int)
458: TypePointer Uniform 457(Block) 463: TypePointer Uniform 462(Block)
459(block): 458(ptr) Variable Uniform 464(block): 463(ptr) Variable Uniform
460(si64): 18(int) SpecConstant 4294967286 4294967295 465(si64): 18(int) SpecConstant 4294967286 4294967295
461(su64): 14(int) SpecConstant 20 0 466(su64): 14(int) SpecConstant 20 0
462(si): 31(int) SpecConstant 4294967291 467(si): 31(int) SpecConstant 4294967291
463(su): 21(int) SpecConstant 4 468(su): 21(int) SpecConstant 4
464(sb): 55(bool) SpecConstantTrue 469(sb): 55(bool) SpecConstantTrue
465: 55(bool) SpecConstantOp 171 460(si64) 69 470: 55(bool) SpecConstantOp 171 465(si64) 69
466: 55(bool) SpecConstantOp 171 461(su64) 69 471: 55(bool) SpecConstantOp 171 466(su64) 69
467: 18(int) SpecConstantOp 169 464(sb) 61 60 472: 18(int) SpecConstantOp 169 469(sb) 61 60
468: 14(int) SpecConstantOp 169 464(sb) 70 69 473: 14(int) SpecConstantOp 169 469(sb) 70 69
469: 31(int) SpecConstantOp 114 460(si64) 474: 31(int) SpecConstantOp 114 465(si64)
470: 18(int) SpecConstantOp 114 462(si) 475: 18(int) SpecConstantOp 114 467(si)
471: 21(int) SpecConstantOp 113 461(su64) 476: 21(int) SpecConstantOp 113 466(su64)
472: 14(int) SpecConstantOp 113 463(su) 477: 14(int) SpecConstantOp 113 468(su)
473: 18(int) SpecConstantOp 128 461(su64) 69 478: 18(int) SpecConstantOp 128 466(su64) 69
474: 14(int) SpecConstantOp 128 460(si64) 69 479: 14(int) SpecConstantOp 128 465(si64) 69
475: 31(int) SpecConstantOp 113 461(su64) 480: 31(int) SpecConstantOp 113 466(su64)
476: 31(int) SpecConstantOp 128 475 222 481: 31(int) SpecConstantOp 128 480 227
477: 18(int) SpecConstantOp 114 462(si) 482: 18(int) SpecConstantOp 114 467(si)
478: 14(int) SpecConstantOp 128 477 69 483: 14(int) SpecConstantOp 128 482 69
479: 31(int) SpecConstantOp 114 460(si64) 484: 31(int) SpecConstantOp 114 465(si64)
480: 21(int) SpecConstantOp 128 479 222 485: 21(int) SpecConstantOp 128 484 227
481: 18(int) SpecConstantOp 113 463(su) 486: 18(int) SpecConstantOp 113 468(su)
482: 18(int) SpecConstantOp 128 481 69 487: 18(int) SpecConstantOp 128 486 69
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
Store 16(u64Max) 17 Store 16(u64Max) 17
@ -286,7 +287,7 @@ spv.int64.frag
139(i64): 19(ptr) Variable Function 139(i64): 19(ptr) Variable Function
159(i): 158(ptr) Variable Function 159(i): 158(ptr) Variable Function
166(uv): 165(ptr) Variable Function 166(uv): 165(ptr) Variable Function
221(b): 220(ptr) Variable Function 226(b): 225(ptr) Variable Function
135: 132(ivec3) Load 134(u64v) 135: 132(ivec3) Load 134(u64v)
137: 136(ivec3) CompositeConstruct 61 61 61 137: 136(ivec3) CompositeConstruct 61 61 61
138: 132(ivec3) IAdd 135 137 138: 132(ivec3) IAdd 135 137
@ -359,302 +360,308 @@ spv.int64.frag
195: 18(int) SConvert 194 195: 18(int) SConvert 194
196: 18(int) SMod 193 195 196: 18(int) SMod 193 195
Store 139(i64) 196 Store 139(i64) 196
197: 31(int) Load 159(i) 197: 132(ivec3) Load 134(u64v)
198: 18(int) SConvert 197 198: 31(int) Load 159(i)
199: 14(int) Bitcast 198 200: 199(ivec3) CompositeConstruct 198 198 198
200: 132(ivec3) Load 134(u64v) 201: 132(ivec3) ShiftLeftLogical 197 200
201: 132(ivec3) CompositeConstruct 199 199 199 Store 134(u64v) 201
202: 132(ivec3) ShiftLeftLogical 200 201 202: 18(int) Load 139(i64)
Store 134(u64v) 202
205: 204(ptr) AccessChain 166(uv) 203 205: 204(ptr) AccessChain 166(uv) 203
206: 21(int) Load 205 206: 21(int) Load 205
207: 18(int) UConvert 206 207: 18(int) ShiftRightArithmetic 202 206
208: 18(int) Bitcast 207 Store 139(i64) 207
209: 18(int) Load 139(i64) 208: 31(int) Load 159(i)
210: 18(int) ShiftRightArithmetic 209 208 209: 132(ivec3) Load 134(u64v)
Store 139(i64) 210 210: 199(ivec3) CompositeConstruct 208 208 208
211: 18(int) Load 139(i64) 211: 132(ivec3) ShiftLeftLogical 209 210
213: 40(ptr) AccessChain 134(u64v) 212 Store 134(u64v) 211
214: 14(int) Load 213 212: 204(ptr) AccessChain 166(uv) 203
215: 18(int) ShiftLeftLogical 211 214 213: 21(int) Load 212
214: 18(int) Load 139(i64)
215: 18(int) ShiftRightArithmetic 214 213
Store 139(i64) 215 Store 139(i64) 215
216: 132(ivec3) Load 134(u64v) 216: 18(int) Load 139(i64)
217: 18(int) Load 139(i64) 218: 40(ptr) AccessChain 134(u64v) 217
218: 136(ivec3) CompositeConstruct 217 217 217 219: 14(int) Load 218
219: 132(ivec3) ShiftLeftLogical 216 218 220: 18(int) ShiftLeftLogical 216 219
Store 134(u64v) 219 Store 139(i64) 220
223: 40(ptr) AccessChain 134(u64v) 222 221: 132(ivec3) Load 134(u64v)
224: 14(int) Load 223 222: 18(int) Load 139(i64)
225: 18(int) Load 139(i64) 223: 136(ivec3) CompositeConstruct 222 222 222
226: 14(int) Bitcast 225 224: 132(ivec3) ShiftLeftLogical 221 223
227: 55(bool) INotEqual 224 226 Store 134(u64v) 224
Store 221(b) 227 228: 40(ptr) AccessChain 134(u64v) 227
228: 18(int) Load 139(i64) 229: 14(int) Load 228
229: 14(int) Bitcast 228 230: 18(int) Load 139(i64)
230: 40(ptr) AccessChain 134(u64v) 222 231: 14(int) Bitcast 230
231: 14(int) Load 230 232: 55(bool) INotEqual 229 231
232: 55(bool) IEqual 229 231 Store 226(b) 232
Store 221(b) 232 233: 18(int) Load 139(i64)
233: 40(ptr) AccessChain 134(u64v) 222 234: 14(int) Bitcast 233
234: 14(int) Load 233 235: 40(ptr) AccessChain 134(u64v) 227
235: 204(ptr) AccessChain 166(uv) 203 236: 14(int) Load 235
236: 21(int) Load 235 237: 55(bool) IEqual 234 236
237: 14(int) UConvert 236 Store 226(b) 237
238: 55(bool) UGreaterThan 234 237 238: 40(ptr) AccessChain 134(u64v) 227
Store 221(b) 238 239: 14(int) Load 238
239: 18(int) Load 139(i64) 240: 204(ptr) AccessChain 166(uv) 203
240: 31(int) Load 159(i) 241: 21(int) Load 240
241: 18(int) SConvert 240 242: 14(int) UConvert 241
242: 55(bool) SLessThan 239 241 243: 55(bool) UGreaterThan 239 242
Store 221(b) 242 Store 226(b) 243
243: 40(ptr) AccessChain 134(u64v) 203 244: 18(int) Load 139(i64)
244: 14(int) Load 243 245: 31(int) Load 159(i)
245: 204(ptr) AccessChain 166(uv) 222 246: 18(int) SConvert 245
246: 21(int) Load 245 247: 55(bool) SLessThan 244 246
247: 14(int) UConvert 246 Store 226(b) 247
248: 55(bool) UGreaterThanEqual 244 247 248: 40(ptr) AccessChain 134(u64v) 203
Store 221(b) 248 249: 14(int) Load 248
249: 18(int) Load 139(i64) 250: 204(ptr) AccessChain 166(uv) 227
250: 31(int) Load 159(i) 251: 21(int) Load 250
251: 18(int) SConvert 250 252: 14(int) UConvert 251
252: 55(bool) SLessThanEqual 249 251 253: 55(bool) UGreaterThanEqual 249 252
Store 221(b) 252 Store 226(b) 253
253: 31(int) Load 159(i) 254: 18(int) Load 139(i64)
254: 18(int) SConvert 253 255: 31(int) Load 159(i)
255: 14(int) Bitcast 254 256: 18(int) SConvert 255
256: 132(ivec3) Load 134(u64v) 257: 55(bool) SLessThanEqual 254 256
257: 132(ivec3) CompositeConstruct 255 255 255 Store 226(b) 257
258: 132(ivec3) BitwiseOr 256 257 258: 31(int) Load 159(i)
Store 134(u64v) 258 259: 18(int) SConvert 258
259: 18(int) Load 139(i64) 260: 14(int) Bitcast 259
260: 31(int) Load 159(i) 261: 132(ivec3) Load 134(u64v)
261: 18(int) SConvert 260 262: 132(ivec3) CompositeConstruct 260 260 260
262: 18(int) BitwiseOr 259 261 263: 132(ivec3) BitwiseOr 261 262
Store 139(i64) 262 Store 134(u64v) 263
263: 31(int) Load 159(i) 264: 18(int) Load 139(i64)
264: 18(int) SConvert 263 265: 31(int) Load 159(i)
265: 18(int) Load 139(i64) 266: 18(int) SConvert 265
266: 18(int) BitwiseAnd 265 264 267: 18(int) BitwiseOr 264 266
Store 139(i64) 266 Store 139(i64) 267
267: 132(ivec3) Load 134(u64v) 268: 31(int) Load 159(i)
268: 164(ivec3) Load 166(uv) 269: 18(int) SConvert 268
269: 132(ivec3) UConvert 268 270: 18(int) Load 139(i64)
270: 132(ivec3) BitwiseAnd 267 269 271: 18(int) BitwiseAnd 270 269
Store 134(u64v) 270 Store 139(i64) 271
271: 18(int) Load 139(i64) 272: 132(ivec3) Load 134(u64v)
272: 14(int) Bitcast 271 273: 164(ivec3) Load 166(uv)
273: 132(ivec3) Load 134(u64v) 274: 132(ivec3) UConvert 273
274: 132(ivec3) CompositeConstruct 272 272 272 275: 132(ivec3) BitwiseAnd 272 274
275: 132(ivec3) BitwiseXor 273 274
Store 134(u64v) 275 Store 134(u64v) 275
276: 132(ivec3) Load 134(u64v) 276: 18(int) Load 139(i64)
277: 18(int) Load 139(i64) 277: 14(int) Bitcast 276
278: 14(int) Bitcast 277 278: 132(ivec3) Load 134(u64v)
279: 132(ivec3) CompositeConstruct 278 278 278 279: 132(ivec3) CompositeConstruct 277 277 277
280: 132(ivec3) BitwiseXor 276 279 280: 132(ivec3) BitwiseXor 278 279
Store 134(u64v) 280 Store 134(u64v) 280
281: 132(ivec3) Load 134(u64v)
282: 18(int) Load 139(i64)
283: 14(int) Bitcast 282
284: 132(ivec3) CompositeConstruct 283 283 283
285: 132(ivec3) BitwiseXor 281 284
Store 134(u64v) 285
Return Return
FunctionEnd FunctionEnd
12(builtinFuncs(): 2 Function None 3 12(builtinFuncs(): 2 Function None 3
13: Label 13: Label
281(i64v): 53(ptr) Variable Function 286(i64v): 53(ptr) Variable Function
284(i64): 19(ptr) Variable Function 289(i64): 19(ptr) Variable Function
294(u64v): 133(ptr) Variable Function 299(u64v): 133(ptr) Variable Function
296(u64): 40(ptr) Variable Function 301(u64): 40(ptr) Variable Function
368(dv): 367(ptr) Variable Function 373(dv): 372(ptr) Variable Function
387(iv): 75(ptr) Variable Function 392(iv): 75(ptr) Variable Function
392(uv): 82(ptr) Variable Function 397(uv): 82(ptr) Variable Function
396(bv): 395(ptr) Variable Function 401(bv): 400(ptr) Variable Function
282: 52(ivec2) Load 281(i64v) 287: 52(ivec2) Load 286(i64v)
283: 52(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 282 288: 52(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 287
Store 281(i64v) 283 Store 286(i64v) 288
285: 18(int) Load 284(i64) 290: 18(int) Load 289(i64)
286: 18(int) ExtInst 1(GLSL.std.450) 7(SSign) 285 291: 18(int) ExtInst 1(GLSL.std.450) 7(SSign) 290
Store 284(i64) 286 Store 289(i64) 291
287: 52(ivec2) Load 281(i64v) 292: 52(ivec2) Load 286(i64v)
288: 18(int) Load 284(i64) 293: 18(int) Load 289(i64)
289: 52(ivec2) CompositeConstruct 288 288 294: 52(ivec2) CompositeConstruct 293 293
290: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 287 289 295: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 292 294
Store 281(i64v) 290 Store 286(i64v) 295
291: 52(ivec2) Load 281(i64v) 296: 52(ivec2) Load 286(i64v)
293: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 291 292 298: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 296 297
Store 281(i64v) 293 Store 286(i64v) 298
295: 132(ivec3) Load 294(u64v) 300: 132(ivec3) Load 299(u64v)
297: 14(int) Load 296(u64) 302: 14(int) Load 301(u64)
298: 132(ivec3) CompositeConstruct 297 297 297 303: 132(ivec3) CompositeConstruct 302 302 302
299: 132(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 295 298 304: 132(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 300 303
Store 294(u64v) 299 Store 299(u64v) 304
300: 132(ivec3) Load 294(u64v) 305: 132(ivec3) Load 299(u64v)
302: 132(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 300 301 307: 132(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 305 306
Store 294(u64v) 302 Store 299(u64v) 307
303: 52(ivec2) Load 281(i64v) 308: 52(ivec2) Load 286(i64v)
304: 18(int) Load 284(i64) 309: 18(int) Load 289(i64)
305: 52(ivec2) CompositeConstruct 304 304 310: 52(ivec2) CompositeConstruct 309 309
306: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 303 305 311: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 308 310
Store 281(i64v) 306 Store 286(i64v) 311
307: 52(ivec2) Load 281(i64v) 312: 52(ivec2) Load 286(i64v)
308: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 307 292 313: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 312 297
Store 281(i64v) 308 Store 286(i64v) 313
309: 132(ivec3) Load 294(u64v) 314: 132(ivec3) Load 299(u64v)
310: 14(int) Load 296(u64) 315: 14(int) Load 301(u64)
311: 132(ivec3) CompositeConstruct 310 310 310 316: 132(ivec3) CompositeConstruct 315 315 315
312: 132(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 309 311 317: 132(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 314 316
Store 294(u64v) 312 Store 299(u64v) 317
313: 132(ivec3) Load 294(u64v) 318: 132(ivec3) Load 299(u64v)
314: 132(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 313 301 319: 132(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 318 306
Store 294(u64v) 314 Store 299(u64v) 319
315: 52(ivec2) Load 281(i64v) 320: 52(ivec2) Load 286(i64v)
316: 18(int) Load 284(i64) 321: 18(int) Load 289(i64)
317: 18(int) SNegate 316 322: 18(int) SNegate 321
318: 18(int) Load 284(i64) 323: 18(int) Load 289(i64)
319: 52(ivec2) CompositeConstruct 317 317 324: 52(ivec2) CompositeConstruct 322 322
320: 52(ivec2) CompositeConstruct 318 318 325: 52(ivec2) CompositeConstruct 323 323
321: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 315 319 320 326: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 320 324 325
Store 281(i64v) 321 Store 286(i64v) 326
322: 52(ivec2) Load 281(i64v) 327: 52(ivec2) Load 286(i64v)
323: 52(ivec2) Load 281(i64v) 328: 52(ivec2) Load 286(i64v)
324: 52(ivec2) SNegate 323 329: 52(ivec2) SNegate 328
325: 52(ivec2) Load 281(i64v) 330: 52(ivec2) Load 286(i64v)
326: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 322 324 325 331: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 327 329 330
Store 281(i64v) 326 Store 286(i64v) 331
327: 132(ivec3) Load 294(u64v) 332: 132(ivec3) Load 299(u64v)
328: 14(int) Load 296(u64) 333: 14(int) Load 301(u64)
329: 14(int) SNegate 328 334: 14(int) SNegate 333
330: 14(int) Load 296(u64) 335: 14(int) Load 301(u64)
331: 132(ivec3) CompositeConstruct 329 329 329 336: 132(ivec3) CompositeConstruct 334 334 334
332: 132(ivec3) CompositeConstruct 330 330 330 337: 132(ivec3) CompositeConstruct 335 335 335
333: 132(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 327 331 332 338: 132(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 332 336 337
Store 294(u64v) 333 Store 299(u64v) 338
334: 132(ivec3) Load 294(u64v) 339: 132(ivec3) Load 299(u64v)
335: 132(ivec3) Load 294(u64v) 340: 132(ivec3) Load 299(u64v)
336: 132(ivec3) SNegate 335 341: 132(ivec3) SNegate 340
337: 132(ivec3) Load 294(u64v) 342: 132(ivec3) Load 299(u64v)
338: 132(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 334 336 337 343: 132(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 339 341 342
Store 294(u64v) 338 Store 299(u64v) 343
339: 19(ptr) AccessChain 281(i64v) 222 344: 19(ptr) AccessChain 286(i64v) 227
340: 18(int) Load 339 345: 18(int) Load 344
341: 19(ptr) AccessChain 281(i64v) 203 346: 19(ptr) AccessChain 286(i64v) 203
342: 18(int) Load 341 347: 18(int) Load 346
344: 18(int) Select 343 342 340 349: 18(int) Select 348 347 345
Store 284(i64) 344 Store 289(i64) 349
345: 18(int) Load 284(i64) 350: 18(int) Load 289(i64)
346: 52(ivec2) CompositeConstruct 345 345 351: 52(ivec2) CompositeConstruct 350 350
347: 18(int) Load 284(i64) 352: 18(int) Load 289(i64)
348: 18(int) SNegate 347 353: 18(int) SNegate 352
349: 52(ivec2) CompositeConstruct 348 348 354: 52(ivec2) CompositeConstruct 353 353
352: 52(ivec2) Select 351 349 346 357: 52(ivec2) Select 356 354 351
Store 281(i64v) 352 Store 286(i64v) 357
353: 40(ptr) AccessChain 294(u64v) 222 358: 40(ptr) AccessChain 299(u64v) 227
354: 14(int) Load 353 359: 14(int) Load 358
355: 40(ptr) AccessChain 294(u64v) 203 360: 40(ptr) AccessChain 299(u64v) 203
356: 14(int) Load 355 361: 14(int) Load 360
357: 14(int) Select 343 356 354 362: 14(int) Select 348 361 359
Store 296(u64) 357 Store 301(u64) 362
358: 14(int) Load 296(u64) 363: 14(int) Load 301(u64)
359: 132(ivec3) CompositeConstruct 358 358 358 364: 132(ivec3) CompositeConstruct 363 363 363
360: 14(int) Load 296(u64) 365: 14(int) Load 301(u64)
361: 14(int) SNegate 360 366: 14(int) SNegate 365
362: 132(ivec3) CompositeConstruct 361 361 361 367: 132(ivec3) CompositeConstruct 366 366 366
365: 132(ivec3) Select 364 362 359 370: 132(ivec3) Select 369 367 364
Store 294(u64v) 365 Store 299(u64v) 370
369: 366(fvec3) Load 368(dv) 374: 371(fvec3) Load 373(dv)
370: 95(fvec2) VectorShuffle 369 369 0 1 375: 95(fvec2) VectorShuffle 374 374 0 1
371: 52(ivec2) Bitcast 370 376: 52(ivec2) Bitcast 375
Store 281(i64v) 371 Store 286(i64v) 376
373: 372(ptr) AccessChain 368(dv) 212 378: 377(ptr) AccessChain 373(dv) 217
374: 94(float) Load 373 379: 94(float) Load 378
375: 14(int) Bitcast 374 380: 14(int) Bitcast 379
376: 40(ptr) AccessChain 294(u64v) 222 381: 40(ptr) AccessChain 299(u64v) 227
Store 376 375 Store 381 380
377: 52(ivec2) Load 281(i64v) 382: 52(ivec2) Load 286(i64v)
378: 95(fvec2) Bitcast 377 383: 95(fvec2) Bitcast 382
379: 366(fvec3) Load 368(dv) 384: 371(fvec3) Load 373(dv)
380: 366(fvec3) VectorShuffle 379 378 3 4 2 385: 371(fvec3) VectorShuffle 384 383 3 4 2
Store 368(dv) 380 Store 373(dv) 385
381: 132(ivec3) Load 294(u64v) 386: 132(ivec3) Load 299(u64v)
382: 366(fvec3) Bitcast 381 387: 371(fvec3) Bitcast 386
Store 368(dv) 382 Store 373(dv) 387
386: 18(int) Bitcast 385 391: 18(int) Bitcast 390
Store 284(i64) 386 Store 289(i64) 391
388: 18(int) Load 284(i64) 393: 18(int) Load 289(i64)
389: 74(ivec2) Bitcast 388 394: 74(ivec2) Bitcast 393
Store 387(iv) 389 Store 392(iv) 394
391: 14(int) Bitcast 390 396: 14(int) Bitcast 395
Store 296(u64) 391 Store 301(u64) 396
393: 14(int) Load 296(u64) 398: 14(int) Load 301(u64)
394: 81(ivec2) Bitcast 393 399: 81(ivec2) Bitcast 398
Store 392(uv) 394 Store 397(uv) 399
397: 132(ivec3) Load 294(u64v) 402: 132(ivec3) Load 299(u64v)
398: 14(int) Load 296(u64) 403: 14(int) Load 301(u64)
399: 132(ivec3) CompositeConstruct 398 398 398 404: 132(ivec3) CompositeConstruct 403 403 403
400: 363(bvec3) ULessThan 397 399 405: 368(bvec3) ULessThan 402 404
Store 396(bv) 400 Store 401(bv) 405
401: 52(ivec2) Load 281(i64v) 406: 52(ivec2) Load 286(i64v)
402: 18(int) Load 284(i64) 407: 18(int) Load 289(i64)
403: 52(ivec2) CompositeConstruct 402 402 408: 52(ivec2) CompositeConstruct 407 407
404: 56(bvec2) SLessThan 401 403 409: 56(bvec2) SLessThan 406 408
405: 363(bvec3) Load 396(bv) 410: 368(bvec3) Load 401(bv)
406: 363(bvec3) VectorShuffle 405 404 3 4 2 411: 368(bvec3) VectorShuffle 410 409 3 4 2
Store 396(bv) 406 Store 401(bv) 411
407: 132(ivec3) Load 294(u64v) 412: 132(ivec3) Load 299(u64v)
408: 14(int) Load 296(u64) 413: 14(int) Load 301(u64)
409: 132(ivec3) CompositeConstruct 408 408 408 414: 132(ivec3) CompositeConstruct 413 413 413
410: 363(bvec3) ULessThanEqual 407 409 415: 368(bvec3) ULessThanEqual 412 414
Store 396(bv) 410 Store 401(bv) 415
411: 52(ivec2) Load 281(i64v) 416: 52(ivec2) Load 286(i64v)
412: 18(int) Load 284(i64) 417: 18(int) Load 289(i64)
413: 52(ivec2) CompositeConstruct 412 412 418: 52(ivec2) CompositeConstruct 417 417
414: 56(bvec2) SLessThanEqual 411 413 419: 56(bvec2) SLessThanEqual 416 418
415: 363(bvec3) Load 396(bv) 420: 368(bvec3) Load 401(bv)
416: 363(bvec3) VectorShuffle 415 414 3 4 2 421: 368(bvec3) VectorShuffle 420 419 3 4 2
Store 396(bv) 416 Store 401(bv) 421
417: 132(ivec3) Load 294(u64v) 422: 132(ivec3) Load 299(u64v)
418: 14(int) Load 296(u64) 423: 14(int) Load 301(u64)
419: 132(ivec3) CompositeConstruct 418 418 418 424: 132(ivec3) CompositeConstruct 423 423 423
420: 363(bvec3) UGreaterThan 417 419 425: 368(bvec3) UGreaterThan 422 424
Store 396(bv) 420 Store 401(bv) 425
421: 52(ivec2) Load 281(i64v) 426: 52(ivec2) Load 286(i64v)
422: 18(int) Load 284(i64) 427: 18(int) Load 289(i64)
423: 52(ivec2) CompositeConstruct 422 422 428: 52(ivec2) CompositeConstruct 427 427
424: 56(bvec2) SGreaterThan 421 423 429: 56(bvec2) SGreaterThan 426 428
425: 363(bvec3) Load 396(bv) 430: 368(bvec3) Load 401(bv)
426: 363(bvec3) VectorShuffle 425 424 3 4 2 431: 368(bvec3) VectorShuffle 430 429 3 4 2
Store 396(bv) 426 Store 401(bv) 431
427: 132(ivec3) Load 294(u64v) 432: 132(ivec3) Load 299(u64v)
428: 14(int) Load 296(u64) 433: 14(int) Load 301(u64)
429: 132(ivec3) CompositeConstruct 428 428 428 434: 132(ivec3) CompositeConstruct 433 433 433
430: 363(bvec3) UGreaterThanEqual 427 429 435: 368(bvec3) UGreaterThanEqual 432 434
Store 396(bv) 430 Store 401(bv) 435
431: 52(ivec2) Load 281(i64v) 436: 52(ivec2) Load 286(i64v)
432: 18(int) Load 284(i64) 437: 18(int) Load 289(i64)
433: 52(ivec2) CompositeConstruct 432 432 438: 52(ivec2) CompositeConstruct 437 437
434: 56(bvec2) SGreaterThanEqual 431 433 439: 56(bvec2) SGreaterThanEqual 436 438
435: 363(bvec3) Load 396(bv) 440: 368(bvec3) Load 401(bv)
436: 363(bvec3) VectorShuffle 435 434 3 4 2 441: 368(bvec3) VectorShuffle 440 439 3 4 2
Store 396(bv) 436 Store 401(bv) 441
437: 132(ivec3) Load 294(u64v) 442: 132(ivec3) Load 299(u64v)
438: 14(int) Load 296(u64) 443: 14(int) Load 301(u64)
439: 132(ivec3) CompositeConstruct 438 438 438 444: 132(ivec3) CompositeConstruct 443 443 443
440: 363(bvec3) IEqual 437 439 445: 368(bvec3) IEqual 442 444
Store 396(bv) 440 Store 401(bv) 445
441: 52(ivec2) Load 281(i64v) 446: 52(ivec2) Load 286(i64v)
442: 18(int) Load 284(i64) 447: 18(int) Load 289(i64)
443: 52(ivec2) CompositeConstruct 442 442 448: 52(ivec2) CompositeConstruct 447 447
444: 56(bvec2) IEqual 441 443 449: 56(bvec2) IEqual 446 448
445: 363(bvec3) Load 396(bv) 450: 368(bvec3) Load 401(bv)
446: 363(bvec3) VectorShuffle 445 444 3 4 2 451: 368(bvec3) VectorShuffle 450 449 3 4 2
Store 396(bv) 446 Store 401(bv) 451
447: 132(ivec3) Load 294(u64v) 452: 132(ivec3) Load 299(u64v)
448: 14(int) Load 296(u64) 453: 14(int) Load 301(u64)
449: 132(ivec3) CompositeConstruct 448 448 448 454: 132(ivec3) CompositeConstruct 453 453 453
450: 363(bvec3) INotEqual 447 449 455: 368(bvec3) INotEqual 452 454
Store 396(bv) 450 Store 401(bv) 455
451: 52(ivec2) Load 281(i64v) 456: 52(ivec2) Load 286(i64v)
452: 18(int) Load 284(i64) 457: 18(int) Load 289(i64)
453: 52(ivec2) CompositeConstruct 452 452 458: 52(ivec2) CompositeConstruct 457 457
454: 56(bvec2) INotEqual 451 453 459: 56(bvec2) INotEqual 456 458
455: 363(bvec3) Load 396(bv) 460: 368(bvec3) Load 401(bv)
456: 363(bvec3) VectorShuffle 455 454 3 4 2 461: 368(bvec3) VectorShuffle 460 459 3 4 2
Store 396(bv) 456 Store 401(bv) 461
Return Return
FunctionEnd FunctionEnd

View File

@ -0,0 +1,57 @@
spv.rankShift.comp
// Module Version 10000
// Generated by (magic number): 80006
// Id's are bound by 33
Capability Shader
Capability Int64
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "main"
ExecutionMode 4 LocalSize 54 1 1
Source GLSL 450
SourceExtension "GL_ARB_gpu_shader_int64"
Name 4 "main"
Name 8 "result"
Name 11 "arg0"
Name 15 "arg1"
Decorate 11(arg0) Location 4
Decorate 15(arg1) Location 5
Decorate 32 BuiltIn WorkgroupSize
2: TypeVoid
3: TypeFunction 2
6: TypeInt 64 0
7: TypePointer Function 6(int)
9: TypeInt 64 1
10: TypePointer UniformConstant 9(int)
11(arg0): 10(ptr) Variable UniformConstant
13: TypeInt 32 0
14: TypePointer UniformConstant 13(int)
15(arg1): 14(ptr) Variable UniformConstant
29: TypeVector 13(int) 3
30: 13(int) Constant 54
31: 13(int) Constant 1
32: 29(ivec3) ConstantComposite 30 31 31
4(main): 2 Function None 3
5: Label
8(result): 7(ptr) Variable Function
12: 9(int) Load 11(arg0)
16: 13(int) Load 15(arg1)
17: 9(int) ShiftLeftLogical 12 16
18: 6(int) Bitcast 17
Store 8(result) 18
19: 9(int) Load 11(arg0)
20: 13(int) Load 15(arg1)
21: 9(int) ShiftRightArithmetic 19 20
22: 6(int) Bitcast 21
Store 8(result) 22
23: 13(int) Load 15(arg1)
24: 6(int) Load 8(result)
25: 6(int) ShiftLeftLogical 24 23
Store 8(result) 25
26: 13(int) Load 15(arg1)
27: 6(int) Load 8(result)
28: 6(int) ShiftRightLogical 27 26
Store 8(result) 28
Return
FunctionEnd

View File

@ -1,7 +1,7 @@
spv.vulkan110.int16.frag spv.vulkan110.int16.frag
// Module Version 10300 // Module Version 10300
// Generated by (magic number): 80006 // Generated by (magic number): 80006
// Id's are bound by 525 // Id's are bound by 523
Capability Shader Capability Shader
Capability Float16 Capability Float16
@ -52,48 +52,48 @@ spv.vulkan110.int16.frag
Name 220 "i" Name 220 "i"
Name 227 "uv" Name 227 "uv"
Name 243 "i64" Name 243 "i64"
Name 283 "b" Name 281 "b"
Name 345 "i16v" Name 343 "i16v"
Name 348 "i16" Name 346 "i16"
Name 358 "u16v" Name 356 "u16v"
Name 360 "u16" Name 358 "u16"
Name 430 "i32" Name 428 "i32"
Name 433 "i64" Name 431 "i64"
Name 436 "i16v4" Name 434 "i16v4"
Name 439 "u32" Name 437 "u32"
Name 440 "u16v2" Name 438 "u16v2"
Name 444 "u64" Name 442 "u64"
Name 447 "u16v4" Name 445 "u16v4"
Name 459 "bv" Name 457 "bv"
Name 520 "Block" Name 518 "Block"
MemberName 520(Block) 0 "i16" MemberName 518(Block) 0 "i16"
MemberName 520(Block) 1 "i16v2" MemberName 518(Block) 1 "i16v2"
MemberName 520(Block) 2 "i16v3" MemberName 518(Block) 2 "i16v3"
MemberName 520(Block) 3 "i16v4" MemberName 518(Block) 3 "i16v4"
MemberName 520(Block) 4 "u16" MemberName 518(Block) 4 "u16"
MemberName 520(Block) 5 "u16v2" MemberName 518(Block) 5 "u16v2"
MemberName 520(Block) 6 "u16v3" MemberName 518(Block) 6 "u16v3"
MemberName 520(Block) 7 "u16v4" MemberName 518(Block) 7 "u16v4"
Name 522 "block" Name 520 "block"
Name 523 "si16" Name 521 "si16"
Name 524 "su16" Name 522 "su16"
MemberDecorate 24(Uniforms) 0 Offset 0 MemberDecorate 24(Uniforms) 0 Offset 0
Decorate 24(Uniforms) Block Decorate 24(Uniforms) Block
Decorate 26 DescriptorSet 0 Decorate 26 DescriptorSet 0
Decorate 26 Binding 0 Decorate 26 Binding 0
MemberDecorate 520(Block) 0 Offset 0 MemberDecorate 518(Block) 0 Offset 0
MemberDecorate 520(Block) 1 Offset 4 MemberDecorate 518(Block) 1 Offset 4
MemberDecorate 520(Block) 2 Offset 8 MemberDecorate 518(Block) 2 Offset 8
MemberDecorate 520(Block) 3 Offset 16 MemberDecorate 518(Block) 3 Offset 16
MemberDecorate 520(Block) 4 Offset 24 MemberDecorate 518(Block) 4 Offset 24
MemberDecorate 520(Block) 5 Offset 28 MemberDecorate 518(Block) 5 Offset 28
MemberDecorate 520(Block) 6 Offset 32 MemberDecorate 518(Block) 6 Offset 32
MemberDecorate 520(Block) 7 Offset 40 MemberDecorate 518(Block) 7 Offset 40
Decorate 520(Block) Block Decorate 518(Block) Block
Decorate 522(block) DescriptorSet 0 Decorate 520(block) DescriptorSet 0
Decorate 522(block) Binding 1 Decorate 520(block) Binding 1
Decorate 523(si16) SpecId 100 Decorate 521(si16) SpecId 100
Decorate 524(su16) SpecId 101 Decorate 522(su16) SpecId 101
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
14: TypeInt 16 1 14: TypeInt 16 1
@ -168,28 +168,28 @@ spv.vulkan110.int16.frag
242: TypePointer Function 71(int) 242: TypePointer Function 71(int)
264: 17(int) Constant 1 264: 17(int) Constant 1
270: 17(int) Constant 2 270: 17(int) Constant 2
275: TypeVector 27(int) 3 276: TypeVector 27(int) 3
282: TypePointer Function 173(bool) 280: TypePointer Function 173(bool)
284: 17(int) Constant 0 282: 17(int) Constant 0
298: TypePointer Function 17(int) 296: TypePointer Function 17(int)
356: 52(ivec2) ConstantComposite 21 21 354: 52(ivec2) ConstantComposite 21 21
365: 193(ivec3) ConstantComposite 184 184 184 363: 193(ivec3) ConstantComposite 184 184 184
407: 173(bool) ConstantTrue 405: 173(bool) ConstantTrue
414: 173(bool) ConstantFalse 412: 173(bool) ConstantFalse
415: 174(bvec2) ConstantComposite 414 414 413: 174(bvec2) ConstantComposite 412 412
427: TypeVector 173(bool) 3 425: TypeVector 173(bool) 3
428: 427(bvec3) ConstantComposite 414 414 414 426: 425(bvec3) ConstantComposite 412 412 412
434: TypeVector 14(int) 4 432: TypeVector 14(int) 4
435: TypePointer Function 434(ivec4) 433: TypePointer Function 432(ivec4)
443: TypePointer Function 77(int) 441: TypePointer Function 77(int)
445: TypeVector 36(int) 4 443: TypeVector 36(int) 4
446: TypePointer Function 445(ivec4) 444: TypePointer Function 443(ivec4)
458: TypePointer Function 427(bvec3) 456: TypePointer Function 425(bvec3)
520(Block): TypeStruct 14(int) 52(ivec2) 197(ivec3) 434(ivec4) 36(int) 57(ivec2) 193(ivec3) 445(ivec4) 518(Block): TypeStruct 14(int) 52(ivec2) 197(ivec3) 432(ivec4) 36(int) 57(ivec2) 193(ivec3) 443(ivec4)
521: TypePointer Uniform 520(Block) 519: TypePointer Uniform 518(Block)
522(block): 521(ptr) Variable Uniform 520(block): 519(ptr) Variable Uniform
523(si16): 14(int) SpecConstant 4294967286 521(si16): 14(int) SpecConstant 4294967286
524(su16): 36(int) SpecConstant 20 522(su16): 36(int) SpecConstant 20
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
Return Return
@ -368,7 +368,7 @@ spv.vulkan110.int16.frag
220(i): 219(ptr) Variable Function 220(i): 219(ptr) Variable Function
227(uv): 226(ptr) Variable Function 227(uv): 226(ptr) Variable Function
243(i64): 242(ptr) Variable Function 243(i64): 242(ptr) Variable Function
283(b): 282(ptr) Variable Function 281(b): 280(ptr) Variable Function
196: 193(ivec3) Load 195(u16v) 196: 193(ivec3) Load 195(u16v)
198: 197(ivec3) CompositeConstruct 179 179 179 198: 197(ivec3) CompositeConstruct 179 179 179
199: 193(ivec3) IAdd 196 198 199: 193(ivec3) IAdd 196 198
@ -457,287 +457,285 @@ spv.vulkan110.int16.frag
273: 14(int) ShiftLeftLogical 269 272 273: 14(int) ShiftLeftLogical 269 272
Store 200(i16) 273 Store 200(i16) 273
274: 193(ivec3) Load 195(u16v) 274: 193(ivec3) Load 195(u16v)
276: 275(ivec3) UConvert 274 275: 27(int) Load 220(i)
277: 275(ivec3) Bitcast 276 277: 276(ivec3) CompositeConstruct 275 275 275
278: 27(int) Load 220(i) 278: 193(ivec3) ShiftLeftLogical 274 277
279: 275(ivec3) CompositeConstruct 278 278 278 279: 225(ivec3) UConvert 278
280: 275(ivec3) ShiftLeftLogical 277 279 Store 227(uv) 279
281: 225(ivec3) Bitcast 280 283: 37(ptr) AccessChain 195(u16v) 282
Store 227(uv) 281 284: 36(int) Load 283
285: 37(ptr) AccessChain 195(u16v) 284 285: 14(int) Load 200(i16)
286: 36(int) Load 285 286: 36(int) Bitcast 285
287: 14(int) Load 200(i16) 287: 173(bool) INotEqual 284 286
288: 36(int) Bitcast 287 Store 281(b) 287
289: 173(bool) INotEqual 286 288 288: 14(int) Load 200(i16)
Store 283(b) 289 289: 36(int) Bitcast 288
290: 14(int) Load 200(i16) 290: 37(ptr) AccessChain 195(u16v) 282
291: 36(int) Bitcast 290 291: 36(int) Load 290
292: 37(ptr) AccessChain 195(u16v) 284 292: 173(bool) IEqual 289 291
293: 36(int) Load 292 Store 281(b) 292
294: 173(bool) IEqual 291 293 293: 37(ptr) AccessChain 195(u16v) 282
Store 283(b) 294 294: 36(int) Load 293
295: 37(ptr) AccessChain 195(u16v) 284 295: 17(int) UConvert 294
296: 36(int) Load 295 297: 296(ptr) AccessChain 227(uv) 264
297: 17(int) UConvert 296 298: 17(int) Load 297
299: 298(ptr) AccessChain 227(uv) 264 299: 173(bool) UGreaterThan 295 298
300: 17(int) Load 299 Store 281(b) 299
301: 173(bool) UGreaterThan 297 300 300: 14(int) Load 200(i16)
Store 283(b) 301 301: 27(int) SConvert 300
302: 14(int) Load 200(i16) 302: 27(int) Load 220(i)
303: 27(int) SConvert 302 303: 173(bool) SLessThan 301 302
304: 27(int) Load 220(i) Store 281(b) 303
305: 173(bool) SLessThan 303 304 304: 37(ptr) AccessChain 195(u16v) 264
Store 283(b) 305 305: 36(int) Load 304
306: 37(ptr) AccessChain 195(u16v) 264 306: 17(int) UConvert 305
307: 36(int) Load 306 307: 296(ptr) AccessChain 227(uv) 282
308: 17(int) UConvert 307 308: 17(int) Load 307
309: 298(ptr) AccessChain 227(uv) 284 309: 173(bool) UGreaterThanEqual 306 308
310: 17(int) Load 309 Store 281(b) 309
311: 173(bool) UGreaterThanEqual 308 310 310: 14(int) Load 200(i16)
Store 283(b) 311 311: 27(int) SConvert 310
312: 14(int) Load 200(i16) 312: 27(int) Load 220(i)
313: 27(int) SConvert 312 313: 173(bool) SLessThanEqual 311 312
314: 27(int) Load 220(i) Store 281(b) 313
315: 173(bool) SLessThanEqual 313 314 314: 14(int) Load 200(i16)
Store 283(b) 315 315: 27(int) SConvert 314
316: 14(int) Load 200(i16) 316: 17(int) Bitcast 315
317: 27(int) SConvert 316 317: 225(ivec3) Load 227(uv)
318: 17(int) Bitcast 317 318: 225(ivec3) CompositeConstruct 316 316 316
319: 225(ivec3) Load 227(uv) 319: 225(ivec3) BitwiseOr 317 318
320: 225(ivec3) CompositeConstruct 318 318 318 Store 227(uv) 319
321: 225(ivec3) BitwiseOr 319 320 320: 14(int) Load 200(i16)
Store 227(uv) 321 321: 27(int) SConvert 320
322: 14(int) Load 200(i16) 322: 27(int) Load 220(i)
323: 27(int) SConvert 322 323: 27(int) BitwiseOr 321 322
324: 27(int) Load 220(i) Store 220(i) 323
325: 27(int) BitwiseOr 323 324 324: 14(int) Load 200(i16)
Store 220(i) 325 325: 71(int) SConvert 324
326: 14(int) Load 200(i16) 326: 71(int) Load 243(i64)
327: 71(int) SConvert 326 327: 71(int) BitwiseAnd 326 325
328: 71(int) Load 243(i64) Store 243(i64) 327
329: 71(int) BitwiseAnd 328 327 328: 193(ivec3) Load 195(u16v)
Store 243(i64) 329 329: 225(ivec3) UConvert 328
330: 193(ivec3) Load 195(u16v) 330: 225(ivec3) Load 227(uv)
331: 225(ivec3) UConvert 330 331: 225(ivec3) BitwiseAnd 329 330
332: 225(ivec3) Load 227(uv) Store 227(uv) 331
333: 225(ivec3) BitwiseAnd 331 332 332: 14(int) Load 200(i16)
Store 227(uv) 333 333: 27(int) SConvert 332
334: 14(int) Load 200(i16) 334: 17(int) Bitcast 333
335: 27(int) SConvert 334 335: 225(ivec3) Load 227(uv)
336: 17(int) Bitcast 335 336: 225(ivec3) CompositeConstruct 334 334 334
337: 225(ivec3) Load 227(uv) 337: 225(ivec3) BitwiseXor 335 336
338: 225(ivec3) CompositeConstruct 336 336 336 Store 227(uv) 337
339: 225(ivec3) BitwiseXor 337 338 338: 193(ivec3) Load 195(u16v)
Store 227(uv) 339 339: 14(int) Load 200(i16)
340: 193(ivec3) Load 195(u16v) 340: 36(int) Bitcast 339
341: 14(int) Load 200(i16) 341: 193(ivec3) CompositeConstruct 340 340 340
342: 36(int) Bitcast 341 342: 193(ivec3) BitwiseXor 338 341
343: 193(ivec3) CompositeConstruct 342 342 342 Store 195(u16v) 342
344: 193(ivec3) BitwiseXor 340 343
Store 195(u16v) 344
Return Return
FunctionEnd FunctionEnd
12(builtinFuncs(): 2 Function None 3 12(builtinFuncs(): 2 Function None 3
13: Label 13: Label
345(i16v): 53(ptr) Variable Function 343(i16v): 53(ptr) Variable Function
348(i16): 15(ptr) Variable Function 346(i16): 15(ptr) Variable Function
358(u16v): 194(ptr) Variable Function 356(u16v): 194(ptr) Variable Function
360(u16): 37(ptr) Variable Function 358(u16): 37(ptr) Variable Function
430(i32): 219(ptr) Variable Function 428(i32): 219(ptr) Variable Function
433(i64): 242(ptr) Variable Function 431(i64): 242(ptr) Variable Function
436(i16v4): 435(ptr) Variable Function 434(i16v4): 433(ptr) Variable Function
439(u32): 298(ptr) Variable Function 437(u32): 296(ptr) Variable Function
440(u16v2): 58(ptr) Variable Function 438(u16v2): 58(ptr) Variable Function
444(u64): 443(ptr) Variable Function 442(u64): 441(ptr) Variable Function
447(u16v4): 446(ptr) Variable Function 445(u16v4): 444(ptr) Variable Function
459(bv): 458(ptr) Variable Function 457(bv): 456(ptr) Variable Function
346: 52(ivec2) Load 345(i16v) 344: 52(ivec2) Load 343(i16v)
347: 52(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 346 345: 52(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 344
Store 345(i16v) 347 Store 343(i16v) 345
349: 14(int) Load 348(i16) 347: 14(int) Load 346(i16)
350: 14(int) ExtInst 1(GLSL.std.450) 7(SSign) 349 348: 14(int) ExtInst 1(GLSL.std.450) 7(SSign) 347
Store 348(i16) 350 Store 346(i16) 348
351: 52(ivec2) Load 345(i16v) 349: 52(ivec2) Load 343(i16v)
352: 14(int) Load 348(i16) 350: 14(int) Load 346(i16)
353: 52(ivec2) CompositeConstruct 352 352 351: 52(ivec2) CompositeConstruct 350 350
354: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 351 353 352: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 349 351
Store 345(i16v) 354 Store 343(i16v) 352
355: 52(ivec2) Load 345(i16v) 353: 52(ivec2) Load 343(i16v)
357: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 355 356 355: 52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 353 354
Store 345(i16v) 357 Store 343(i16v) 355
359: 193(ivec3) Load 358(u16v) 357: 193(ivec3) Load 356(u16v)
361: 36(int) Load 360(u16) 359: 36(int) Load 358(u16)
362: 193(ivec3) CompositeConstruct 361 361 361 360: 193(ivec3) CompositeConstruct 359 359 359
363: 193(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 359 362 361: 193(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 357 360
Store 358(u16v) 363 Store 356(u16v) 361
364: 193(ivec3) Load 358(u16v) 362: 193(ivec3) Load 356(u16v)
366: 193(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 364 365 364: 193(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 362 363
Store 358(u16v) 366 Store 356(u16v) 364
367: 52(ivec2) Load 345(i16v) 365: 52(ivec2) Load 343(i16v)
368: 14(int) Load 348(i16) 366: 14(int) Load 346(i16)
369: 52(ivec2) CompositeConstruct 368 368 367: 52(ivec2) CompositeConstruct 366 366
370: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 367 369 368: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 365 367
Store 345(i16v) 370 Store 343(i16v) 368
371: 52(ivec2) Load 345(i16v) 369: 52(ivec2) Load 343(i16v)
372: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 371 356 370: 52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 369 354
Store 345(i16v) 372 Store 343(i16v) 370
373: 193(ivec3) Load 358(u16v) 371: 193(ivec3) Load 356(u16v)
374: 36(int) Load 360(u16) 372: 36(int) Load 358(u16)
375: 193(ivec3) CompositeConstruct 374 374 374 373: 193(ivec3) CompositeConstruct 372 372 372
376: 193(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 373 375 374: 193(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 371 373
Store 358(u16v) 376 Store 356(u16v) 374
377: 193(ivec3) Load 358(u16v) 375: 193(ivec3) Load 356(u16v)
378: 193(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 377 365 376: 193(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 375 363
Store 358(u16v) 378 Store 356(u16v) 376
379: 52(ivec2) Load 345(i16v) 377: 52(ivec2) Load 343(i16v)
380: 14(int) Load 348(i16) 378: 14(int) Load 346(i16)
381: 14(int) SNegate 380 379: 14(int) SNegate 378
382: 14(int) Load 348(i16) 380: 14(int) Load 346(i16)
383: 52(ivec2) CompositeConstruct 381 381 381: 52(ivec2) CompositeConstruct 379 379
384: 52(ivec2) CompositeConstruct 382 382 382: 52(ivec2) CompositeConstruct 380 380
385: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 379 383 384 383: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 377 381 382
Store 345(i16v) 385 Store 343(i16v) 383
386: 52(ivec2) Load 345(i16v) 384: 52(ivec2) Load 343(i16v)
387: 52(ivec2) Load 345(i16v) 385: 52(ivec2) Load 343(i16v)
388: 52(ivec2) SNegate 387 386: 52(ivec2) SNegate 385
389: 52(ivec2) Load 345(i16v) 387: 52(ivec2) Load 343(i16v)
390: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 386 388 389 388: 52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 384 386 387
Store 345(i16v) 390 Store 343(i16v) 388
391: 193(ivec3) Load 358(u16v) 389: 193(ivec3) Load 356(u16v)
392: 36(int) Load 360(u16) 390: 36(int) Load 358(u16)
393: 36(int) SNegate 392 391: 36(int) SNegate 390
394: 36(int) Load 360(u16) 392: 36(int) Load 358(u16)
395: 193(ivec3) CompositeConstruct 393 393 393 393: 193(ivec3) CompositeConstruct 391 391 391
396: 193(ivec3) CompositeConstruct 394 394 394 394: 193(ivec3) CompositeConstruct 392 392 392
397: 193(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 391 395 396 395: 193(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 389 393 394
Store 358(u16v) 397 Store 356(u16v) 395
398: 193(ivec3) Load 358(u16v) 396: 193(ivec3) Load 356(u16v)
399: 193(ivec3) Load 358(u16v) 397: 193(ivec3) Load 356(u16v)
400: 193(ivec3) SNegate 399 398: 193(ivec3) SNegate 397
401: 193(ivec3) Load 358(u16v) 399: 193(ivec3) Load 356(u16v)
402: 193(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 398 400 401 400: 193(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 396 398 399
Store 358(u16v) 402 Store 356(u16v) 400
403: 15(ptr) AccessChain 345(i16v) 284 401: 15(ptr) AccessChain 343(i16v) 282
402: 14(int) Load 401
403: 15(ptr) AccessChain 343(i16v) 264
404: 14(int) Load 403 404: 14(int) Load 403
405: 15(ptr) AccessChain 345(i16v) 264 406: 14(int) Select 405 404 402
406: 14(int) Load 405 Store 346(i16) 406
408: 14(int) Select 407 406 404 407: 14(int) Load 346(i16)
Store 348(i16) 408 408: 52(ivec2) CompositeConstruct 407 407
409: 14(int) Load 348(i16) 409: 14(int) Load 346(i16)
410: 52(ivec2) CompositeConstruct 409 409 410: 14(int) SNegate 409
411: 14(int) Load 348(i16) 411: 52(ivec2) CompositeConstruct 410 410
412: 14(int) SNegate 411 414: 52(ivec2) Select 413 411 408
413: 52(ivec2) CompositeConstruct 412 412 Store 343(i16v) 414
416: 52(ivec2) Select 415 413 410 415: 37(ptr) AccessChain 356(u16v) 282
Store 345(i16v) 416 416: 36(int) Load 415
417: 37(ptr) AccessChain 358(u16v) 284 417: 37(ptr) AccessChain 356(u16v) 264
418: 36(int) Load 417 418: 36(int) Load 417
419: 37(ptr) AccessChain 358(u16v) 264 419: 36(int) Select 405 418 416
420: 36(int) Load 419 Store 358(u16) 419
421: 36(int) Select 407 420 418 420: 36(int) Load 358(u16)
Store 360(u16) 421 421: 193(ivec3) CompositeConstruct 420 420 420
422: 36(int) Load 360(u16) 422: 36(int) Load 358(u16)
423: 193(ivec3) CompositeConstruct 422 422 422 423: 36(int) SNegate 422
424: 36(int) Load 360(u16) 424: 193(ivec3) CompositeConstruct 423 423 423
425: 36(int) SNegate 424 427: 193(ivec3) Select 426 424 421
426: 193(ivec3) CompositeConstruct 425 425 425 Store 356(u16v) 427
429: 193(ivec3) Select 428 426 423 429: 52(ivec2) Load 343(i16v)
Store 358(u16v) 429 430: 27(int) Bitcast 429
431: 52(ivec2) Load 345(i16v) Store 428(i32) 430
432: 27(int) Bitcast 431 435: 432(ivec4) Load 434(i16v4)
Store 430(i32) 432 436: 71(int) Bitcast 435
437: 434(ivec4) Load 436(i16v4) Store 431(i64) 436
438: 71(int) Bitcast 437 439: 57(ivec2) Load 438(u16v2)
Store 433(i64) 438 440: 17(int) Bitcast 439
441: 57(ivec2) Load 440(u16v2) Store 437(u32) 440
442: 17(int) Bitcast 441 446: 443(ivec4) Load 445(u16v4)
Store 439(u32) 442 447: 77(int) Bitcast 446
448: 445(ivec4) Load 447(u16v4) Store 442(u64) 447
449: 77(int) Bitcast 448 448: 27(int) Load 428(i32)
Store 444(u64) 449 449: 52(ivec2) Bitcast 448
450: 27(int) Load 430(i32) Store 343(i16v) 449
451: 52(ivec2) Bitcast 450 450: 71(int) Load 431(i64)
Store 345(i16v) 451 451: 432(ivec4) Bitcast 450
452: 71(int) Load 433(i64) Store 434(i16v4) 451
453: 434(ivec4) Bitcast 452 452: 17(int) Load 437(u32)
Store 436(i16v4) 453 453: 57(ivec2) Bitcast 452
454: 17(int) Load 439(u32) Store 438(u16v2) 453
455: 57(ivec2) Bitcast 454 454: 77(int) Load 442(u64)
Store 440(u16v2) 455 455: 443(ivec4) Bitcast 454
456: 77(int) Load 444(u64) Store 445(u16v4) 455
457: 445(ivec4) Bitcast 456 458: 193(ivec3) Load 356(u16v)
Store 447(u16v4) 457 459: 36(int) Load 358(u16)
460: 193(ivec3) Load 358(u16v) 460: 193(ivec3) CompositeConstruct 459 459 459
461: 36(int) Load 360(u16) 461: 425(bvec3) ULessThan 458 460
462: 193(ivec3) CompositeConstruct 461 461 461 Store 457(bv) 461
463: 427(bvec3) ULessThan 460 462 462: 52(ivec2) Load 343(i16v)
Store 459(bv) 463 463: 14(int) Load 346(i16)
464: 52(ivec2) Load 345(i16v) 464: 52(ivec2) CompositeConstruct 463 463
465: 14(int) Load 348(i16) 465: 174(bvec2) SLessThan 462 464
466: 52(ivec2) CompositeConstruct 465 465 466: 425(bvec3) Load 457(bv)
467: 174(bvec2) SLessThan 464 466 467: 425(bvec3) VectorShuffle 466 465 3 4 2
468: 427(bvec3) Load 459(bv) Store 457(bv) 467
469: 427(bvec3) VectorShuffle 468 467 3 4 2 468: 193(ivec3) Load 356(u16v)
Store 459(bv) 469 469: 36(int) Load 358(u16)
470: 193(ivec3) Load 358(u16v) 470: 193(ivec3) CompositeConstruct 469 469 469
471: 36(int) Load 360(u16) 471: 425(bvec3) ULessThanEqual 468 470
472: 193(ivec3) CompositeConstruct 471 471 471 Store 457(bv) 471
473: 427(bvec3) ULessThanEqual 470 472 472: 52(ivec2) Load 343(i16v)
Store 459(bv) 473 473: 14(int) Load 346(i16)
474: 52(ivec2) Load 345(i16v) 474: 52(ivec2) CompositeConstruct 473 473
475: 14(int) Load 348(i16) 475: 174(bvec2) SLessThanEqual 472 474
476: 52(ivec2) CompositeConstruct 475 475 476: 425(bvec3) Load 457(bv)
477: 174(bvec2) SLessThanEqual 474 476 477: 425(bvec3) VectorShuffle 476 475 3 4 2
478: 427(bvec3) Load 459(bv) Store 457(bv) 477
479: 427(bvec3) VectorShuffle 478 477 3 4 2 478: 193(ivec3) Load 356(u16v)
Store 459(bv) 479 479: 36(int) Load 358(u16)
480: 193(ivec3) Load 358(u16v) 480: 193(ivec3) CompositeConstruct 479 479 479
481: 36(int) Load 360(u16) 481: 425(bvec3) UGreaterThan 478 480
482: 193(ivec3) CompositeConstruct 481 481 481 Store 457(bv) 481
483: 427(bvec3) UGreaterThan 480 482 482: 52(ivec2) Load 343(i16v)
Store 459(bv) 483 483: 14(int) Load 346(i16)
484: 52(ivec2) Load 345(i16v) 484: 52(ivec2) CompositeConstruct 483 483
485: 14(int) Load 348(i16) 485: 174(bvec2) SGreaterThan 482 484
486: 52(ivec2) CompositeConstruct 485 485 486: 425(bvec3) Load 457(bv)
487: 174(bvec2) SGreaterThan 484 486 487: 425(bvec3) VectorShuffle 486 485 3 4 2
488: 427(bvec3) Load 459(bv) Store 457(bv) 487
489: 427(bvec3) VectorShuffle 488 487 3 4 2 488: 193(ivec3) Load 356(u16v)
Store 459(bv) 489 489: 36(int) Load 358(u16)
490: 193(ivec3) Load 358(u16v) 490: 193(ivec3) CompositeConstruct 489 489 489
491: 36(int) Load 360(u16) 491: 425(bvec3) UGreaterThanEqual 488 490
492: 193(ivec3) CompositeConstruct 491 491 491 Store 457(bv) 491
493: 427(bvec3) UGreaterThanEqual 490 492 492: 52(ivec2) Load 343(i16v)
Store 459(bv) 493 493: 14(int) Load 346(i16)
494: 52(ivec2) Load 345(i16v) 494: 52(ivec2) CompositeConstruct 493 493
495: 14(int) Load 348(i16) 495: 174(bvec2) SGreaterThanEqual 492 494
496: 52(ivec2) CompositeConstruct 495 495 496: 425(bvec3) Load 457(bv)
497: 174(bvec2) SGreaterThanEqual 494 496 497: 425(bvec3) VectorShuffle 496 495 3 4 2
498: 427(bvec3) Load 459(bv) Store 457(bv) 497
499: 427(bvec3) VectorShuffle 498 497 3 4 2 498: 193(ivec3) Load 356(u16v)
Store 459(bv) 499 499: 36(int) Load 358(u16)
500: 193(ivec3) Load 358(u16v) 500: 193(ivec3) CompositeConstruct 499 499 499
501: 36(int) Load 360(u16) 501: 425(bvec3) IEqual 498 500
502: 193(ivec3) CompositeConstruct 501 501 501 Store 457(bv) 501
503: 427(bvec3) IEqual 500 502 502: 52(ivec2) Load 343(i16v)
Store 459(bv) 503 503: 14(int) Load 346(i16)
504: 52(ivec2) Load 345(i16v) 504: 52(ivec2) CompositeConstruct 503 503
505: 14(int) Load 348(i16) 505: 174(bvec2) IEqual 502 504
506: 52(ivec2) CompositeConstruct 505 505 506: 425(bvec3) Load 457(bv)
507: 174(bvec2) IEqual 504 506 507: 425(bvec3) VectorShuffle 506 505 3 4 2
508: 427(bvec3) Load 459(bv) Store 457(bv) 507
509: 427(bvec3) VectorShuffle 508 507 3 4 2 508: 193(ivec3) Load 356(u16v)
Store 459(bv) 509 509: 36(int) Load 358(u16)
510: 193(ivec3) Load 358(u16v) 510: 193(ivec3) CompositeConstruct 509 509 509
511: 36(int) Load 360(u16) 511: 425(bvec3) INotEqual 508 510
512: 193(ivec3) CompositeConstruct 511 511 511 Store 457(bv) 511
513: 427(bvec3) INotEqual 510 512 512: 52(ivec2) Load 343(i16v)
Store 459(bv) 513 513: 14(int) Load 346(i16)
514: 52(ivec2) Load 345(i16v) 514: 52(ivec2) CompositeConstruct 513 513
515: 14(int) Load 348(i16) 515: 174(bvec2) INotEqual 512 514
516: 52(ivec2) CompositeConstruct 515 515 516: 425(bvec3) Load 457(bv)
517: 174(bvec2) INotEqual 514 516 517: 425(bvec3) VectorShuffle 516 515 3 4 2
518: 427(bvec3) Load 459(bv) Store 457(bv) 517
519: 427(bvec3) VectorShuffle 518 517 3 4 2
Store 459(bv) 519
Return Return
FunctionEnd FunctionEnd

View File

@ -1,5 +1,5 @@
#define m#0# #define m#0#
#if m #if m
#endif
#define n() #define n()
int n" int n"

View File

@ -0,0 +1,14 @@
#version 110
#if 0
3.5L
3.5h
2034h
1.#INF
0x1234567812345L
12323394203923879234L
0123s;
123s;
0123456712345671234L
"string"
#endif

View File

@ -0,0 +1,15 @@
#version 300 es
precision mediump float;
noperspective in vec4 bad; // ERROR
#extension GL_NV_shader_noperspective_interpolation : enable
noperspective in vec4 color;
out vec4 fragColor;
void main() {
fragColor = color;
}

View File

@ -201,6 +201,13 @@ diff -b $BASEDIR/hlsl.y-negate-2.vert.out $TARGETDIR/hlsl.y-negate-2.vert.out ||
$EXE -H -e main -V -D -Od -H -i --invert-y hlsl.y-negate-3.vert > $TARGETDIR/hlsl.y-negate-3.vert.out $EXE -H -e main -V -D -Od -H -i --invert-y hlsl.y-negate-3.vert > $TARGETDIR/hlsl.y-negate-3.vert.out
diff -b $BASEDIR/hlsl.y-negate-3.vert.out $TARGETDIR/hlsl.y-negate-3.vert.out || HASERROR=1 diff -b $BASEDIR/hlsl.y-negate-3.vert.out $TARGETDIR/hlsl.y-negate-3.vert.out || HASERROR=1
#
# Testing hlsl_functionality1
#
$EXE -H -e main -D -Od -fhlsl_functionality1 hlsl.structbuffer.incdec.frag > \
$TARGETDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out
diff -b $BASEDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out $TARGETDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out || HASERROR=1
# #
# Final checking # Final checking
# #

View File

@ -116,6 +116,8 @@ void operators()
i64 = i64 % i; i64 = i64 % i;
// Shift // Shift
u64v = u64v << i;
i64 = i64 >> uv.y;
u64v <<= i; u64v <<= i;
i64 >>= uv.y; i64 >>= uv.y;

15
Test/spv.rankShift.comp Normal file
View File

@ -0,0 +1,15 @@
#version 450
#extension GL_ARB_gpu_shader_int64 : require
layout(local_size_x = 54) in;
layout(location=4) uniform int64_t arg0;
layout(location=5) uniform uint arg1;
void main()
{
uint64_t result = arg0 << arg1;
result = arg0 >> arg1;
result <<= arg1;
result >>= arg1;
}

View File

@ -37,21 +37,8 @@
#ifndef _COMMON_INCLUDED_ #ifndef _COMMON_INCLUDED_
#define _COMMON_INCLUDED_ #define _COMMON_INCLUDED_
#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) || defined MINGW_HAS_SECURE_API
#include <basetsd.h>
#define snprintf sprintf_s
#define safe_vsprintf(buf,max,format,args) vsnprintf_s((buf), (max), (max), (format), (args))
#elif defined (solaris)
#define safe_vsprintf(buf,max,format,args) vsnprintf((buf), (max), (format), (args))
#include <sys/int_types.h>
#define UINT_PTR uintptr_t
#else
#define safe_vsprintf(buf,max,format,args) vsnprintf((buf), (max), (format), (args))
#include <stdint.h>
#define UINT_PTR uintptr_t
#endif
#if defined(__ANDROID__) || (defined(_MSC_VER) && _MSC_VER < 1700) #if defined(__ANDROID__) || _MSC_VER < 1700
#include <sstream> #include <sstream>
namespace std { namespace std {
template<typename T> template<typename T>
@ -63,6 +50,22 @@ std::string to_string(const T& val) {
} }
#endif #endif
#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) || defined MINGW_HAS_SECURE_API
#include <basetsd.h>
#ifndef snprintf
#define snprintf sprintf_s
#endif
#define safe_vsprintf(buf,max,format,args) vsnprintf_s((buf), (max), (max), (format), (args))
#elif defined (solaris)
#define safe_vsprintf(buf,max,format,args) vsnprintf((buf), (max), (format), (args))
#include <sys/int_types.h>
#define UINT_PTR uintptr_t
#else
#define safe_vsprintf(buf,max,format,args) vsnprintf((buf), (max), (format), (args))
#include <stdint.h>
#define UINT_PTR uintptr_t
#endif
#if defined(_MSC_VER) && _MSC_VER < 1800 #if defined(_MSC_VER) && _MSC_VER < 1800
inline long long int strtoll (const char* str, char** endptr, int base) inline long long int strtoll (const char* str, char** endptr, int base)
{ {

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 2604 #define GLSLANG_PATCH_LEVEL 2637

View File

@ -475,7 +475,7 @@ bool TIntermediate::isConversionAllowed(TOperator op, TIntermTyped* node) const
// This is 'mechanism' here, it does any conversion told. // This is 'mechanism' here, it does any conversion told.
// It is about basic type, not about shape. // It is about basic type, not about shape.
// The policy comes from the shader or the above code. // The policy comes from the shader or the calling code.
TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped* node) const TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped* node) const
{ {
// //
@ -488,44 +488,44 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
switch (convertTo) { switch (convertTo) {
case EbtDouble: case EbtDouble:
switch (node->getBasicType()) { switch (node->getBasicType()) {
case EbtInt8: newOp = EOpConvInt8ToDouble; break; case EbtInt8: newOp = EOpConvInt8ToDouble; break;
case EbtUint8: newOp = EOpConvUint8ToDouble; break; case EbtUint8: newOp = EOpConvUint8ToDouble; break;
case EbtInt16: newOp = EOpConvInt16ToDouble; break; case EbtInt16: newOp = EOpConvInt16ToDouble; break;
case EbtUint16:newOp = EOpConvUint16ToDouble;break; case EbtUint16: newOp = EOpConvUint16ToDouble; break;
case EbtInt: newOp = EOpConvIntToDouble; break; case EbtInt: newOp = EOpConvIntToDouble; break;
case EbtUint: newOp = EOpConvUintToDouble; break; case EbtUint: newOp = EOpConvUintToDouble; break;
case EbtBool: newOp = EOpConvBoolToDouble; break; case EbtBool: newOp = EOpConvBoolToDouble; break;
case EbtFloat: newOp = EOpConvFloatToDouble; break; case EbtFloat: newOp = EOpConvFloatToDouble; break;
case EbtFloat16: newOp = EOpConvFloat16ToDouble; break; case EbtFloat16: newOp = EOpConvFloat16ToDouble; break;
case EbtInt64: newOp = EOpConvInt64ToDouble; break; case EbtInt64: newOp = EOpConvInt64ToDouble; break;
case EbtUint64: newOp = EOpConvUint64ToDouble; break; case EbtUint64: newOp = EOpConvUint64ToDouble; break;
default: default:
return nullptr; return nullptr;
} }
break; break;
case EbtFloat: case EbtFloat:
switch (node->getBasicType()) { switch (node->getBasicType()) {
case EbtInt8: newOp = EOpConvInt8ToFloat; break; case EbtInt8: newOp = EOpConvInt8ToFloat; break;
case EbtUint8: newOp = EOpConvUint8ToFloat; break; case EbtUint8: newOp = EOpConvUint8ToFloat; break;
case EbtInt16: newOp = EOpConvInt16ToFloat; break; case EbtInt16: newOp = EOpConvInt16ToFloat; break;
case EbtUint16: newOp = EOpConvUint16ToFloat; break; case EbtUint16: newOp = EOpConvUint16ToFloat; break;
case EbtInt: newOp = EOpConvIntToFloat; break; case EbtInt: newOp = EOpConvIntToFloat; break;
case EbtUint: newOp = EOpConvUintToFloat; break; case EbtUint: newOp = EOpConvUintToFloat; break;
case EbtBool: newOp = EOpConvBoolToFloat; break; case EbtBool: newOp = EOpConvBoolToFloat; break;
case EbtDouble: newOp = EOpConvDoubleToFloat; break; case EbtDouble: newOp = EOpConvDoubleToFloat; break;
case EbtFloat16: newOp = EOpConvFloat16ToFloat; break; case EbtFloat16: newOp = EOpConvFloat16ToFloat; break;
case EbtInt64: newOp = EOpConvInt64ToFloat; break; case EbtInt64: newOp = EOpConvInt64ToFloat; break;
case EbtUint64: newOp = EOpConvUint64ToFloat; break; case EbtUint64: newOp = EOpConvUint64ToFloat; break;
default: default:
return nullptr; return nullptr;
} }
break; break;
case EbtFloat16: case EbtFloat16:
switch (node->getBasicType()) { switch (node->getBasicType()) {
case EbtInt8: newOp = EOpConvInt8ToFloat16; break; case EbtInt8: newOp = EOpConvInt8ToFloat16; break;
case EbtUint8: newOp = EOpConvUint8ToFloat16; break; case EbtUint8: newOp = EOpConvUint8ToFloat16; break;
case EbtInt16: newOp = EOpConvInt16ToFloat16; break; case EbtInt16: newOp = EOpConvInt16ToFloat16; break;
case EbtUint16: newOp = EOpConvUint16ToFloat16; break; case EbtUint16: newOp = EOpConvUint16ToFloat16; break;
case EbtInt: newOp = EOpConvIntToFloat16; break; case EbtInt: newOp = EOpConvIntToFloat16; break;
case EbtUint: newOp = EOpConvUintToFloat16; break; case EbtUint: newOp = EOpConvUintToFloat16; break;
case EbtBool: newOp = EOpConvBoolToFloat16; break; case EbtBool: newOp = EOpConvBoolToFloat16; break;
@ -539,33 +539,33 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
break; break;
case EbtBool: case EbtBool:
switch (node->getBasicType()) { switch (node->getBasicType()) {
case EbtInt8: newOp = EOpConvInt8ToBool; break; case EbtInt8: newOp = EOpConvInt8ToBool; break;
case EbtUint8: newOp = EOpConvUint8ToBool; break; case EbtUint8: newOp = EOpConvUint8ToBool; break;
case EbtInt16: newOp = EOpConvInt16ToBool; break; case EbtInt16: newOp = EOpConvInt16ToBool; break;
case EbtUint16: newOp = EOpConvUint16ToBool; break; case EbtUint16: newOp = EOpConvUint16ToBool; break;
case EbtInt: newOp = EOpConvIntToBool; break; case EbtInt: newOp = EOpConvIntToBool; break;
case EbtUint: newOp = EOpConvUintToBool; break; case EbtUint: newOp = EOpConvUintToBool; break;
case EbtFloat: newOp = EOpConvFloatToBool; break; case EbtFloat: newOp = EOpConvFloatToBool; break;
case EbtDouble: newOp = EOpConvDoubleToBool; break; case EbtDouble: newOp = EOpConvDoubleToBool; break;
case EbtFloat16: newOp = EOpConvFloat16ToBool; break; case EbtFloat16: newOp = EOpConvFloat16ToBool; break;
case EbtInt64: newOp = EOpConvInt64ToBool; break; case EbtInt64: newOp = EOpConvInt64ToBool; break;
case EbtUint64: newOp = EOpConvUint64ToBool; break; case EbtUint64: newOp = EOpConvUint64ToBool; break;
default: default:
return nullptr; return nullptr;
} }
break; break;
case EbtInt8: case EbtInt8:
switch (node->getBasicType()) { switch (node->getBasicType()) {
case EbtUint8: newOp = EOpConvUint8ToInt8; break; case EbtUint8: newOp = EOpConvUint8ToInt8; break;
case EbtInt16: newOp = EOpConvInt16ToInt8; break; case EbtInt16: newOp = EOpConvInt16ToInt8; break;
case EbtUint16: newOp = EOpConvUint16ToInt8; break; case EbtUint16: newOp = EOpConvUint16ToInt8; break;
case EbtInt: newOp = EOpConvIntToInt8; break; case EbtInt: newOp = EOpConvIntToInt8; break;
case EbtUint: newOp = EOpConvUintToInt8; break; case EbtUint: newOp = EOpConvUintToInt8; break;
case EbtInt64: newOp = EOpConvInt64ToInt8; break; case EbtInt64: newOp = EOpConvInt64ToInt8; break;
case EbtUint64: newOp = EOpConvUint64ToInt8; break; case EbtUint64: newOp = EOpConvUint64ToInt8; break;
case EbtBool: newOp = EOpConvBoolToInt8; break; case EbtBool: newOp = EOpConvBoolToInt8; break;
case EbtFloat: newOp = EOpConvFloatToInt8; break; case EbtFloat: newOp = EOpConvFloatToInt8; break;
case EbtDouble: newOp = EOpConvDoubleToInt8; break; case EbtDouble: newOp = EOpConvDoubleToInt8; break;
case EbtFloat16: newOp = EOpConvFloat16ToInt8; break; case EbtFloat16: newOp = EOpConvFloat16ToInt8; break;
default: default:
return nullptr; return nullptr;
@ -573,16 +573,16 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
break; break;
case EbtUint8: case EbtUint8:
switch (node->getBasicType()) { switch (node->getBasicType()) {
case EbtInt8: newOp = EOpConvInt8ToUint8; break; case EbtInt8: newOp = EOpConvInt8ToUint8; break;
case EbtInt16: newOp = EOpConvInt16ToUint8; break; case EbtInt16: newOp = EOpConvInt16ToUint8; break;
case EbtUint16: newOp = EOpConvUint16ToUint8; break; case EbtUint16: newOp = EOpConvUint16ToUint8; break;
case EbtInt: newOp = EOpConvIntToUint8; break; case EbtInt: newOp = EOpConvIntToUint8; break;
case EbtUint: newOp = EOpConvUintToUint8; break; case EbtUint: newOp = EOpConvUintToUint8; break;
case EbtInt64: newOp = EOpConvInt64ToUint8; break; case EbtInt64: newOp = EOpConvInt64ToUint8; break;
case EbtUint64: newOp = EOpConvUint64ToUint8; break; case EbtUint64: newOp = EOpConvUint64ToUint8; break;
case EbtBool: newOp = EOpConvBoolToUint8; break; case EbtBool: newOp = EOpConvBoolToUint8; break;
case EbtFloat: newOp = EOpConvFloatToUint8; break; case EbtFloat: newOp = EOpConvFloatToUint8; break;
case EbtDouble: newOp = EOpConvDoubleToUint8; break; case EbtDouble: newOp = EOpConvDoubleToUint8; break;
case EbtFloat16: newOp = EOpConvFloat16ToUint8; break; case EbtFloat16: newOp = EOpConvFloat16ToUint8; break;
default: default:
return nullptr; return nullptr;
@ -591,16 +591,16 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
case EbtInt16: case EbtInt16:
switch (node->getBasicType()) { switch (node->getBasicType()) {
case EbtUint8: newOp = EOpConvUint8ToInt16; break; case EbtUint8: newOp = EOpConvUint8ToInt16; break;
case EbtInt8: newOp = EOpConvInt8ToInt16; break; case EbtInt8: newOp = EOpConvInt8ToInt16; break;
case EbtUint16: newOp = EOpConvUint16ToInt16; break; case EbtUint16: newOp = EOpConvUint16ToInt16; break;
case EbtInt: newOp = EOpConvIntToInt16; break; case EbtInt: newOp = EOpConvIntToInt16; break;
case EbtUint: newOp = EOpConvUintToInt16; break; case EbtUint: newOp = EOpConvUintToInt16; break;
case EbtInt64: newOp = EOpConvInt64ToInt16; break; case EbtInt64: newOp = EOpConvInt64ToInt16; break;
case EbtUint64: newOp = EOpConvUint64ToInt16; break; case EbtUint64: newOp = EOpConvUint64ToInt16; break;
case EbtBool: newOp = EOpConvBoolToInt16; break; case EbtBool: newOp = EOpConvBoolToInt16; break;
case EbtFloat: newOp = EOpConvFloatToInt16; break; case EbtFloat: newOp = EOpConvFloatToInt16; break;
case EbtDouble: newOp = EOpConvDoubleToInt16; break; case EbtDouble: newOp = EOpConvDoubleToInt16; break;
case EbtFloat16: newOp = EOpConvFloat16ToInt16; break; case EbtFloat16: newOp = EOpConvFloat16ToInt16; break;
default: default:
return nullptr; return nullptr;
@ -608,16 +608,16 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
break; break;
case EbtUint16: case EbtUint16:
switch (node->getBasicType()) { switch (node->getBasicType()) {
case EbtInt8: newOp = EOpConvInt8ToUint16; break; case EbtInt8: newOp = EOpConvInt8ToUint16; break;
case EbtUint8: newOp = EOpConvUint8ToUint16; break; case EbtUint8: newOp = EOpConvUint8ToUint16; break;
case EbtInt16: newOp = EOpConvInt16ToUint16; break; case EbtInt16: newOp = EOpConvInt16ToUint16; break;
case EbtInt: newOp = EOpConvIntToUint16; break; case EbtInt: newOp = EOpConvIntToUint16; break;
case EbtUint: newOp = EOpConvUintToUint16; break; case EbtUint: newOp = EOpConvUintToUint16; break;
case EbtInt64: newOp = EOpConvInt64ToUint16; break; case EbtInt64: newOp = EOpConvInt64ToUint16; break;
case EbtUint64: newOp = EOpConvUint64ToUint16; break; case EbtUint64: newOp = EOpConvUint64ToUint16; break;
case EbtBool: newOp = EOpConvBoolToUint16; break; case EbtBool: newOp = EOpConvBoolToUint16; break;
case EbtFloat: newOp = EOpConvFloatToUint16; break; case EbtFloat: newOp = EOpConvFloatToUint16; break;
case EbtDouble: newOp = EOpConvDoubleToUint16; break; case EbtDouble: newOp = EOpConvDoubleToUint16; break;
case EbtFloat16: newOp = EOpConvFloat16ToUint16; break; case EbtFloat16: newOp = EOpConvFloat16ToUint16; break;
default: default:
return nullptr; return nullptr;
@ -626,68 +626,68 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
case EbtInt: case EbtInt:
switch (node->getBasicType()) { switch (node->getBasicType()) {
case EbtInt8: newOp = EOpConvInt8ToInt; break; case EbtInt8: newOp = EOpConvInt8ToInt; break;
case EbtUint8: newOp = EOpConvUint8ToInt; break; case EbtUint8: newOp = EOpConvUint8ToInt; break;
case EbtInt16: newOp = EOpConvInt16ToInt; break; case EbtInt16: newOp = EOpConvInt16ToInt; break;
case EbtUint16: newOp = EOpConvUint16ToInt; break; case EbtUint16: newOp = EOpConvUint16ToInt; break;
case EbtUint: newOp = EOpConvUintToInt; break; case EbtUint: newOp = EOpConvUintToInt; break;
case EbtBool: newOp = EOpConvBoolToInt; break; case EbtBool: newOp = EOpConvBoolToInt; break;
case EbtFloat: newOp = EOpConvFloatToInt; break; case EbtFloat: newOp = EOpConvFloatToInt; break;
case EbtDouble: newOp = EOpConvDoubleToInt; break; case EbtDouble: newOp = EOpConvDoubleToInt; break;
case EbtFloat16: newOp = EOpConvFloat16ToInt; break; case EbtFloat16: newOp = EOpConvFloat16ToInt; break;
case EbtInt64: newOp = EOpConvInt64ToInt; break; case EbtInt64: newOp = EOpConvInt64ToInt; break;
case EbtUint64: newOp = EOpConvUint64ToInt; break; case EbtUint64: newOp = EOpConvUint64ToInt; break;
default: default:
return nullptr; return nullptr;
} }
break; break;
case EbtUint: case EbtUint:
switch (node->getBasicType()) { switch (node->getBasicType()) {
case EbtInt8: newOp = EOpConvInt8ToUint; break; case EbtInt8: newOp = EOpConvInt8ToUint; break;
case EbtUint8: newOp = EOpConvUint8ToUint; break; case EbtUint8: newOp = EOpConvUint8ToUint; break;
case EbtInt16: newOp = EOpConvInt16ToUint; break; case EbtInt16: newOp = EOpConvInt16ToUint; break;
case EbtUint16: newOp = EOpConvUint16ToUint; break; case EbtUint16: newOp = EOpConvUint16ToUint; break;
case EbtInt: newOp = EOpConvIntToUint; break; case EbtInt: newOp = EOpConvIntToUint; break;
case EbtBool: newOp = EOpConvBoolToUint; break; case EbtBool: newOp = EOpConvBoolToUint; break;
case EbtFloat: newOp = EOpConvFloatToUint; break; case EbtFloat: newOp = EOpConvFloatToUint; break;
case EbtDouble: newOp = EOpConvDoubleToUint; break; case EbtDouble: newOp = EOpConvDoubleToUint; break;
case EbtFloat16: newOp = EOpConvFloat16ToUint; break; case EbtFloat16: newOp = EOpConvFloat16ToUint; break;
case EbtInt64: newOp = EOpConvInt64ToUint; break; case EbtInt64: newOp = EOpConvInt64ToUint; break;
case EbtUint64: newOp = EOpConvUint64ToUint; break; case EbtUint64: newOp = EOpConvUint64ToUint; break;
default: default:
return nullptr; return nullptr;
} }
break; break;
case EbtInt64: case EbtInt64:
switch (node->getBasicType()) { switch (node->getBasicType()) {
case EbtInt8: newOp = EOpConvInt8ToInt64; break; case EbtInt8: newOp = EOpConvInt8ToInt64; break;
case EbtUint8: newOp = EOpConvUint8ToInt64; break; case EbtUint8: newOp = EOpConvUint8ToInt64; break;
case EbtInt16: newOp = EOpConvInt16ToInt64; break; case EbtInt16: newOp = EOpConvInt16ToInt64; break;
case EbtUint16: newOp = EOpConvUint16ToInt64; break; case EbtUint16: newOp = EOpConvUint16ToInt64; break;
case EbtInt: newOp = EOpConvIntToInt64; break; case EbtInt: newOp = EOpConvIntToInt64; break;
case EbtUint: newOp = EOpConvUintToInt64; break; case EbtUint: newOp = EOpConvUintToInt64; break;
case EbtBool: newOp = EOpConvBoolToInt64; break; case EbtBool: newOp = EOpConvBoolToInt64; break;
case EbtFloat: newOp = EOpConvFloatToInt64; break; case EbtFloat: newOp = EOpConvFloatToInt64; break;
case EbtDouble: newOp = EOpConvDoubleToInt64; break; case EbtDouble: newOp = EOpConvDoubleToInt64; break;
case EbtFloat16: newOp = EOpConvFloat16ToInt64; break; case EbtFloat16: newOp = EOpConvFloat16ToInt64; break;
case EbtUint64: newOp = EOpConvUint64ToInt64; break; case EbtUint64: newOp = EOpConvUint64ToInt64; break;
default: default:
return nullptr; return nullptr;
} }
break; break;
case EbtUint64: case EbtUint64:
switch (node->getBasicType()) { switch (node->getBasicType()) {
case EbtInt8: newOp = EOpConvInt8ToUint64; break; case EbtInt8: newOp = EOpConvInt8ToUint64; break;
case EbtUint8: newOp = EOpConvUint8ToUint64; break; case EbtUint8: newOp = EOpConvUint8ToUint64; break;
case EbtInt16: newOp = EOpConvInt16ToUint64; break; case EbtInt16: newOp = EOpConvInt16ToUint64; break;
case EbtUint16: newOp = EOpConvUint16ToUint64; break; case EbtUint16: newOp = EOpConvUint16ToUint64; break;
case EbtInt: newOp = EOpConvIntToUint64; break; case EbtInt: newOp = EOpConvIntToUint64; break;
case EbtUint: newOp = EOpConvUintToUint64; break; case EbtUint: newOp = EOpConvUintToUint64; break;
case EbtBool: newOp = EOpConvBoolToUint64; break; case EbtBool: newOp = EOpConvBoolToUint64; break;
case EbtFloat: newOp = EOpConvFloatToUint64; break; case EbtFloat: newOp = EOpConvFloatToUint64; break;
case EbtDouble: newOp = EOpConvDoubleToUint64; break; case EbtDouble: newOp = EOpConvDoubleToUint64; break;
case EbtFloat16: newOp = EOpConvFloat16ToUint64; break; case EbtFloat16: newOp = EOpConvFloat16ToUint64; break;
case EbtInt64: newOp = EOpConvInt64ToUint64; break; case EbtInt64: newOp = EOpConvInt64ToUint64; break;
default: default:
return nullptr; return nullptr;
} }
@ -714,30 +714,36 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
return newNode; return newNode;
} }
// For converting a pair of operands to a binary operation to compatible
// types with each other, relative to the operation in 'op'.
// This does not cover assignment operations, which is asymmetric in that the
// left type is not changeable.
// See addConversion(op, type, node) for assignments and unary operation
// conversions.
//
// Generally, this is focused on basic type conversion, not shape conversion.
// See addShapeConversion() for shape conversions.
//
// Returns the converted pair of nodes.
// Returns <nullptr, nullptr> when there is no conversion.
std::tuple<TIntermTyped*, TIntermTyped*> std::tuple<TIntermTyped*, TIntermTyped*>
TIntermediate::addConversion(TOperator op, TIntermTyped* node0, TIntermTyped* node1) const TIntermediate::addConversion(TOperator op, TIntermTyped* node0, TIntermTyped* node1) const
{ {
if (!isConversionAllowed(op, node0) || !isConversionAllowed(op, node1)) { if (!isConversionAllowed(op, node0) || !isConversionAllowed(op, node1))
return std::make_tuple(nullptr, nullptr); return std::make_tuple(nullptr, nullptr);
if (node0->getType() != node1->getType()) {
// If differing structure, then no conversions.
if (node0->isStruct() || node1->isStruct())
return std::make_tuple(nullptr, nullptr);
// If differing arrays, then no conversions.
if (node0->getType().isArray() || node1->getType().isArray())
return std::make_tuple(nullptr, nullptr);
} }
// If types are identical, no problem
if (node0->getType() == node1->getType())
return std::make_tuple(node0, node1);
// If one's a structure, then no conversions.
if (node0->isStruct() || node1->isStruct())
return std::make_tuple(nullptr, nullptr);
// If one's an array, then no conversions.
if (node0->getType().isArray() || node1->getType().isArray())
return std::make_tuple(nullptr, nullptr);
auto promoteTo = std::make_tuple(EbtNumTypes, EbtNumTypes); auto promoteTo = std::make_tuple(EbtNumTypes, EbtNumTypes);
TBasicType type0 = node0->getType().getBasicType();
TBasicType type1 = node1->getType().getBasicType();
switch (op) { switch (op) {
// //
// List all the binary ops that can implicitly convert one operand to the other's type; // List all the binary ops that can implicitly convert one operand to the other's type;
@ -764,80 +770,52 @@ TIntermediate::addConversion(TOperator op, TIntermTyped* node0, TIntermTyped* no
case EOpAnd: case EOpAnd:
case EOpInclusiveOr: case EOpInclusiveOr:
case EOpExclusiveOr: case EOpExclusiveOr:
case EOpAndAssign:
case EOpInclusiveOrAssign:
case EOpExclusiveOrAssign:
case EOpLogicalNot:
case EOpLogicalAnd:
case EOpLogicalOr:
case EOpLogicalXor:
case EOpFunctionCall: case EOpSequence: // used by ?:
case EOpReturn:
case EOpAssign:
case EOpAddAssign:
case EOpSubAssign:
case EOpMulAssign:
case EOpVectorTimesScalarAssign:
case EOpMatrixTimesScalarAssign:
case EOpDivAssign:
case EOpModAssign:
case EOpAtan: if (node0->getBasicType() == node1->getBasicType())
case EOpClamp:
case EOpCross:
case EOpDistance:
case EOpDot:
case EOpDst:
case EOpFaceForward:
case EOpFma:
case EOpFrexp:
case EOpLdexp:
case EOpMix:
case EOpLit:
case EOpMax:
case EOpMin:
case EOpModf:
case EOpPow:
case EOpReflect:
case EOpRefract:
case EOpSmoothStep:
case EOpStep:
case EOpSequence:
case EOpConstructStruct:
if (type0 == type1)
return std::make_tuple(node0, node1); return std::make_tuple(node0, node1);
promoteTo = getConversionDestinatonType(type0, type1, op); promoteTo = getConversionDestinatonType(node0->getBasicType(), node1->getBasicType(), op);
if (std::get<0>(promoteTo) == EbtNumTypes || std::get<1>(promoteTo) == EbtNumTypes) if (std::get<0>(promoteTo) == EbtNumTypes || std::get<1>(promoteTo) == EbtNumTypes)
return std::make_tuple(nullptr, nullptr); return std::make_tuple(nullptr, nullptr);
break; break;
// Shifts can have mixed types as long as they are integer and of the same rank, case EOpLogicalAnd:
// without converting. case EOpLogicalOr:
// It's the left operand's type that determines the resulting type, so no issue case EOpLogicalXor:
// with assign shift ops either. if (source == EShSourceHlsl)
promoteTo = std::make_tuple(EbtBool, EbtBool);
else
return std::make_tuple(node0, node1);
break;
// There are no conversions needed for GLSL; the shift amount just needs to be an
// integer type, as does the base.
// HLSL can promote bools to ints to make this work.
case EOpLeftShift: case EOpLeftShift:
case EOpRightShift: case EOpRightShift:
case EOpLeftShiftAssign: if (source == EShSourceHlsl) {
case EOpRightShiftAssign: TBasicType node0BasicType = node0->getBasicType();
if (node0BasicType == EbtBool)
if (isTypeInt(type0) && isTypeInt(type1)) { node0BasicType = EbtInt;
if (getTypeRank(type0) == getTypeRank(type1)) { if (node1->getBasicType() == EbtBool)
promoteTo = std::make_tuple(node0BasicType, EbtInt);
else
promoteTo = std::make_tuple(node0BasicType, node1->getBasicType());
} else {
if (isTypeInt(node0->getBasicType()) && isTypeInt(node1->getBasicType()))
return std::make_tuple(node0, node1); return std::make_tuple(node0, node1);
} else { else
promoteTo = getConversionDestinatonType(type0, type1, op); return std::make_tuple(nullptr, nullptr);
if (std::get<0>(promoteTo) == EbtNumTypes || std::get<1>(promoteTo) == EbtNumTypes) }
return std::make_tuple(nullptr, nullptr);
}
} else
return std::make_tuple(nullptr, nullptr);
break; break;
default: default:
if (node0->getType() == node1->getType())
return std::make_tuple(node0, node1);
return std::make_tuple(nullptr, nullptr); return std::make_tuple(nullptr, nullptr);
} }
@ -868,11 +846,13 @@ TIntermediate::addConversion(TOperator op, TIntermTyped* node0, TIntermTyped* no
// For implicit conversions, 'op' is not the requested conversion, it is the explicit // For implicit conversions, 'op' is not the requested conversion, it is the explicit
// operation requiring the implicit conversion. // operation requiring the implicit conversion.
// //
// Binary operation conversions should be handled by addConversion(op, node, node), not here.
//
// Returns a node representing the conversion, which could be the same // Returns a node representing the conversion, which could be the same
// node passed in if no conversion was needed. // node passed in if no conversion was needed.
// //
// Generally, this is focused on basic type conversion, not shape conversion. // Generally, this is focused on basic type conversion, not shape conversion.
// See addShapeConversion(). // See addShapeConversion() for shape conversions.
// //
// Return nullptr if a conversion can't be done. // Return nullptr if a conversion can't be done.
// //
@ -939,40 +919,10 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
promoteTo = EbtUint64; promoteTo = EbtUint64;
break; break;
//
// List all the binary ops that can implicitly convert one operand to the other's type;
// This implements the 'policy' for implicit type conversion.
//
case EOpLessThan:
case EOpGreaterThan:
case EOpLessThanEqual:
case EOpGreaterThanEqual:
case EOpEqual:
case EOpNotEqual:
case EOpAdd:
case EOpSub:
case EOpMul:
case EOpDiv:
case EOpMod:
case EOpVectorTimesScalar:
case EOpVectorTimesMatrix:
case EOpMatrixTimesVector:
case EOpMatrixTimesScalar:
case EOpAnd:
case EOpInclusiveOr:
case EOpExclusiveOr:
case EOpAndAssign:
case EOpInclusiveOrAssign:
case EOpExclusiveOrAssign:
case EOpLogicalNot: case EOpLogicalNot:
case EOpLogicalAnd:
case EOpLogicalOr:
case EOpLogicalXor:
case EOpFunctionCall: case EOpFunctionCall:
case EOpReturn: case EOpReturn:
case EOpAssign: case EOpAssign:
case EOpAddAssign: case EOpAddAssign:
@ -982,6 +932,9 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
case EOpMatrixTimesScalarAssign: case EOpMatrixTimesScalarAssign:
case EOpDivAssign: case EOpDivAssign:
case EOpModAssign: case EOpModAssign:
case EOpAndAssign:
case EOpInclusiveOrAssign:
case EOpExclusiveOrAssign:
case EOpAtan: case EOpAtan:
case EOpClamp: case EOpClamp:
@ -1010,37 +963,24 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
if (type.getBasicType() == node->getType().getBasicType()) if (type.getBasicType() == node->getType().getBasicType())
return node; return node;
if (canImplicitlyPromote(node->getType().getBasicType(), type.getBasicType(), op)) if (canImplicitlyPromote(node->getBasicType(), type.getBasicType(), op))
promoteTo = type.getBasicType(); promoteTo = type.getBasicType();
else else
return nullptr; return nullptr;
break; break;
// Shifts can have mixed types as long as they are integer and of the same rank, // For GLSL, there are no conversions needed; the shift amount just needs to be an
// without converting. // integer type, as do the base/result.
// It's the left operand's type that determines the resulting type, so no issue // HLSL can convert the shift from a bool to an int.
// with assign shift ops either.
case EOpLeftShift:
case EOpRightShift:
case EOpLeftShiftAssign: case EOpLeftShiftAssign:
case EOpRightShiftAssign: case EOpRightShiftAssign:
{ {
TBasicType type0 = type.getBasicType(); if (source == EShSourceHlsl && node->getType().getBasicType() == EbtBool)
TBasicType type1 = node->getType().getBasicType(); promoteTo = type.getBasicType();
else {
if (source == EShSourceHlsl && node->getType().getBasicType() == EbtBool) { if (isTypeInt(type.getBasicType()) && isTypeInt(node->getBasicType()))
promoteTo = type0; return node;
} else { else
if (isTypeInt(type0) && isTypeInt(type1)) {
if (getTypeRank(type0) == getTypeRank(type1)) {
return node;
} else {
if (canImplicitlyPromote(type1, type0, op))
promoteTo = type0;
else
return nullptr;
}
} else
return nullptr; return nullptr;
} }
break; break;
@ -1485,9 +1425,7 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_float32) || extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_float32) ||
extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_float64); extensionRequested(E_GL_KHX_shader_explicit_arithmetic_types_float64);
if(explicitTypesEnabled) if(explicitTypesEnabled) {
{
// integral promotions // integral promotions
if (isIntegralPromotion(from, to)) { if (isIntegralPromotion(from, to)) {
return true; return true;
@ -2952,7 +2890,7 @@ bool TIntermediate::promoteUnary(TIntermUnary& node)
// Convert operand to a boolean type // Convert operand to a boolean type
if (operand->getBasicType() != EbtBool) { if (operand->getBasicType() != EbtBool) {
// Add constructor to boolean type. If that fails, we can't do it, so return false. // Add constructor to boolean type. If that fails, we can't do it, so return false.
TIntermTyped* converted = convertToBasicType(op, EbtBool, operand); TIntermTyped* converted = addConversion(op, TType(EbtBool), operand);
if (converted == nullptr) if (converted == nullptr)
return false; return false;
@ -2997,24 +2935,6 @@ void TIntermUnary::updatePrecision()
} }
} }
// If it is not already, convert this node to the given basic type.
TIntermTyped* TIntermediate::convertToBasicType(TOperator op, TBasicType basicType, TIntermTyped* node) const
{
if (node == nullptr)
return nullptr;
// It's already this basic type: nothing needs to be done, so use the node directly.
if (node->getBasicType() == basicType)
return node;
const TType& type = node->getType();
const TType newType(basicType, type.getQualifier().storage,
type.getVectorSize(), type.getMatrixCols(), type.getMatrixRows(), type.isVector());
// Add constructor to the right vectorness of the right type. If that fails, we can't do it, so return nullptr.
return addConversion(op, newType, node);
}
// //
// See TIntermediate::promote // See TIntermediate::promote
// //
@ -3087,8 +3007,10 @@ bool TIntermediate::promoteBinary(TIntermBinary& node)
case EOpSub: case EOpSub:
case EOpDiv: case EOpDiv:
case EOpMul: case EOpMul:
left = addConversion(op, TType(EbtInt, EvqTemporary, left->getVectorSize()), left); if (left->getBasicType() == EbtBool)
right = addConversion(op, TType(EbtInt, EvqTemporary, right->getVectorSize()), right); left = createConversion(EbtInt, left);
if (right->getBasicType() == EbtBool)
right = createConversion(EbtInt, right);
if (left == nullptr || right == nullptr) if (left == nullptr || right == nullptr)
return false; return false;
node.setLeft(left); node.setLeft(left);
@ -3139,21 +3061,17 @@ bool TIntermediate::promoteBinary(TIntermBinary& node)
case EOpLogicalAnd: case EOpLogicalAnd:
case EOpLogicalOr: case EOpLogicalOr:
case EOpLogicalXor: case EOpLogicalXor:
if (getSource() == EShSourceHlsl) { // logical ops operate only on Booleans or vectors of Booleans.
TIntermTyped* convertedL = convertToBasicType(op, EbtBool, left); if (left->getBasicType() != EbtBool || left->isMatrix())
TIntermTyped* convertedR = convertToBasicType(op, EbtBool, right);
if (convertedL == nullptr || convertedR == nullptr)
return false; return false;
node.setLeft(left = convertedL); // also updates stack variable
node.setRight(right = convertedR); // also updates stack variable if (getSource() == EShSourceGlsl) {
} else {
// logical ops operate only on scalar Booleans and will promote to scalar Boolean. // logical ops operate only on scalar Booleans and will promote to scalar Boolean.
if (left->getBasicType() != EbtBool || left->isVector() || left->isMatrix()) if (left->isVector())
return false; return false;
} }
node.setType(TType(EbtBool, EvqTemporary, left->getVectorSize())); node.setType(TType(EbtBool, EvqTemporary, left->getVectorSize()));
break; break;
case EOpRightShift: case EOpRightShift:

View File

@ -228,6 +228,7 @@ void TParseContextBase::rValueErrorCheck(const TSourceLoc& loc, const char* op,
// must still be valid. // must still be valid.
// It is okay if the symbol's type will be subsequently edited; // It is okay if the symbol's type will be subsequently edited;
// the modifications will be tracked. // the modifications will be tracked.
// Order is preserved, to avoid creating novel forward references.
void TParseContextBase::trackLinkage(TSymbol& symbol) void TParseContextBase::trackLinkage(TSymbol& symbol)
{ {
if (!parsingBuiltins) if (!parsingBuiltins)
@ -602,7 +603,7 @@ void TParseContextBase::finish()
if (parsingBuiltins) if (parsingBuiltins)
return; return;
// Transfer the linkage symbols to AST nodes // Transfer the linkage symbols to AST nodes, preserving order.
TIntermAggregate* linkage = new TIntermAggregate; TIntermAggregate* linkage = new TIntermAggregate;
for (auto i = linkageSymbols.begin(); i != linkageSymbols.end(); ++i) for (auto i = linkageSymbols.begin(); i != linkageSymbols.end(); ++i)
intermediate.addSymbolLinkageNode(linkage, **i); intermediate.addSymbolLinkageNode(linkage, **i);

View File

@ -2778,8 +2778,8 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali
error(loc, "can't use auxiliary qualifier on a fragment output", "centroid/sample/patch", ""); error(loc, "can't use auxiliary qualifier on a fragment output", "centroid/sample/patch", "");
if (qualifier.isInterpolation()) if (qualifier.isInterpolation())
error(loc, "can't use interpolation qualifier on a fragment output", "flat/smooth/noperspective", ""); error(loc, "can't use interpolation qualifier on a fragment output", "flat/smooth/noperspective", "");
if (publicType.basicType == EbtDouble) if (publicType.basicType == EbtDouble || publicType.basicType == EbtInt64 || publicType.basicType == EbtUint64)
error(loc, "cannot contain a double", GetStorageQualifierString(qualifier.storage), ""); error(loc, "cannot contain a double, int64, or uint64", GetStorageQualifierString(qualifier.storage), "");
break; break;
case EShLangCompute: case EShLangCompute:

View File

@ -187,7 +187,7 @@ protected:
TParseContextBase& operator=(TParseContextBase&); TParseContextBase& operator=(TParseContextBase&);
const bool parsingBuiltins; // true if parsing built-in symbols/functions const bool parsingBuiltins; // true if parsing built-in symbols/functions
TVector<TSymbol*> linkageSymbols; // these need to be transferred to 'linkage', after all editing is done TVector<TSymbol*> linkageSymbols; // will be transferred to 'linkage', after all editing is done, order preserving
TScanContext* scanContext; TScanContext* scanContext;
TPpContext* ppContext; TPpContext* ppContext;
TBuiltInResource resources; TBuiltInResource resources;

View File

@ -962,7 +962,7 @@ int TScanContext::tokenizeIdentifier()
case PATCH: case PATCH:
if (parseContext.symbolTable.atBuiltInLevel() || if (parseContext.symbolTable.atBuiltInLevel() ||
(parseContext.profile == EEsProfile && (parseContext.profile == EEsProfile &&
(parseContext.version >= 320 || (parseContext.version >= 320 ||
parseContext.extensionsTurnedOn(Num_AEP_tessellation_shader, AEP_tessellation_shader))) || parseContext.extensionsTurnedOn(Num_AEP_tessellation_shader, AEP_tessellation_shader))) ||
(parseContext.profile != EEsProfile && parseContext.extensionTurnedOn(E_GL_ARB_tessellation_shader))) (parseContext.profile != EEsProfile && parseContext.extensionTurnedOn(E_GL_ARB_tessellation_shader)))
return keyword; return keyword;
@ -1450,6 +1450,11 @@ int TScanContext::tokenizeIdentifier()
#endif #endif
case NOPERSPECTIVE: case NOPERSPECTIVE:
#ifdef NV_EXTENSIONS
if (parseContext.profile == EEsProfile && parseContext.version >= 300 &&
parseContext.extensionTurnedOn(E_GL_NV_shader_noperspective_interpolation))
return keyword;
#endif
return es30ReservedFromGLSL(130); return es30ReservedFromGLSL(130);
case SMOOTH: case SMOOTH:

View File

@ -768,6 +768,8 @@ bool ProcessDeferred(
SpvVersion spvVersion; SpvVersion spvVersion;
EShLanguage stage = compiler->getLanguage(); EShLanguage stage = compiler->getLanguage();
TranslateEnvironment(environment, messages, source, stage, spvVersion); TranslateEnvironment(environment, messages, source, stage, spvVersion);
if (environment != nullptr && environment->target.hlslFunctionality1)
intermediate.setHlslFunctionality1();
// First, without using the preprocessor or parser, find the #version, so we know what // First, without using the preprocessor or parser, find the #version, so we know what
// symbol tables, processing rules, etc. to set up. This does not need the extra strings // symbol tables, processing rules, etc. to set up. This does not need the extra strings
@ -1629,6 +1631,7 @@ TShader::TShader(EShLanguage s)
environment.input.dialect = EShClientNone; environment.input.dialect = EShClientNone;
environment.client.client = EShClientNone; environment.client.client = EShClientNone;
environment.target.language = EShTargetNone; environment.target.language = EShTargetNone;
environment.target.hlslFunctionality1 = false;
} }
TShader::~TShader() TShader::~TShader()

View File

@ -225,6 +225,7 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_NVX_multiview_per_view_attributes] = EBhDisable; extensionBehavior[E_GL_NVX_multiview_per_view_attributes] = EBhDisable;
extensionBehavior[E_GL_NV_shader_atomic_int64] = EBhDisable; extensionBehavior[E_GL_NV_shader_atomic_int64] = EBhDisable;
extensionBehavior[E_GL_NV_conservative_raster_underestimation] = EBhDisable; extensionBehavior[E_GL_NV_conservative_raster_underestimation] = EBhDisable;
extensionBehavior[E_GL_NV_shader_noperspective_interpolation] = EBhDisable;
#endif #endif
// AEP // AEP
@ -319,6 +320,13 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_OES_texture_cube_map_array 1\n" "#define GL_OES_texture_cube_map_array 1\n"
"#define GL_EXT_shader_non_constant_global_initializers 1\n" "#define GL_EXT_shader_non_constant_global_initializers 1\n"
; ;
#ifdef NV_EXTENSIONS
if (profile == EEsProfile && version >= 300) {
preamble += "#define GL_NV_shader_noperspective_interpolation 1\n";
}
#endif
} else { } else {
preamble = preamble =
"#define GL_FRAGMENT_PRECISION_HIGH 1\n" "#define GL_FRAGMENT_PRECISION_HIGH 1\n"

View File

@ -196,6 +196,7 @@ const char* const E_GL_NV_stereo_view_rendering = "GL_NV_stereo_
const char* const E_GL_NVX_multiview_per_view_attributes = "GL_NVX_multiview_per_view_attributes"; const char* const E_GL_NVX_multiview_per_view_attributes = "GL_NVX_multiview_per_view_attributes";
const char* const E_GL_NV_shader_atomic_int64 = "GL_NV_shader_atomic_int64"; const char* const E_GL_NV_shader_atomic_int64 = "GL_NV_shader_atomic_int64";
const char* const E_GL_NV_conservative_raster_underestimation = "GL_NV_conservative_raster_underestimation"; const char* const E_GL_NV_conservative_raster_underestimation = "GL_NV_conservative_raster_underestimation";
const char* const E_GL_NV_shader_noperspective_interpolation = "GL_NV_shader_noperspective_interpolation";
// Arrays of extensions for the above viewportEXTs duplications // Arrays of extensions for the above viewportEXTs duplications

View File

@ -82,7 +82,7 @@ const TConstUnion* TAttributeArgs::getConstUnion(TBasicType basicType, int argNu
if (args == nullptr) if (args == nullptr)
return nullptr; return nullptr;
if (argNum >= args->getSequence().size()) if (argNum >= (int)args->getSequence().size())
return nullptr; return nullptr;
const TConstUnion* constVal = &args->getSequence()[argNum]->getAsConstantUnion()->getConstArray()[0]; const TConstUnion* constVal = &args->getSequence()[argNum]->getAsConstantUnion()->getConstArray()[0];

View File

@ -1117,7 +1117,11 @@ interpolation_qualifier
} }
| NOPERSPECTIVE { | NOPERSPECTIVE {
parseContext.globalCheck($1.loc, "noperspective"); parseContext.globalCheck($1.loc, "noperspective");
#ifdef NV_EXTENSIONS
parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_NV_shader_noperspective_interpolation, "noperspective");
#else
parseContext.requireProfile($1.loc, ~EEsProfile, "noperspective"); parseContext.requireProfile($1.loc, ~EEsProfile, "noperspective");
#endif
parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "noperspective"); parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "noperspective");
$$.init($1.loc); $$.init($1.loc);
$$.qualifier.nopersp = true; $$.qualifier.nopersp = true;

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
/* A Bison parser, made by GNU Bison 3.0. */ /* A Bison parser, made by GNU Bison 3.0.4. */
/* Bison interface for Yacc-like parsers in C /* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -437,7 +437,7 @@ extern int yydebug;
/* Value type. */ /* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE YYSTYPE;
union YYSTYPE union YYSTYPE
{ {
#line 70 "MachineIndependent/glslang.y" /* yacc.c:1909 */ #line 70 "MachineIndependent/glslang.y" /* yacc.c:1909 */
@ -477,6 +477,8 @@ union YYSTYPE
#line 479 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */ #line 479 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */
}; };
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
#endif #endif

View File

@ -431,7 +431,8 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver
// no locations added if already present, a built-in variable, a block, or an opaque // no locations added if already present, a built-in variable, a block, or an opaque
if (type.getQualifier().hasLocation() || type.isBuiltIn() || if (type.getQualifier().hasLocation() || type.isBuiltIn() ||
type.getBasicType() == EbtBlock || type.containsOpaque()) type.getBasicType() == EbtBlock ||
(type.containsOpaque() && intermediate.getSpv().openGl == 0))
return -1; return -1;
// no locations on blocks of built-in variables // no locations on blocks of built-in variables
@ -442,7 +443,11 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver
return -1; return -1;
} }
return nextUniformLocation++; int location = nextUniformLocation;
nextUniformLocation += TIntermediate::computeTypeUniformLocationSize(type);
return location;
} }
bool validateInOut(EShLanguage /*stage*/, const char* /*name*/, const TType& /*type*/, bool /*is_live*/) override bool validateInOut(EShLanguage /*stage*/, const char* /*name*/, const TType& /*type*/, bool /*is_live*/) override
{ {
@ -598,7 +603,7 @@ protected:
/******************************************************************************** /********************************************************************************
The following IO resolver maps types in HLSL register space, as follows: The following IO resolver maps types in HLSL register space, as follows:
t for shader resource views (SRV) t - for shader resource views (SRV)
TEXTURE1D TEXTURE1D
TEXTURE1DARRAY TEXTURE1DARRAY
TEXTURE2D TEXTURE2D
@ -613,7 +618,7 @@ t for shader resource views (SRV)
BUFFER BUFFER
TBUFFER TBUFFER
s for samplers s - for samplers
SAMPLER SAMPLER
SAMPLER1D SAMPLER1D
SAMPLER2D SAMPLER2D
@ -622,7 +627,7 @@ s for samplers
SAMPLERSTATE SAMPLERSTATE
SAMPLERCOMPARISONSTATE SAMPLERCOMPARISONSTATE
u for unordered access views (UAV) u - for unordered access views (UAV)
RWBYTEADDRESSBUFFER RWBYTEADDRESSBUFFER
RWSTRUCTUREDBUFFER RWSTRUCTUREDBUFFER
APPENDSTRUCTUREDBUFFER APPENDSTRUCTUREDBUFFER
@ -634,7 +639,7 @@ u for unordered access views (UAV)
RWTEXTURE2DARRAY RWTEXTURE2DARRAY
RWTEXTURE3D RWTEXTURE3D
b for constant buffer views (CBV) b - for constant buffer views (CBV)
CBUFFER CBUFFER
CONSTANTBUFFER CONSTANTBUFFER
********************************************************************************/ ********************************************************************************/

View File

@ -962,6 +962,36 @@ int TIntermediate::computeTypeLocationSize(const TType& type, EShLanguage stage)
return 1; return 1;
} }
// Same as computeTypeLocationSize but for uniforms
int TIntermediate::computeTypeUniformLocationSize(const TType& type)
{
// "Individual elements of a uniform array are assigned
// consecutive locations with the first element taking location
// location."
if (type.isArray()) {
// TODO: perf: this can be flattened by using getCumulativeArraySize(), and a deref that discards all arrayness
TType elementType(type, 0);
if (type.isImplicitlySizedArray()) {
// TODO: are there valid cases of having an implicitly-sized array with a location? If so, running this code too early.
return computeTypeUniformLocationSize(elementType);
} else
return type.getOuterArraySize() * computeTypeUniformLocationSize(elementType);
}
// "Each subsequent inner-most member or element gets incremental
// locations for the entire structure or array."
if (type.isStruct()) {
int size = 0;
for (int member = 0; member < (int)type.getStruct()->size(); ++member) {
TType memberType(type, member);
size += computeTypeUniformLocationSize(memberType);
}
return size;
}
return 1;
}
// Accumulate xfb buffer ranges and check for collisions as the accumulation is done. // Accumulate xfb buffer ranges and check for collisions as the accumulation is done.
// //
// Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value. // Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value.

View File

@ -210,7 +210,7 @@ class TVariable;
class TIntermediate { class TIntermediate {
public: public:
explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) : explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) :
implicitThisName("@this"), implicitThisName("@this"), implicitCounterName("@count"),
language(l), source(EShSourceNone), profile(p), version(v), treeRoot(0), language(l), source(EShSourceNone), profile(p), version(v), treeRoot(0),
numEntryPoints(0), numErrors(0), numPushConstants(0), recursive(false), numEntryPoints(0), numErrors(0), numPushConstants(0), recursive(false),
invocations(TQualifier::layoutNotSet), vertices(TQualifier::layoutNotSet), invocations(TQualifier::layoutNotSet), vertices(TQualifier::layoutNotSet),
@ -218,6 +218,7 @@ public:
pixelCenterInteger(false), originUpperLeft(false), pixelCenterInteger(false), originUpperLeft(false),
vertexSpacing(EvsNone), vertexOrder(EvoNone), pointMode(false), earlyFragmentTests(false), vertexSpacing(EvsNone), vertexOrder(EvoNone), pointMode(false), earlyFragmentTests(false),
postDepthCoverage(false), depthLayout(EldNone), depthReplacing(false), postDepthCoverage(false), depthLayout(EldNone), depthReplacing(false),
hlslFunctionality1(false),
blendEquations(0), xfbMode(false), multiStream(false), blendEquations(0), xfbMode(false), multiStream(false),
#ifdef NV_EXTENSIONS #ifdef NV_EXTENSIONS
layoutOverrideCoverage(false), layoutOverrideCoverage(false),
@ -362,6 +363,13 @@ public:
} }
bool usingHlslIoMapping() { return hlslIoMapping; } bool usingHlslIoMapping() { return hlslIoMapping; }
template<class T> T addCounterBufferName(const T& name) const { return name + implicitCounterName; }
bool hasCounterBufferName(const TString& name) const {
size_t len = strlen(implicitCounterName);
return name.size() > len &&
name.compare(name.size() - len, len, implicitCounterName) == 0;
}
void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode) { textureSamplerTransformMode = mode; } void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode) { textureSamplerTransformMode = mode; }
void setVersion(int v) { version = v; } void setVersion(int v) { version = v; }
@ -459,9 +467,6 @@ public:
TIntermUnary* addUnaryNode(TOperator op, TIntermTyped* child, TSourceLoc) const; TIntermUnary* addUnaryNode(TOperator op, TIntermTyped* child, TSourceLoc) const;
TIntermUnary* addUnaryNode(TOperator op, TIntermTyped* child, TSourceLoc, const TType&) const; TIntermUnary* addUnaryNode(TOperator op, TIntermTyped* child, TSourceLoc, const TType&) const;
// Add conversion from node's type to given basic type.
TIntermTyped* convertToBasicType(TOperator op, TBasicType basicType, TIntermTyped* node) const;
// Constant folding (in Constant.cpp) // Constant folding (in Constant.cpp)
TIntermTyped* fold(TIntermAggregate* aggrNode); TIntermTyped* fold(TIntermAggregate* aggrNode);
TIntermTyped* foldConstructor(TIntermAggregate* aggrNode); TIntermTyped* foldConstructor(TIntermAggregate* aggrNode);
@ -567,6 +572,9 @@ public:
void setDepthReplacing() { depthReplacing = true; } void setDepthReplacing() { depthReplacing = true; }
bool isDepthReplacing() const { return depthReplacing; } bool isDepthReplacing() const { return depthReplacing; }
void setHlslFunctionality1() { hlslFunctionality1 = true; }
bool getHlslFunctionality1() const { return hlslFunctionality1; }
void addBlendEquation(TBlendEquationShift b) { blendEquations |= (1 << b); } void addBlendEquation(TBlendEquationShift b) { blendEquations |= (1 << b); }
unsigned int getBlendEquations() const { return blendEquations; } unsigned int getBlendEquations() const { return blendEquations; }
@ -582,6 +590,7 @@ public:
int addUsedOffsets(int binding, int offset, int numOffsets); int addUsedOffsets(int binding, int offset, int numOffsets);
bool addUsedConstantId(int id); bool addUsedConstantId(int id);
static int computeTypeLocationSize(const TType&, EShLanguage); static int computeTypeLocationSize(const TType&, EShLanguage);
static int computeTypeUniformLocationSize(const TType&);
bool setXfbBufferStride(int buffer, unsigned stride) bool setXfbBufferStride(int buffer, unsigned stride)
{ {
@ -626,6 +635,7 @@ public:
bool needsLegalization() const { return needToLegalize; } bool needsLegalization() const { return needToLegalize; }
const char* const implicitThisName; const char* const implicitThisName;
const char* const implicitCounterName;
protected: protected:
TIntermSymbol* addSymbol(int Id, const TString&, const TType&, const TConstUnionArray&, TIntermTyped* subtree, const TSourceLoc&); TIntermSymbol* addSymbol(int Id, const TString&, const TType&, const TConstUnionArray&, TIntermTyped* subtree, const TSourceLoc&);
@ -685,6 +695,7 @@ protected:
bool postDepthCoverage; bool postDepthCoverage;
TLayoutDepth depthLayout; TLayoutDepth depthLayout;
bool depthReplacing; bool depthReplacing;
bool hlslFunctionality1;
int blendEquations; // an 'or'ing of masks of shifts of TBlendEquationShift int blendEquations; // an 'or'ing of masks of shifts of TBlendEquationShift
bool xfbMode; bool xfbMode;
bool multiStream; bool multiStream;

View File

@ -118,7 +118,7 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
ch = getChar(); ch = getChar();
// 1.#INF or -1.#INF // 1.#INF or -1.#INF
if (parseContext.intermediate.getSource() == EShSourceHlsl && ch == '#') { if (ch == '#' && (ifdepth > 0 || parseContext.intermediate.getSource() == EShSourceHlsl)) {
if ((len < 2) || if ((len < 2) ||
(len == 2 && ppToken->name[0] != '1') || (len == 2 && ppToken->name[0] != '1') ||
(len == 3 && ppToken->name[1] != '1' && !(ppToken->name[0] == '-' || ppToken->name[0] == '+')) || (len == 3 && ppToken->name[1] != '1' && !(ppToken->name[0] == '-' || ppToken->name[0] == '+')) ||
@ -174,22 +174,28 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
// Suffix: // Suffix:
bool isFloat16 = false; bool isFloat16 = false;
if (ch == 'l' || ch == 'L') { if (ch == 'l' || ch == 'L') {
parseContext.doubleCheck(ppToken->loc, "double floating-point suffix"); if (ifdepth == 0 && parseContext.intermediate.getSource() == EShSourceGlsl)
if (! HasDecimalOrExponent) parseContext.doubleCheck(ppToken->loc, "double floating-point suffix");
if (ifdepth == 0 && !HasDecimalOrExponent)
parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", ""); parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", "");
int ch2 = getChar(); if (parseContext.intermediate.getSource() == EShSourceGlsl) {
if (ch2 != 'f' && ch2 != 'F') { int ch2 = getChar();
ungetChar(); if (ch2 != 'f' && ch2 != 'F') {
ungetChar(); ungetChar();
} else { ungetChar();
} else {
saveName(ch);
saveName(ch2);
isDouble = 1;
}
} else if (parseContext.intermediate.getSource() == EShSourceHlsl) {
saveName(ch); saveName(ch);
saveName(ch2);
isDouble = 1; isDouble = 1;
} }
} else if (ch == 'h' || ch == 'H') { } else if (ch == 'h' || ch == 'H') {
if (parseContext.intermediate.getSource() == EShSourceGlsl) if (ifdepth == 0 && parseContext.intermediate.getSource() == EShSourceGlsl)
parseContext.float16Check(ppToken->loc, "half floating-point suffix"); parseContext.float16Check(ppToken->loc, "half floating-point suffix");
if (!HasDecimalOrExponent) if (ifdepth == 0 && !HasDecimalOrExponent)
parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", ""); parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", "");
if (parseContext.intermediate.getSource() == EShSourceGlsl) { if (parseContext.intermediate.getSource() == EShSourceGlsl) {
int ch2 = getChar(); int ch2 = getChar();
@ -201,15 +207,16 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
saveName(ch2); saveName(ch2);
isFloat16 = true; isFloat16 = true;
} }
} else { } else if (parseContext.intermediate.getSource() == EShSourceHlsl) {
saveName(ch); saveName(ch);
isFloat16 = false; isFloat16 = true;
} }
} else if (ch == 'f' || ch == 'F') { } else if (ch == 'f' || ch == 'F') {
parseContext.profileRequires(ppToken->loc, EEsProfile, 300, nullptr, "floating-point suffix"); if (ifdepth == 0)
if (! parseContext.relaxedErrors()) parseContext.profileRequires(ppToken->loc, EEsProfile, 300, nullptr, "floating-point suffix");
if (ifdepth == 0 && !parseContext.relaxedErrors())
parseContext.profileRequires(ppToken->loc, ~EEsProfile, 120, nullptr, "floating-point suffix"); parseContext.profileRequires(ppToken->loc, ~EEsProfile, 120, nullptr, "floating-point suffix");
if (! HasDecimalOrExponent) if (ifdepth == 0 && !HasDecimalOrExponent)
parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", ""); parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", "");
saveName(ch); saveName(ch);
} else } else
@ -477,18 +484,22 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
ppToken->name[len] = '\0'; ppToken->name[len] = '\0';
if (isInt64 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) { if (isInt64 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, if (pp->ifdepth == 0) {
pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile,
"64-bit hexadecimal literal"); "64-bit hexadecimal literal");
pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0,
Num_Int64_Extensions, Int64_Extensions, "64-bit hexadecimal literal"); Num_Int64_Extensions, Int64_Extensions, "64-bit hexadecimal literal");
}
ppToken->i64val = ival; ppToken->i64val = ival;
return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64; return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64;
} else if (isInt16) { } else if (isInt16) {
if (pp->parseContext.intermediate.getSource() == EShSourceGlsl) { if (pp->ifdepth == 0) {
pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, if (pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
"16-bit hexadecimal literal"); pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile,
pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, "16-bit hexadecimal literal");
Num_Int16_Extensions, Int16_Extensions, "16-bit hexadecimal literal"); pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0,
Num_Int16_Extensions, Int16_Extensions, "16-bit hexadecimal literal");
}
} }
ppToken->ival = (int)ival; ppToken->ival = (int)ival;
return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16; return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16;
@ -589,18 +600,22 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
pp->parseContext.ppError(ppToken->loc, "octal literal too big", "", ""); pp->parseContext.ppError(ppToken->loc, "octal literal too big", "", "");
if (isInt64 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) { if (isInt64 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, if (pp->ifdepth == 0) {
pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile,
"64-bit octal literal"); "64-bit octal literal");
pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0,
Num_Int64_Extensions, Int64_Extensions, "64-bit octal literal"); Num_Int64_Extensions, Int64_Extensions, "64-bit octal literal");
}
ppToken->i64val = ival; ppToken->i64val = ival;
return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64; return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64;
} else if (isInt16) { } else if (isInt16) {
if (pp->parseContext.intermediate.getSource() == EShSourceGlsl) { if (pp->ifdepth == 0) {
pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, if (pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
"16-bit octal literal"); pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile,
pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, "16-bit octal literal");
Num_Int16_Extensions, Int16_Extensions, "16-bit octal literal"); pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0,
Num_Int16_Extensions, Int16_Extensions, "16-bit octal literal");
}
} }
ppToken->ival = (int)ival; ppToken->ival = (int)ival;
return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16; return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16;
@ -694,16 +709,18 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
} }
if (isInt64 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) { if (isInt64 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, if (pp->ifdepth == 0) {
pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile,
"64-bit literal"); "64-bit literal");
pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0,
Num_Int64_Extensions, Int64_Extensions, "64-bit literal"); Num_Int64_Extensions, Int64_Extensions, "64-bit literal");
}
ppToken->i64val = ival; ppToken->i64val = ival;
return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64; return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64;
} else if (isInt16) { } else if (isInt16) {
if (pp->parseContext.intermediate.getSource() == EShSourceGlsl) { if (pp->ifdepth == 0 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile, pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile,
"16-bit literal"); "16-bit literal");
pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0, pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0,
Num_Int16_Extensions, Int16_Extensions, "16-bit literal"); Num_Int16_Extensions, Int16_Extensions, "16-bit literal");
} }
@ -966,7 +983,7 @@ int TPpContext::tokenize(TPpToken& ppToken)
continue; continue;
break; break;
case PpAtomConstString: case PpAtomConstString:
if (parseContext.intermediate.getSource() != EShSourceHlsl) { if (ifdepth == 0 && parseContext.intermediate.getSource() != EShSourceHlsl) {
// HLSL allows string literals. // HLSL allows string literals.
parseContext.ppError(ppToken.loc, "string literals not supported", "\"\"", ""); parseContext.ppError(ppToken.loc, "string literals not supported", "\"\"", "");
continue; continue;

View File

@ -766,11 +766,11 @@ void TReflection::buildAttributeReflection(EShLanguage stage, const TIntermediat
} }
// build counter block index associations for buffers // build counter block index associations for buffers
void TReflection::buildCounterIndices() void TReflection::buildCounterIndices(const TIntermediate& intermediate)
{ {
// search for ones that have counters // search for ones that have counters
for (int i = 0; i < int(indexToUniformBlock.size()); ++i) { for (int i = 0; i < int(indexToUniformBlock.size()); ++i) {
const TString counterName(indexToUniformBlock[i].name + "@count"); const TString counterName(intermediate.addCounterBufferName(indexToUniformBlock[i].name));
const int index = getIndex(counterName); const int index = getIndex(counterName);
if (index >= 0) if (index >= 0)
@ -802,7 +802,7 @@ bool TReflection::addStage(EShLanguage stage, const TIntermediate& intermediate)
function->traverse(&it); function->traverse(&it);
} }
buildCounterIndices(); buildCounterIndices(intermediate);
return true; return true;
} }

View File

@ -156,7 +156,7 @@ public:
protected: protected:
friend class glslang::TReflectionTraverser; friend class glslang::TReflectionTraverser;
void buildCounterIndices(); void buildCounterIndices(const TIntermediate&);
void buildAttributeReflection(EShLanguage, const TIntermediate&); void buildAttributeReflection(EShLanguage, const TIntermediate&);
// Need a TString hash: typedef std::unordered_map<TString, int> TNameToIndex; // Need a TString hash: typedef std::unordered_map<TString, int> TNameToIndex;

View File

@ -70,7 +70,7 @@
// This should always increase, as some paths to do not consume // This should always increase, as some paths to do not consume
// a more major number. // a more major number.
// It should increment by one when new functionality is added. // It should increment by one when new functionality is added.
#define GLSLANG_MINOR_VERSION 3 #define GLSLANG_MINOR_VERSION 5
// //
// Call before doing any other compiler/linker operations. // Call before doing any other compiler/linker operations.
@ -132,7 +132,9 @@ typedef enum {
EShTargetVulkan_1_0 = (1 << 22), EShTargetVulkan_1_0 = (1 << 22),
EShTargetVulkan_1_1 = (1 << 22) | (1 << 12), EShTargetVulkan_1_1 = (1 << 22) | (1 << 12),
EShTargetOpenGL_450 = 450, EShTargetOpenGL_450 = 450,
} EshTargetClientVersion; } EShTargetClientVersion;
typedef EShTargetClientVersion EshTargetClientVersion;
typedef enum { typedef enum {
EShTargetSpv_1_0 = (1 << 16), EShTargetSpv_1_0 = (1 << 16),
@ -148,12 +150,13 @@ struct TInputLanguage {
struct TClient { struct TClient {
EShClient client; EShClient client;
EshTargetClientVersion version; // version of client itself (not the client's input dialect) EShTargetClientVersion version; // version of client itself (not the client's input dialect)
}; };
struct TTarget { struct TTarget {
EShTargetLanguage language; EShTargetLanguage language;
EShTargetLanguageVersion version; // version to target, if SPIR-V, defined by "word 1" of the SPIR-V header EShTargetLanguageVersion version; // version to target, if SPIR-V, defined by "word 1" of the SPIR-V header
bool hlslFunctionality1; // can target hlsl_functionality1 extension(s)
}; };
// All source/client/target versions and settings. // All source/client/target versions and settings.
@ -410,7 +413,7 @@ public:
environment.input.dialect = client; environment.input.dialect = client;
environment.input.dialectVersion = version; environment.input.dialectVersion = version;
} }
void setEnvClient(EShClient client, EshTargetClientVersion version) void setEnvClient(EShClient client, EShTargetClientVersion version)
{ {
environment.client.client = client; environment.client.client = client;
environment.client.version = version; environment.client.version = version;
@ -420,6 +423,8 @@ public:
environment.target.language = lang; environment.target.language = lang;
environment.target.version = version; environment.target.version = version;
} }
void setEnvTargetHlslFunctionality1() { environment.target.hlslFunctionality1 = true; }
bool getEnvTargetHlslFunctionality1() const { return environment.target.hlslFunctionality1; }
// Interface to #include handlers. // Interface to #include handlers.
// //

View File

@ -41,6 +41,10 @@ namespace {
using CompileToAstTest = GlslangTest<::testing::TestWithParam<std::string>>; using CompileToAstTest = GlslangTest<::testing::TestWithParam<std::string>>;
#ifdef NV_EXTENSIONS
using CompileToAstTestNV = GlslangTest<::testing::TestWithParam<std::string>>;
#endif
TEST_P(CompileToAstTest, FromFile) TEST_P(CompileToAstTest, FromFile)
{ {
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
@ -48,6 +52,16 @@ TEST_P(CompileToAstTest, FromFile)
Target::AST); Target::AST);
} }
#ifdef NV_EXTENSIONS
// Compiling GLSL to SPIR-V under OpenGL semantics (NV extensions enabled).
TEST_P(CompileToAstTestNV, FromFile)
{
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
Source::GLSL, Semantics::OpenGL, glslang::EShTargetVulkan_1_0,
Target::AST);
}
#endif
// clang-format off // clang-format off
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_CASE_P(
Glsl, CompileToAstTest, Glsl, CompileToAstTest,
@ -85,6 +99,7 @@ INSTANTIATE_TEST_CASE_P(
"cppComplexExpr.vert", "cppComplexExpr.vert",
"cppDeepNest.frag", "cppDeepNest.frag",
"cppPassMacroName.frag", "cppPassMacroName.frag",
"cppRelaxSkipTokensErrors.vert",
"badChars.frag", "badChars.frag",
"pointCoord.frag", "pointCoord.frag",
"array.frag", "array.frag",
@ -214,6 +229,16 @@ INSTANTIATE_TEST_CASE_P(
})), })),
FileNameAsCustomTestSuffix FileNameAsCustomTestSuffix
); );
#ifdef NV_EXTENSIONS
INSTANTIATE_TEST_CASE_P(
Glsl, CompileToAstTestNV,
::testing::ValuesIn(std::vector<std::string>({
"nvShaderNoperspectiveInterpolation.frag",
})),
FileNameAsCustomTestSuffix
);
#endif
// clang-format on // clang-format on
} // anonymous namespace } // anonymous namespace

View File

@ -171,7 +171,7 @@ TEST_P(CompileVulkanToSpirvTestAMD, FromFile)
#endif #endif
#ifdef NV_EXTENSIONS #ifdef NV_EXTENSIONS
// Compiling GLSL to SPIR-V under Vulkan semantics (AMD extensions enabled). // Compiling GLSL to SPIR-V under Vulkan semantics (NV extensions enabled).
// Expected to successfully generate SPIR-V. // Expected to successfully generate SPIR-V.
TEST_P(CompileVulkanToSpirvTestNV, FromFile) TEST_P(CompileVulkanToSpirvTestNV, FromFile)
{ {
@ -416,6 +416,7 @@ INSTANTIATE_TEST_CASE_P(
"spv.460.comp", "spv.460.comp",
"spv.atomic.comp", "spv.atomic.comp",
"spv.glFragColor.frag", "spv.glFragColor.frag",
"spv.rankShift.comp",
"spv.specConst.vert", "spv.specConst.vert",
"spv.OVR_multiview.vert", "spv.OVR_multiview.vert",
})), })),

View File

@ -197,7 +197,7 @@ public:
GlslangResult compileAndLink( GlslangResult compileAndLink(
const std::string shaderName, const std::string& code, const std::string shaderName, const std::string& code,
const std::string& entryPointName, EShMessages controls, const std::string& entryPointName, EShMessages controls,
glslang::EshTargetClientVersion clientTargetVersion, glslang::EShTargetClientVersion clientTargetVersion,
bool flattenUniformArrays = false, bool flattenUniformArrays = false,
EShTextureSamplerTransformMode texSampTransMode = EShTexSampTransKeep, EShTextureSamplerTransformMode texSampTransMode = EShTexSampTransKeep,
bool disableOptimizer = true, bool disableOptimizer = true,
@ -407,7 +407,7 @@ public:
const std::string& testName, const std::string& testName,
Source source, Source source,
Semantics semantics, Semantics semantics,
glslang::EshTargetClientVersion clientTargetVersion, glslang::EShTargetClientVersion clientTargetVersion,
Target target, Target target,
bool automap = true, bool automap = true,
const std::string& entryPointName="", const std::string& entryPointName="",

View File

@ -3283,6 +3283,9 @@ bool HlslGrammar::acceptLiteral(TIntermTyped*& node)
case EHTokUintConstant: case EHTokUintConstant:
node = intermediate.addConstantUnion(token.u, token.loc, true); node = intermediate.addConstantUnion(token.u, token.loc, true);
break; break;
case EHTokFloat16Constant:
node = intermediate.addConstantUnion(token.d, EbtFloat16, token.loc, true);
break;
case EHTokFloatConstant: case EHTokFloatConstant:
node = intermediate.addConstantUnion(token.d, EbtFloat, token.loc, true); node = intermediate.addConstantUnion(token.d, EbtFloat, token.loc, true);
break; break;

View File

@ -65,10 +65,10 @@ HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& int
entryPointFunction(nullptr), entryPointFunction(nullptr),
entryPointFunctionBody(nullptr), entryPointFunctionBody(nullptr),
gsStreamOutput(nullptr), gsStreamOutput(nullptr),
clipDistanceInput(nullptr),
cullDistanceInput(nullptr),
clipDistanceOutput(nullptr), clipDistanceOutput(nullptr),
cullDistanceOutput(nullptr) cullDistanceOutput(nullptr),
clipDistanceInput(nullptr),
cullDistanceInput(nullptr)
{ {
globalUniformDefaults.clear(); globalUniformDefaults.clear();
globalUniformDefaults.layoutMatrix = ElmRowMajor; globalUniformDefaults.layoutMatrix = ElmRowMajor;
@ -1608,7 +1608,7 @@ void HlslParseContext::addStructBufferHiddenCounterParam(const TSourceLoc& loc,
if (! hasStructBuffCounter(*param.type)) if (! hasStructBuffCounter(*param.type))
return; return;
const TString counterBlockName(getStructBuffCounterName(*param.name)); const TString counterBlockName(intermediate.addCounterBufferName(*param.name));
TType counterType; TType counterType;
counterBufferType(loc, counterType); counterBufferType(loc, counterType);
@ -3163,7 +3163,7 @@ void HlslParseContext::counterBufferType(const TSourceLoc& loc, TType& type)
{ {
// Counter type // Counter type
TType* counterType = new TType(EbtInt, EvqBuffer); TType* counterType = new TType(EbtInt, EvqBuffer);
counterType->setFieldName("@count"); counterType->setFieldName(intermediate.implicitCounterName);
TTypeList* blockStruct = new TTypeList; TTypeList* blockStruct = new TTypeList;
TTypeLoc member = { counterType, loc }; TTypeLoc member = { counterType, loc };
@ -3176,12 +3176,6 @@ void HlslParseContext::counterBufferType(const TSourceLoc& loc, TType& type)
shareStructBufferType(type); shareStructBufferType(type);
} }
// knowledge of how to construct block name, in one place instead of N places.
TString HlslParseContext::getStructBuffCounterName(const TString& blockName) const
{
return blockName + "@count";
}
// declare counter for a structured buffer type // declare counter for a structured buffer type
void HlslParseContext::declareStructBufferCounter(const TSourceLoc& loc, const TType& bufferType, const TString& name) void HlslParseContext::declareStructBufferCounter(const TSourceLoc& loc, const TType& bufferType, const TString& name)
{ {
@ -3195,9 +3189,9 @@ void HlslParseContext::declareStructBufferCounter(const TSourceLoc& loc, const T
TType blockType; TType blockType;
counterBufferType(loc, blockType); counterBufferType(loc, blockType);
TString* blockName = new TString(getStructBuffCounterName(name)); TString* blockName = new TString(intermediate.addCounterBufferName(name));
// Counter buffer does not have its own counter buffer. TODO: there should be a better way to track this. // Counter buffer is not yet in use
structBufferCounter[*blockName] = false; structBufferCounter[*blockName] = false;
shareStructBufferType(blockType); shareStructBufferType(blockType);
@ -3211,7 +3205,7 @@ TIntermTyped* HlslParseContext::getStructBufferCounter(const TSourceLoc& loc, TI
if (buffer == nullptr || ! isStructBufferType(buffer->getType())) if (buffer == nullptr || ! isStructBufferType(buffer->getType()))
return nullptr; return nullptr;
const TString counterBlockName(getStructBuffCounterName(buffer->getAsSymbolNode()->getName())); const TString counterBlockName(intermediate.addCounterBufferName(buffer->getAsSymbolNode()->getName()));
// Mark the counter as being used // Mark the counter as being used
structBufferCounter[counterBlockName] = true; structBufferCounter[counterBlockName] = true;
@ -3224,7 +3218,6 @@ TIntermTyped* HlslParseContext::getStructBufferCounter(const TSourceLoc& loc, TI
return counterMember; return counterMember;
} }
// //
// Decompose structure buffer methods into AST // Decompose structure buffer methods into AST
// //
@ -5743,12 +5736,11 @@ void HlslParseContext::addStructBuffArguments(const TSourceLoc& loc, TIntermAggr
TType counterType; TType counterType;
counterBufferType(loc, counterType); counterBufferType(loc, counterType);
const TString counterBlockName(getStructBuffCounterName(blockSym->getName())); const TString counterBlockName(intermediate.addCounterBufferName(blockSym->getName()));
TVariable* variable = makeInternalVariable(counterBlockName, counterType); TVariable* variable = makeInternalVariable(counterBlockName, counterType);
// Mark this buffer as requiring a counter block. TODO: there should be a better // Mark this buffer's counter block as being in use
// way to track it.
structBufferCounter[counterBlockName] = true; structBufferCounter[counterBlockName] = true;
TIntermSymbol* sym = intermediate.addSymbol(*variable, loc); TIntermSymbol* sym = intermediate.addSymbol(*variable, loc);
@ -8320,6 +8312,22 @@ TIntermTyped* HlslParseContext::constructBuiltIn(const TType& type, TOperator op
// First, convert types as needed. // First, convert types as needed.
// //
switch (op) { switch (op) {
case EOpConstructF16Vec2:
case EOpConstructF16Vec3:
case EOpConstructF16Vec4:
case EOpConstructF16Mat2x2:
case EOpConstructF16Mat2x3:
case EOpConstructF16Mat2x4:
case EOpConstructF16Mat3x2:
case EOpConstructF16Mat3x3:
case EOpConstructF16Mat3x4:
case EOpConstructF16Mat4x2:
case EOpConstructF16Mat4x3:
case EOpConstructF16Mat4x4:
case EOpConstructFloat16:
basicOp = EOpConstructFloat16;
break;
case EOpConstructVec2: case EOpConstructVec2:
case EOpConstructVec3: case EOpConstructVec3:
case EOpConstructVec4: case EOpConstructVec4:
@ -8352,6 +8360,13 @@ TIntermTyped* HlslParseContext::constructBuiltIn(const TType& type, TOperator op
basicOp = EOpConstructDouble; basicOp = EOpConstructDouble;
break; break;
case EOpConstructI16Vec2:
case EOpConstructI16Vec3:
case EOpConstructI16Vec4:
case EOpConstructInt16:
basicOp = EOpConstructInt16;
break;
case EOpConstructIVec2: case EOpConstructIVec2:
case EOpConstructIVec3: case EOpConstructIVec3:
case EOpConstructIVec4: case EOpConstructIVec4:
@ -8368,6 +8383,13 @@ TIntermTyped* HlslParseContext::constructBuiltIn(const TType& type, TOperator op
basicOp = EOpConstructInt; basicOp = EOpConstructInt;
break; break;
case EOpConstructU16Vec2:
case EOpConstructU16Vec3:
case EOpConstructU16Vec4:
case EOpConstructUint16:
basicOp = EOpConstructUint16;
break;
case EOpConstructUVec2: case EOpConstructUVec2:
case EOpConstructUVec3: case EOpConstructUVec3:
case EOpConstructUVec4: case EOpConstructUVec4:
@ -9914,7 +9936,8 @@ void HlslParseContext::addPatchConstantInvocation()
} }
// Finalization step: remove unused buffer blocks from linkage (we don't know until the // Finalization step: remove unused buffer blocks from linkage (we don't know until the
// shader is entirely compiled) // shader is entirely compiled).
// Preserve order of remaining symbols.
void HlslParseContext::removeUnusedStructBufferCounters() void HlslParseContext::removeUnusedStructBufferCounters()
{ {
const auto endIt = std::remove_if(linkageSymbols.begin(), linkageSymbols.end(), const auto endIt = std::remove_if(linkageSymbols.begin(), linkageSymbols.end(),

View File

@ -405,7 +405,7 @@ protected:
// may fit in TSampler::structReturnIndex. // may fit in TSampler::structReturnIndex.
TVector<TTypeList*> textureReturnStruct; TVector<TTypeList*> textureReturnStruct;
TMap<TString, bool> structBufferCounter; TMap<TString, bool> structBufferCounter; // true if counter buffer is in use
// The built-in interstage IO map considers e.g, EvqPosition on input and output separately, so that we // The built-in interstage IO map considers e.g, EvqPosition on input and output separately, so that we
// can build the linkage correctly if position appears on both sides. Otherwise, multiple positions // can build the linkage correctly if position appears on both sides. Otherwise, multiple positions

View File

@ -550,6 +550,7 @@ EHlslTokenClass HlslScanContext::tokenizeClass(HlslToken& token)
case PpAtomConstInt: parserToken->i = ppToken.ival; return EHTokIntConstant; case PpAtomConstInt: parserToken->i = ppToken.ival; return EHTokIntConstant;
case PpAtomConstUint: parserToken->i = ppToken.ival; return EHTokUintConstant; case PpAtomConstUint: parserToken->i = ppToken.ival; return EHTokUintConstant;
case PpAtomConstFloat16: parserToken->d = ppToken.dval; return EHTokFloat16Constant;
case PpAtomConstFloat: parserToken->d = ppToken.dval; return EHTokFloatConstant; case PpAtomConstFloat: parserToken->d = ppToken.dval; return EHTokFloatConstant;
case PpAtomConstDouble: parserToken->d = ppToken.dval; return EHTokDoubleConstant; case PpAtomConstDouble: parserToken->d = ppToken.dval; return EHTokDoubleConstant;
case PpAtomIdentifier: case PpAtomIdentifier:

View File

@ -298,6 +298,7 @@ enum EHlslTokenClass {
EHTokConstantBuffer, EHTokConstantBuffer,
// constant // constant
EHTokFloat16Constant,
EHTokFloatConstant, EHTokFloatConstant,
EHTokDoubleConstant, EHTokDoubleConstant,
EHTokIntConstant, EHTokIntConstant,

View File

@ -12,7 +12,7 @@
"site" : "github", "site" : "github",
"subrepo" : "KhronosGroup/SPIRV-Headers", "subrepo" : "KhronosGroup/SPIRV-Headers",
"subdir" : "External/spirv-tools/external/spirv-headers", "subdir" : "External/spirv-tools/external/spirv-headers",
"commit" : "ce309203d7eceaf908bea8862c27f3e0749f7d00" "commit" : "02ffc719aa9f9c1dce5ce05743fb1afe6cbf17ea"
} }
] ]
} }