@@ -8046,7 +8046,8 @@ void EmitPass::emitGather4Instruction(SamplerGatherIntrinsic *inst) {
8046
8046
bool feedbackEnable = (m_destination->GetNumberElement() / numLanes(m_currShader->m_SIMDSize) == 5) ? true : false;
8047
8047
uint label = 0;
8048
8048
CVariable *flag = nullptr;
8049
- bool needLoop = ResourceLoopHeader(dst, resource, sampler, flag, label);
8049
+ CVariable *dest = dst ? dst : m_destination;
8050
+ bool needLoop = ResourceLoopHeader(dest, resource, sampler, flag, label);
8050
8051
ResourceLoopSubIteration(resource, sampler, flag, label);
8051
8052
m_encoder->SetPredicate(flag);
8052
8053
m_encoder->Gather4Inst(opCode, offset, resource, pairedResource, sampler, numSources, dst, payload, channel,
@@ -14585,7 +14586,8 @@ void EmitPass::emitAtomicRaw(llvm::GenIntrinsicInst *pInst, Value *dstAddr, Cons
14585
14586
}
14586
14587
uint label = 0;
14587
14588
CVariable *flag = nullptr;
14588
- bool needLoop = ResourceLoopHeader(pDst, resource, flag, label);
14589
+ CVariable *dest = pDst ? pDst : m_destination;
14590
+ bool needLoop = ResourceLoopHeader(dest, resource, flag, label);
14589
14591
ResourceLoopSubIteration(resource, flag, label);
14590
14592
if (shouldGenerateLSC(pInst)) {
14591
14593
auto cacheOpts = LSC_DEFAULT_CACHING;
0 commit comments