Skip to content

Commit c5f0503

Browse files
bcheng0127igcbot
authored andcommitted
Use sampler header to solve HW issue
Use sampler header to solve HW issue
1 parent c9ada7c commit c5f0503

File tree

5 files changed

+15
-2
lines changed

5 files changed

+15
-2
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4631,6 +4631,10 @@ namespace IGC
46314631
{
46324632
SaveOption(vISA_forceSamplerHeader, true);
46334633
}
4634+
if (IGC_IS_FLAG_ENABLED(samplerHeaderWA))
4635+
{
4636+
SaveOption(vISA_samplerHeaderWA, true);
4637+
}
46344638
if (IGC_IS_FLAG_ENABLED(EnableIGAEncoder))
46354639
{
46364640
SaveOption(vISA_IGAEncoder, true);

IGC/common/igc_flags.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,7 @@ DECLARE_IGC_REGKEY(bool, LimitConstantBuffersPushed, true, "Limit max number
578578
DECLARE_IGC_REGKEY(DWORD, MaxPreRASchedulerRegPressureThreshold, 60, "Max PreRA Scheduler Threshold", false)
579579
DECLARE_IGC_REGKEY(bool, EnablePreRASampleCluster, false, "Enabling helps cluster sample instructions with identical texture index which are ready to be scheduled, to be scheduled together", false)
580580
DECLARE_IGC_REGKEY(bool, forceSamplerHeader, false, "force sampler messages to use header", false)
581+
DECLARE_IGC_REGKEY(bool, samplerHeaderWA, false, "enable sampler header to solve HW WA", false)
581582
DECLARE_IGC_REGKEY(bool, VFPackingDisablePartialElements, false, "disable packing for partial vertex element as it causes performance drops", false)
582583
DECLARE_IGC_REGKEY(bool, cl_khr_srgb_image_writes, false, "Enable cl_khr_srgb_image_writes extension", false)
583584
DECLARE_IGC_REGKEY(bool, MSAA16BitPayloadEnable, true, "Enable support for MSAA 16 bit payload , a hardware DCN supporting this from ICL+ to improve perf on MSAA workloads", false)

visa/HWCaps.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ SPDX-License-Identifier: MIT
3434
(getPlatform() < GENX_ICLLP && m_options->getOption(vISA_enablePreemption));
3535
}
3636

37+
bool samplerHeaderPreemptionWA() const
38+
{
39+
return m_options->getOption(vISA_enablePreemption) && m_options->getOption(vISA_samplerHeaderWA);
40+
}
41+
3742
bool needsNoPreemptR2ForSend() const
3843
{
3944
return getPlatformGeneration() == PlatformGen::GEN11;

visa/VisaToG4/TranslateSend3D.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,7 +1865,8 @@ int IR_Builder::translateVISASampler3DInst(
18651865
bool simd16HFReturn = FP16Return && execSize == 16;
18661866
if (needSamplerHeader(this, pixelNullMask, nonZeroAoffImmi, needHeaderForChannels,
18671867
isBindlessSampler(sampler),
1868-
simd16HFReturn))
1868+
simd16HFReturn) ||
1869+
samplerHeaderPreemptionWA())
18691870
{
18701871
useHeader = true;
18711872
++numRows;
@@ -2119,7 +2120,8 @@ int IR_Builder::translateVISAGather3dInst(
21192120

21202121
if (needSamplerHeader(this, pixelNullMask, nonZeroAoffImmi, needHeaderForChannels,
21212122
isBindlessSampler(sampler),
2122-
simd16HFReturn))
2123+
simd16HFReturn) ||
2124+
samplerHeaderPreemptionWA())
21232125
{
21242126
useHeader = true;
21252127
++numRows;

visa/include/VISAOptionsDefs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ DEF_VISA_OPTION(vISA_expandPlane, ET_BOOL, "-expandPlane", UNUSED
111111
DEF_VISA_OPTION(vISA_FImmToHFImm, ET_BOOL, "-fiTohfi", UNUSED, false)
112112
DEF_VISA_OPTION(vISA_cacheSamplerHeader, ET_BOOL, "-noSamplerHeaderCache", UNUSED, true)
113113
DEF_VISA_OPTION(vISA_forceSamplerHeader, ET_BOOL, "-forceSamplerHeader", UNUSED, false)
114+
DEF_VISA_OPTION(vISA_samplerHeaderWA, ET_BOOL, "-samplerHeaderWA", UNUSED, false)
114115
DEF_VISA_OPTION(vISA_markSamplerMoves, ET_BOOL, "-markSamplerMoves", UNUSED, false)
115116
DEF_VISA_OPTION(vISA_noncoherentStateless, ET_BOOL, "-ncstateless", UNUSED, false)
116117
DEF_VISA_OPTION(vISA_enablePreemption, ET_BOOL, "-enablePreemption", UNUSED, false)

0 commit comments

Comments
 (0)