- Notifications
You must be signed in to change notification settings - Fork 803
[Diagnostics] Improve recursion diagnostics, specifically for library shaders #5858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bob80905 merged 19 commits into microsoft:staging-sm-6.8 from bob80905:recursive_functions_in_shader Nov 2, 2023
Merged
Changes from all commits
Commits
Show all changes
19 commits Select commit Hold shift + click to select a range
f819ecc add recursion check, fix up some typos, update tests
bob80905 607c6f3 cf relevant files
bob80905 006e78e cf once again
bob80905 9794954 remove extra qualifiers to remove compilation errors in macos/linux
bob80905 0b1a1b9 revert format changes to semadecl
bob80905 6c20e66 Merge branch 'staging-sm-6.8' of https://github.com/microsoft/DirectX…
bob80905 fb7fdae update diagnostic emission algorithm to use set instead of vector
bob80905 ced6adb update pcf diagnostic message
bob80905 96ae4b6 address all feedback, add test for missing pcf in library
bob80905 8cb1749 add recursive patch constant function in library test case
bob80905 4083366 address all but the Hungarian notation
bob80905 8665b37 cf
bob80905 25ea357 make variable name format consistently camel case
bob80905 564da0f comment out unused checkreachability function
bob80905 5588d29 completely remove function
bob80905 e88f5f8 add back reachability, test that pcf and entry fn don't reach each other
bob80905 845dcb4 prevent infinite recursion during check reachability
bob80905 a339241 move some tests to verifier tests
bob80905 0b24873 consistent %
bob80905 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
22 changes: 22 additions & 0 deletions 22 tools/clang/test/HLSLFileCheck/hlsl/functions/attribute/patch_constant_function_missing.hlsl
This file contains hidden or 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,22 @@ | ||
| // RUN: %dxc -T lib_6_5 %s | FileCheck %s | ||
| | ||
| | ||
| // actual selected HSPerPatchFunc1 for HSMain1 and HSMain3 | ||
| float4 fooey() | ||
| { | ||
| float4 e; | ||
| float4 d; | ||
| d.x = 4; | ||
| | ||
| return e; | ||
| } | ||
| | ||
| [shader("hull")] | ||
| // CHECK: error: patch constant function 'NotFooey' must be defined | ||
| [patchconstantfunc("NotFooey")] | ||
| float4 main(float a : A, float b:B) : SV_TARGET | ||
| { | ||
| float4 f = b; | ||
| return f; | ||
| } | ||
| |
42 changes: 42 additions & 0 deletions 42 tools/clang/test/HLSLFileCheck/hlsl/functions/recursion/entry_point_is_reachable.hlsl
This file contains hidden or 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,42 @@ | ||
| // RUN: %dxc -E HSmain -T hs_6_0 %s | FileCheck %s | ||
| | ||
| struct HSPerPatchData | ||
| { | ||
| float edges[3] : SV_TessFactor; | ||
| float inside : SV_InsideTessFactor; | ||
| }; | ||
| | ||
| [shader("hull")] | ||
| [domain("tri")] | ||
| [partitioning("fractional_odd")] | ||
| [outputtopology("triangle_cw")] | ||
| [outputcontrolpoints(3)] | ||
| [patchconstantfunc("patchfn")] | ||
| void HSmain(uint ix : SV_OutputControlPointID); | ||
| | ||
| | ||
| // actual selected HSPerPatchFunc1 for HSMain1 and HSMain3 | ||
| HSPerPatchData patchfn() | ||
| { | ||
| HSPerPatchData d; | ||
| | ||
| d.edges[0] = -5; | ||
| d.edges[1] = -6; | ||
| d.edges[2] = -7; | ||
| d.inside = -8; | ||
| // CHECK: error: entry function 'HSmain' should not be reachable from patch constant function 'patchfn' | ||
| HSmain(3); | ||
| return d; | ||
| } | ||
| | ||
| [shader("hull")] | ||
| [domain("tri")] | ||
| [partitioning("fractional_odd")] | ||
| [outputtopology("triangle_cw")] | ||
| [outputcontrolpoints(3)] | ||
| [patchconstantfunc("patchfn")] | ||
| void HSmain(uint ix : SV_OutputControlPointID) | ||
| { | ||
| return; | ||
| } | ||
| |
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.