-
Notifications
You must be signed in to change notification settings - Fork 246
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
Simplify CapabilitySet
Diagnostic Printing
#4678
Simplify CapabilitySet
Diagnostic Printing
#4678
Conversation
Made the following changes: 1. All capability diagnostic printing logic tries to simplify before printing This means that we do not print atoms which imply another atom. 2. Don't print the `_` prefix part of atom names since it is misleading users on what they should use to solve a capability issue encountered.
I think there is another opportunity for simplification: when complaining that two caoapbility sets are incompatible, we can just print the "key" atoms in both sets instead of everything. Because only the key atoms are causing the incompatiblity. |
100% agree, I think I will put this change in a separate PR more geared-towards solving #4443. The issue #4683 I think I will also add a method to print sets (where the only difference is a shader stage) in the form of "vertex/fragment {capabilities}". This would be quite useful since normally capabilities overlap across stages, This change will be in this PR since it touches the same code. |
…/github.com/ArielG-NV/slang into implied-atom-removal-from-diagnostic-prints
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
But the new message is still not clear to me of what is wrong.
source/slang/slang-diagnostic-defs.h
Outdated
@@ -737,8 +737,8 @@ DIAGNOSTIC(41001, Error, recursiveType, "type '$0' contains cyclic reference to | |||
|
|||
DIAGNOSTIC(41010, Warning, missingReturn, "control flow may reach end of non-'void' function") | |||
DIAGNOSTIC(41011, Error, profileIncompatibleWithTargetSwitch, "__target_switch has no compatable target with current profile '$0'") | |||
DIAGNOSTIC(41012, Warning, profileImplicitlyUpgraded, "user set `profile` had an implicit upgrade applied to it, atoms added: '$0'") | |||
DIAGNOSTIC(41012, Error, profileImplicitlyUpgradedRestrictive, "user set `profile` had an implicit upgrade applied to it, atoms added: '$0'") | |||
DIAGNOSTIC(41012, Warning, profileImplicitlyUpgraded, "user set profile $0 had an implicit upgrade applied to it, atoms added: '$1'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"shader '$0' uses additional capabilities that are not part of the specified profile '$1'. The profile setting is automatically updated to include these capabilities: '$2'"
source/slang/slang-diagnostic-defs.h
Outdated
DIAGNOSTIC(41012, Warning, profileImplicitlyUpgraded, "user set `profile` had an implicit upgrade applied to it, atoms added: '$0'") | ||
DIAGNOSTIC(41012, Error, profileImplicitlyUpgradedRestrictive, "user set `profile` had an implicit upgrade applied to it, atoms added: '$0'") | ||
DIAGNOSTIC(41012, Warning, profileImplicitlyUpgraded, "user set profile $0 had an implicit upgrade applied to it, atoms added: '$1'") | ||
DIAGNOSTIC(41012, Error, profileImplicitlyUpgradedRestrictive, "user set profile $0 had an implicit upgrade applied to it, atoms added: '$1'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"shader '$0' uses capabilities that are not part of the specified profile '$1'. Missing capabilities are: '$2'"
This is a problem I should fix in this PR, otherwise this PR has no value in changing error/warning messages.
so what this means is the following code:
will output the following if compiled to
|
Sorry. I clicked a wrong button and accidently closed it; but reopened it right away. |
This error message looks great. |
1. cheaper collection 2. don't give assumptions of problems, find the actual decl with incorrect capabilities. 3. change warning/error format to be more readable/useful
…/github.com/ArielG-NV/slang into implied-atom-removal-from-diagnostic-prints
Fixes: #4675
Fixes: #4683
Fixes: #4443
Fixes: #4585
Fixes: #4172
Made the following changes:
_
prefix part of atom names since it is misleading users on what they should use to solve a capability issue encountered. (_Internal
External
atom changes are not in this PR)vertex/fragment/hull/domain/... + glsl
instead ofvertex + glsl | fragment + glsl | hull + glsl | domain + glsl | ....
CapabilityAtom
comes from. This heavily simplifies AST logic for the capability system. AST parsing of capabilities is much faster. The trade-off is faster AST parsing and correct AST node data for slower diagnostics if an error is foundcase 1 of example output which needs to be addressed (test
capabilitySimplification1.slang
):case 1 now:
case 2 of what needs to be addressed (test
capability7.slang
):case 2 now:
case 3 of what needs to be addressed (test
capabilitySimplification2.slang
):case 3 now