-
Notifications
You must be signed in to change notification settings - Fork 977
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
[DX12] Readonly StorageTexture binding does not create UAV binding #574
Comments
Probably related to KhronosGroup/SPIRV-Cross#1306, we might just need to update spirv_cross to use this flag |
Oh snap, I thought this is already the way it works. I recall working on it in gfx-rs/gfx#3176 and testing on gfx-ocean, which uses a bunch of read-only descriptors now 🤔 |
Is this still an issue on master? |
Looking at your repro closely it looks like you are creating a bind group that doesn't match the bind group layout (layout has one binding, bind group has none) so I'm going to call this closed for now, if you have an updated example that still has this problem, feel free to reopen! |
apologies for not following up on this one. Thanks for digging in and pointing out that mistake! |
574: Implement AsRef for BufferView r=kvark a=de-vri-es This PR implements `AsRef` and `AsMut` in addition to `Deref` and `DerefMut` for `BufferView` and `BufferViewMut`. This allows the buffer views to be used directly by generic code that wants an `AsRef<[u8]>`. It's also subjectively a small win when you want to pass the views to non-generic code. I find `buffer.as_ref()` clearer than `&*buffer`. That also goes for `buffer.deref()`, but `Deref` is not in the prelude. Co-authored-by: Maarten de Vries <[email protected]>
Minimal repro here:
Wumpf/wgpu-rs@a00e08c
Note that this builds on top of the fix from #572/#573 - haven't tried again, but I'm quite sure the particular case would work before the fix.
Steps:
uniform readonly image2D
image. Note that you actually need to use the image, otherwise DX validation layer won't complain (does not influence hlsl conversion though).This is translated in hlsl to a RWTexture2D image, so a UAV, not a SRV as one might expect!
Without diving into wgpu/gfx-hal it looks like either a UAV binding is simply missing or the assumption was that the HLSL shader wouldn't use a UAV to begin with? Arguably it would have made more sense if it would convert everything to a SRV and changes the respective loads to
texture.Load
Full converted hlsl shader code from the example repro for reference:
The text was updated successfully, but these errors were encountered: