Skip to content

Commit 9081e8d

Browse files
iwwuigcbot
authored andcommitted
Turn on SetHasSample for gather4* instructions
HasSample is currently set in emitSampleInstruction() only. This flag is extended to emitGather4Instruction() as well.
1 parent 4141d7f commit 9081e8d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8234,7 +8234,7 @@ void EmitPass::emitSampleInstruction(SampleIntrinsic* inst)
82348234
{
82358235
EOPCODE opCode = GetOpCode(inst);
82368236

8237-
m_currShader->m_State.SetHasSample();
8237+
m_currShader->m_State.SetHasSampleInst();
82388238
ResourceDescriptor resource = GetSampleResourceHelper(inst);
82398239
bool isEval = isUsedOnlyByEval(inst);
82408240
ResourceDescriptor pairedResource = inst->hasPairedTextureArg() && llvm::isa<llvm::UndefValue>(inst->getPairedTextureValue()) == false ?
@@ -8664,6 +8664,7 @@ void EmitPass::emitGather4Instruction(SamplerGatherIntrinsic* inst)
86648664
{
86658665
EOPCODE opCode = GetOpCode(inst);
86668666
uint numOperands = inst->getNumOperands();
8667+
m_currShader->m_State.SetHasGather4Inst();
86678668

86688669
//Subtract the offsets, resource and sampler sources to get
86698670
//the number of texture coordinates, src channel select and index to texture source

IGC/Compiler/CISACodeGen/GenericShaderState.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ namespace IGC
5151
int GetBarrierNumber() const { return m_BarrierNumber; }
5252

5353
bool GetHasSample() const { return m_HasSample; }
54-
void SetHasSample() { m_HasSample = true; }
54+
void SetHasSampleInst() { m_HasSampleInst = true; m_HasSample = true; }
55+
void SetHasGather4Inst() { m_HasGather4Inst = true; m_HasSample = true; }
5556

5657
bool GetHasDPAS() const { return m_HasDPAS; }
5758
void SetHasDPAS() { m_HasDPAS = true; }
@@ -115,6 +116,8 @@ namespace IGC
115116
}
116117
private:
117118
bool m_HasSample = false;
119+
bool m_HasSampleInst = false;
120+
bool m_HasGather4Inst = false;
118121
int m_BarrierNumber = 0;
119122
bool m_HasDPAS = false;
120123
// Shader has LSC store messages with non-default L1 cache control

0 commit comments

Comments
 (0)