Skip to content

Don't let the clustering vertex shader see any read-write storage buffers.#23256

Merged
mockersf merged 1 commit intobevyengine:mainfrom
pcwalton:vertex-writable-storage
Mar 8, 2026
Merged

Don't let the clustering vertex shader see any read-write storage buffers.#23256
mockersf merged 1 commit intobevyengine:mainfrom
pcwalton:vertex-writable-storage

Conversation

@pcwalton
Copy link
Copy Markdown
Contributor

@pcwalton pcwalton commented Mar 7, 2026

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 #ifdefs and changing the ShaderStages for those bindings to FRAGMENT.

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.

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.
@pcwalton pcwalton added A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior labels Mar 7, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in Rendering Mar 7, 2026
@pcwalton pcwalton added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Mar 7, 2026
@pcwalton pcwalton added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Mar 8, 2026
@mockersf
Copy link
Copy Markdown
Member

mockersf commented Mar 8, 2026

Doesn't fix the incorrect lighting on Android, and still crashes on some Android:

  • Android 13 / OnePlus 11R
  • Android 16 / Samsung Galaxy S26
  • Android 16 / Google Pixel 10

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

@mockersf mockersf added this pull request to the merge queue Mar 8, 2026
Merged via the queue into bevyengine:main with commit 7fc2e2d Mar 8, 2026
47 checks passed
@github-project-automation github-project-automation bot moved this from Needs SME Triage to Done in Rendering 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants