-
Notifications
You must be signed in to change notification settings - Fork 36
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
[0010] Define casting rules for vk::BufferPointer<T,A>
#44
Comments
If we use the idea for aliasing in #42 (comment). I would have no problem with adding a pointer cast. There is not type based aliasing in spir-v, so this should not cause any subtle and dangerous interactions because of the different types. If we go with @greg-lunarg's idea to add type based aliasing, then we will have to think carefully about this. My view would be to disallow it. |
Can we re-use syntax we're all familiar with? vk::BufferPointer<uint,4> pU;
auto pF = reinterpret_cast<vk::BufferPointer<float,4>>(pU); Then Also if |
Lets say I have a |
Based on requests from @natevm et al, I propose that we support a mechanism to cast from a uint64_t. The syntax would need to be able to specify the type that is being created. My preference would be the simple vk::BufferPointer<T,A>(u). |
You should be able to put the array in a struct, and then have a pointer to that struct.
|
Which proposal does this relate to?
0010-vk-buffer-ref.md
Describe the issue or outstanding question.
We need to define the casting rules and casting operators for
vk::BufferPointer<T,A>
objects. Completely off the top of my head, I think it would be beneficial to have avk::pointer_cast<>()
casting operator and enforce the legality of casts through the operator.Open to other suggestions and explorations.
Additional context
See initial review discussion.
The text was updated successfully, but these errors were encountered: