Skip to content

Accept snorm main textures for Oklab compositing - #25646

Merged
alice-i-cecile merged 2 commits into
bevyengine:mainfrom
stuartparmenter:hdr-wave2-oklab-snorm-storage
Sep 8, 2026
Merged

alice-i-cecile merged 2 commits into
bevyengine:mainfrom
stuartparmenter:hdr-wave2-oklab-snorm-storage

Conversation

@stuartparmenter

@stuartparmenter stuartparmenter commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Objective

#25481 only counted float formats as signed storage for CompositingSpace::Oklab, but snorm formats are valid signed storage too.

Solution

Accept Rgba8Snorm and Rgba16Snorm alongside the float formats.

Testing

Tested locally.


This PR was built by me with the assistance of Claude Code w/ Fable 5.1

@stuartparmenter stuartparmenter added A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Sep 2, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering Sep 2, 2026
@JMS55

JMS55 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@stuartparmenter

Copy link
Copy Markdown
Contributor Author

Maybe you could use https://docs.rs/wgpu/latest/wgpu/enum.TextureFormat.html#method.sample_type ?

sample_type returns TextureSampleType::Float for unorm, snorm, and float formats, so it gives the same answer for Rgba8Unorm, which clamps negative values to zero, and Rgba8Snorm, which stores them. I had looked across wgpu & bevy for a better solution but didn't find one.

Comment thread crates/bevy_render/src/view/composition.rs Outdated
@Zeophlite Zeophlite 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 Sep 6, 2026
@alice-i-cecile
alice-i-cecile added this pull request to the merge queue Sep 7, 2026
Merged via the queue into bevyengine:main with commit d815357 Sep 8, 2026
40 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in Rendering Sep 8, 2026
joelawm pushed a commit to joelawm/bevy that referenced this pull request Sep 8, 2026
# Objective

bevyengine#25481 only counted float formats as signed storage for
`CompositingSpace::Oklab`, but snorm formats are valid signed storage
too.

## Solution

Accept `Rgba8Snorm` and `Rgba16Snorm` alongside the float formats.

## Testing

Tested locally.

---

This PR was built by me with the assistance of Claude Code w/ Fable 5.1
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-Trivial Nice and easy! A great choice to get started with Bevy 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