Conversation
158dedb to
9fed96c
Compare
6685477 to
d33c0ad
Compare
d33c0ad to
a43bd86
Compare
jimblandy
left a comment
There was a problem hiding this comment.
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
|
@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 |
jimblandy
left a comment
There was a problem hiding this comment.
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
|
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 <28601907+teoxoy@users.noreply.github.com>
|
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 |
cwfitzgerald
left a comment
There was a problem hiding this comment.
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.
Could you point out where metal requires this? For texture access I only see: |
This is a working naga 28 update. I noticed some tests haven't passed (specifically cargo test --all-features) since before 0.14, so this PR doesn't attempt to make them pass. ## enumerate_adaptors `instance.enumerate_adapters` is async now (and available on webgpu): gfx-rs/wgpu#8230 . more details in the wgpu release notes. ## ControlBarrier & MemoryBarrier Barrier was split in two to support MemoryBarriers: gfx-rs/wgpu#7630 From the PR, it seems like falling back to ControlBarrier is fine so that's what I did. ## Ray Query enable ray queries require `enable wgpu_ray_query;`: gfx-rs/wgpu#8545 This doesn't currently seem to make it through, and the relevant test fails. ## ImageAtomic Image atomics were added in gfx-rs/wgpu#6706 ## Mesh Shaders Mesh shaders are a major feature of wgpu 28, ~~but I've set their fields to None here in the interest of doing an upgrade and not a feature add at the same time~~ https://github.com/gfx-rs/wgpu/releases/tag/v28.0.0 update: I found some time and built a wgpu mesh/task shader demo and used that to validate some of the mesh shader functionality. I've used this to successfully compile a task shader with naga-oil and run it, but there's still something missing from the mesh shader module output here. --------- Co-authored-by: robtfm <50659922+robtfm@users.noreply.github.com>
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-emscriptencargo xtask testto run tests.CHANGELOG.md. See simple instructions inside file.