- 
        Couldn't load subscription status. 
- Fork 802
Allows Vulkan spec constants as attribute arguments. #7439
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
8e898bf
              27547de
              a9e9d4b
              eb2dc82
              423617d
              793f8f1
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|  | @@ -328,6 +328,19 @@ class CGMSHLSLRuntime : public CGHLSLRuntime { | |||||||
| }; | ||||||||
| } // namespace | ||||||||
|  | ||||||||
| static uint32_t GetIntConstAttrArg(ASTContext &astContext, const Expr *expr, | ||||||||
| uint32_t defaultVal = 0) { | ||||||||
|          | ||||||||
| uint32_t defaultVal = 0) { | |
| uint32_t defaultVal) { | 
Doesn't look like this is ever called without a default value.
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.
I've changed this to use llvm::Optional so that an absent default indicates that expr should be non-null. (See note on SemaHLSL below.)
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.
| } | |
| llvm_unreachable("Expression must be a constant expression or spec constant") | |
| } | 
We should be erroring in Sema if this isn't a constant expression or spec constant.
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.
Changed as suggested.
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.
You've got a fair amount of mixing coding style, and DXC is a bit inconsistent.
In general if you're adding code in a part of the codebase that isn't otherwise following a consistent style we follow the LLVM Coding Standards. LLVM uses
CamelCasefor variable names and type names (see: https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly).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.
Done.