diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index e9c14df3..a24b5223 100644 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -149,6 +149,7 @@ protected: spv::Decoration TranslateInterpolationDecoration(const glslang::TQualifier& qualifier); spv::Decoration TranslateAuxiliaryStorageDecoration(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::MemoryAccessMask TranslateMemoryAccess(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; } +// 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( const spv::Builder::AccessChain::CoherentFlags &coherentFlags) { @@ -614,6 +629,7 @@ spv::Builder::AccessChain::CoherentFlags TGlslangToSpvTraverser::TranslateCohere flags.volatil; flags.isImage = type.getBasicType() == glslang::EbtSampler; #endif + flags.nonUniform = type.getQualifier().nonUniform; return flags; } @@ -1376,6 +1392,8 @@ void InheritQualifiers(glslang::TQualifier& child, const glslang::TQualifier& pa if (parent.writeonly) child.writeonly = true; #endif + if (parent.nonUniform) + child.nonUniform = true; } 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()); // do the operation + spv::Builder::AccessChain::CoherentFlags coherentFlags = TranslateCoherent(node->getLeft()->getType()); + coherentFlags |= TranslateCoherent(node->getRight()->getType()); OpDecorations decorations = { TranslatePrecisionDecoration(node->getOperationPrecision()), TranslateNoContractionDecoration(node->getType().getQualifier()), - TranslateNonUniformDecoration(node->getType().getQualifier()) }; + TranslateNonUniformDecoration(coherentFlags) }; rValue = createBinaryOperation(node->getOp(), decorations, convertGlslangToSpvType(node->getType()), leftRValue, rValue, node->getType().getBasicType()); @@ -1914,13 +1934,16 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T if (! node->getLeft()->getType().isArray() && node->getLeft()->getType().isVector() && 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, // so short circuit the access-chain stuff with a swizzle. std::vector swizzle; swizzle.push_back(glslangIndex); int dummySize; builder.accessChainPushSwizzle(swizzle, convertGlslangToSpvType(node->getLeft()->getType()), - TranslateCoherent(node->getLeft()->getType()), + coherentFlags, glslangIntermediate->getBaseAlignmentScalar( node->getLeft()->getType(), dummySize)); } 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 builder.accessChainPush(builder.makeIntConstant(spvIndex), - TranslateCoherent(node->getLeft()->getType()), + coherentFlags, node->getLeft()->getType().getBufferReferenceAlignment()); // 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 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()) { int dummySize; - builder.accessChainPushComponent(index, convertGlslangToSpvType(node->getLeft()->getType()), - TranslateCoherent(node->getLeft()->getType()), + builder.accessChainPushComponent( + index, convertGlslangToSpvType(node->getLeft()->getType()), coherent_flags, glslangIntermediate->getBaseAlignmentScalar(node->getLeft()->getType(), dummySize)); } else - builder.accessChainPush(index, TranslateCoherent(node->getLeft()->getType()), - node->getLeft()->getType().getBufferReferenceAlignment()); + builder.accessChainPush(index, coherent_flags, + node->getLeft()->getType().getBufferReferenceAlignment()); } return false; case glslang::EOpVectorSwizzle: @@ -2119,7 +2152,7 @@ spv::Id TGlslangToSpvTraverser::translateForcedType(spv::Id object) // handle 32-bit v.xy* -> 64-bit builder.clearAccessChain(); builder.setAccessChainLValue(object); - object = builder.accessChainLoad(spv::NoPrecision, spv::DecorationMax, objectTypeId); + object = builder.accessChainLoad(spv::NoPrecision, spv::DecorationMax, spv::DecorationMax, objectTypeId); std::vector components; components.push_back(builder.createCompositeExtract(object, builder.getContainedTypeId(objectTypeId), 0)); 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 builder.clearAccessChain(); 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); } else { @@ -2322,7 +2355,7 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI // The result of operation is always stored, but conditionally the // consumed result. The consumed result is always an r-value. builder.accessChainStore(result, - TranslateNonUniformDecoration(node->getOperand()->getType().getQualifier())); + TranslateNonUniformDecoration(builder.getAccessChain().coherentFlags)); builder.clearAccessChain(); if (node->getOp() == glslang::EOpPreIncrement || 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 std::vector complexLvalues; // for holding swizzling l-values too complex for // SPIR-V, for an out parameter - std::vector complexLValueQualifiers; std::vector temporaryLvalues; // temporaries to pass, as proxies for complexLValues 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 // l-value. complexLvalues.push_back(builder.getAccessChain()); - complexLValueQualifiers.push_back(glslangOperands[arg]->getAsTyped()->getType().getQualifier()); temporaryLvalues.push_back(builder.createVariable( spv::NoPrecision, spv::StorageClassFunction, builder.accessChainGetInferredType(), "swizzleTemp")); @@ -3125,7 +3156,8 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt for (unsigned int i = 0; i < temporaryLvalues.size(); ++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(); spv::Id loadedId = builder.accessChainLoad(TranslatePrecisionDecoration(type), + TranslateNonUniformDecoration(builder.getAccessChain().coherentFlags), TranslateNonUniformDecoration(type.getQualifier()), nominalTypeId, 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; alignment |= type.getBufferReferenceAlignment(); - builder.accessChainStore(rvalue, TranslateNonUniformDecoration(type.getQualifier()), + builder.accessChainStore(rvalue, TranslateNonUniformDecoration(builder.getAccessChain().coherentFlags), spv::MemoryAccessMask(TranslateMemoryAccess(coherentFlags) & ~spv::MemoryAccessMakePointerVisibleKHRMask), TranslateMemoryScope(coherentFlags), alignment); @@ -4734,8 +4767,10 @@ void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& } if (lvalue) { - arguments.push_back(builder.accessChainGetLValue()); + spv::Id lvalue_id = builder.accessChainGetLValue(); + arguments.push_back(lvalue_id); lvalueCoherentFlags = builder.getAccessChain().coherentFlags; + builder.addDecoration(lvalue_id, TranslateNonUniformDecoration(lvalueCoherentFlags)); lvalueCoherentFlags |= TranslateCoherent(glslangArguments[i]->getAsTyped()->getType()); } else #endif @@ -5415,6 +5450,7 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg // 3. Make the call. spv::Id result = builder.createFunctionCall(function, spvArgs); builder.setPrecision(result, TranslatePrecisionDecoration(node->getType())); + builder.addDecoration(result, TranslateNonUniformDecoration(node->getType().getQualifier())); // 4. Copy back out an "out" arguments. lValueCount = 0; @@ -5424,6 +5460,7 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg else if (writableParam(qualifiers[a])) { if (qualifiers[a] == glslang::EvqOut || qualifiers[a] == glslang::EvqInOut) { spv::Id copy = builder.createLoad(spvArgs[a], spv::NoPrecision); + builder.addDecoration(copy, TranslateNonUniformDecoration(argTypes[a]->getQualifier())); builder.setAccessChain(lValues[lValueCount]); multiTypeStore(*argTypes[a], copy); } @@ -8228,9 +8265,6 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol builder.addDecoration(id, memory[i]); } - // nonuniform - builder.addDecoration(id, TranslateNonUniformDecoration(symbol->getType().getQualifier())); - if (builtIn == spv::BuiltInSampleMask) { spv::Decoration decoration; // GL_NV_sample_mask_override_coverage extension diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index 85ffe90a..390b18ad 100644 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -2798,8 +2798,9 @@ void Builder::accessChainStore(Id rvalue, Decoration nonUniform, spv::MemoryAcce } // Comments in header -Id Builder::accessChainLoad(Decoration precision, Decoration nonUniform, Id resultType, - spv::MemoryAccessMask memoryAccess, spv::Scope scope, unsigned int alignment) +Id Builder::accessChainLoad(Decoration precision, Decoration l_nonUniform, + Decoration r_nonUniform, Id resultType, spv::MemoryAccessMask memoryAccess, + spv::Scope scope, unsigned int alignment) { 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 // loaded image types get decorated. TODO: This should maybe move to // createImageTextureFunctionCall. - addDecoration(id, nonUniform); + addDecoration(id, l_nonUniform); id = createLoad(id, precision, memoryAccess, scope, alignment); - addDecoration(id, nonUniform); + addDecoration(id, r_nonUniform); } // Done, unless there are swizzles to do @@ -2886,7 +2887,7 @@ Id Builder::accessChainLoad(Decoration precision, Decoration nonUniform, Id resu if (accessChain.component != NoResult) id = setPrecision(createVectorExtractDynamic(id, resultType, accessChain.component), precision); - addDecoration(id, nonUniform); + addDecoration(id, r_nonUniform); return id; } diff --git a/SPIRV/SpvBuilder.h b/SPIRV/SpvBuilder.h index 873c0cd7..63dddcb8 100644 --- a/SPIRV/SpvBuilder.h +++ b/SPIRV/SpvBuilder.h @@ -625,6 +625,7 @@ public: CoherentFlags operator |=(const CoherentFlags &other) { return *this; } #else bool isVolatile() const { return volatil; } + bool isNonUniform() const { return nonUniform; } bool anyCoherent() const { return coherent || devicecoherent || queuefamilycoherent || workgroupcoherent || subgroupcoherent || shadercallcoherent; @@ -639,6 +640,7 @@ public: unsigned nonprivate : 1; unsigned volatil : 1; unsigned isImage : 1; + unsigned nonUniform : 1; void clear() { coherent = 0; @@ -650,6 +652,7 @@ public: nonprivate = 0; volatil = 0; isImage = 0; + nonUniform = 0; } CoherentFlags operator |=(const CoherentFlags &other) { @@ -662,6 +665,7 @@ public: nonprivate |= other.nonprivate; volatil |= other.volatil; isImage |= other.isImage; + nonUniform |= other.nonUniform; return *this; } #endif @@ -727,7 +731,7 @@ public: spv::Scope scope = spv::ScopeMax, unsigned int alignment = 0); // 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, unsigned int alignment = 0); diff --git a/Test/baseResults/spv.nonuniform.frag.out b/Test/baseResults/spv.nonuniform.frag.out index 66f53d5f..f6febc9b 100644 --- a/Test/baseResults/spv.nonuniform.frag.out +++ b/Test/baseResults/spv.nonuniform.frag.out @@ -1,7 +1,7 @@ spv.nonuniform.frag // Module Version 10000 // Generated by (magic number): 8000a -// Id's are bound by 235 +// Id's are bound by 289 Capability Shader Capability InputAttachment @@ -22,7 +22,7 @@ spv.nonuniform.frag Extension "SPV_EXT_descriptor_indexing" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 35 92 182 + EntryPoint Fragment 4 "main" 41 98 188 ExecutionMode 4 OriginUpperLeft Source GLSL 450 SourceExtension "GL_EXT_nonuniform_qualifier" @@ -34,246 +34,268 @@ spv.nonuniform.frag Name 17 "nu_li" Name 18 "param" Name 20 "param" - Name 32 "b" - Name 35 "nu_inv4" - Name 41 "nu_gf" - Name 47 "inputAttachmentDyn" - Name 48 "dyn_i" - Name 64 "uniformTexelBufferDyn" - Name 78 "storageTexelBufferDyn" - Name 87 "uname" - MemberName 87(uname) 0 "a" - Name 90 "uniformBuffer" - Name 92 "nu_ii" - Name 99 "bname" - MemberName 99(bname) 0 "b" - Name 102 "storageBuffer" - Name 112 "sampledImage" - Name 127 "storageImage" - Name 139 "inputAttachment" - Name 149 "uniformTexelBuffer" - Name 160 "storageTexelBuffer" - Name 171 "uniformTexArr" - Name 178 "uniformSampler" - Name 182 "inTexcoord" - Name 190 "v" - Name 205 "uv" - Name 215 "m" - Name 223 "S" - MemberName 223(S) 0 "a" - Name 225 "s" - Decorate 9(nupi) DecorationNonUniformEXT + Name 30 "nu_li2" + Name 38 "b" + Name 41 "nu_inv4" + Name 47 "nu_gf" + Name 53 "inputAttachmentDyn" + Name 54 "dyn_i" + Name 70 "uniformTexelBufferDyn" + Name 84 "storageTexelBufferDyn" + Name 93 "uname" + MemberName 93(uname) 0 "a" + Name 96 "uniformBuffer" + Name 98 "nu_ii" + Name 105 "bname" + MemberName 105(bname) 0 "b" + Name 108 "storageBuffer" + Name 118 "sampledImage" + Name 133 "storageImage" + Name 145 "inputAttachment" + Name 155 "uniformTexelBuffer" + Name 166 "storageTexelBuffer" + Name 177 "uniformTexArr" + Name 184 "uniformSampler" + Name 188 "inTexcoord" + Name 207 "v" + Name 222 "uv" + Name 232 "m" + Name 240 "S" + MemberName 240(S) 0 "a" + 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 17(nu_li) DecorationNonUniformEXT - Decorate 17(nu_li) DecorationNonUniformEXT Decorate 19 DecorationNonUniformEXT - Decorate 18(param) DecorationNonUniformEXT - Decorate 17(nu_li) DecorationNonUniformEXT + Decorate 21 DecorationNonUniformEXT + Decorate 22 DecorationNonUniformEXT Decorate 24 DecorationNonUniformEXT Decorate 28 DecorationNonUniformEXT Decorate 29 DecorationNonUniformEXT - Decorate 17(nu_li) DecorationNonUniformEXT - Decorate 35(nu_inv4) Location 0 - Decorate 35(nu_inv4) DecorationNonUniformEXT - Decorate 39 DecorationNonUniformEXT - Decorate 40 DecorationNonUniformEXT - Decorate 41(nu_gf) DecorationNonUniformEXT - Decorate 41(nu_gf) DecorationNonUniformEXT - Decorate 42 DecorationNonUniformEXT - Decorate 43 DecorationNonUniformEXT - Decorate 47(inputAttachmentDyn) DescriptorSet 0 - Decorate 47(inputAttachmentDyn) Binding 0 - Decorate 47(inputAttachmentDyn) InputAttachmentIndex 0 - Decorate 64(uniformTexelBufferDyn) DescriptorSet 0 - Decorate 64(uniformTexelBufferDyn) Binding 1 - Decorate 78(storageTexelBufferDyn) DescriptorSet 0 - Decorate 78(storageTexelBufferDyn) Binding 2 - MemberDecorate 87(uname) 0 Offset 0 - Decorate 87(uname) Block - Decorate 90(uniformBuffer) DescriptorSet 0 - Decorate 90(uniformBuffer) Binding 3 - Decorate 92(nu_ii) Flat - Decorate 92(nu_ii) Location 1 - 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 34 DecorationNonUniformEXT + Decorate 35 DecorationNonUniformEXT + Decorate 41(nu_inv4) Location 0 + Decorate 46 DecorationNonUniformEXT + Decorate 48 DecorationNonUniformEXT + Decorate 49 DecorationNonUniformEXT + Decorate 53(inputAttachmentDyn) DescriptorSet 0 + Decorate 53(inputAttachmentDyn) Binding 0 + Decorate 53(inputAttachmentDyn) InputAttachmentIndex 0 + Decorate 70(uniformTexelBufferDyn) DescriptorSet 0 + Decorate 70(uniformTexelBufferDyn) Binding 1 + Decorate 84(storageTexelBufferDyn) DescriptorSet 0 + Decorate 84(storageTexelBufferDyn) Binding 2 + MemberDecorate 93(uname) 0 Offset 0 + Decorate 93(uname) Block + Decorate 96(uniformBuffer) DescriptorSet 0 + Decorate 96(uniformBuffer) Binding 3 + Decorate 98(nu_ii) Flat + Decorate 98(nu_ii) Location 1 + Decorate 99 DecorationNonUniformEXT + Decorate 101 DecorationNonUniformEXT + Decorate 102 DecorationNonUniformEXT Decorate 104 DecorationNonUniformEXT - Decorate 105 DecorationNonUniformEXT - Decorate 112(sampledImage) DescriptorSet 0 - Decorate 112(sampledImage) Binding 5 - Decorate 92(nu_ii) DecorationNonUniformEXT + MemberDecorate 105(bname) 0 Offset 0 + Decorate 105(bname) BufferBlock + Decorate 108(storageBuffer) DescriptorSet 0 + Decorate 108(storageBuffer) Binding 4 + Decorate 109 DecorationNonUniformEXT + Decorate 110 DecorationNonUniformEXT + Decorate 111 DecorationNonUniformEXT Decorate 113 DecorationNonUniformEXT - Decorate 115 DecorationNonUniformEXT - Decorate 116 DecorationNonUniformEXT - Decorate 127(storageImage) DescriptorSet 0 - Decorate 127(storageImage) Binding 6 - Decorate 92(nu_ii) DecorationNonUniformEXT - Decorate 128 DecorationNonUniformEXT - Decorate 130 DecorationNonUniformEXT - Decorate 131 DecorationNonUniformEXT - Decorate 139(inputAttachment) DescriptorSet 0 - Decorate 139(inputAttachment) Binding 7 - Decorate 139(inputAttachment) InputAttachmentIndex 1 - Decorate 92(nu_ii) DecorationNonUniformEXT - Decorate 140 DecorationNonUniformEXT - Decorate 141 DecorationNonUniformEXT - Decorate 142 DecorationNonUniformEXT - Decorate 149(uniformTexelBuffer) DescriptorSet 0 - Decorate 149(uniformTexelBuffer) Binding 8 - Decorate 92(nu_ii) DecorationNonUniformEXT - Decorate 150 DecorationNonUniformEXT - Decorate 151 DecorationNonUniformEXT - Decorate 152 DecorationNonUniformEXT - Decorate 153 DecorationNonUniformEXT - Decorate 160(storageTexelBuffer) DescriptorSet 0 - Decorate 160(storageTexelBuffer) Binding 9 - Decorate 92(nu_ii) DecorationNonUniformEXT - Decorate 161 DecorationNonUniformEXT - Decorate 162 DecorationNonUniformEXT - Decorate 163 DecorationNonUniformEXT - Decorate 171(uniformTexArr) DescriptorSet 0 - Decorate 171(uniformTexArr) Binding 10 - Decorate 92(nu_ii) DecorationNonUniformEXT - Decorate 172 DecorationNonUniformEXT - Decorate 174 DecorationNonUniformEXT - Decorate 175 DecorationNonUniformEXT - Decorate 178(uniformSampler) DescriptorSet 0 - Decorate 178(uniformSampler) Binding 11 - Decorate 182(inTexcoord) Location 2 - Decorate 190(v) DecorationNonUniformEXT - Decorate 192 DecorationNonUniformEXT - Decorate 193 DecorationNonUniformEXT + Decorate 118(sampledImage) DescriptorSet 0 + Decorate 118(sampledImage) Binding 5 + Decorate 119 DecorationNonUniformEXT + Decorate 121 DecorationNonUniformEXT + Decorate 122 DecorationNonUniformEXT + Decorate 133(storageImage) DescriptorSet 0 + Decorate 133(storageImage) Binding 6 + Decorate 134 DecorationNonUniformEXT + Decorate 136 DecorationNonUniformEXT + Decorate 137 DecorationNonUniformEXT + Decorate 145(inputAttachment) DescriptorSet 0 + Decorate 145(inputAttachment) Binding 7 + Decorate 145(inputAttachment) InputAttachmentIndex 1 + Decorate 146 DecorationNonUniformEXT + Decorate 147 DecorationNonUniformEXT + Decorate 148 DecorationNonUniformEXT + Decorate 155(uniformTexelBuffer) DescriptorSet 0 + Decorate 155(uniformTexelBuffer) Binding 8 + Decorate 156 DecorationNonUniformEXT + Decorate 157 DecorationNonUniformEXT + Decorate 158 DecorationNonUniformEXT + Decorate 159 DecorationNonUniformEXT + Decorate 166(storageTexelBuffer) DescriptorSet 0 + Decorate 166(storageTexelBuffer) Binding 9 + Decorate 167 DecorationNonUniformEXT + Decorate 168 DecorationNonUniformEXT + Decorate 169 DecorationNonUniformEXT + Decorate 177(uniformTexArr) DescriptorSet 0 + Decorate 177(uniformTexArr) Binding 10 + Decorate 178 DecorationNonUniformEXT + Decorate 180 DecorationNonUniformEXT + Decorate 181 DecorationNonUniformEXT + Decorate 184(uniformSampler) DescriptorSet 0 + Decorate 184(uniformSampler) Binding 11 + Decorate 188(inTexcoord) Location 2 Decorate 194 DecorationNonUniformEXT Decorate 195 DecorationNonUniformEXT + Decorate 196 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 215(m) DecorationNonUniformEXT - Decorate 216 DecorationNonUniformEXT + Decorate 211 DecorationNonUniformEXT + Decorate 212 DecorationNonUniformEXT + Decorate 214 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 227 DecorationNonUniformEXT - Decorate 228 DecorationNonUniformEXT Decorate 229 DecorationNonUniformEXT - Decorate 92(nu_ii) DecorationNonUniformEXT - Decorate 232 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 3: TypeFunction 2 6: TypeInt 32 1 7: TypePointer Function 6(int) 8: TypeFunction 6(int) 7(ptr) 7(ptr) 26: 6(int) Constant 2 - 30: TypeFloat 32 - 31: TypePointer Function 30(float) - 33: TypeVector 30(float) 4 - 34: TypePointer Input 33(fvec4) - 35(nu_inv4): 34(ptr) Variable Input - 36: TypeInt 32 0 - 37: 36(int) Constant 0 - 38: TypePointer Input 30(float) - 44: TypeImage 30(float) SubpassData nonsampled format:Unknown - 45: TypeRuntimeArray 44 - 46: TypePointer UniformConstant 45 -47(inputAttachmentDyn): 46(ptr) Variable UniformConstant - 50: TypePointer UniformConstant 44 - 53: 6(int) Constant 0 - 54: TypeVector 6(int) 2 - 55: 54(ivec2) ConstantComposite 53 53 - 60: TypeImage 30(float) Buffer sampled format:Unknown - 61: TypeSampledImage 60 - 62: TypeRuntimeArray 61 - 63: TypePointer UniformConstant 62 -64(uniformTexelBufferDyn): 63(ptr) Variable UniformConstant - 66: TypePointer UniformConstant 61 - 69: 6(int) Constant 1 - 75: TypeImage 30(float) Buffer nonsampled format:R32f - 76: TypeRuntimeArray 75 - 77: TypePointer UniformConstant 76 -78(storageTexelBufferDyn): 77(ptr) Variable UniformConstant - 80: TypePointer UniformConstant 75 - 87(uname): TypeStruct 30(float) - 88: TypeRuntimeArray 87(uname) - 89: TypePointer Uniform 88 -90(uniformBuffer): 89(ptr) Variable Uniform - 91: TypePointer Input 6(int) - 92(nu_ii): 91(ptr) Variable Input - 94: TypePointer Uniform 30(float) - 99(bname): TypeStruct 30(float) - 100: TypeRuntimeArray 99(bname) - 101: TypePointer Uniform 100 -102(storageBuffer): 101(ptr) Variable Uniform - 108: TypeImage 30(float) 2D sampled format:Unknown - 109: TypeSampledImage 108 - 110: TypeRuntimeArray 109 - 111: TypePointer UniformConstant 110 -112(sampledImage): 111(ptr) Variable UniformConstant - 114: TypePointer UniformConstant 109 - 117: TypeVector 30(float) 2 - 118: 30(float) Constant 1056964608 - 119: 117(fvec2) ConstantComposite 118 118 - 124: TypeImage 30(float) 2D nonsampled format:R32f - 125: TypeRuntimeArray 124 - 126: TypePointer UniformConstant 125 -127(storageImage): 126(ptr) Variable UniformConstant - 129: TypePointer UniformConstant 124 - 132: 54(ivec2) ConstantComposite 69 69 - 137: TypeRuntimeArray 44 - 138: TypePointer UniformConstant 137 -139(inputAttachment): 138(ptr) Variable UniformConstant - 147: TypeRuntimeArray 61 - 148: TypePointer UniformConstant 147 -149(uniformTexelBuffer): 148(ptr) Variable UniformConstant - 158: TypeRuntimeArray 75 - 159: TypePointer UniformConstant 158 -160(storageTexelBuffer): 159(ptr) Variable UniformConstant - 168: 36(int) Constant 8 - 169: TypeArray 108 168 - 170: TypePointer UniformConstant 169 -171(uniformTexArr): 170(ptr) Variable UniformConstant - 173: TypePointer UniformConstant 108 - 176: TypeSampler - 177: TypePointer UniformConstant 176 -178(uniformSampler): 177(ptr) Variable UniformConstant - 181: TypePointer Input 117(fvec2) - 182(inTexcoord): 181(ptr) Variable Input - 188: TypeVector 6(int) 4 - 189: TypePointer Function 188(ivec4) - 191: 36(int) Constant 1 - 198: 36(int) Constant 2 - 213: TypeMatrix 33(fvec4) 4 - 214: TypePointer Function 213 - 223(S): TypeStruct 6(int) - 224: TypePointer Function 223(S) + 36: TypeFloat 32 + 37: TypePointer Function 36(float) + 39: TypeVector 36(float) 4 + 40: TypePointer Input 39(fvec4) + 41(nu_inv4): 40(ptr) Variable Input + 42: TypeInt 32 0 + 43: 42(int) Constant 0 + 44: TypePointer Input 36(float) + 50: TypeImage 36(float) SubpassData nonsampled format:Unknown + 51: TypeRuntimeArray 50 + 52: TypePointer UniformConstant 51 +53(inputAttachmentDyn): 52(ptr) Variable UniformConstant + 56: TypePointer UniformConstant 50 + 59: 6(int) Constant 0 + 60: TypeVector 6(int) 2 + 61: 60(ivec2) ConstantComposite 59 59 + 66: TypeImage 36(float) Buffer sampled format:Unknown + 67: TypeSampledImage 66 + 68: TypeRuntimeArray 67 + 69: TypePointer UniformConstant 68 +70(uniformTexelBufferDyn): 69(ptr) Variable UniformConstant + 72: TypePointer UniformConstant 67 + 75: 6(int) Constant 1 + 81: TypeImage 36(float) Buffer nonsampled format:R32f + 82: TypeRuntimeArray 81 + 83: TypePointer UniformConstant 82 +84(storageTexelBufferDyn): 83(ptr) Variable UniformConstant + 86: TypePointer UniformConstant 81 + 93(uname): TypeStruct 36(float) + 94: TypeRuntimeArray 93(uname) + 95: TypePointer Uniform 94 +96(uniformBuffer): 95(ptr) Variable Uniform + 97: TypePointer Input 6(int) + 98(nu_ii): 97(ptr) Variable Input + 100: TypePointer Uniform 36(float) + 105(bname): TypeStruct 36(float) + 106: TypeRuntimeArray 105(bname) + 107: TypePointer Uniform 106 +108(storageBuffer): 107(ptr) Variable Uniform + 114: TypeImage 36(float) 2D sampled format:Unknown + 115: TypeSampledImage 114 + 116: TypeRuntimeArray 115 + 117: TypePointer UniformConstant 116 +118(sampledImage): 117(ptr) Variable UniformConstant + 120: TypePointer UniformConstant 115 + 123: TypeVector 36(float) 2 + 124: 36(float) Constant 1056964608 + 125: 123(fvec2) ConstantComposite 124 124 + 130: TypeImage 36(float) 2D nonsampled format:R32f + 131: TypeRuntimeArray 130 + 132: TypePointer UniformConstant 131 +133(storageImage): 132(ptr) Variable UniformConstant + 135: TypePointer UniformConstant 130 + 138: 60(ivec2) ConstantComposite 75 75 + 143: TypeRuntimeArray 50 + 144: TypePointer UniformConstant 143 +145(inputAttachment): 144(ptr) Variable UniformConstant + 153: TypeRuntimeArray 67 + 154: TypePointer UniformConstant 153 +155(uniformTexelBuffer): 154(ptr) Variable UniformConstant + 164: TypeRuntimeArray 81 + 165: TypePointer UniformConstant 164 +166(storageTexelBuffer): 165(ptr) Variable UniformConstant + 174: 42(int) Constant 8 + 175: TypeArray 114 174 + 176: TypePointer UniformConstant 175 +177(uniformTexArr): 176(ptr) Variable UniformConstant + 179: TypePointer UniformConstant 114 + 182: TypeSampler + 183: TypePointer UniformConstant 182 +184(uniformSampler): 183(ptr) Variable UniformConstant + 187: TypePointer Input 123(fvec2) + 188(inTexcoord): 187(ptr) Variable Input + 205: TypeVector 6(int) 4 + 206: TypePointer Function 205(ivec4) + 208: 42(int) Constant 1 + 215: 42(int) Constant 2 + 230: TypeMatrix 39(fvec4) 4 + 231: TypePointer Function 230 + 240(S): TypeStruct 6(int) + 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 5: Label 16(a): 7(ptr) Variable Function 17(nu_li): 7(ptr) Variable Function 18(param): 7(ptr) Variable Function 20(param): 7(ptr) Variable Function - 32(b): 31(ptr) Variable Function - 41(nu_gf): 31(ptr) Variable Function - 48(dyn_i): 7(ptr) Variable Function - 190(v): 189(ptr) Variable Function - 205(uv): 189(ptr) Variable Function - 215(m): 214(ptr) Variable Function - 225(s): 224(ptr) Variable Function + 30(nu_li2): 7(ptr) Variable Function + 38(b): 37(ptr) Variable Function + 47(nu_gf): 37(ptr) Variable Function + 54(dyn_i): 7(ptr) Variable Function + 207(v): 206(ptr) Variable Function + 222(uv): 206(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) Store 18(param) 19 21: 6(int) FunctionCall 11(foo(i1;i1;) 18(param) 20(param) @@ -287,141 +309,191 @@ spv.nonuniform.frag 28: 6(int) CopyObject 27 29: 6(int) IAdd 24 28 Store 17(nu_li) 29 - 39: 38(ptr) AccessChain 35(nu_inv4) 37 - 40: 30(float) Load 39 - 42: 30(float) Load 41(nu_gf) - 43: 30(float) FMul 40 42 - Store 32(b) 43 - 49: 6(int) Load 48(dyn_i) - 51: 50(ptr) AccessChain 47(inputAttachmentDyn) 49 - 52: 44 Load 51 - 56: 33(fvec4) ImageRead 52 55 - 57: 30(float) CompositeExtract 56 0 - 58: 30(float) Load 32(b) - 59: 30(float) FAdd 58 57 - Store 32(b) 59 - 65: 6(int) Load 48(dyn_i) - 67: 66(ptr) AccessChain 64(uniformTexelBufferDyn) 65 - 68: 61 Load 67 - 70: 60 Image 68 - 71: 33(fvec4) ImageFetch 70 69 - 72: 30(float) CompositeExtract 71 0 - 73: 30(float) Load 32(b) - 74: 30(float) FAdd 73 72 - Store 32(b) 74 - 79: 6(int) Load 48(dyn_i) - 81: 80(ptr) AccessChain 78(storageTexelBufferDyn) 79 - 82: 75 Load 81 - 83: 33(fvec4) ImageRead 82 69 - 84: 30(float) CompositeExtract 83 0 - 85: 30(float) Load 32(b) - 86: 30(float) FAdd 85 84 - Store 32(b) 86 - 93: 6(int) Load 92(nu_ii) - 95: 94(ptr) AccessChain 90(uniformBuffer) 93 53 - 96: 30(float) Load 95 - 97: 30(float) Load 32(b) - 98: 30(float) FAdd 97 96 - Store 32(b) 98 - 103: 6(int) Load 92(nu_ii) - 104: 94(ptr) AccessChain 102(storageBuffer) 103 53 - 105: 30(float) Load 104 - 106: 30(float) Load 32(b) - 107: 30(float) FAdd 106 105 - Store 32(b) 107 - 113: 6(int) Load 92(nu_ii) - 115: 114(ptr) AccessChain 112(sampledImage) 113 - 116: 109 Load 115 - 120: 33(fvec4) ImageSampleImplicitLod 116 119 - 121: 30(float) CompositeExtract 120 0 - 122: 30(float) Load 32(b) - 123: 30(float) FAdd 122 121 - Store 32(b) 123 - 128: 6(int) Load 92(nu_ii) - 130: 129(ptr) AccessChain 127(storageImage) 128 - 131: 124 Load 130 - 133: 33(fvec4) ImageRead 131 132 - 134: 30(float) CompositeExtract 133 0 - 135: 30(float) Load 32(b) - 136: 30(float) FAdd 135 134 - Store 32(b) 136 - 140: 6(int) Load 92(nu_ii) - 141: 50(ptr) AccessChain 139(inputAttachment) 140 - 142: 44 Load 141 - 143: 33(fvec4) ImageRead 142 55 - 144: 30(float) CompositeExtract 143 0 - 145: 30(float) Load 32(b) - 146: 30(float) FAdd 145 144 - Store 32(b) 146 - 150: 6(int) Load 92(nu_ii) - 151: 66(ptr) AccessChain 149(uniformTexelBuffer) 150 - 152: 61 Load 151 - 153: 60 Image 152 - 154: 33(fvec4) ImageFetch 153 69 - 155: 30(float) CompositeExtract 154 0 - 156: 30(float) Load 32(b) - 157: 30(float) FAdd 156 155 - Store 32(b) 157 - 161: 6(int) Load 92(nu_ii) - 162: 80(ptr) AccessChain 160(storageTexelBuffer) 161 - 163: 75 Load 162 - 164: 33(fvec4) ImageRead 163 69 - 165: 30(float) CompositeExtract 164 0 - 166: 30(float) Load 32(b) - 167: 30(float) FAdd 166 165 - Store 32(b) 167 - 172: 6(int) Load 92(nu_ii) - 174: 173(ptr) AccessChain 171(uniformTexArr) 172 - 175: 108 Load 174 - 179: 176 Load 178(uniformSampler) - 180: 109 SampledImage 175 179 - 183: 117(fvec2) Load 182(inTexcoord) - 184: 33(fvec4) ImageSampleImplicitLod 180 183 - 185: 30(float) CompositeExtract 184 0 - 186: 30(float) Load 32(b) - 187: 30(float) FAdd 186 185 - Store 32(b) 187 - 192: 7(ptr) AccessChain 190(v) 191 - 193: 6(int) Load 192 - 194: 94(ptr) AccessChain 90(uniformBuffer) 193 53 - 195: 30(float) Load 194 - 196: 30(float) Load 32(b) - 197: 30(float) FAdd 196 195 - Store 32(b) 197 - 199: 7(ptr) AccessChain 190(v) 198 - 200: 6(int) Load 199 - 201: 94(ptr) AccessChain 90(uniformBuffer) 200 53 - 202: 30(float) Load 201 - 203: 30(float) Load 32(b) - 204: 30(float) FAdd 203 202 - Store 32(b) 204 - 206: 6(int) Load 92(nu_ii) - 207: 7(ptr) AccessChain 205(uv) 206 - 208: 6(int) Load 207 - 209: 94(ptr) AccessChain 90(uniformBuffer) 208 53 - 210: 30(float) Load 209 - 211: 30(float) Load 32(b) - 212: 30(float) FAdd 211 210 - Store 32(b) 212 - 216: 31(ptr) AccessChain 215(m) 26 198 - 217: 30(float) Load 216 - 218: 6(int) ConvertFToS 217 - 219: 94(ptr) AccessChain 90(uniformBuffer) 218 53 - 220: 30(float) Load 219 - 221: 30(float) Load 32(b) - 222: 30(float) FAdd 221 220 - Store 32(b) 222 - 226: 7(ptr) AccessChain 225(s) 53 - 227: 6(int) Load 226 - 228: 94(ptr) AccessChain 90(uniformBuffer) 227 53 - 229: 30(float) Load 228 - 230: 30(float) Load 32(b) - 231: 30(float) FAdd 230 229 - Store 32(b) 231 - 232: 6(int) Load 92(nu_ii) - 233: 30(float) Load 32(b) - 234: 94(ptr) AccessChain 102(storageBuffer) 232 53 - Store 234 233 + 31: 6(int) Load 16(a) + 32: 6(int) Load 16(a) + 33: 6(int) IMul 32 26 + 34: 6(int) CopyObject 33 + 35: 6(int) IAdd 31 34 + Store 30(nu_li2) 35 + 45: 44(ptr) AccessChain 41(nu_inv4) 43 + 46: 36(float) Load 45 + 48: 36(float) Load 47(nu_gf) + 49: 36(float) FMul 46 48 + Store 38(b) 49 + 55: 6(int) Load 54(dyn_i) + 57: 56(ptr) AccessChain 53(inputAttachmentDyn) 55 + 58: 50 Load 57 + 62: 39(fvec4) ImageRead 58 61 + 63: 36(float) CompositeExtract 62 0 + 64: 36(float) Load 38(b) + 65: 36(float) FAdd 64 63 + Store 38(b) 65 + 71: 6(int) Load 54(dyn_i) + 73: 72(ptr) AccessChain 70(uniformTexelBufferDyn) 71 + 74: 67 Load 73 + 76: 66 Image 74 + 77: 39(fvec4) ImageFetch 76 75 + 78: 36(float) CompositeExtract 77 0 + 79: 36(float) Load 38(b) + 80: 36(float) FAdd 79 78 + Store 38(b) 80 + 85: 6(int) Load 54(dyn_i) + 87: 86(ptr) AccessChain 84(storageTexelBufferDyn) 85 + 88: 81 Load 87 + 89: 39(fvec4) ImageRead 88 75 + 90: 36(float) CompositeExtract 89 0 + 91: 36(float) Load 38(b) + 92: 36(float) FAdd 91 90 + Store 38(b) 92 + 99: 6(int) Load 98(nu_ii) + 101: 100(ptr) AccessChain 96(uniformBuffer) 99 59 + 102: 36(float) Load 101 + 103: 36(float) Load 38(b) + 104: 36(float) FAdd 103 102 + Store 38(b) 104 + 109: 6(int) Load 98(nu_ii) + 110: 100(ptr) AccessChain 108(storageBuffer) 109 59 + 111: 36(float) Load 110 + 112: 36(float) Load 38(b) + 113: 36(float) FAdd 112 111 + Store 38(b) 113 + 119: 6(int) Load 98(nu_ii) + 121: 120(ptr) AccessChain 118(sampledImage) 119 + 122: 115 Load 121 + 126: 39(fvec4) ImageSampleImplicitLod 122 125 + 127: 36(float) CompositeExtract 126 0 + 128: 36(float) Load 38(b) + 129: 36(float) FAdd 128 127 + Store 38(b) 129 + 134: 6(int) Load 98(nu_ii) + 136: 135(ptr) AccessChain 133(storageImage) 134 + 137: 130 Load 136 + 139: 39(fvec4) ImageRead 137 138 + 140: 36(float) CompositeExtract 139 0 + 141: 36(float) Load 38(b) + 142: 36(float) FAdd 141 140 + Store 38(b) 142 + 146: 6(int) Load 98(nu_ii) + 147: 56(ptr) AccessChain 145(inputAttachment) 146 + 148: 50 Load 147 + 149: 39(fvec4) ImageRead 148 61 + 150: 36(float) CompositeExtract 149 0 + 151: 36(float) Load 38(b) + 152: 36(float) FAdd 151 150 + Store 38(b) 152 + 156: 6(int) Load 98(nu_ii) + 157: 72(ptr) AccessChain 155(uniformTexelBuffer) 156 + 158: 67 Load 157 + 159: 66 Image 158 + 160: 39(fvec4) ImageFetch 159 75 + 161: 36(float) CompositeExtract 160 0 + 162: 36(float) Load 38(b) + 163: 36(float) FAdd 162 161 + Store 38(b) 163 + 167: 6(int) Load 98(nu_ii) + 168: 86(ptr) AccessChain 166(storageTexelBuffer) 167 + 169: 81 Load 168 + 170: 39(fvec4) ImageRead 169 75 + 171: 36(float) CompositeExtract 170 0 + 172: 36(float) Load 38(b) + 173: 36(float) FAdd 172 171 + Store 38(b) 173 + 178: 6(int) Load 98(nu_ii) + 180: 179(ptr) AccessChain 177(uniformTexArr) 178 + 181: 114 Load 180 + 185: 182 Load 184(uniformSampler) + 186: 115 SampledImage 181 185 + 189: 123(fvec2) Load 188(inTexcoord) + 190: 39(fvec4) ImageSampleImplicitLod 186 189 + 191: 36(float) CompositeExtract 190 0 + 192: 36(float) Load 38(b) + 193: 36(float) FAdd 192 191 + Store 38(b) 193 + 194: 6(int) Load 98(nu_ii) + 195: 179(ptr) AccessChain 177(uniformTexArr) 194 + 196: 114 Load 195 + 197: 182 Load 184(uniformSampler) + 198: 115 SampledImage 196 197 + 199: 115 CopyObject 198 + 200: 123(fvec2) Load 188(inTexcoord) + 201: 39(fvec4) ImageSampleImplicitLod 199 200 + 202: 36(float) CompositeExtract 201 0 + 203: 36(float) Load 38(b) + 204: 36(float) FAdd 203 202 + Store 38(b) 204 + 209: 7(ptr) AccessChain 207(v) 208 + 210: 6(int) Load 209 + 211: 100(ptr) AccessChain 96(uniformBuffer) 210 59 + 212: 36(float) Load 211 + 213: 36(float) Load 38(b) + 214: 36(float) FAdd 213 212 + Store 38(b) 214 + 216: 7(ptr) AccessChain 207(v) 215 + 217: 6(int) Load 216 + 218: 100(ptr) AccessChain 96(uniformBuffer) 217 59 + 219: 36(float) Load 218 + 220: 36(float) Load 38(b) + 221: 36(float) FAdd 220 219 + Store 38(b) 221 + 223: 6(int) Load 98(nu_ii) + 224: 7(ptr) AccessChain 222(uv) 223 + 225: 6(int) Load 224 + 226: 100(ptr) AccessChain 96(uniformBuffer) 225 59 + 227: 36(float) Load 226 + 228: 36(float) Load 38(b) + 229: 36(float) FAdd 228 227 + Store 38(b) 229 + 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 FunctionEnd 11(foo(i1;i1;): 6(int) Function None 8 diff --git a/Test/baseResults/spv.nonuniform4.frag.out b/Test/baseResults/spv.nonuniform4.frag.out index 92cbd363..6bfc9575 100644 --- a/Test/baseResults/spv.nonuniform4.frag.out +++ b/Test/baseResults/spv.nonuniform4.frag.out @@ -23,6 +23,7 @@ spv.nonuniform4.frag Decorate 13(rIndex) Flat Decorate 13(rIndex) Location 3 Decorate 15 DecorationNonUniformEXT + Decorate 17 DecorationNonUniformEXT Decorate 21 DecorationNonUniformEXT 2: TypeVoid 3: TypeFunction 2 diff --git a/Test/spv.nonuniform.frag b/Test/spv.nonuniform.frag index c136d256..cf7ebedc 100644 --- a/Test/spv.nonuniform.frag +++ b/Test/spv.nonuniform.frag @@ -28,10 +28,12 @@ nonuniformEXT int foo(nonuniformEXT int nupi, nonuniformEXT out int f) void main() { nonuniformEXT int nu_li; + nonuniformEXT int nu_li2; int dyn_i; int a = foo(nu_li, nu_li); nu_li = nonuniformEXT(a) + nonuniformEXT(a * 2); + nu_li2 = a + nonuniformEXT(a * 2); float b; b = nu_inv4.x * nu_gf; @@ -46,16 +48,25 @@ void main() b += texelFetch(uniformTexelBuffer[nu_ii], 1).x; b += imageLoad(storageTexelBuffer[nu_ii], 1).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 mat4 m; nonuniformEXT struct S { int a; } s; + nonuniformEXT int arr[10]; ivec4 uv; + mat4 um; + struct US { int a[10]; } us; + int uarr[10]; b += uniformBuffer[v.y].a; b += uniformBuffer[v[2]].a; b += uniformBuffer[uv[nu_ii]].a; b += uniformBuffer[int(m[2].z)].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; }