Skip to content

Commit bc7ac53

Browse files
krystian-andrzejewskiigcbot
authored andcommitted
Setup correct values of URB Info
If URB Info was not defined, set all properties based on existing instructions (SGVs and SIVs).
1 parent 69b34ec commit bc7ac53

File tree

4 files changed

+39
-1
lines changed

4 files changed

+39
-1
lines changed

IGC/Compiler/CISACodeGen/CollectGeometryShaderProperties.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,19 @@ void CollectGeometryShaderProperties::HandleSystemInput(llvm::GenIntrinsicInst&
147147
case CLIP_DISTANCE_Y:
148148
case CLIP_DISTANCE_Z:
149149
case CLIP_DISTANCE_W:
150+
m_gsProps.Input().PerVertex().HasVertexHeader(true);
150151
m_gsProps.Input().PerVertex().HasClipCullDistances(true);
151152
break;
152153

154+
case POSITION_X:
155+
case POSITION_Y:
156+
case POSITION_Z:
157+
case POSITION_W:
158+
m_gsProps.Input().PerVertex().HasVertexHeader(true);
159+
160+
case POINT_WIDTH:
161+
m_gsProps.Input().PerVertex().HasVertexHeader(true);
162+
153163
case GS_INSTANCEID:
154164
m_gsProps.Input().HasInstanceID(true);
155165
break;

IGC/Compiler/CISACodeGen/DomainShaderLowering.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,22 @@ namespace IGC
385385
if (usage == SHADER_OUTPUT_TYPE_CLIPDISTANCE_LO ||
386386
usage == SHADER_OUTPUT_TYPE_CLIPDISTANCE_HI)
387387
{
388+
context->getModuleMetaData()->URBInfo.hasVertexHeader = true;
389+
context->getModuleMetaData()->URBInfo.has64BVertexHeaderOutput = true;
388390
m_headerSize = QuadEltUnit(4);
389391
m_dsPropsPass->DeclareClipDistance();
390392
}
393+
else if (usage == SHADER_OUTPUT_TYPE_POSITION ||
394+
usage == SHADER_OUTPUT_TYPE_POINTWIDTH ||
395+
usage == SHADER_OUTPUT_TYPE_RENDER_TARGET_ARRAY_INDEX ||
396+
usage == SHADER_OUTPUT_TYPE_COARSE_PIXEL_SIZE)
397+
{
398+
context->getModuleMetaData()->URBInfo.hasVertexHeader = true;
399+
if (m_headerSize < QuadEltUnit(2))
400+
{
401+
m_headerSize = QuadEltUnit(2);
402+
}
403+
}
391404
}
392405
}
393406
}

IGC/Compiler/CISACodeGen/HullShaderLowering.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,10 @@ namespace IGC
758758

759759
auto clipCullAsInput = false;
760760
IGC::CodeGenContext* ctx = getAnalysis<CodeGenContextWrapper>().getCodeGenContext();
761-
if (ctx->getModuleMetaData()->URBInfo.has64BVertexHeaderInput) {
761+
if (ctx->getModuleMetaData()->URBInfo.has64BVertexHeaderInput)
762+
{
762763
// In case we have no linking information we need the URB header to have a fixed size
764+
IGC_ASSERT(ctx->getModuleMetaData()->URBInfo.hasVertexHeader);
763765
clipCullAsInput = true;
764766
}
765767

IGC/Compiler/CISACodeGen/VertexShaderLowering.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,9 +556,22 @@ namespace IGC
556556
if (usage == SHADER_OUTPUT_TYPE_CLIPDISTANCE_LO ||
557557
usage == SHADER_OUTPUT_TYPE_CLIPDISTANCE_HI)
558558
{
559+
m_context->getModuleMetaData()->URBInfo.hasVertexHeader = true;
560+
m_context->getModuleMetaData()->URBInfo.has64BVertexHeaderOutput = true;
559561
m_headerSize = QuadEltUnit(4);
560562
m_vsPropsPass->DeclareClipDistance();
561563
}
564+
else if (usage == SHADER_OUTPUT_TYPE_POSITION ||
565+
usage == SHADER_OUTPUT_TYPE_POINTWIDTH ||
566+
usage == SHADER_OUTPUT_TYPE_RENDER_TARGET_ARRAY_INDEX ||
567+
usage == SHADER_OUTPUT_TYPE_COARSE_PIXEL_SIZE)
568+
{
569+
m_context->getModuleMetaData()->URBInfo.hasVertexHeader = true;
570+
if (m_headerSize < QuadEltUnit(2))
571+
{
572+
m_headerSize = QuadEltUnit(2);
573+
}
574+
}
562575
}
563576
}
564577
}

0 commit comments

Comments
 (0)