@@ -456,12 +456,7 @@ CVariable* CPixelShader::GetBaryReg(e_interpolation mode)
456456
457457CVariable* CPixelShader::GetBaryRegLoweredHalf (e_interpolation mode)
458458{
459- IGC_ASSERT (mode == EINTERPOLATION_LINEAR ||
460- mode == EINTERPOLATION_LINEARCENTROID ||
461- mode == EINTERPOLATION_LINEARSAMPLE ||
462- mode == EINTERPOLATION_LINEARNOPERSPECTIVE ||
463- mode == EINTERPOLATION_LINEARNOPERSPECTIVECENTROID ||
464- mode == EINTERPOLATION_LINEARNOPERSPECTIVESAMPLE);
459+ IGC_ASSERT (IsInterpolationLinear (mode));
465460
466461 const char * const name =
467462 mode == EINTERPOLATION_LINEAR ? " PerspectivePixelLoweredHalf" :
@@ -487,12 +482,7 @@ CVariable* CPixelShader::GetBaryRegLoweredHalf(e_interpolation mode)
487482
488483CVariable* CPixelShader::GetBaryRegLoweredFloat (e_interpolation mode)
489484{
490- IGC_ASSERT (mode == EINTERPOLATION_LINEAR ||
491- mode == EINTERPOLATION_LINEARCENTROID ||
492- mode == EINTERPOLATION_LINEARSAMPLE ||
493- mode == EINTERPOLATION_LINEARNOPERSPECTIVE ||
494- mode == EINTERPOLATION_LINEARNOPERSPECTIVECENTROID ||
495- mode == EINTERPOLATION_LINEARNOPERSPECTIVESAMPLE);
485+ IGC_ASSERT (IsInterpolationLinear (mode));
496486
497487 const char * const name =
498488 mode == EINTERPOLATION_LINEAR ? " PerspectivePixelLoweredFloat" :
@@ -893,6 +883,7 @@ void CPixelShader::FillProgram(SPixelShaderKernelProgram* pKernelProgram)
893883 pKernelProgram->NOSBufferSize = m_NOSBufferSize / getMinPushConstantBufferAlignmentInBytes ();
894884 pKernelProgram->isMessageTargetDataCacheDataPort = isMessageTargetDataCacheDataPort;
895885
886+
896887 CreateGatherMap ();
897888 CreateConstantBufferOutput (pKernelProgram);
898889
@@ -997,14 +988,16 @@ void CPixelShader::ParseShaderSpecificOpcode(llvm::Instruction* inst)
997988 e_interpolation mode = static_cast <e_interpolation>(llvm::cast<llvm::ConstantInt>(inst->getOperand (1 ))->getZExtValue ());
998989 if (mode != EINTERPOLATION_CONSTANT)
999990 {
1000- if (inst->getType ()->isHalfTy ())
1001- {
1002- loweredSetupIndexes.insert (setupIndex);
1003- m_ModeUsedHalf.set (mode);
1004- }
1005- else
1006991 {
1007- m_ModeUsedFloat.set (mode);
992+ if (inst->getType ()->isHalfTy ())
993+ {
994+ loweredSetupIndexes.insert (setupIndex);
995+ m_ModeUsedHalf.set (mode);
996+ }
997+ else
998+ {
999+ m_ModeUsedFloat.set (mode);
1000+ }
10081001 }
10091002 }
10101003 break ;
@@ -1654,6 +1647,16 @@ bool CPixelShader::LowerPSInput()
16541647 return (m_SIMDSize == SIMDMode::SIMD16 || !m_Platform->supportMixMode ());
16551648}
16561649
1650+ bool CPixelShader::IsInterpolationLinear (e_interpolation mode)
1651+ {
1652+ return mode == EINTERPOLATION_LINEAR ||
1653+ mode == EINTERPOLATION_LINEARCENTROID ||
1654+ mode == EINTERPOLATION_LINEARSAMPLE ||
1655+ mode == EINTERPOLATION_LINEARNOPERSPECTIVE ||
1656+ mode == EINTERPOLATION_LINEARNOPERSPECTIVECENTROID ||
1657+ mode == EINTERPOLATION_LINEARNOPERSPECTIVESAMPLE;
1658+ }
1659+
16571660void CPixelShader::emitPSInputLowering ()
16581661{
16591662 auto iterSetupIndex = loweredSetupIndexes.begin ();
0 commit comments