Skip to content

Commit 5d742f7

Browse files
krystian-andrzejewskiigcbot
authored andcommitted
Fix copying uniform variables
This change is to fix copying uniform variables.
1 parent 9e2fefd commit 5d742f7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

IGC/Compiler/CISACodeGen/CShader.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3991,7 +3991,8 @@ void CShader::CopyVariableRaw(
39913991
CVariable* dst,
39923992
CVariable* src)
39933993
{
3994-
VISA_Type dataType = ISA_TYPE_UD;
3994+
// handle cases with uniform variables
3995+
VISA_Type dataType = dst->IsUniform() ? dst->GetType() : ISA_TYPE_UD;
39953996
uint dataTypeSizeInBytes = CEncoder::GetCISADataTypeSize(dataType);
39963997
uint offset = 0;
39973998
uint bytesToCopy = src->GetSize() * src->GetNumberInstance();
@@ -4001,7 +4002,8 @@ void CShader::CopyVariableRaw(
40014002
bool dstSeconfHalf = offset >= dst->GetSize();
40024003
bool srcSeconfHalf = offset >= src->GetSize();
40034004
encoder.SetSecondHalf(dstSeconfHalf || srcSeconfHalf);
4004-
SIMDMode simdMode = getGRFSize() == 64 ? SIMDMode::SIMD32 : SIMDMode::SIMD16;
4005+
SIMDMode simdMode = dst->IsUniform() ? SIMDMode::SIMD1 :
4006+
getGRFSize() == 64 ? SIMDMode::SIMD32 : SIMDMode::SIMD16;
40054007
uint movSize = numLanes(simdMode) * dataTypeSizeInBytes;
40064008
while (movSize > bytesToCopy ||
40074009
(!srcSeconfHalf && ((offset + movSize) > src->GetSize())) ||

0 commit comments

Comments
 (0)