forked from microsoft/DirectXShaderCompiler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Require outputtopology attribute on Hull shader
There was an existing check in DXIL validation that failed when the outputtopology was not set for a Hull shader. Rather than duplicate this check in the SPIR-V backend/validator, it seems correct to check that it is present in Sema. This PR needs review from someone who is more familiar with the HLSL spec for hull shaders to verify that this check is correct though. Fixes microsoft#3740
- Loading branch information
1 parent
79f55f2
commit 4e4fc65
Showing
5 changed files
with
23 additions
and
0 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
17 changes: 17 additions & 0 deletions
17
tools/clang/test/HLSLFileCheck/hlsl/functions/attribute/outputtopology_missing.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,17 @@ | ||
// RUN: %dxc -T hs_6_0 -E Hull %s | FileCheck %s | ||
|
||
struct ControlPoint { float4 position : POSITION; }; | ||
struct HullPatchOut { | ||
float edge [3] : SV_TessFactor; | ||
float inside : SV_InsideTessFactor; | ||
}; | ||
|
||
HullPatchOut HullConst (InputPatch<ControlPoint,3> v) { return (HullPatchOut)0; } | ||
|
||
//CHECK: error: hull entry point must have a valid outputtopology attribute | ||
|
||
[domain("tri")] | ||
[partitioning("fractional_odd")] | ||
[patchconstantfunc("HullConst")] | ||
[outputcontrolpoints(3)] | ||
ControlPoint Hull (InputPatch<ControlPoint,3> v, uint id : SV_OutputControlPointID) { return v[id]; } |
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