-
Notifications
You must be signed in to change notification settings - Fork 973
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
Image atomics support #6706
Image atomics support #6706
Conversation
158dedb
to
9fed96c
Compare
6685477
to
d33c0ad
Compare
d33c0ad
to
a43bd86
Compare
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.
I started reviewing with the Naga IR, and found something that should be addressed.
@atlv24 I appreciate the docs! |
This comment was marked as outdated.
This comment was marked as outdated.
a43bd86
to
5bb6d54
Compare
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.
Some more requests.
@jimblandy what did you force push may i ask? and thanks for the review! |
Just changing I always feel bad asking people to change stuff like that because it's trivial, so I just fix it myself, amend to keep the PR review a single commit, and force push. If you'd rather I not amend, that's fine. (And if you'd rather I make lots of minor change requests, I could do that too, but...) |
nah its fine, was just curious. i can't see the diff and visual inspection yielded nothing |
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.
In Validator::validate_entry_point
, we have the following code:
let allowed_usage = match var.space {
...
crate::AddressSpace::Private | crate::AddressSpace::WorkGroup => GlobalUse::all(),
...
};
By adding ATOMIC
to GlobalUse
, this became incorrect: atomic accesses to Private
address space variables isn't permitted.
I think using atomics in local variables is already covered by Validator::validate_local_var
, but validate_entry_point
should still not say strange things.
@atlv24 If it's ok, since I've requested some non-trivial changes, rather than finishing this review, I'm going to go review some other, simpler PRs first, and then come back to this one once you've got it revised. |
@jimblandy thats fine. I am unsure how to remove the sample expression handle from the naga ir, because of the way spir-v wants to write cached expressions. before i added that field, i had tried for quite a while and not found a way to generate it on the fly once, so i settled on the dumb and simple solution. |
@atlv24 If you call |
26598f2
to
00b45cc
Compare
@jimblandy resolved all feedback |
6c2359a
to
5a4b0a8
Compare
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.
Alright, we're getting close on the wgpu side.
I think we need some wgpu runtime tests of specifically the validation of:
- Texture Usages
- Wgpu Features
To ensure that they are correctly validated out when the features aren't enabled.
Besides the few comments I left, the naga side of this looks good to me. |
A design question that shouldn't block this PR is: Is it necessary to have an |
Co-authored-by: Teodor Tanasoaia <[email protected]>
Its needed because Metal needs atomic usage to be marked as a texture usage, and if we dont have the shader specify that a texture will be used atomically then we dont have a way to validate metal usage |
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.
Alright, approving wgpu side.
I've also done a review of the naga side and I had a few comments, but everything looks fine @teoxoy can you just make sure that I didn't miss anything, then we can get this in.
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.
LGTM
Could you point out where metal requires this? For texture access I only see:
|
Connections
Broken off from #5537
Description
Adds image atomics to Vulkan, DirectX, and Metal backends.
Testing
naga snapshot tests and runtime tests are included
Checklist
cargo fmt
.taplo format
.cargo clippy
. If applicable, add:--target wasm32-unknown-unknown
--target wasm32-unknown-emscripten
cargo xtask test
to run tests.CHANGELOG.md
. See simple instructions inside file.