-
Notifications
You must be signed in to change notification settings - Fork 25
[VULKAN] Add support for specialization constants #499
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?
Conversation
This commit introduces support for specialization constants in the Vulkan backend. Key changes: - Added struct to to represent a specialization constant with its ID, type, and value. - Updated YAML mapping in to parse specialization constants from the test configuration. - Modified to create and use when creating the compute pipeline, allowing specialization constants to be passed to the shader. - Added a new test case in to verify the functionality of specialization constants with various data types (bool, int, uint, float). Fixes llvm/llvm-project#142992
Keenuts
left a comment
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.
A small improvement on an error message, otherwise LGTM
| if (!SeenConstantIDs.insert(SpecConst.ConstantID).second) | ||
| return llvm::createStringError( | ||
| std::errc::invalid_argument, | ||
| "Specialization constant ID %u is already defined", |
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.
nit: would change the error to something more explicit about the location of the issue:
"YAML/config contains conflicting entries for constant ID %u"
(Looking at the test, the error could be interpreted as "we disallow constant ID reuse in the shader itself")
This commit introduces support for specialization constants in the Vulkan backend.
Key changes:
Fixes llvm/llvm-project#142992