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

Distinguish STORAGE from STORAGE_READ_WRITE image feature #3559

Merged
merged 4 commits into from
Jan 3, 2021

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Dec 29, 2020

Implemented for Vulkan/DX12/DX11.
In Vulkan, storage image implies simultaneous read/write access.
Other APIs in contrast may allow STORAGE writeonly while disallowing reading.

Related to gfx-rs/wgpu#1109 - native extension for for read+write storage textures in wgpu native; following comments on the PR I'm redoing it and would need to add this to the hal api.

PR checklist:

  • make succeeds (on *nix)
  • make reftests succeeds
  • tested examples with the following backends:
    • Vulkan/DX12/DX11
    • did a dump of storage/storage-atomic/storage-rw flags each and eyeballed it as a sanity check

@Wumpf Wumpf marked this pull request as ready for review December 30, 2020 10:46
Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for doing this, much needed for good wgpu support!

src/hal/src/format.rs Outdated Show resolved Hide resolved
src/hal/src/format.rs Outdated Show resolved Hide resolved
@Wumpf Wumpf requested a review from kvark January 2, 2021 09:07
src/hal/src/format.rs Outdated Show resolved Hide resolved
src/hal/src/format.rs Outdated Show resolved Hide resolved
@Wumpf Wumpf requested a review from kvark January 3, 2021 10:53
Wumpf added 4 commits January 3, 2021 16:28
Implemented for Vulkan/DX12/DX11
In Vulkan, storage image implies simultaneous read/write access.
Other APIs in contrast may allow STORAGE writeonly while disallowing reading.
@Wumpf Wumpf force-pushed the distinguish-rw-storage-texture branch from 5ee7d53 to 8b902f5 Compare January 3, 2021 15:35
Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!
bors r+

@bors
Copy link
Contributor

bors bot commented Jan 3, 2021

@bors bors bot merged commit 187197d into gfx-rs:master Jan 3, 2021
bors bot added a commit to gfx-rs/wgpu that referenced this pull request Jan 6, 2021
1112: Expose adapter specific formats features via Extension, support for storage read+write r=kvark a=Wumpf

**Connections**
Draft until gfx-rs/gfx#3559 landed (then update and comment two lines in)
New & improved replacement for #1109

PR for wgpu-rs to be opened once there's some confidence that this is that it should look like. [Preview](https://github.com/gfx-rs/wgpu-rs/compare/master...Wumpf:texture-format-feature-query?expand=1)

**Description**
Adapter exposes now per texture format specific features. Feature struct defined as allowed usages + flags. Flags describe only storage texture usage so far.

Query not used for validation unless `TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES` feature is enabled on a device. Otherwise uses hardcoded feature set guaranteed by webgpu.
Storage read/write binding can then be used as a consequence (storage atomic has no effect yet).

**Testing**
Manual testing with my fluid sim project through wgpu-rs which covers storage r/w for a few different formats and storage in general for formats that don't support this usage by default at all.
Ran tests and a couple of samples to see if anything broke with the feature disabled.

Co-authored-by: Andreas Reich <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants