Skip to content

Commit aefce6d

Browse files
weiyu-chensys_zuul
authored andcommitted
Avoid hard-coding SIMD size for hull shader and domain shader.
Change-Id: I752ac60a1cd6a72a979b2c80a610078148e7fdd8
1 parent b6576fd commit aefce6d

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

IGC/Compiler/CISACodeGen/DomainShaderCodeGen.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ namespace IGC
170170
}
171171
else if (m_ShaderDispatchMode == ShaderDispatchMode::DUAL_PATCH)
172172
{
173-
encoder.SetSimdSize(SIMDMode::SIMD8);
173+
encoder.SetSimdSize(m_Platform->getMinDispatchMode());
174174
encoder.SetSrcRegion(0, 1, 4, 0);
175175
encoder.SetSrcSubReg(0, 0);
176176

@@ -244,11 +244,15 @@ namespace IGC
244244

245245
void CShaderProgram::FillProgram(SDomainShaderKernelProgram* pKernelProgram)
246246
{
247-
CDomainShader* pShader = static_cast<CDomainShader*>(GetShader(SIMDMode::SIMD8));
247+
auto simdMode = m_context->platform.getMinDispatchMode();
248+
CDomainShader* pShader = static_cast<CDomainShader*>(GetShader(simdMode));
248249
pShader->FillProgram(pKernelProgram);
249-
pKernelProgram->simd8 = *pShader->ProgramOutput();
250250

251-
CDomainShader* dualPatchShader = static_cast<CDomainShader*>(GetShader(SIMDMode::SIMD8, ShaderDispatchMode::DUAL_PATCH));
251+
SProgramOutput* output = &pKernelProgram->simd8;
252+
253+
*output = *pShader->ProgramOutput();
254+
255+
CDomainShader* dualPatchShader = static_cast<CDomainShader*>(GetShader(simdMode, ShaderDispatchMode::DUAL_PATCH));
252256
if (dualPatchShader)
253257
{
254258
pKernelProgram->simd8DualPatch = *dualPatchShader->ProgramOutput();

IGC/Compiler/CISACodeGen/GeometryShaderCodeGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ namespace IGC
335335

336336
void CShaderProgram::FillProgram(SGeometryShaderKernelProgram* pKernelProgram)
337337
{
338-
CGeometryShader* pShader = static_cast<CGeometryShader*>(GetShader(SIMDMode::SIMD8));
338+
CGeometryShader* pShader = static_cast<CGeometryShader*>(GetShader(m_context->platform.getMinDispatchMode()));
339339
pShader->FillProgram(pKernelProgram);
340340
}
341341

IGC/Compiler/CISACodeGen/HullShaderCodeGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ namespace IGC
264264

265265
void CShaderProgram::FillProgram(SHullShaderKernelProgram* pKernelProgram)
266266
{
267-
CHullShader* pShader = static_cast<CHullShader*>(GetShader(SIMDMode::SIMD8));
267+
CHullShader* pShader = static_cast<CHullShader*>(GetShader(m_context->platform.getMinDispatchMode()));
268268
pShader->FillProgram(pKernelProgram);
269269
}
270270

0 commit comments

Comments
 (0)