-
Notifications
You must be signed in to change notification settings - Fork 692
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace reachable llvm_unreachable with errors in HLSignatureLower
Constrain IA signature allocation to legal bounds.
- Loading branch information
Showing
6 changed files
with
97 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
tools/clang/test/HLSLFileCheck/hlsl/diagnostics/errors/ia_sig_too_large.hlsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// RUN: %dxc -E main -T vs_6_0 %s | FileCheck %s | ||
|
||
// Expect error when the Input Assembler (vertex input) signature is too large | ||
// CHECK: error: Failed to allocate all input signature elements in available space. | ||
|
||
struct VSIN { | ||
float4 pos : Position; | ||
float array1[30] : ARRAY1; | ||
float array2[2] : ARRAY2; | ||
}; | ||
|
||
float4 main(VSIN In) : SV_Position { | ||
return In.pos; | ||
} |
11 changes: 11 additions & 0 deletions
11
...s/clang/test/HLSLFileCheck/hlsl/diagnostics/errors/invalid_interpolation_sv_position.hlsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s | ||
|
||
// CHECK: error: invalid interpolation mode for SV_Position | ||
|
||
struct PSIN { | ||
nointerpolation float4 pos : SV_Position; | ||
}; | ||
|
||
float main(PSIN In) : SV_Target{ | ||
return In.pos.x; | ||
} |
15 changes: 15 additions & 0 deletions
15
tools/clang/test/HLSLFileCheck/hlsl/diagnostics/errors/output_sig_too_large.hlsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// RUN: %dxc -E main -T vs_6_0 %s | FileCheck %s | ||
|
||
// Expect error when the output signature is too large | ||
// CHECK: error: Failed to allocate all output signature elements in available space. | ||
|
||
struct VSOUT { | ||
float4 pos : SV_Position; | ||
float4 array1[30] : BIGARRAY; | ||
float4 array2[2] : SMALLARRAY; | ||
}; | ||
|
||
VSOUT main() { | ||
VSOUT Out = (VSOUT)0; | ||
return Out; | ||
} |
39 changes: 39 additions & 0 deletions
39
tools/clang/test/HLSLFileCheck/hlsl/diagnostics/errors/pc_sig_too_large.hlsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// RUN: %dxc -E main -T hs_6_0 %s | FileCheck %s | ||
|
||
// Expect error when the patch constant signature is too large | ||
// CHECK: error: Failed to allocate all patch constant signature elements in available space. | ||
|
||
#define NumOutPoints 2 | ||
|
||
struct HsCpIn { | ||
float4 pos : SV_Position; | ||
}; | ||
|
||
struct HsCpOut { | ||
float4 pos : SV_Position; | ||
}; | ||
|
||
struct HsPcfOut | ||
{ | ||
float tessOuter[4] : SV_TessFactor; | ||
float tessInner[2] : SV_InsideTessFactor; | ||
float4 array1[25] : BIGARRAY; | ||
float4 array2[2] : SMALLARRAY; | ||
}; | ||
|
||
HsPcfOut pcf(InputPatch<HsCpIn, NumOutPoints> patch, uint patchId : SV_PrimitiveID) { | ||
HsPcfOut output = (HsPcfOut)0; | ||
return output; | ||
} | ||
|
||
[patchconstantfunc("pcf")] | ||
[domain("quad")] | ||
[partitioning("fractional_odd")] | ||
[outputtopology("triangle_ccw")] | ||
[outputcontrolpoints(NumOutPoints)] | ||
HsCpOut main(InputPatch<HsCpIn, NumOutPoints> patch, | ||
uint cpId : SV_OutputControlPointID, | ||
uint patchId : SV_PrimitiveID) { | ||
HsCpOut output = (HsCpOut)0; | ||
return output; | ||
} |