Skip to content

Commit b1a5438

Browse files
weiyu-chengfxbot
authored andcommitted
Enable clear scratch write before EOT WA for selected APIs
Change-Id: I2b202bc48b73ef41edbbaea22903b2b8a54bbd27
1 parent 20de8a1 commit b1a5438

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3495,14 +3495,10 @@ void CEncoder::InitEncoder( bool canAbortOnSpill )
34953495
vbuilder->SetOption(vISA_foldEOTtoPrevSend, true);
34963496
}
34973497

3498-
if (context->type == ShaderType::PIXEL_SHADER || context->type == ShaderType::OPENCL_SHADER ||
3499-
context->type == ShaderType::COMPUTE_SHADER)
3498+
if (m_program->m_DriverInfo->clearScratchWriteBeforeEOT() &&
3499+
(context->type == ShaderType::PIXEL_SHADER || context->type == ShaderType::OPENCL_SHADER))
35003500
{
3501-
vbuilder->SetOption(vISA_clearScratchWritesBeforeEOT, false);
3502-
}
3503-
else
3504-
{
3505-
vbuilder->SetOption(vISA_clearScratchWritesBeforeEOT, false);
3501+
vbuilder->SetOption(vISA_clearScratchWritesBeforeEOT, true);
35063502
}
35073503

35083504
// Disable multi-threaded latencies in the vISA scheduler when not in 3D
@@ -3859,7 +3855,6 @@ void CEncoder::InitEncoder( bool canAbortOnSpill )
38593855
vbuilder->SetOption(vISA_ReorderDPSendToDifferentBti, false);
38603856
}
38613857

3862-
38633858
vKernel = nullptr;
38643859

38653860
const char* kernelName = m_program->entry->getName().data();

IGC/Compiler/CISACodeGen/DriverInfo.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ class CDriverInfo
222222

223223
/// Disables dual patch dispatch for APIs that don't use it
224224
virtual bool APIDisableDSDualPatchDispatch() const { return false; }
225+
226+
/// WA to make sure scratch writes are globally observed before EOT
227+
virtual bool clearScratchWriteBeforeEOT() const { return false; }
228+
225229
};
226230

227231
}//namespace IGC

visa/include/VISAOptions.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ DEF_VISA_OPTION(vISA_ReRAPostSchedule, ET_BOOL, "-rerapostschedule", UNUSED
192192
DEF_VISA_OPTION(vISA_GetFreeGRFInfo, ET_BOOL, "-getfreegrfinfo", UNUSED, false)
193193

194194
//=== HW Workarounds ===
195-
DEF_VISA_OPTION(vISA_clearScratchWritesBeforeEOT, ET_BOOL, NULLSTR, UNUSED, true)
195+
DEF_VISA_OPTION(vISA_clearScratchWritesBeforeEOT, ET_BOOL, NULLSTR, UNUSED, false)
196196

197197
//=== HW debugging options ===
198198
DEF_VISA_OPTION(vISA_GenerateDebugInfo, ET_BOOL, "-generateDebugInfo", UNUSED, false)

0 commit comments

Comments
 (0)