New nonuniform analysis (#2457)

This implements a new nonunifom analysis suggested by @jbolz. This change
generates nonUniform decorations that were previously missing and avoids
generation of incorrect decorations. Most notably, it now generates
decorations for nonuniform functions and out params. It avoids generating
decorations for lvalues which themselves are not nonuniform.
This commit is contained in:
greg-lunarg 2020-11-12 11:10:07 -07:00 committed by GitHub
parent 74e8f05b9f
commit 639f5461e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 496 additions and 373 deletions

View File

@ -149,6 +149,7 @@ protected:
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::Decoration TranslateNonUniformDecoration(const glslang::TQualifier& qualifier); spv::Decoration TranslateNonUniformDecoration(const glslang::TQualifier& qualifier);
spv::Decoration TranslateNonUniformDecoration(const spv::Builder::AccessChain::CoherentFlags& coherentFlags);
spv::Builder::AccessChain::CoherentFlags TranslateCoherent(const glslang::TType& type); spv::Builder::AccessChain::CoherentFlags TranslateCoherent(const glslang::TType& type);
spv::MemoryAccessMask TranslateMemoryAccess(const spv::Builder::AccessChain::CoherentFlags &coherentFlags); spv::MemoryAccessMask TranslateMemoryAccess(const spv::Builder::AccessChain::CoherentFlags &coherentFlags);
spv::ImageOperandsMask TranslateImageOperands(const spv::Builder::AccessChain::CoherentFlags &coherentFlags); spv::ImageOperandsMask TranslateImageOperands(const spv::Builder::AccessChain::CoherentFlags &coherentFlags);
@ -539,6 +540,20 @@ spv::Decoration TGlslangToSpvTraverser::TranslateNonUniformDecoration(const glsl
return spv::DecorationMax; return spv::DecorationMax;
} }
// If lvalue flags contains nonUniform, return SPIR-V NonUniform decoration.
spv::Decoration TGlslangToSpvTraverser::TranslateNonUniformDecoration(
const spv::Builder::AccessChain::CoherentFlags& coherentFlags)
{
#ifndef GLSLANG_WEB
if (coherentFlags.isNonUniform()) {
builder.addIncorporatedExtension("SPV_EXT_descriptor_indexing", spv::Spv_1_5);
builder.addCapability(spv::CapabilityShaderNonUniformEXT);
return spv::DecorationNonUniformEXT;
} else
#endif
return spv::DecorationMax;
}
spv::MemoryAccessMask TGlslangToSpvTraverser::TranslateMemoryAccess( spv::MemoryAccessMask TGlslangToSpvTraverser::TranslateMemoryAccess(
const spv::Builder::AccessChain::CoherentFlags &coherentFlags) const spv::Builder::AccessChain::CoherentFlags &coherentFlags)
{ {
@ -614,6 +629,7 @@ spv::Builder::AccessChain::CoherentFlags TGlslangToSpvTraverser::TranslateCohere
flags.volatil; flags.volatil;
flags.isImage = type.getBasicType() == glslang::EbtSampler; flags.isImage = type.getBasicType() == glslang::EbtSampler;
#endif #endif
flags.nonUniform = type.getQualifier().nonUniform;
return flags; return flags;
} }
@ -1376,6 +1392,8 @@ void InheritQualifiers(glslang::TQualifier& child, const glslang::TQualifier& pa
if (parent.writeonly) if (parent.writeonly)
child.writeonly = true; child.writeonly = true;
#endif #endif
if (parent.nonUniform)
child.nonUniform = true;
} }
bool HasNonLayoutQualifiers(const glslang::TType& type, const glslang::TQualifier& qualifier) bool HasNonLayoutQualifiers(const glslang::TType& type, const glslang::TQualifier& qualifier)
@ -1881,9 +1899,11 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T
spv::Id leftRValue = accessChainLoad(node->getLeft()->getType()); spv::Id leftRValue = accessChainLoad(node->getLeft()->getType());
// do the operation // do the operation
spv::Builder::AccessChain::CoherentFlags coherentFlags = TranslateCoherent(node->getLeft()->getType());
coherentFlags |= TranslateCoherent(node->getRight()->getType());
OpDecorations decorations = { TranslatePrecisionDecoration(node->getOperationPrecision()), OpDecorations decorations = { TranslatePrecisionDecoration(node->getOperationPrecision()),
TranslateNoContractionDecoration(node->getType().getQualifier()), TranslateNoContractionDecoration(node->getType().getQualifier()),
TranslateNonUniformDecoration(node->getType().getQualifier()) }; TranslateNonUniformDecoration(coherentFlags) };
rValue = createBinaryOperation(node->getOp(), decorations, rValue = createBinaryOperation(node->getOp(), decorations,
convertGlslangToSpvType(node->getType()), leftRValue, rValue, convertGlslangToSpvType(node->getType()), leftRValue, rValue,
node->getType().getBasicType()); node->getType().getBasicType());
@ -1914,13 +1934,16 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T
if (! node->getLeft()->getType().isArray() && if (! node->getLeft()->getType().isArray() &&
node->getLeft()->getType().isVector() && node->getLeft()->getType().isVector() &&
node->getOp() == glslang::EOpIndexDirect) { node->getOp() == glslang::EOpIndexDirect) {
// Swizzle is uniform so propagate uniform into access chain
spv::Builder::AccessChain::CoherentFlags coherentFlags = TranslateCoherent(node->getLeft()->getType());
coherentFlags.nonUniform = 0;
// This is essentially a hard-coded vector swizzle of size 1, // This is essentially a hard-coded vector swizzle of size 1,
// so short circuit the access-chain stuff with a swizzle. // so short circuit the access-chain stuff with a swizzle.
std::vector<unsigned> swizzle; std::vector<unsigned> swizzle;
swizzle.push_back(glslangIndex); swizzle.push_back(glslangIndex);
int dummySize; int dummySize;
builder.accessChainPushSwizzle(swizzle, convertGlslangToSpvType(node->getLeft()->getType()), builder.accessChainPushSwizzle(swizzle, convertGlslangToSpvType(node->getLeft()->getType()),
TranslateCoherent(node->getLeft()->getType()), coherentFlags,
glslangIntermediate->getBaseAlignmentScalar( glslangIntermediate->getBaseAlignmentScalar(
node->getLeft()->getType(), dummySize)); node->getLeft()->getType(), dummySize));
} else { } else {
@ -1951,9 +1974,14 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T
} }
} }
// Struct reference propagates uniform lvalue
spv::Builder::AccessChain::CoherentFlags coherentFlags =
TranslateCoherent(node->getLeft()->getType());
coherentFlags.nonUniform = 0;
// normal case for indexing array or structure or block // normal case for indexing array or structure or block
builder.accessChainPush(builder.makeIntConstant(spvIndex), builder.accessChainPush(builder.makeIntConstant(spvIndex),
TranslateCoherent(node->getLeft()->getType()), coherentFlags,
node->getLeft()->getType().getBufferReferenceAlignment()); node->getLeft()->getType().getBufferReferenceAlignment());
// Add capabilities here for accessing PointSize and clip/cull distance. // Add capabilities here for accessing PointSize and clip/cull distance.
@ -1987,15 +2015,20 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T
// restore the saved access chain // restore the saved access chain
builder.setAccessChain(partial); builder.setAccessChain(partial);
// Only if index is nonUniform should we propagate nonUniform into access chain
spv::Builder::AccessChain::CoherentFlags index_flags = TranslateCoherent(node->getRight()->getType());
spv::Builder::AccessChain::CoherentFlags coherent_flags = TranslateCoherent(node->getLeft()->getType());
coherent_flags.nonUniform = index_flags.nonUniform;
if (! node->getLeft()->getType().isArray() && node->getLeft()->getType().isVector()) { if (! node->getLeft()->getType().isArray() && node->getLeft()->getType().isVector()) {
int dummySize; int dummySize;
builder.accessChainPushComponent(index, convertGlslangToSpvType(node->getLeft()->getType()), builder.accessChainPushComponent(
TranslateCoherent(node->getLeft()->getType()), index, convertGlslangToSpvType(node->getLeft()->getType()), coherent_flags,
glslangIntermediate->getBaseAlignmentScalar(node->getLeft()->getType(), glslangIntermediate->getBaseAlignmentScalar(node->getLeft()->getType(),
dummySize)); dummySize));
} else } else
builder.accessChainPush(index, TranslateCoherent(node->getLeft()->getType()), builder.accessChainPush(index, coherent_flags,
node->getLeft()->getType().getBufferReferenceAlignment()); node->getLeft()->getType().getBufferReferenceAlignment());
} }
return false; return false;
case glslang::EOpVectorSwizzle: case glslang::EOpVectorSwizzle:
@ -2119,7 +2152,7 @@ spv::Id TGlslangToSpvTraverser::translateForcedType(spv::Id object)
// handle 32-bit v.xy* -> 64-bit // handle 32-bit v.xy* -> 64-bit
builder.clearAccessChain(); builder.clearAccessChain();
builder.setAccessChainLValue(object); builder.setAccessChainLValue(object);
object = builder.accessChainLoad(spv::NoPrecision, spv::DecorationMax, objectTypeId); object = builder.accessChainLoad(spv::NoPrecision, spv::DecorationMax, spv::DecorationMax, objectTypeId);
std::vector<spv::Id> components; std::vector<spv::Id> components;
components.push_back(builder.createCompositeExtract(object, builder.getContainedTypeId(objectTypeId), 0)); components.push_back(builder.createCompositeExtract(object, builder.getContainedTypeId(objectTypeId), 0));
components.push_back(builder.createCompositeExtract(object, builder.getContainedTypeId(objectTypeId), 1)); components.push_back(builder.createCompositeExtract(object, builder.getContainedTypeId(objectTypeId), 1));
@ -2135,7 +2168,7 @@ spv::Id TGlslangToSpvTraverser::translateForcedType(spv::Id object)
// and we insert a transpose after loading the original non-transposed builtins // and we insert a transpose after loading the original non-transposed builtins
builder.clearAccessChain(); builder.clearAccessChain();
builder.setAccessChainLValue(object); builder.setAccessChainLValue(object);
object = builder.accessChainLoad(spv::NoPrecision, spv::DecorationMax, objectTypeId); object = builder.accessChainLoad(spv::NoPrecision, spv::DecorationMax, spv::DecorationMax, objectTypeId);
return builder.createUnaryOp(spv::OpTranspose, desiredTypeId, object); return builder.createUnaryOp(spv::OpTranspose, desiredTypeId, object);
} else { } else {
@ -2322,7 +2355,7 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
// The result of operation is always stored, but conditionally the // The result of operation is always stored, but conditionally the
// consumed result. The consumed result is always an r-value. // consumed result. The consumed result is always an r-value.
builder.accessChainStore(result, builder.accessChainStore(result,
TranslateNonUniformDecoration(node->getOperand()->getType().getQualifier())); TranslateNonUniformDecoration(builder.getAccessChain().coherentFlags));
builder.clearAccessChain(); builder.clearAccessChain();
if (node->getOp() == glslang::EOpPreIncrement || if (node->getOp() == glslang::EOpPreIncrement ||
node->getOp() == glslang::EOpPreDecrement) node->getOp() == glslang::EOpPreDecrement)
@ -2398,7 +2431,6 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
spv::Id invertedType = spv::NoType; // to use to override the natural type of the node spv::Id invertedType = spv::NoType; // to use to override the natural type of the node
std::vector<spv::Builder::AccessChain> complexLvalues; // for holding swizzling l-values too complex for std::vector<spv::Builder::AccessChain> complexLvalues; // for holding swizzling l-values too complex for
// SPIR-V, for an out parameter // SPIR-V, for an out parameter
std::vector<glslang::TQualifier> complexLValueQualifiers;
std::vector<spv::Id> temporaryLvalues; // temporaries to pass, as proxies for complexLValues std::vector<spv::Id> temporaryLvalues; // temporaries to pass, as proxies for complexLValues
auto resultType = [&invertedType, &node, this](){ return invertedType != spv::NoType ? auto resultType = [&invertedType, &node, this](){ return invertedType != spv::NoType ?
@ -3020,7 +3052,6 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
// receive the result, and must later swizzle that into the original // receive the result, and must later swizzle that into the original
// l-value. // l-value.
complexLvalues.push_back(builder.getAccessChain()); complexLvalues.push_back(builder.getAccessChain());
complexLValueQualifiers.push_back(glslangOperands[arg]->getAsTyped()->getType().getQualifier());
temporaryLvalues.push_back(builder.createVariable( temporaryLvalues.push_back(builder.createVariable(
spv::NoPrecision, spv::StorageClassFunction, spv::NoPrecision, spv::StorageClassFunction,
builder.accessChainGetInferredType(), "swizzleTemp")); builder.accessChainGetInferredType(), "swizzleTemp"));
@ -3125,7 +3156,8 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
for (unsigned int i = 0; i < temporaryLvalues.size(); ++i) { for (unsigned int i = 0; i < temporaryLvalues.size(); ++i) {
builder.setAccessChain(complexLvalues[i]); builder.setAccessChain(complexLvalues[i]);
builder.accessChainStore(builder.createLoad(temporaryLvalues[i], spv::NoPrecision), TranslateNonUniformDecoration(complexLValueQualifiers[i])); builder.accessChainStore(builder.createLoad(temporaryLvalues[i], spv::NoPrecision),
TranslateNonUniformDecoration(complexLvalues[i].coherentFlags));
} }
} }
@ -4135,6 +4167,7 @@ spv::Id TGlslangToSpvTraverser::accessChainLoad(const glslang::TType& type)
alignment |= type.getBufferReferenceAlignment(); alignment |= type.getBufferReferenceAlignment();
spv::Id loadedId = builder.accessChainLoad(TranslatePrecisionDecoration(type), spv::Id loadedId = builder.accessChainLoad(TranslatePrecisionDecoration(type),
TranslateNonUniformDecoration(builder.getAccessChain().coherentFlags),
TranslateNonUniformDecoration(type.getQualifier()), TranslateNonUniformDecoration(type.getQualifier()),
nominalTypeId, nominalTypeId,
spv::MemoryAccessMask(TranslateMemoryAccess(coherentFlags) & ~spv::MemoryAccessMakePointerAvailableKHRMask), spv::MemoryAccessMask(TranslateMemoryAccess(coherentFlags) & ~spv::MemoryAccessMakePointerAvailableKHRMask),
@ -4202,7 +4235,7 @@ void TGlslangToSpvTraverser::accessChainStore(const glslang::TType& type, spv::I
unsigned int alignment = builder.getAccessChain().alignment; unsigned int alignment = builder.getAccessChain().alignment;
alignment |= type.getBufferReferenceAlignment(); alignment |= type.getBufferReferenceAlignment();
builder.accessChainStore(rvalue, TranslateNonUniformDecoration(type.getQualifier()), builder.accessChainStore(rvalue, TranslateNonUniformDecoration(builder.getAccessChain().coherentFlags),
spv::MemoryAccessMask(TranslateMemoryAccess(coherentFlags) & spv::MemoryAccessMask(TranslateMemoryAccess(coherentFlags) &
~spv::MemoryAccessMakePointerVisibleKHRMask), ~spv::MemoryAccessMakePointerVisibleKHRMask),
TranslateMemoryScope(coherentFlags), alignment); TranslateMemoryScope(coherentFlags), alignment);
@ -4734,8 +4767,10 @@ void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate&
} }
if (lvalue) { if (lvalue) {
arguments.push_back(builder.accessChainGetLValue()); spv::Id lvalue_id = builder.accessChainGetLValue();
arguments.push_back(lvalue_id);
lvalueCoherentFlags = builder.getAccessChain().coherentFlags; lvalueCoherentFlags = builder.getAccessChain().coherentFlags;
builder.addDecoration(lvalue_id, TranslateNonUniformDecoration(lvalueCoherentFlags));
lvalueCoherentFlags |= TranslateCoherent(glslangArguments[i]->getAsTyped()->getType()); lvalueCoherentFlags |= TranslateCoherent(glslangArguments[i]->getAsTyped()->getType());
} else } else
#endif #endif
@ -5415,6 +5450,7 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg
// 3. Make the call. // 3. Make the call.
spv::Id result = builder.createFunctionCall(function, spvArgs); spv::Id result = builder.createFunctionCall(function, spvArgs);
builder.setPrecision(result, TranslatePrecisionDecoration(node->getType())); builder.setPrecision(result, TranslatePrecisionDecoration(node->getType()));
builder.addDecoration(result, TranslateNonUniformDecoration(node->getType().getQualifier()));
// 4. Copy back out an "out" arguments. // 4. Copy back out an "out" arguments.
lValueCount = 0; lValueCount = 0;
@ -5424,6 +5460,7 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg
else if (writableParam(qualifiers[a])) { else if (writableParam(qualifiers[a])) {
if (qualifiers[a] == glslang::EvqOut || qualifiers[a] == glslang::EvqInOut) { if (qualifiers[a] == glslang::EvqOut || qualifiers[a] == glslang::EvqInOut) {
spv::Id copy = builder.createLoad(spvArgs[a], spv::NoPrecision); spv::Id copy = builder.createLoad(spvArgs[a], spv::NoPrecision);
builder.addDecoration(copy, TranslateNonUniformDecoration(argTypes[a]->getQualifier()));
builder.setAccessChain(lValues[lValueCount]); builder.setAccessChain(lValues[lValueCount]);
multiTypeStore(*argTypes[a], copy); multiTypeStore(*argTypes[a], copy);
} }
@ -8228,9 +8265,6 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
builder.addDecoration(id, memory[i]); builder.addDecoration(id, memory[i]);
} }
// nonuniform
builder.addDecoration(id, TranslateNonUniformDecoration(symbol->getType().getQualifier()));
if (builtIn == spv::BuiltInSampleMask) { if (builtIn == spv::BuiltInSampleMask) {
spv::Decoration decoration; spv::Decoration decoration;
// GL_NV_sample_mask_override_coverage extension // GL_NV_sample_mask_override_coverage extension

View File

@ -2798,8 +2798,9 @@ void Builder::accessChainStore(Id rvalue, Decoration nonUniform, spv::MemoryAcce
} }
// Comments in header // Comments in header
Id Builder::accessChainLoad(Decoration precision, Decoration nonUniform, Id resultType, Id Builder::accessChainLoad(Decoration precision, Decoration l_nonUniform,
spv::MemoryAccessMask memoryAccess, spv::Scope scope, unsigned int alignment) Decoration r_nonUniform, Id resultType, spv::MemoryAccessMask memoryAccess,
spv::Scope scope, unsigned int alignment)
{ {
Id id; Id id;
@ -2863,9 +2864,9 @@ Id Builder::accessChainLoad(Decoration precision, Decoration nonUniform, Id resu
// Buffer accesses need the access chain decorated, and this is where // Buffer accesses need the access chain decorated, and this is where
// loaded image types get decorated. TODO: This should maybe move to // loaded image types get decorated. TODO: This should maybe move to
// createImageTextureFunctionCall. // createImageTextureFunctionCall.
addDecoration(id, nonUniform); addDecoration(id, l_nonUniform);
id = createLoad(id, precision, memoryAccess, scope, alignment); id = createLoad(id, precision, memoryAccess, scope, alignment);
addDecoration(id, nonUniform); addDecoration(id, r_nonUniform);
} }
// Done, unless there are swizzles to do // Done, unless there are swizzles to do
@ -2886,7 +2887,7 @@ Id Builder::accessChainLoad(Decoration precision, Decoration nonUniform, Id resu
if (accessChain.component != NoResult) if (accessChain.component != NoResult)
id = setPrecision(createVectorExtractDynamic(id, resultType, accessChain.component), precision); id = setPrecision(createVectorExtractDynamic(id, resultType, accessChain.component), precision);
addDecoration(id, nonUniform); addDecoration(id, r_nonUniform);
return id; return id;
} }

View File

@ -625,6 +625,7 @@ public:
CoherentFlags operator |=(const CoherentFlags &other) { return *this; } CoherentFlags operator |=(const CoherentFlags &other) { return *this; }
#else #else
bool isVolatile() const { return volatil; } bool isVolatile() const { return volatil; }
bool isNonUniform() const { return nonUniform; }
bool anyCoherent() const { bool anyCoherent() const {
return coherent || devicecoherent || queuefamilycoherent || workgroupcoherent || return coherent || devicecoherent || queuefamilycoherent || workgroupcoherent ||
subgroupcoherent || shadercallcoherent; subgroupcoherent || shadercallcoherent;
@ -639,6 +640,7 @@ public:
unsigned nonprivate : 1; unsigned nonprivate : 1;
unsigned volatil : 1; unsigned volatil : 1;
unsigned isImage : 1; unsigned isImage : 1;
unsigned nonUniform : 1;
void clear() { void clear() {
coherent = 0; coherent = 0;
@ -650,6 +652,7 @@ public:
nonprivate = 0; nonprivate = 0;
volatil = 0; volatil = 0;
isImage = 0; isImage = 0;
nonUniform = 0;
} }
CoherentFlags operator |=(const CoherentFlags &other) { CoherentFlags operator |=(const CoherentFlags &other) {
@ -662,6 +665,7 @@ public:
nonprivate |= other.nonprivate; nonprivate |= other.nonprivate;
volatil |= other.volatil; volatil |= other.volatil;
isImage |= other.isImage; isImage |= other.isImage;
nonUniform |= other.nonUniform;
return *this; return *this;
} }
#endif #endif
@ -727,7 +731,7 @@ public:
spv::Scope scope = spv::ScopeMax, unsigned int alignment = 0); spv::Scope scope = spv::ScopeMax, unsigned int alignment = 0);
// use accessChain and swizzle to load an r-value // use accessChain and swizzle to load an r-value
Id accessChainLoad(Decoration precision, Decoration nonUniform, Id ResultType, Id accessChainLoad(Decoration precision, Decoration l_nonUniform, Decoration r_nonUniform, Id ResultType,
spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, spv::Scope scope = spv::ScopeMax, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, spv::Scope scope = spv::ScopeMax,
unsigned int alignment = 0); unsigned int alignment = 0);

View File

@ -1,7 +1,7 @@
spv.nonuniform.frag spv.nonuniform.frag
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 8000a // Generated by (magic number): 8000a
// Id's are bound by 235 // Id's are bound by 289
Capability Shader Capability Shader
Capability InputAttachment Capability InputAttachment
@ -22,7 +22,7 @@ spv.nonuniform.frag
Extension "SPV_EXT_descriptor_indexing" Extension "SPV_EXT_descriptor_indexing"
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 35 92 182 EntryPoint Fragment 4 "main" 41 98 188
ExecutionMode 4 OriginUpperLeft ExecutionMode 4 OriginUpperLeft
Source GLSL 450 Source GLSL 450
SourceExtension "GL_EXT_nonuniform_qualifier" SourceExtension "GL_EXT_nonuniform_qualifier"
@ -34,246 +34,268 @@ spv.nonuniform.frag
Name 17 "nu_li" Name 17 "nu_li"
Name 18 "param" Name 18 "param"
Name 20 "param" Name 20 "param"
Name 32 "b" Name 30 "nu_li2"
Name 35 "nu_inv4" Name 38 "b"
Name 41 "nu_gf" Name 41 "nu_inv4"
Name 47 "inputAttachmentDyn" Name 47 "nu_gf"
Name 48 "dyn_i" Name 53 "inputAttachmentDyn"
Name 64 "uniformTexelBufferDyn" Name 54 "dyn_i"
Name 78 "storageTexelBufferDyn" Name 70 "uniformTexelBufferDyn"
Name 87 "uname" Name 84 "storageTexelBufferDyn"
MemberName 87(uname) 0 "a" Name 93 "uname"
Name 90 "uniformBuffer" MemberName 93(uname) 0 "a"
Name 92 "nu_ii" Name 96 "uniformBuffer"
Name 99 "bname" Name 98 "nu_ii"
MemberName 99(bname) 0 "b" Name 105 "bname"
Name 102 "storageBuffer" MemberName 105(bname) 0 "b"
Name 112 "sampledImage" Name 108 "storageBuffer"
Name 127 "storageImage" Name 118 "sampledImage"
Name 139 "inputAttachment" Name 133 "storageImage"
Name 149 "uniformTexelBuffer" Name 145 "inputAttachment"
Name 160 "storageTexelBuffer" Name 155 "uniformTexelBuffer"
Name 171 "uniformTexArr" Name 166 "storageTexelBuffer"
Name 178 "uniformSampler" Name 177 "uniformTexArr"
Name 182 "inTexcoord" Name 184 "uniformSampler"
Name 190 "v" Name 188 "inTexcoord"
Name 205 "uv" Name 207 "v"
Name 215 "m" Name 222 "uv"
Name 223 "S" Name 232 "m"
MemberName 223(S) 0 "a" Name 240 "S"
Name 225 "s" MemberName 240(S) 0 "a"
Decorate 9(nupi) DecorationNonUniformEXT Name 242 "s"
Name 252 "arr"
Name 259 "um"
Name 268 "US"
MemberName 268(US) 0 "a"
Name 270 "us"
Name 278 "uarr"
Decorate 13 DecorationNonUniformEXT Decorate 13 DecorationNonUniformEXT
Decorate 17(nu_li) DecorationNonUniformEXT
Decorate 17(nu_li) DecorationNonUniformEXT
Decorate 19 DecorationNonUniformEXT Decorate 19 DecorationNonUniformEXT
Decorate 18(param) DecorationNonUniformEXT Decorate 21 DecorationNonUniformEXT
Decorate 17(nu_li) DecorationNonUniformEXT Decorate 22 DecorationNonUniformEXT
Decorate 24 DecorationNonUniformEXT Decorate 24 DecorationNonUniformEXT
Decorate 28 DecorationNonUniformEXT Decorate 28 DecorationNonUniformEXT
Decorate 29 DecorationNonUniformEXT Decorate 29 DecorationNonUniformEXT
Decorate 17(nu_li) DecorationNonUniformEXT Decorate 34 DecorationNonUniformEXT
Decorate 35(nu_inv4) Location 0 Decorate 35 DecorationNonUniformEXT
Decorate 35(nu_inv4) DecorationNonUniformEXT Decorate 41(nu_inv4) Location 0
Decorate 39 DecorationNonUniformEXT Decorate 46 DecorationNonUniformEXT
Decorate 40 DecorationNonUniformEXT Decorate 48 DecorationNonUniformEXT
Decorate 41(nu_gf) DecorationNonUniformEXT Decorate 49 DecorationNonUniformEXT
Decorate 41(nu_gf) DecorationNonUniformEXT Decorate 53(inputAttachmentDyn) DescriptorSet 0
Decorate 42 DecorationNonUniformEXT Decorate 53(inputAttachmentDyn) Binding 0
Decorate 43 DecorationNonUniformEXT Decorate 53(inputAttachmentDyn) InputAttachmentIndex 0
Decorate 47(inputAttachmentDyn) DescriptorSet 0 Decorate 70(uniformTexelBufferDyn) DescriptorSet 0
Decorate 47(inputAttachmentDyn) Binding 0 Decorate 70(uniformTexelBufferDyn) Binding 1
Decorate 47(inputAttachmentDyn) InputAttachmentIndex 0 Decorate 84(storageTexelBufferDyn) DescriptorSet 0
Decorate 64(uniformTexelBufferDyn) DescriptorSet 0 Decorate 84(storageTexelBufferDyn) Binding 2
Decorate 64(uniformTexelBufferDyn) Binding 1 MemberDecorate 93(uname) 0 Offset 0
Decorate 78(storageTexelBufferDyn) DescriptorSet 0 Decorate 93(uname) Block
Decorate 78(storageTexelBufferDyn) Binding 2 Decorate 96(uniformBuffer) DescriptorSet 0
MemberDecorate 87(uname) 0 Offset 0 Decorate 96(uniformBuffer) Binding 3
Decorate 87(uname) Block Decorate 98(nu_ii) Flat
Decorate 90(uniformBuffer) DescriptorSet 0 Decorate 98(nu_ii) Location 1
Decorate 90(uniformBuffer) Binding 3 Decorate 99 DecorationNonUniformEXT
Decorate 92(nu_ii) Flat Decorate 101 DecorationNonUniformEXT
Decorate 92(nu_ii) Location 1 Decorate 102 DecorationNonUniformEXT
Decorate 92(nu_ii) DecorationNonUniformEXT
Decorate 92(nu_ii) DecorationNonUniformEXT
Decorate 93 DecorationNonUniformEXT
Decorate 95 DecorationNonUniformEXT
Decorate 96 DecorationNonUniformEXT
MemberDecorate 99(bname) 0 Offset 0
Decorate 99(bname) BufferBlock
Decorate 102(storageBuffer) DescriptorSet 0
Decorate 102(storageBuffer) Binding 4
Decorate 92(nu_ii) DecorationNonUniformEXT
Decorate 103 DecorationNonUniformEXT
Decorate 104 DecorationNonUniformEXT Decorate 104 DecorationNonUniformEXT
Decorate 105 DecorationNonUniformEXT MemberDecorate 105(bname) 0 Offset 0
Decorate 112(sampledImage) DescriptorSet 0 Decorate 105(bname) BufferBlock
Decorate 112(sampledImage) Binding 5 Decorate 108(storageBuffer) DescriptorSet 0
Decorate 92(nu_ii) DecorationNonUniformEXT Decorate 108(storageBuffer) Binding 4
Decorate 109 DecorationNonUniformEXT
Decorate 110 DecorationNonUniformEXT
Decorate 111 DecorationNonUniformEXT
Decorate 113 DecorationNonUniformEXT Decorate 113 DecorationNonUniformEXT
Decorate 115 DecorationNonUniformEXT Decorate 118(sampledImage) DescriptorSet 0
Decorate 116 DecorationNonUniformEXT Decorate 118(sampledImage) Binding 5
Decorate 127(storageImage) DescriptorSet 0 Decorate 119 DecorationNonUniformEXT
Decorate 127(storageImage) Binding 6 Decorate 121 DecorationNonUniformEXT
Decorate 92(nu_ii) DecorationNonUniformEXT Decorate 122 DecorationNonUniformEXT
Decorate 128 DecorationNonUniformEXT Decorate 133(storageImage) DescriptorSet 0
Decorate 130 DecorationNonUniformEXT Decorate 133(storageImage) Binding 6
Decorate 131 DecorationNonUniformEXT Decorate 134 DecorationNonUniformEXT
Decorate 139(inputAttachment) DescriptorSet 0 Decorate 136 DecorationNonUniformEXT
Decorate 139(inputAttachment) Binding 7 Decorate 137 DecorationNonUniformEXT
Decorate 139(inputAttachment) InputAttachmentIndex 1 Decorate 145(inputAttachment) DescriptorSet 0
Decorate 92(nu_ii) DecorationNonUniformEXT Decorate 145(inputAttachment) Binding 7
Decorate 140 DecorationNonUniformEXT Decorate 145(inputAttachment) InputAttachmentIndex 1
Decorate 141 DecorationNonUniformEXT Decorate 146 DecorationNonUniformEXT
Decorate 142 DecorationNonUniformEXT Decorate 147 DecorationNonUniformEXT
Decorate 149(uniformTexelBuffer) DescriptorSet 0 Decorate 148 DecorationNonUniformEXT
Decorate 149(uniformTexelBuffer) Binding 8 Decorate 155(uniformTexelBuffer) DescriptorSet 0
Decorate 92(nu_ii) DecorationNonUniformEXT Decorate 155(uniformTexelBuffer) Binding 8
Decorate 150 DecorationNonUniformEXT Decorate 156 DecorationNonUniformEXT
Decorate 151 DecorationNonUniformEXT Decorate 157 DecorationNonUniformEXT
Decorate 152 DecorationNonUniformEXT Decorate 158 DecorationNonUniformEXT
Decorate 153 DecorationNonUniformEXT Decorate 159 DecorationNonUniformEXT
Decorate 160(storageTexelBuffer) DescriptorSet 0 Decorate 166(storageTexelBuffer) DescriptorSet 0
Decorate 160(storageTexelBuffer) Binding 9 Decorate 166(storageTexelBuffer) Binding 9
Decorate 92(nu_ii) DecorationNonUniformEXT Decorate 167 DecorationNonUniformEXT
Decorate 161 DecorationNonUniformEXT Decorate 168 DecorationNonUniformEXT
Decorate 162 DecorationNonUniformEXT Decorate 169 DecorationNonUniformEXT
Decorate 163 DecorationNonUniformEXT Decorate 177(uniformTexArr) DescriptorSet 0
Decorate 171(uniformTexArr) DescriptorSet 0 Decorate 177(uniformTexArr) Binding 10
Decorate 171(uniformTexArr) Binding 10 Decorate 178 DecorationNonUniformEXT
Decorate 92(nu_ii) DecorationNonUniformEXT Decorate 180 DecorationNonUniformEXT
Decorate 172 DecorationNonUniformEXT Decorate 181 DecorationNonUniformEXT
Decorate 174 DecorationNonUniformEXT Decorate 184(uniformSampler) DescriptorSet 0
Decorate 175 DecorationNonUniformEXT Decorate 184(uniformSampler) Binding 11
Decorate 178(uniformSampler) DescriptorSet 0 Decorate 188(inTexcoord) Location 2
Decorate 178(uniformSampler) Binding 11
Decorate 182(inTexcoord) Location 2
Decorate 190(v) DecorationNonUniformEXT
Decorate 192 DecorationNonUniformEXT
Decorate 193 DecorationNonUniformEXT
Decorate 194 DecorationNonUniformEXT Decorate 194 DecorationNonUniformEXT
Decorate 195 DecorationNonUniformEXT Decorate 195 DecorationNonUniformEXT
Decorate 196 DecorationNonUniformEXT
Decorate 199 DecorationNonUniformEXT Decorate 199 DecorationNonUniformEXT
Decorate 200 DecorationNonUniformEXT
Decorate 201 DecorationNonUniformEXT
Decorate 202 DecorationNonUniformEXT
Decorate 92(nu_ii) DecorationNonUniformEXT
Decorate 206 DecorationNonUniformEXT
Decorate 207 DecorationNonUniformEXT
Decorate 208 DecorationNonUniformEXT
Decorate 209 DecorationNonUniformEXT
Decorate 210 DecorationNonUniformEXT Decorate 210 DecorationNonUniformEXT
Decorate 215(m) DecorationNonUniformEXT Decorate 211 DecorationNonUniformEXT
Decorate 216 DecorationNonUniformEXT Decorate 212 DecorationNonUniformEXT
Decorate 214 DecorationNonUniformEXT
Decorate 217 DecorationNonUniformEXT Decorate 217 DecorationNonUniformEXT
Decorate 225(s) DecorationNonUniformEXT Decorate 218 DecorationNonUniformEXT
Decorate 219 DecorationNonUniformEXT
Decorate 221 DecorationNonUniformEXT
Decorate 223 DecorationNonUniformEXT
Decorate 224 DecorationNonUniformEXT
Decorate 225 DecorationNonUniformEXT
Decorate 226 DecorationNonUniformEXT Decorate 226 DecorationNonUniformEXT
Decorate 227 DecorationNonUniformEXT Decorate 227 DecorationNonUniformEXT
Decorate 228 DecorationNonUniformEXT
Decorate 229 DecorationNonUniformEXT Decorate 229 DecorationNonUniformEXT
Decorate 92(nu_ii) DecorationNonUniformEXT
Decorate 232 DecorationNonUniformEXT
Decorate 234 DecorationNonUniformEXT Decorate 234 DecorationNonUniformEXT
Decorate 244 DecorationNonUniformEXT
Decorate 245 DecorationNonUniformEXT
Decorate 246 DecorationNonUniformEXT
Decorate 248 DecorationNonUniformEXT
Decorate 254 DecorationNonUniformEXT
Decorate 255 DecorationNonUniformEXT
Decorate 256 DecorationNonUniformEXT
Decorate 258 DecorationNonUniformEXT
Decorate 260 DecorationNonUniformEXT
Decorate 261 DecorationNonUniformEXT
Decorate 262 DecorationNonUniformEXT
Decorate 271 DecorationNonUniformEXT
Decorate 272 DecorationNonUniformEXT
Decorate 273 DecorationNonUniformEXT
Decorate 274 DecorationNonUniformEXT
Decorate 275 DecorationNonUniformEXT
Decorate 277 DecorationNonUniformEXT
Decorate 279 DecorationNonUniformEXT
Decorate 280 DecorationNonUniformEXT
Decorate 281 DecorationNonUniformEXT
Decorate 282 DecorationNonUniformEXT
Decorate 283 DecorationNonUniformEXT
Decorate 285 DecorationNonUniformEXT
Decorate 286 DecorationNonUniformEXT
Decorate 288 DecorationNonUniformEXT
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
7: TypePointer Function 6(int) 7: TypePointer Function 6(int)
8: TypeFunction 6(int) 7(ptr) 7(ptr) 8: TypeFunction 6(int) 7(ptr) 7(ptr)
26: 6(int) Constant 2 26: 6(int) Constant 2
30: TypeFloat 32 36: TypeFloat 32
31: TypePointer Function 30(float) 37: TypePointer Function 36(float)
33: TypeVector 30(float) 4 39: TypeVector 36(float) 4
34: TypePointer Input 33(fvec4) 40: TypePointer Input 39(fvec4)
35(nu_inv4): 34(ptr) Variable Input 41(nu_inv4): 40(ptr) Variable Input
36: TypeInt 32 0 42: TypeInt 32 0
37: 36(int) Constant 0 43: 42(int) Constant 0
38: TypePointer Input 30(float) 44: TypePointer Input 36(float)
44: TypeImage 30(float) SubpassData nonsampled format:Unknown 50: TypeImage 36(float) SubpassData nonsampled format:Unknown
45: TypeRuntimeArray 44 51: TypeRuntimeArray 50
46: TypePointer UniformConstant 45 52: TypePointer UniformConstant 51
47(inputAttachmentDyn): 46(ptr) Variable UniformConstant 53(inputAttachmentDyn): 52(ptr) Variable UniformConstant
50: TypePointer UniformConstant 44 56: TypePointer UniformConstant 50
53: 6(int) Constant 0 59: 6(int) Constant 0
54: TypeVector 6(int) 2 60: TypeVector 6(int) 2
55: 54(ivec2) ConstantComposite 53 53 61: 60(ivec2) ConstantComposite 59 59
60: TypeImage 30(float) Buffer sampled format:Unknown 66: TypeImage 36(float) Buffer sampled format:Unknown
61: TypeSampledImage 60 67: TypeSampledImage 66
62: TypeRuntimeArray 61 68: TypeRuntimeArray 67
63: TypePointer UniformConstant 62 69: TypePointer UniformConstant 68
64(uniformTexelBufferDyn): 63(ptr) Variable UniformConstant 70(uniformTexelBufferDyn): 69(ptr) Variable UniformConstant
66: TypePointer UniformConstant 61 72: TypePointer UniformConstant 67
69: 6(int) Constant 1 75: 6(int) Constant 1
75: TypeImage 30(float) Buffer nonsampled format:R32f 81: TypeImage 36(float) Buffer nonsampled format:R32f
76: TypeRuntimeArray 75 82: TypeRuntimeArray 81
77: TypePointer UniformConstant 76 83: TypePointer UniformConstant 82
78(storageTexelBufferDyn): 77(ptr) Variable UniformConstant 84(storageTexelBufferDyn): 83(ptr) Variable UniformConstant
80: TypePointer UniformConstant 75 86: TypePointer UniformConstant 81
87(uname): TypeStruct 30(float) 93(uname): TypeStruct 36(float)
88: TypeRuntimeArray 87(uname) 94: TypeRuntimeArray 93(uname)
89: TypePointer Uniform 88 95: TypePointer Uniform 94
90(uniformBuffer): 89(ptr) Variable Uniform 96(uniformBuffer): 95(ptr) Variable Uniform
91: TypePointer Input 6(int) 97: TypePointer Input 6(int)
92(nu_ii): 91(ptr) Variable Input 98(nu_ii): 97(ptr) Variable Input
94: TypePointer Uniform 30(float) 100: TypePointer Uniform 36(float)
99(bname): TypeStruct 30(float) 105(bname): TypeStruct 36(float)
100: TypeRuntimeArray 99(bname) 106: TypeRuntimeArray 105(bname)
101: TypePointer Uniform 100 107: TypePointer Uniform 106
102(storageBuffer): 101(ptr) Variable Uniform 108(storageBuffer): 107(ptr) Variable Uniform
108: TypeImage 30(float) 2D sampled format:Unknown 114: TypeImage 36(float) 2D sampled format:Unknown
109: TypeSampledImage 108 115: TypeSampledImage 114
110: TypeRuntimeArray 109 116: TypeRuntimeArray 115
111: TypePointer UniformConstant 110 117: TypePointer UniformConstant 116
112(sampledImage): 111(ptr) Variable UniformConstant 118(sampledImage): 117(ptr) Variable UniformConstant
114: TypePointer UniformConstant 109 120: TypePointer UniformConstant 115
117: TypeVector 30(float) 2 123: TypeVector 36(float) 2
118: 30(float) Constant 1056964608 124: 36(float) Constant 1056964608
119: 117(fvec2) ConstantComposite 118 118 125: 123(fvec2) ConstantComposite 124 124
124: TypeImage 30(float) 2D nonsampled format:R32f 130: TypeImage 36(float) 2D nonsampled format:R32f
125: TypeRuntimeArray 124 131: TypeRuntimeArray 130
126: TypePointer UniformConstant 125 132: TypePointer UniformConstant 131
127(storageImage): 126(ptr) Variable UniformConstant 133(storageImage): 132(ptr) Variable UniformConstant
129: TypePointer UniformConstant 124 135: TypePointer UniformConstant 130
132: 54(ivec2) ConstantComposite 69 69 138: 60(ivec2) ConstantComposite 75 75
137: TypeRuntimeArray 44 143: TypeRuntimeArray 50
138: TypePointer UniformConstant 137 144: TypePointer UniformConstant 143
139(inputAttachment): 138(ptr) Variable UniformConstant 145(inputAttachment): 144(ptr) Variable UniformConstant
147: TypeRuntimeArray 61 153: TypeRuntimeArray 67
148: TypePointer UniformConstant 147 154: TypePointer UniformConstant 153
149(uniformTexelBuffer): 148(ptr) Variable UniformConstant 155(uniformTexelBuffer): 154(ptr) Variable UniformConstant
158: TypeRuntimeArray 75 164: TypeRuntimeArray 81
159: TypePointer UniformConstant 158 165: TypePointer UniformConstant 164
160(storageTexelBuffer): 159(ptr) Variable UniformConstant 166(storageTexelBuffer): 165(ptr) Variable UniformConstant
168: 36(int) Constant 8 174: 42(int) Constant 8
169: TypeArray 108 168 175: TypeArray 114 174
170: TypePointer UniformConstant 169 176: TypePointer UniformConstant 175
171(uniformTexArr): 170(ptr) Variable UniformConstant 177(uniformTexArr): 176(ptr) Variable UniformConstant
173: TypePointer UniformConstant 108 179: TypePointer UniformConstant 114
176: TypeSampler 182: TypeSampler
177: TypePointer UniformConstant 176 183: TypePointer UniformConstant 182
178(uniformSampler): 177(ptr) Variable UniformConstant 184(uniformSampler): 183(ptr) Variable UniformConstant
181: TypePointer Input 117(fvec2) 187: TypePointer Input 123(fvec2)
182(inTexcoord): 181(ptr) Variable Input 188(inTexcoord): 187(ptr) Variable Input
188: TypeVector 6(int) 4 205: TypeVector 6(int) 4
189: TypePointer Function 188(ivec4) 206: TypePointer Function 205(ivec4)
191: 36(int) Constant 1 208: 42(int) Constant 1
198: 36(int) Constant 2 215: 42(int) Constant 2
213: TypeMatrix 33(fvec4) 4 230: TypeMatrix 39(fvec4) 4
214: TypePointer Function 213 231: TypePointer Function 230
223(S): TypeStruct 6(int) 240(S): TypeStruct 6(int)
224: TypePointer Function 223(S) 241: TypePointer Function 240(S)
249: 42(int) Constant 10
250: TypeArray 6(int) 249
251: TypePointer Function 250
268(US): TypeStruct 250
269: TypePointer Function 268(US)
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
16(a): 7(ptr) Variable Function 16(a): 7(ptr) Variable Function
17(nu_li): 7(ptr) Variable Function 17(nu_li): 7(ptr) Variable Function
18(param): 7(ptr) Variable Function 18(param): 7(ptr) Variable Function
20(param): 7(ptr) Variable Function 20(param): 7(ptr) Variable Function
32(b): 31(ptr) Variable Function 30(nu_li2): 7(ptr) Variable Function
41(nu_gf): 31(ptr) Variable Function 38(b): 37(ptr) Variable Function
48(dyn_i): 7(ptr) Variable Function 47(nu_gf): 37(ptr) Variable Function
190(v): 189(ptr) Variable Function 54(dyn_i): 7(ptr) Variable Function
205(uv): 189(ptr) Variable Function 207(v): 206(ptr) Variable Function
215(m): 214(ptr) Variable Function 222(uv): 206(ptr) Variable Function
225(s): 224(ptr) Variable Function 232(m): 231(ptr) Variable Function
242(s): 241(ptr) Variable Function
252(arr): 251(ptr) Variable Function
259(um): 231(ptr) Variable Function
270(us): 269(ptr) Variable Function
278(uarr): 251(ptr) Variable Function
19: 6(int) Load 17(nu_li) 19: 6(int) Load 17(nu_li)
Store 18(param) 19 Store 18(param) 19
21: 6(int) FunctionCall 11(foo(i1;i1;) 18(param) 20(param) 21: 6(int) FunctionCall 11(foo(i1;i1;) 18(param) 20(param)
@ -287,141 +309,191 @@ spv.nonuniform.frag
28: 6(int) CopyObject 27 28: 6(int) CopyObject 27
29: 6(int) IAdd 24 28 29: 6(int) IAdd 24 28
Store 17(nu_li) 29 Store 17(nu_li) 29
39: 38(ptr) AccessChain 35(nu_inv4) 37 31: 6(int) Load 16(a)
40: 30(float) Load 39 32: 6(int) Load 16(a)
42: 30(float) Load 41(nu_gf) 33: 6(int) IMul 32 26
43: 30(float) FMul 40 42 34: 6(int) CopyObject 33
Store 32(b) 43 35: 6(int) IAdd 31 34
49: 6(int) Load 48(dyn_i) Store 30(nu_li2) 35
51: 50(ptr) AccessChain 47(inputAttachmentDyn) 49 45: 44(ptr) AccessChain 41(nu_inv4) 43
52: 44 Load 51 46: 36(float) Load 45
56: 33(fvec4) ImageRead 52 55 48: 36(float) Load 47(nu_gf)
57: 30(float) CompositeExtract 56 0 49: 36(float) FMul 46 48
58: 30(float) Load 32(b) Store 38(b) 49
59: 30(float) FAdd 58 57 55: 6(int) Load 54(dyn_i)
Store 32(b) 59 57: 56(ptr) AccessChain 53(inputAttachmentDyn) 55
65: 6(int) Load 48(dyn_i) 58: 50 Load 57
67: 66(ptr) AccessChain 64(uniformTexelBufferDyn) 65 62: 39(fvec4) ImageRead 58 61
68: 61 Load 67 63: 36(float) CompositeExtract 62 0
70: 60 Image 68 64: 36(float) Load 38(b)
71: 33(fvec4) ImageFetch 70 69 65: 36(float) FAdd 64 63
72: 30(float) CompositeExtract 71 0 Store 38(b) 65
73: 30(float) Load 32(b) 71: 6(int) Load 54(dyn_i)
74: 30(float) FAdd 73 72 73: 72(ptr) AccessChain 70(uniformTexelBufferDyn) 71
Store 32(b) 74 74: 67 Load 73
79: 6(int) Load 48(dyn_i) 76: 66 Image 74
81: 80(ptr) AccessChain 78(storageTexelBufferDyn) 79 77: 39(fvec4) ImageFetch 76 75
82: 75 Load 81 78: 36(float) CompositeExtract 77 0
83: 33(fvec4) ImageRead 82 69 79: 36(float) Load 38(b)
84: 30(float) CompositeExtract 83 0 80: 36(float) FAdd 79 78
85: 30(float) Load 32(b) Store 38(b) 80
86: 30(float) FAdd 85 84 85: 6(int) Load 54(dyn_i)
Store 32(b) 86 87: 86(ptr) AccessChain 84(storageTexelBufferDyn) 85
93: 6(int) Load 92(nu_ii) 88: 81 Load 87
95: 94(ptr) AccessChain 90(uniformBuffer) 93 53 89: 39(fvec4) ImageRead 88 75
96: 30(float) Load 95 90: 36(float) CompositeExtract 89 0
97: 30(float) Load 32(b) 91: 36(float) Load 38(b)
98: 30(float) FAdd 97 96 92: 36(float) FAdd 91 90
Store 32(b) 98 Store 38(b) 92
103: 6(int) Load 92(nu_ii) 99: 6(int) Load 98(nu_ii)
104: 94(ptr) AccessChain 102(storageBuffer) 103 53 101: 100(ptr) AccessChain 96(uniformBuffer) 99 59
105: 30(float) Load 104 102: 36(float) Load 101
106: 30(float) Load 32(b) 103: 36(float) Load 38(b)
107: 30(float) FAdd 106 105 104: 36(float) FAdd 103 102
Store 32(b) 107 Store 38(b) 104
113: 6(int) Load 92(nu_ii) 109: 6(int) Load 98(nu_ii)
115: 114(ptr) AccessChain 112(sampledImage) 113 110: 100(ptr) AccessChain 108(storageBuffer) 109 59
116: 109 Load 115 111: 36(float) Load 110
120: 33(fvec4) ImageSampleImplicitLod 116 119 112: 36(float) Load 38(b)
121: 30(float) CompositeExtract 120 0 113: 36(float) FAdd 112 111
122: 30(float) Load 32(b) Store 38(b) 113
123: 30(float) FAdd 122 121 119: 6(int) Load 98(nu_ii)
Store 32(b) 123 121: 120(ptr) AccessChain 118(sampledImage) 119
128: 6(int) Load 92(nu_ii) 122: 115 Load 121
130: 129(ptr) AccessChain 127(storageImage) 128 126: 39(fvec4) ImageSampleImplicitLod 122 125
131: 124 Load 130 127: 36(float) CompositeExtract 126 0
133: 33(fvec4) ImageRead 131 132 128: 36(float) Load 38(b)
134: 30(float) CompositeExtract 133 0 129: 36(float) FAdd 128 127
135: 30(float) Load 32(b) Store 38(b) 129
136: 30(float) FAdd 135 134 134: 6(int) Load 98(nu_ii)
Store 32(b) 136 136: 135(ptr) AccessChain 133(storageImage) 134
140: 6(int) Load 92(nu_ii) 137: 130 Load 136
141: 50(ptr) AccessChain 139(inputAttachment) 140 139: 39(fvec4) ImageRead 137 138
142: 44 Load 141 140: 36(float) CompositeExtract 139 0
143: 33(fvec4) ImageRead 142 55 141: 36(float) Load 38(b)
144: 30(float) CompositeExtract 143 0 142: 36(float) FAdd 141 140
145: 30(float) Load 32(b) Store 38(b) 142
146: 30(float) FAdd 145 144 146: 6(int) Load 98(nu_ii)
Store 32(b) 146 147: 56(ptr) AccessChain 145(inputAttachment) 146
150: 6(int) Load 92(nu_ii) 148: 50 Load 147
151: 66(ptr) AccessChain 149(uniformTexelBuffer) 150 149: 39(fvec4) ImageRead 148 61
152: 61 Load 151 150: 36(float) CompositeExtract 149 0
153: 60 Image 152 151: 36(float) Load 38(b)
154: 33(fvec4) ImageFetch 153 69 152: 36(float) FAdd 151 150
155: 30(float) CompositeExtract 154 0 Store 38(b) 152
156: 30(float) Load 32(b) 156: 6(int) Load 98(nu_ii)
157: 30(float) FAdd 156 155 157: 72(ptr) AccessChain 155(uniformTexelBuffer) 156
Store 32(b) 157 158: 67 Load 157
161: 6(int) Load 92(nu_ii) 159: 66 Image 158
162: 80(ptr) AccessChain 160(storageTexelBuffer) 161 160: 39(fvec4) ImageFetch 159 75
163: 75 Load 162 161: 36(float) CompositeExtract 160 0
164: 33(fvec4) ImageRead 163 69 162: 36(float) Load 38(b)
165: 30(float) CompositeExtract 164 0 163: 36(float) FAdd 162 161
166: 30(float) Load 32(b) Store 38(b) 163
167: 30(float) FAdd 166 165 167: 6(int) Load 98(nu_ii)
Store 32(b) 167 168: 86(ptr) AccessChain 166(storageTexelBuffer) 167
172: 6(int) Load 92(nu_ii) 169: 81 Load 168
174: 173(ptr) AccessChain 171(uniformTexArr) 172 170: 39(fvec4) ImageRead 169 75
175: 108 Load 174 171: 36(float) CompositeExtract 170 0
179: 176 Load 178(uniformSampler) 172: 36(float) Load 38(b)
180: 109 SampledImage 175 179 173: 36(float) FAdd 172 171
183: 117(fvec2) Load 182(inTexcoord) Store 38(b) 173
184: 33(fvec4) ImageSampleImplicitLod 180 183 178: 6(int) Load 98(nu_ii)
185: 30(float) CompositeExtract 184 0 180: 179(ptr) AccessChain 177(uniformTexArr) 178
186: 30(float) Load 32(b) 181: 114 Load 180
187: 30(float) FAdd 186 185 185: 182 Load 184(uniformSampler)
Store 32(b) 187 186: 115 SampledImage 181 185
192: 7(ptr) AccessChain 190(v) 191 189: 123(fvec2) Load 188(inTexcoord)
193: 6(int) Load 192 190: 39(fvec4) ImageSampleImplicitLod 186 189
194: 94(ptr) AccessChain 90(uniformBuffer) 193 53 191: 36(float) CompositeExtract 190 0
195: 30(float) Load 194 192: 36(float) Load 38(b)
196: 30(float) Load 32(b) 193: 36(float) FAdd 192 191
197: 30(float) FAdd 196 195 Store 38(b) 193
Store 32(b) 197 194: 6(int) Load 98(nu_ii)
199: 7(ptr) AccessChain 190(v) 198 195: 179(ptr) AccessChain 177(uniformTexArr) 194
200: 6(int) Load 199 196: 114 Load 195
201: 94(ptr) AccessChain 90(uniformBuffer) 200 53 197: 182 Load 184(uniformSampler)
202: 30(float) Load 201 198: 115 SampledImage 196 197
203: 30(float) Load 32(b) 199: 115 CopyObject 198
204: 30(float) FAdd 203 202 200: 123(fvec2) Load 188(inTexcoord)
Store 32(b) 204 201: 39(fvec4) ImageSampleImplicitLod 199 200
206: 6(int) Load 92(nu_ii) 202: 36(float) CompositeExtract 201 0
207: 7(ptr) AccessChain 205(uv) 206 203: 36(float) Load 38(b)
208: 6(int) Load 207 204: 36(float) FAdd 203 202
209: 94(ptr) AccessChain 90(uniformBuffer) 208 53 Store 38(b) 204
210: 30(float) Load 209 209: 7(ptr) AccessChain 207(v) 208
211: 30(float) Load 32(b) 210: 6(int) Load 209
212: 30(float) FAdd 211 210 211: 100(ptr) AccessChain 96(uniformBuffer) 210 59
Store 32(b) 212 212: 36(float) Load 211
216: 31(ptr) AccessChain 215(m) 26 198 213: 36(float) Load 38(b)
217: 30(float) Load 216 214: 36(float) FAdd 213 212
218: 6(int) ConvertFToS 217 Store 38(b) 214
219: 94(ptr) AccessChain 90(uniformBuffer) 218 53 216: 7(ptr) AccessChain 207(v) 215
220: 30(float) Load 219 217: 6(int) Load 216
221: 30(float) Load 32(b) 218: 100(ptr) AccessChain 96(uniformBuffer) 217 59
222: 30(float) FAdd 221 220 219: 36(float) Load 218
Store 32(b) 222 220: 36(float) Load 38(b)
226: 7(ptr) AccessChain 225(s) 53 221: 36(float) FAdd 220 219
227: 6(int) Load 226 Store 38(b) 221
228: 94(ptr) AccessChain 90(uniformBuffer) 227 53 223: 6(int) Load 98(nu_ii)
229: 30(float) Load 228 224: 7(ptr) AccessChain 222(uv) 223
230: 30(float) Load 32(b) 225: 6(int) Load 224
231: 30(float) FAdd 230 229 226: 100(ptr) AccessChain 96(uniformBuffer) 225 59
Store 32(b) 231 227: 36(float) Load 226
232: 6(int) Load 92(nu_ii) 228: 36(float) Load 38(b)
233: 30(float) Load 32(b) 229: 36(float) FAdd 228 227
234: 94(ptr) AccessChain 102(storageBuffer) 232 53 Store 38(b) 229
Store 234 233 233: 37(ptr) AccessChain 232(m) 26 215
234: 36(float) Load 233
235: 6(int) ConvertFToS 234
236: 100(ptr) AccessChain 96(uniformBuffer) 235 59
237: 36(float) Load 236
238: 36(float) Load 38(b)
239: 36(float) FAdd 238 237
Store 38(b) 239
243: 7(ptr) AccessChain 242(s) 59
244: 6(int) Load 243
245: 100(ptr) AccessChain 96(uniformBuffer) 244 59
246: 36(float) Load 245
247: 36(float) Load 38(b)
248: 36(float) FAdd 247 246
Store 38(b) 248
253: 7(ptr) AccessChain 252(arr) 26
254: 6(int) Load 253
255: 100(ptr) AccessChain 96(uniformBuffer) 254 59
256: 36(float) Load 255
257: 36(float) Load 38(b)
258: 36(float) FAdd 257 256
Store 38(b) 258
260: 6(int) Load 98(nu_ii)
261: 37(ptr) AccessChain 259(um) 260 215
262: 36(float) Load 261
263: 6(int) ConvertFToS 262
264: 100(ptr) AccessChain 96(uniformBuffer) 263 59
265: 36(float) Load 264
266: 36(float) Load 38(b)
267: 36(float) FAdd 266 265
Store 38(b) 267
271: 6(int) Load 98(nu_ii)
272: 7(ptr) AccessChain 270(us) 59 271
273: 6(int) Load 272
274: 100(ptr) AccessChain 96(uniformBuffer) 273 59
275: 36(float) Load 274
276: 36(float) Load 38(b)
277: 36(float) FAdd 276 275
Store 38(b) 277
279: 6(int) Load 98(nu_ii)
280: 7(ptr) AccessChain 278(uarr) 279
281: 6(int) Load 280
282: 100(ptr) AccessChain 96(uniformBuffer) 281 59
283: 36(float) Load 282
284: 36(float) Load 38(b)
285: 36(float) FAdd 284 283
Store 38(b) 285
286: 6(int) Load 98(nu_ii)
287: 36(float) Load 38(b)
288: 100(ptr) AccessChain 108(storageBuffer) 286 59
Store 288 287
Return Return
FunctionEnd FunctionEnd
11(foo(i1;i1;): 6(int) Function None 8 11(foo(i1;i1;): 6(int) Function None 8

View File

@ -23,6 +23,7 @@ spv.nonuniform4.frag
Decorate 13(rIndex) Flat Decorate 13(rIndex) Flat
Decorate 13(rIndex) Location 3 Decorate 13(rIndex) Location 3
Decorate 15 DecorationNonUniformEXT Decorate 15 DecorationNonUniformEXT
Decorate 17 DecorationNonUniformEXT
Decorate 21 DecorationNonUniformEXT Decorate 21 DecorationNonUniformEXT
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2

View File

@ -28,10 +28,12 @@ nonuniformEXT int foo(nonuniformEXT int nupi, nonuniformEXT out int f)
void main() void main()
{ {
nonuniformEXT int nu_li; nonuniformEXT int nu_li;
nonuniformEXT int nu_li2;
int dyn_i; int dyn_i;
int a = foo(nu_li, nu_li); int a = foo(nu_li, nu_li);
nu_li = nonuniformEXT(a) + nonuniformEXT(a * 2); nu_li = nonuniformEXT(a) + nonuniformEXT(a * 2);
nu_li2 = a + nonuniformEXT(a * 2);
float b; float b;
b = nu_inv4.x * nu_gf; b = nu_inv4.x * nu_gf;
@ -46,16 +48,25 @@ void main()
b += texelFetch(uniformTexelBuffer[nu_ii], 1).x; b += texelFetch(uniformTexelBuffer[nu_ii], 1).x;
b += imageLoad(storageTexelBuffer[nu_ii], 1).x; b += imageLoad(storageTexelBuffer[nu_ii], 1).x;
b += texture(sampler2D(uniformTexArr[nu_ii], uniformSampler), inTexcoord.xy).x; b += texture(sampler2D(uniformTexArr[nu_ii], uniformSampler), inTexcoord.xy).x;
b += texture(nonuniformEXT(sampler2D(uniformTexArr[nu_ii], uniformSampler)), inTexcoord.xy).x;
nonuniformEXT ivec4 v; nonuniformEXT ivec4 v;
nonuniformEXT mat4 m; nonuniformEXT mat4 m;
nonuniformEXT struct S { int a; } s; nonuniformEXT struct S { int a; } s;
nonuniformEXT int arr[10];
ivec4 uv; ivec4 uv;
mat4 um;
struct US { int a[10]; } us;
int uarr[10];
b += uniformBuffer[v.y].a; b += uniformBuffer[v.y].a;
b += uniformBuffer[v[2]].a; b += uniformBuffer[v[2]].a;
b += uniformBuffer[uv[nu_ii]].a; b += uniformBuffer[uv[nu_ii]].a;
b += uniformBuffer[int(m[2].z)].a; b += uniformBuffer[int(m[2].z)].a;
b += uniformBuffer[s.a].a; b += uniformBuffer[s.a].a;
b += uniformBuffer[arr[2]].a;
b += uniformBuffer[int(um[nu_ii].z)].a;
b += uniformBuffer[us.a[nu_ii]].a;
b += uniformBuffer[uarr[nu_ii]].a;
storageBuffer[nu_ii].b = b; storageBuffer[nu_ii].b = b;
} }