Skip to content
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 vk::BufferPointer pointee atomics #88

Closed
llvm-beanz opened this issue Sep 6, 2023 · 5 comments · Fixed by #136
Closed

[0010] Define vk::BufferPointer pointee atomics #88

llvm-beanz opened this issue Sep 6, 2023 · 5 comments · Fixed by #136
Assignees
Labels
language-spec Issue with completed spec

Comments

@llvm-beanz
Copy link
Collaborator

Which document does this relate to?
Proposal 0010 - vk::BufferPointer

Describe the issue you see with the spec
vk::BufferPointer::Get returns a reference. Can this reference be used with atomics?

Additional context
See comment here

@llvm-beanz llvm-beanz added the language-spec Issue with completed spec label Sep 6, 2023
@devshgraphicsprogramming

I think what me, @Ipotrick and @Dolkar are getting at is more along the lines, can the reference be used as an inline-spirv function argument declared with [vk::ext_reference]

I don't think the ability to just be able to pass the immediate result of Get to InterlockedAdd and friends will make us happy.

@llvm-beanz
Copy link
Collaborator Author

@devshgraphicsprogramming, that's completely separate from what this issue is tracking. The intent of this issue is to track defining how vk::BufferPointer will interact with the current atomic operations. How it will interact with other Vulkan extensions is something we should track and discuss elsewhere.

I may have confused you by the comment that I linked to, but I think there are multiple issues here that need to be tracked and discussed separately.

@llvm-beanz llvm-beanz self-assigned this Sep 8, 2023
@llvm-beanz
Copy link
Collaborator Author

@greg-lunarg, I'm going to put this one on my plate at least to start with. It relates to #89, and I have some questions I want to sort out relating to the address spacing of the references these APIs will return.

@devshgraphicsprogramming

Can we make it the job of SPIR-V intrinsics (proposal 0011) to provide the atomics?

@s-perron
Copy link
Collaborator

s-perron commented Dec 6, 2023

I think what me, @Ipotrick and @Dolkar are getting at is more along the lines, can the reference be used as an inline-spirv function argument declared with [vk::ext_reference]

Yes it can. We could try calling that out explicitly.

I don't think the ability to just be able to pass the immediate result of Get to InterlockedAdd and friends will make us happy.

What more do you need? Is this because you want to pass the members. You should be able to do write:

InterlockedAdd(bufferPointer.Get().x, 1, orig);

This will do an atomic operation on the member. From a language perspective, this falls out natually because the dot operation on an lvalue returns another lvalue. We should call this out explicitly, and make sure we have a test for it in the implementation.

llvm-beanz added a commit to llvm-beanz/hlsl-specs that referenced this issue Dec 7, 2023
This clarifies any ambiguity around atomic operations.

Fixes microsoft#88
llvm-beanz added a commit to llvm-beanz/hlsl-specs that referenced this issue Dec 7, 2023
This clarifies any ambiguity around atomic operations.

Fixes microsoft#88
llvm-beanz added a commit that referenced this issue Dec 18, 2023
This clarifies any ambiguity around atomic operations.

Fixes #88
@github-project-automation github-project-automation bot moved this from Backlog to Done in HLSL Language Features Dec 18, 2023
llvm-beanz added a commit to llvm-beanz/hlsl-specs that referenced this issue Feb 9, 2025
This clarifies any ambiguity around atomic operations.

Fixes microsoft#88
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language-spec Issue with completed spec
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants