-
Notifications
You must be signed in to change notification settings - Fork 34
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] Address writability of vk::BufferPointer<T,A>
pointees
#41
Comments
The client I am proposing this for is only interested in reading the pointee. But I am guessing there is interest in writing as well. Still, it would be good to have at least one real live potential buffer pointer user testify that they want to write. @natevm, do you want to be able to write to the pointee? |
Yeah, my end users at Argonne labs both read and write to pointers throughout all our Vulkan accelerated projects. |
While I appreciate that you have your priorities and that your client probably ranks up there... We should consider the applications of the feature and how they might be useful to a wider audience. |
My point was only that I couldn't recall seeing a request to write to a pointee. I always like to make sure I have at least one customer before I create a capability :) |
I'd definitely be interested in the optimizer optimizing away stores on variables which have not changed, i.e. struct Joint
{
float3x4 relativeTForm;
vk::BufferPointer<Joint> parent;
uint modifiedStamp;
uint recomputedStamp;
float3x4 absoluteTForm;
};
...
Joint tmp = ptr.get();
tmp.absoluteTForm = special_mul(tmp.parent.get().absoluteTForm,tmp.relativeTForm);
tmp.recomputedStamp = tmp.modifiedStamp;
ptr.get() = tmp; I'd expect this to only store the modified fields after inlining and optimization. |
Prefacing with: We should not specify optimization behavior in the spec. The spec needs to document the language behavior, optimizations need to be spec-conforming and are implementation defined. I would expect optimizers to remove stores to non-written fields if it is safe to do so, but given the example above, optimizing stores may not be safe depending on memory access and aliasing rules (which we haven’t yet fully defined). If a Since In HLSL 202x with user-defined references, you could write the code instead to write back to the |
Given the response from @natevm et al, I will add some language to the proposal that writes of pointees is supported. |
* Add writability to vk::BufferPointer pointees Fixes #41 * Add example of write through vk::BufferPointer * Add SPIR-V for write through buffer pointer.
Which proposal does this relate to?
0010-vk-buffer-ref.md
Describe the issue or outstanding question.
The spec mentions
vk::RawBufferStore
, but doesn't explicitly clarify if or how writing through avk::BufferPointer<T,A>
is supported. We should clarify this case.If writing through
vk::BufferPointer<T,A>
is allowed we also need to spec how this works with HLSL's copy-in/copy-out paramter passing as well as pointer address spacing.Additional context
See initial review discussion.
The text was updated successfully, but these errors were encountered: