GPU: RGBA8 shader views keep their sRGB or linear format where the host can cast (#578) #644
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/644"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from fxceless/victory-fork. Originally posted by laptopnotebook on 2026-11-25T03:52:05Z.
Fixes #578.
fitsindescriptor/host.rsgave a shader view of a typed texture the texture's format whenever the view asked for another format of the same family. For RGBA8 that dropped the sRGB conversion: an sRGB view of a UNORM texture read its texels as linear, and a linear view of an sRGB texture read them converted.On a host that reports
CastingFullyTypedFormatSupported(Options3, queried once and logged like the depth bounds check), an RGBA8 shader view now keeps the sRGB or linear format it asks for. Unordered access views, other format pairs (BGRA8 still has the old shortcut) and hosts without the cast behave as before. This follows the patch @akimfomin proposed in the issue.inplace::Rigis nowpub(crate)so the new test can use its queue; nothing else about it changed.Validation (Windows 11, NVIDIA):
descriptor::host::tests::rgba8_views_keep_their_srgb_conversionuploads one 0x80 texel and samples it on the GPU through all four texture/view pairs. The sRGB view of the UNORM texture reads 0.2159 with the change and 0.5020 without it (the test fails then).VICTORY_D3D12_DEBUG=1) the four views raise no messages.cargo test --workspace --locked: all pass.mainindraw.rs(sort_unstable_by_key),indirect.rs(depth_writtenunused) andresource.rs(placed_filler_twinsunused); this PR doesn't touch those.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.