-
Notifications
You must be signed in to change notification settings - Fork 17
Resource constructors proposal #197
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
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.
So I've tried to understand this, and maybe I've been reading it too quickly, but I don't understand how any of these non-default constructors would get called?
Right, I did not mention that. Only the default constructor call gets generated automatically by Clang. The others will be set up by Sema after processing the resource binding attribute, or a lack of it. Basically it will be changing:
|
Ah, thanks, that helps!
What will Sema use to identify things that need to be fixed up in this way? |
Sema detects whether a global variable is resource class by checking if the first field of the declaration is a resource handle. |
…ip the order of space and register
…sibly not needing __handle as builtin param
We already have `__builtin_hlsl_resource_getpointer` and we should follow the same pattern for other buildins related to resources. Renaming the builtins to: `__builtin_hlsl_resource_createpoisonhandle` `__builtin_hlsl_resource_createhandlefrombinding` `__builtin_hlsl_resource_createhandlefromimplicitbinding`
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 my untrained eye
Proposal for resource classes constructors.
Fixes #209