Skip to content

Commit c8f4132

Browse files
authored
Update SPIRV-Headers and SPIRV-Tools (#1334)
* Prevent the SPIRVProducer from adding duplicate NonUniform decorations
1 parent d0eb439 commit c8f4132

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

deps.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
"subrepo" : "KhronosGroup/SPIRV-Headers",
1515
"branch" : "main",
1616
"subdir" : "third_party/SPIRV-Headers",
17-
"commit" : "4183b260f4cccae52a89efdfcdd43c4897989f42"
17+
"commit" : "4f7b471f1a66b6d06462cd4ba57628cc0cd087d7"
1818
},
1919
{
2020
"name" : "SPIRV-Tools",
2121
"site" : "github",
2222
"subrepo" : "KhronosGroup/SPIRV-Tools",
2323
"branch" : "main",
2424
"subdir" : "third_party/SPIRV-Tools",
25-
"commit" : "a996591b1c67e789e88e99ae3881272f5fc47374"
25+
"commit" : "02470f606fe1571de808cb773d8c521ab201aaff"
2626
}
2727
]
2828
}

lib/SPIRVProducerPass.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,7 @@ struct SPIRVProducerPassImpl {
687687
Type *SamplerPointerTy;
688688
Type *SamplerDataTy;
689689
DenseMap<unsigned, SPIRVID> SamplerLiteralToIDMap;
690+
DenseSet<uint32_t> DecoratedNonUniform;
690691

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

46404641
SPIRVOperandVec Ops;
4641-
Ops << getSPIRVValue(op) << spv::DecorationNonUniform;
4642-
addSPIRVInst<kAnnotations>(spv::OpDecorate, Ops);
4642+
auto id = getSPIRVValue(op);
4643+
if (DecoratedNonUniform.insert(id.get()).second) {
4644+
Ops << id << spv::DecorationNonUniform;
4645+
addSPIRVInst<kAnnotations>(spv::OpDecorate, Ops);
4646+
}
46434647
}
46444648
}
46454649
}

0 commit comments

Comments
 (0)