Don't let the clustering vertex shader see any read-write storage buffers.#23256
Merged
mockersf merged 1 commit intobevyengine:mainfrom Mar 8, 2026
Merged
Conversation
buffers. The WebGPU spec forbids vertex shaders from having read-write storage buffers attached. As an extension, `wgpu` allows this on some hardware, but many mobile GPUs don't support it either. Because our bind group for GPU clustering rasterization specified `VERTEX_FRAGMENT` for all bindings, this was causing errors, even though we never actually used those read-write storage buffers in any vertex shaders. This commit should fix the issue, by putting all read-write SSBO bindings behind `#ifdef`s and changing the `ShaderStages` for those bindings to `FRAGMENT`. This should address the crashes in bevyengine#23208 and bevyengine#23216. I'm not sure if it'll address the incorrect lighting on certain devices in bevyengine#23208, however; we may have to disable GPU clustering on those GPUs.
dloukadakis
approved these changes
Mar 7, 2026
mockersf
approved these changes
Mar 8, 2026
Member
|
Doesn't fix the incorrect lighting on Android, and still crashes on some Android:
I couldn't find anything that seems like an error in the logs. I'll post them in #23208, but this is an improvement and fixes the crash with the initial error |
atlv24
approved these changes
Mar 8, 2026
dylansechet
pushed a commit
to dylansechet/bevy
that referenced
this pull request
Mar 9, 2026
…fers. (bevyengine#23256) The WebGPU spec forbids vertex shaders from having read-write storage buffers attached. As an extension, `wgpu` allows this on some hardware, but many mobile GPUs don't support it either. Because our bind group for GPU clustering rasterization specified `VERTEX_FRAGMENT` for all bindings, this was causing errors, even though we never actually used those read-write storage buffers in any vertex shaders. This commit should fix the issue, by putting all read-write SSBO bindings behind `#ifdef`s and changing the `ShaderStages` for those bindings to `FRAGMENT`. This should address the crashes in bevyengine#23208 and bevyengine#23216. I'm not sure if it'll address the incorrect lighting on certain devices in bevyengine#23208, however; we may have to disable GPU clustering on those GPUs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The WebGPU spec forbids vertex shaders from having read-write storage buffers attached. As an extension,
wgpuallows this on some hardware, but many mobile GPUs don't support it either. Because our bind group for GPU clustering rasterization specifiedVERTEX_FRAGMENTfor all bindings, this was causing errors, even though we never actually used those read-write storage buffers in any vertex shaders.This commit should fix the issue, by putting all read-write SSBO bindings behind
#ifdefs and changing theShaderStagesfor those bindings toFRAGMENT.This should address the crashes in #23208 and #23216. I'm not sure if it'll address the incorrect lighting on certain devices in #23208, however; we may have to disable GPU clustering on those GPUs.