SPV: Add NonUniform decorations for stores.
The direct pointer argument to stores has to use the NonUniform decoration but we were not using qualifiers at all to decorate the NonUniform pointer. (Test fixes by Greg Fischer <greg@lunarg.com>)
This commit is contained in:
parent
517f39eee4
commit
de949a2afc
4 changed files with 16 additions and 6 deletions
|
|
@ -2292,7 +2292,8 @@ 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);
|
||||
builder.accessChainStore(result,
|
||||
TranslateNonUniformDecoration(node->getOperand()->getType().getQualifier()));
|
||||
builder.clearAccessChain();
|
||||
if (node->getOp() == glslang::EOpPreIncrement ||
|
||||
node->getOp() == glslang::EOpPreDecrement)
|
||||
|
|
@ -2368,6 +2369,7 @@ 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<spv::Builder::AccessChain> complexLvalues; // for holding swizzling l-values too complex for
|
||||
// SPIR-V, for an out parameter
|
||||
std::vector<glslang::TQualifier> complexLValueQualifiers;
|
||||
std::vector<spv::Id> temporaryLvalues; // temporaries to pass, as proxies for complexLValues
|
||||
|
||||
auto resultType = [&invertedType, &node, this](){ return invertedType != spv::NoType ?
|
||||
|
|
@ -2985,6 +2987,7 @@ 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"));
|
||||
|
|
@ -3089,7 +3092,7 @@ 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));
|
||||
builder.accessChainStore(builder.createLoad(temporaryLvalues[i], spv::NoPrecision), TranslateNonUniformDecoration(complexLValueQualifiers[i]));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4154,7 +4157,7 @@ void TGlslangToSpvTraverser::accessChainStore(const glslang::TType& type, spv::I
|
|||
unsigned int alignment = builder.getAccessChain().alignment;
|
||||
alignment |= type.getBufferReferenceAlignment();
|
||||
|
||||
builder.accessChainStore(rvalue,
|
||||
builder.accessChainStore(rvalue, TranslateNonUniformDecoration(type.getQualifier()),
|
||||
spv::MemoryAccessMask(TranslateMemoryAccess(coherentFlags) &
|
||||
~spv::MemoryAccessMakePointerVisibleKHRMask),
|
||||
TranslateMemoryScope(coherentFlags), alignment);
|
||||
|
|
@ -5239,7 +5242,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
|
|||
|
||||
builder.accessChainPush(builder.makeIntConstant(i), flags, 0);
|
||||
builder.accessChainStore(builder.createCompositeExtract(res, builder.getContainedTypeId(resType, i+1),
|
||||
i+1));
|
||||
i+1), TranslateNonUniformDecoration(imageType.getQualifier()));
|
||||
}
|
||||
return builder.createCompositeExtract(res, resultType(), 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue