Skip to content

Don't declare atomics in the read-only late mesh preprocessing buffer#24650

Open
stuartparmenter wants to merge 1 commit into
bevyengine:mainfrom
stuartparmenter:late-preprocess-readonly-atomics
Open

Don't declare atomics in the read-only late mesh preprocessing buffer#24650
stuartparmenter wants to merge 1 commit into
bevyengine:mainfrom
stuartparmenter:late-preprocess-readonly-atomics

Conversation

@stuartparmenter

Copy link
Copy Markdown
Contributor

Objective

  • Most examples in Bevy w/ wgpu main break on DX12 because Naga now (correctly) rejects atomicLoad when bound read only (by incorrectly generating bad code... going to work on a naga fix to more cleanly reject). See https://www.w3.org/TR/WGSL/#atomic-load that it is for read_write.

Solution

  • Use non-atomic in the same spot for LATE_PHASE.

Testing

  • Change Bevy to use latest wgpu main, run most examples w/ WGPU_BACKEND="dx12"

@kfc35 kfc35 added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen O-DX12 Specific to the DX12 render API D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward D-Shaders This code uses GPU shader languages labels Jun 17, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering Jun 17, 2026

@beicause beicause left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks correct.

I'm not sure why this is dx12-specific. It should fail on other backends too if wgsl spec disallows it.

@stuartparmenter

stuartparmenter commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

Thanks!

It broke because of gfx-rs/wgpu#9387 which, which only changed some of the code generation. It doesn't currently reject, but rather generates bad code that then fails. I asked the wgpu folks and after checking the specs making it reject across the board seems like the right fix upstream, so am planning on trying to do that when I get a chance.

@kfc35 kfc35 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks correct to me

@kfc35 kfc35 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 Jun 18, 2026
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 D-Shaders This code uses GPU shader languages D-Straightforward Simple bug fixes and API improvements, docs, test and examples O-DX12 Specific to the DX12 render API 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: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

3 participants