Skip to content

Commit

Permalink
Update SPIRV-Headers and SPIRV-Tools (google#1334)
Browse files Browse the repository at this point in the history
* Prevent the SPIRVProducer from adding duplicate NonUniform decorations
  • Loading branch information
alan-baker authored Apr 14, 2024
1 parent d0eb439 commit c8f4132
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions deps.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
"subrepo" : "KhronosGroup/SPIRV-Headers",
"branch" : "main",
"subdir" : "third_party/SPIRV-Headers",
"commit" : "4183b260f4cccae52a89efdfcdd43c4897989f42"
"commit" : "4f7b471f1a66b6d06462cd4ba57628cc0cd087d7"
},
{
"name" : "SPIRV-Tools",
"site" : "github",
"subrepo" : "KhronosGroup/SPIRV-Tools",
"branch" : "main",
"subdir" : "third_party/SPIRV-Tools",
"commit" : "a996591b1c67e789e88e99ae3881272f5fc47374"
"commit" : "02470f606fe1571de808cb773d8c521ab201aaff"
}
]
}
8 changes: 6 additions & 2 deletions lib/SPIRVProducerPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,7 @@ struct SPIRVProducerPassImpl {
Type *SamplerPointerTy;
Type *SamplerDataTy;
DenseMap<unsigned, SPIRVID> SamplerLiteralToIDMap;
DenseSet<uint32_t> DecoratedNonUniform;

// If a function F has a pointer-to-__constant parameter, then this variable
// will map F's type to (G, index of the parameter), where in a first phase
Expand Down Expand Up @@ -4638,8 +4639,11 @@ void SPIRVProducerPassImpl::GenerateInstruction(Instruction &I) {
setNonUniformPointers();

SPIRVOperandVec Ops;
Ops << getSPIRVValue(op) << spv::DecorationNonUniform;
addSPIRVInst<kAnnotations>(spv::OpDecorate, Ops);
auto id = getSPIRVValue(op);
if (DecoratedNonUniform.insert(id.get()).second) {
Ops << id << spv::DecorationNonUniform;
addSPIRVInst<kAnnotations>(spv::OpDecorate, Ops);
}
}
}
}
Expand Down

0 comments on commit c8f4132

Please sign in to comment.