@@ -7852,12 +7852,18 @@ void EmitPass::getCoarsePixelSize(CVariable* destination, const uint component,
7852
7852
7853
7853
CPixelShader* const psProgram = static_cast<CPixelShader*>(m_currShader);
7854
7854
CVariable* r;
7855
+ bool isR1Lo = false;
7855
7856
// Coarse pixel sizes are in R1 for both simd32 halves.
7856
7857
{
7857
7858
r = psProgram->GetPhase() == PSPHASE_PIXEL ? psProgram->GetCoarseR1() : psProgram->GetR1();
7859
+ isR1Lo = true;
7858
7860
}
7859
7861
r = m_currShader->GetVarHalf(r, 0);
7860
7862
CVariable* const coarsePixelSize = m_currShader->BitCast(r, ISA_TYPE_UB);
7863
+ if (isR1Lo && isCodePatchCandidate)
7864
+ {
7865
+ psProgram->AppendR1Lo(coarsePixelSize);
7866
+ }
7861
7867
m_encoder->SetSrcRegion(0, 0, 1, 0);
7862
7868
uint subReg;
7863
7869
{
@@ -7908,6 +7914,10 @@ void EmitPass::emitPSSGV(GenIntrinsicInst* inst)
7908
7914
CVariable* floatR1 = nullptr;
7909
7915
{
7910
7916
floatR1 = psProgram->BitCast(psProgram->GetR1(), ISA_TYPE_F);
7917
+ if (m_encoder->IsCodePatchCandidate())
7918
+ {
7919
+ psProgram->AppendR1Lo(floatR1);
7920
+ }
7911
7921
}
7912
7922
7913
7923
// Returns (x - xstart) or (y - ystart) in float.
@@ -8117,6 +8127,10 @@ void EmitPass::emitPSSGV(GenIntrinsicInst* inst)
8117
8127
m_encoder->SetSimdSize(simdSize);
8118
8128
m_encoder->SetMask(i == 0 ? EMASK_Q1 : EMASK_Q2);
8119
8129
m_encoder->SetDstSubVar(i);
8130
+ if (m_encoder->IsCodePatchCandidate())
8131
+ {
8132
+ psProgram->AppendR1Lo(src);
8133
+ }
8120
8134
m_encoder->Cast(dst, src);
8121
8135
m_encoder->Push();
8122
8136
}
@@ -8287,10 +8301,16 @@ void EmitPass::getPixelPosition(CVariable* destination, const uint component, bo
8287
8301
{
8288
8302
// Coarse pixel sizes are in R1 for both simd32 halves.
8289
8303
CVariable* r;
8304
+ bool isR1Lo = false;
8290
8305
{
8291
8306
r = m_currShader->GetVarHalf(psProgram->GetR1(), 0);
8307
+ isR1Lo = true;
8292
8308
}
8293
8309
CVariable* CPSize = m_currShader->BitCast(r, ISA_TYPE_UB);
8310
+ if (isR1Lo && isCodePatchCandidate)
8311
+ {
8312
+ psProgram->AppendR1Lo(CPSize);
8313
+ }
8294
8314
pixelSize =
8295
8315
m_currShader->GetNewVariable(
8296
8316
numLanes(m_currShader->m_SIMDSize), ISA_TYPE_UW, EALIGN_GRF, CName::NONE);
@@ -8325,6 +8345,7 @@ void EmitPass::getPixelPosition(CVariable* destination, const uint component, bo
8325
8345
if (isCodePatchCandidate)
8326
8346
{
8327
8347
m_encoder->SetPayloadSectionAsPrimary();
8348
+ psProgram->AppendR1Lo(position);
8328
8349
m_currShader->AddPatchTempSetup(destination);
8329
8350
}
8330
8351
m_encoder->Add(destination, position, pixelSize);
0 commit comments