Skip to content

Commit 3613039

Browse files
jsantillan2017sys_zuul
authored andcommitted
Propogate numInstance of original resource variable to new resource variable. If numInstance is equal to 2, generate another cast for other half.
Change-Id: Idca7d5d5919fe26db2225af4a5ecdcfc23a221cb
1 parent c73ac48 commit 3613039

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14580,12 +14580,23 @@ ResourceDescriptor EmitPass::GetResourceVariable(Value* resourcePtr)
1458014580
if (resource.m_resource->GetElemSize() < 4)
1458114581
{
1458214582
// vISA assumes all BTIs to be 32 bit. Need to cast, otherwise higher bits would be uninitialized.
14583+
unsigned numInstance = resource.m_resource->GetNumberInstance();
1458314584
CVariable* newResource = m_currShader->GetNewVariable(
1458414585
resource.m_resource->GetNumberElement(),
1458514586
ISA_TYPE_UD,
1458614587
resource.m_resource->IsUniform() ? EALIGN_DWORD : EALIGN_GRF,
14587-
resource.m_resource->IsUniform());
14588+
resource.m_resource->IsUniform(),
14589+
numInstance);
14590+
1458814591
m_encoder->Cast(newResource, resource.m_resource);
14592+
14593+
if (numInstance == 2)
14594+
{
14595+
m_encoder->SetSecondHalf(!m_encoder->IsSecondHalf());
14596+
m_encoder->Cast(newResource, resource.m_resource);
14597+
m_encoder->SetSecondHalf(!m_encoder->IsSecondHalf());
14598+
}
14599+
1458914600
resource.m_resource = newResource;
1459014601
}
1459114602

0 commit comments

Comments
 (0)