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

[shaders] Option to force read_write access mode on all storage bindings #364

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

armansito
Copy link
Collaborator

Introduced the force_rw_storage feature which applies a transformation that converts all read-only storage bindings to have the read_write access mode.

This is being provided as an optional preprocessor transformation to work around the WebGPU standard's limitation on mixed storage-read and storage usages by a GPU program over the same buffer object (see https://www.w3.org/TR/webgpu/#programming-model-resource-usages).

This limitation makes the WGSL shaders incompatible with (Skia) Graphite's sub-allocating buffer manager when they are run on its Dawn backend. This workaround will be removed once Graphite's buffer management system supports whole buffer bindings.

Copy link
Contributor

@raphlinus raphlinus left a comment

Choose a reason for hiding this comment

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

It feels hacky, so I'm glad there's a plan to remove it, but if it unblocks integration work I'm ok with it.

crates/shaders/src/compile/preprocess.rs Outdated Show resolved Hide resolved
@raphlinus
Copy link
Contributor

The CI problem was fixed by the #360 merge. If you merge or rebase against that, it should clear it up.

Introduced the `force_rw_storage` feature which applies a transformation
that converts all read-only storage bindings to have the `read_write`
access mode.

This is being provided as an optional preprocessor transformation to
work around the WebGPU standard's limitation on mixed `storage-read` and
`storage` usages by a GPU program over the same buffer object (see
https://www.w3.org/TR/webgpu/#programming-model-resource-usages).

This limitation makes the WGSL shaders incompatible with (Skia)
Graphite's sub-allocating buffer manager when they are run on its Dawn
backend. This workaround will be removed once Graphite's buffer
management system supports whole buffer bindings.
@armansito armansito merged commit ee3a076 into linebender:main Sep 22, 2023
4 checks passed
@armansito armansito deleted the pr-force_rw_storage-feature branch September 22, 2023 20:09
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