@@ -3487,6 +3487,10 @@ void EmitPass::emitEvalAttribute(llvm::GenIntrinsicInst* inst)
34873487 uint exDesc = EU_GEN7_MESSAGE_TARGET_PIXEL_INTERPOLATOR;
34883488 EU_PIXEL_INTERPOLATOR_SIMD_MODE executionMode = pixelInterpolatorSimDMode(m_currShader->m_SIMDSize);
34893489 uint responseLength = executionMode ? 4 : 2;
3490+ if (getGRFSize() != 32)
3491+ {
3492+ responseLength /= 2;
3493+ }
34903494 uint messageLength = 1;
34913495 CVariable* payload = nullptr;
34923496 uint desc = 0;
@@ -3550,6 +3554,7 @@ void EmitPass::emitEvalAttribute(llvm::GenIntrinsicInst* inst)
35503554 uint offsetY = 0;
35513555 bool offsetIsConst = true;
35523556 auto messageType = EU_PI_MESSAGE_EVAL_CENTROID_POSITION;
3557+ auto numDWPerGRF = getGRFSize() / SIZE_DWORD;
35533558 if (inst->getIntrinsicID() == GenISAIntrinsic::GenISA_PullSnappedBarys)
35543559 {
35553560 offsetIsConst = false;
@@ -3568,7 +3573,7 @@ void EmitPass::emitEvalAttribute(llvm::GenIntrinsicInst* inst)
35683573 }
35693574 if (offsetIsConst && psProgram->GetPhase() != PSPHASE_COARSE)
35703575 {
3571- payload = m_currShader->GetNewVariable(messageLength * (getGRFSize() >> 2) , ISA_TYPE_D, EALIGN_GRF);
3576+ payload = m_currShader->GetNewVariable(messageLength * numDWPerGRF , ISA_TYPE_D, EALIGN_GRF);
35723577 desc = PixelInterpolator(
35733578 messageLength,
35743579 responseLength,
@@ -3583,7 +3588,7 @@ void EmitPass::emitEvalAttribute(llvm::GenIntrinsicInst* inst)
35833588 {
35843589 IGC_ASSERT(messageType != EU_PI_MESSAGE_EVAL_CENTROID_POSITION);
35853590
3586- messageLength = 2 * numLanes(m_currShader->m_SIMDSize) / 8 ;
3591+ messageLength = 2 * numLanes(m_currShader->m_SIMDSize) / numDWPerGRF ;
35873592 payload = m_currShader->GetNewVariable(messageLength * (getGRFSize() >> 2), ISA_TYPE_D, EALIGN_GRF);
35883593 desc = PixelInterpolator(
35893594 messageLength,
@@ -3598,7 +3603,7 @@ void EmitPass::emitEvalAttribute(llvm::GenIntrinsicInst* inst)
35983603 m_encoder->Copy(payload, XOffset);
35993604 m_encoder->Push();
36003605
3601- m_encoder->SetDstSubVar(numLanes(m_currShader->m_SIMDSize) / 8 );
3606+ m_encoder->SetDstSubVar(numLanes(m_currShader->m_SIMDSize) / numDWPerGRF );
36023607 m_encoder->Copy(payload, YOffset);
36033608 m_encoder->Push();
36043609 }
@@ -16374,10 +16379,13 @@ bool EmitPass::ResourceLoopHeader(
1637416379 {
1637516380 flag = resourceFlag != nullptr ? resourceFlag : samplerFlag;
1637616381 }
16377- if (m_SimdMode == SIMDMode::SIMD32)
16382+ if (m_SimdMode == SIMDMode::SIMD32 && m_currShader->m_numberInstance == 2 )
1637816383 {
1637916384 // For SIMD32 need to initialize to 1 the other half of the flag
16385+ // ToDo: check if this is actually necessary, as the other half should not get used
1638016386 m_encoder->SetSecondHalf(!m_encoder->IsSecondHalf());
16387+ m_encoder->SetSrcRegion(0, 0, 1, 0);
16388+ m_encoder->SetSrcRegion(1, 0, 1, 0);
1638116389 m_encoder->Cmp(EPREDICATE_EQ, flag, m_currShader->GetR0(), m_currShader->GetR0());
1638216390 m_encoder->Push();
1638316391 m_encoder->SetSecondHalf(!m_encoder->IsSecondHalf());
0 commit comments