Skip to content

Commit

Permalink
[Dump] Fix PSV dump issues. (#6881)
Browse files Browse the repository at this point in the history
1. Number of SemanticIndex should match number of rows instead of number
of columns.
2. Mesh shader could have ViewID mask for Primitive output.

For #6817.
  • Loading branch information
python3kgae authored Aug 28, 2024
1 parent 6227e57 commit 6c99ecf
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 33 deletions.
4 changes: 2 additions & 2 deletions lib/DxilContainer/DxilPipelineStateValidation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ void PSVSignatureElement::Print(raw_ostream &OS) const {
OS << " SemanticName: " << GetSemanticName() << "\n";
OS << " SemanticIndex: ";
const uint32_t *SemanticIndexes = GetSemanticIndexes();
for (unsigned i = 0; i < GetCols(); ++i) {
for (unsigned i = 0; i < GetRows(); ++i) {
OS << *(SemanticIndexes + i) << " ";
}
OS << "\n";
Expand Down Expand Up @@ -880,7 +880,7 @@ void DxilPipelineStateValidation::Print(raw_ostream &OS,
ViewIDMask.Print(OS, "ViewID", OutputSetName.c_str());
}

if (IsHS()) {
if (IsHS() || IsMS()) {
OS << "PCOutputs affected by ViewID as a bitmask:\n";
uint8_t OutputVectors = m_pPSVRuntimeInfo1->SigPatchConstOrPrimVectors;
const PSVComponentMask ViewIDMask(m_pViewIDPCOrPrimOutputMask,
Expand Down
14 changes: 7 additions & 7 deletions tools/clang/test/DXC/dumpPSV_DS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// CHECK-NEXT: ResourceCount : 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName:
// CHECK-NEXT: SemanticIndex: 0 0 1 2
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 0
// CHECK-NEXT: StartCol: 0
Expand All @@ -33,7 +33,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName: TEXCOORD
// CHECK-NEXT: SemanticIndex: 0 0
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 1
// CHECK-NEXT: StartCol: 0
Expand All @@ -46,7 +46,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName: NORMAL
// CHECK-NEXT: SemanticIndex: 0 0 1
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 2
// CHECK-NEXT: StartCol: 0
Expand All @@ -72,7 +72,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName:
// CHECK-NEXT: SemanticIndex: 0 0 1 2
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 0
// CHECK-NEXT: StartCol: 0
Expand All @@ -85,7 +85,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName: TEXCOORD
// CHECK-NEXT: SemanticIndex: 0 0
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 1
// CHECK-NEXT: StartCol: 0
Expand All @@ -98,7 +98,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName: NORMAL
// CHECK-NEXT: SemanticIndex: 0 0 1
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 2
// CHECK-NEXT: StartCol: 0
Expand All @@ -124,7 +124,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName:
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: SemanticIndex: 0 1 2
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 0
// CHECK-NEXT: StartCol: 3
Expand Down
10 changes: 5 additions & 5 deletions tools/clang/test/DXC/dumpPSV_GS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
// CHECK-NEXT: ResFlags: None
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName: POSSIZE
// CHECK-NEXT: SemanticIndex: 0 16 1
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 0
// CHECK-NEXT: StartCol: 0
Expand All @@ -43,7 +43,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName: COLOR
// CHECK-NEXT: SemanticIndex: 0 16 1 0
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 1
// CHECK-NEXT: StartCol: 0
Expand All @@ -69,7 +69,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName: TEXCOORD
// CHECK-NEXT: SemanticIndex: 0 16
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 0
// CHECK-NEXT: StartCol: 0
Expand All @@ -82,7 +82,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName: COLOR
// CHECK-NEXT: SemanticIndex: 0 16 1 0
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 1
// CHECK-NEXT: StartCol: 0
Expand All @@ -95,7 +95,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName:
// CHECK-NEXT: SemanticIndex: 0 16 1 0
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 2
// CHECK-NEXT: StartCol: 0
Expand Down
14 changes: 7 additions & 7 deletions tools/clang/test/DXC/dumpPSV_HS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// CHECK-NEXT: ResourceCount : 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName:
// CHECK-NEXT: SemanticIndex: 0 0 1 2
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 0
// CHECK-NEXT: StartCol: 0
Expand All @@ -36,7 +36,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName: TEXCOORD
// CHECK-NEXT: SemanticIndex: 0 0
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 1
// CHECK-NEXT: StartCol: 0
Expand All @@ -49,7 +49,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName: NORMAL
// CHECK-NEXT: SemanticIndex: 0 0 1
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 2
// CHECK-NEXT: StartCol: 0
Expand All @@ -62,7 +62,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName:
// CHECK-NEXT: SemanticIndex: 0 0 1 2
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 0
// CHECK-NEXT: StartCol: 0
Expand All @@ -75,7 +75,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName: TEXCOORD
// CHECK-NEXT: SemanticIndex: 0 0
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 1
// CHECK-NEXT: StartCol: 0
Expand All @@ -88,7 +88,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName: NORMAL
// CHECK-NEXT: SemanticIndex: 0 0 1
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 2
// CHECK-NEXT: StartCol: 0
Expand All @@ -101,7 +101,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName:
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: SemanticIndex: 0 1 2
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 0
// CHECK-NEXT: StartCol: 3
Expand Down
8 changes: 5 additions & 3 deletions tools/clang/test/DXC/dumpPSV_MS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// CHECK-NEXT: ResourceCount : 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName:
// CHECK-NEXT: SemanticIndex: 0 0 1 2
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 0
// CHECK-NEXT: StartCol: 0
Expand All @@ -34,7 +34,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName: COLOR
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: SemanticIndex: 0 1 2 3
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 1
// CHECK-NEXT: StartCol: 0
Expand Down Expand Up @@ -99,7 +99,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName: LAYER
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: SemanticIndex: 0 1 2 3 4 5
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 1
// CHECK-NEXT: StartCol: 0
Expand All @@ -125,6 +125,8 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: Outputs affected by ViewID as a bitmask for stream 0:
// CHECK-NEXT: ViewID influencing Outputs[0] : 0 1 2 3 4 8 12 16
// CHECK-NEXT: PCOutputs affected by ViewID as a bitmask:
// CHECK-NEXT: ViewID influencing PCOutputs : None
// CHECK-NEXT: Outputs affected by inputs as a table of bitmasks for stream 0:
// CHECK-NEXT: Inputs contributing to computation of Outputs[0]: None

Expand Down
6 changes: 3 additions & 3 deletions tools/clang/test/DXC/dumpPSV_PS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
// CHECK-NEXT: ResFlags: None
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName: NORMAL
// CHECK-NEXT: SemanticIndex: 0 16 1
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 0
// CHECK-NEXT: StartCol: 0
Expand All @@ -55,7 +55,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName: TEXCOORD
// CHECK-NEXT: SemanticIndex: 0 16
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 1
// CHECK-NEXT: StartCol: 0
Expand All @@ -68,7 +68,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName:
// CHECK-NEXT: SemanticIndex: 0 16 1 0
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 0
// CHECK-NEXT: StartCol: 0
Expand Down
12 changes: 6 additions & 6 deletions tools/clang/test/DXC/dumpPSV_VS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// CHECK-NEXT: ResFlags: None
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName: POSITION
// CHECK-NEXT: SemanticIndex: 0 16 1
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 0
// CHECK-NEXT: StartCol: 0
Expand All @@ -40,7 +40,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName: NORMAL
// CHECK-NEXT: SemanticIndex: 0 16 1
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 1
// CHECK-NEXT: StartCol: 0
Expand All @@ -53,7 +53,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName: TEXCOORD
// CHECK-NEXT: SemanticIndex: 0 16
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 2
// CHECK-NEXT: StartCol: 0
Expand All @@ -66,7 +66,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName: NORMAL
// CHECK-NEXT: SemanticIndex: 0 16 1
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 0
// CHECK-NEXT: StartCol: 0
Expand All @@ -79,7 +79,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName: TEXCOORD
// CHECK-NEXT: SemanticIndex: 0 16
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 1
// CHECK-NEXT: StartCol: 0
Expand All @@ -92,7 +92,7 @@
// CHECK-NEXT: DynamicIndexMask: 0
// CHECK-NEXT: PSVSignatureElement:
// CHECK-NEXT: SemanticName:
// CHECK-NEXT: SemanticIndex: 0 16 1 0
// CHECK-NEXT: SemanticIndex: 0
// CHECK-NEXT: IsAllocated: 1
// CHECK-NEXT: StartRow: 2
// CHECK-NEXT: StartCol: 0
Expand Down

0 comments on commit 6c99ecf

Please sign in to comment.