sRGB views of typed textures keep their format where the host casts fully typed formats #4383
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4383
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4382"
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?
@tyr0nsur on GitHub · 2026-11-30 19:29 UTC · original
tyr0nsur:claude/srgb-views-keep-their-format→main· +254 −6 · 2 files · 2 commits · openRelates to the
fitsshortcut indescriptor/host.rs("such a view (sRGB of UNORM, say) reads without its conversion") and the cast log added incb191f38.What it changes
fitsgives a shader view of a typed host texture in another format of its family the texture's own format. For the other half of an sRGB pair that drops the conversion: an sRGB view of UNORM memory reads the stored bytes as linear (too bright, few steps in the dark), and a UNORM view of sRGB memory decodes when the title asked it not to.The opening of the title makes such views of BC7 on an RTX 4060 (release v2026.11.30, from the existing cast log line):
(
srgb_pair=falsethere is the table, which named only the three 8-bit pairs.)resource::SRGB_BLOCKS: the block pairs, BC1 (72/71), BC2 (75/74), BC3 (78/77) and BC7 (99/98), in a table of their own.SRGB(the UAV linear twin infits, the typeless sRGB UAV texture at creation) is unchanged.srgb_pairreads both tables, and the cast log now sayssrgb_pair=truefor the block pairs.resource::srgb_cast(own, view): a shader view (not unordered access) that is the other half of the texture's sRGB pair keeps the title's format when the host reportsCastingFullyTypedFormatSupported. Every other cast is as before.VICTORY_SRGB_CASTS=0restores the old behaviour.How it was tested
descriptor::host::srgb_cast_testsreads a texel through SRVs of 4x4 RGBA8, BC1 and BC7 textures, each made in UNORM and in sRGB and viewed in both formats:A cast view reads exactly what a texture made in the view's format reads, so the host does the conversion the console does. On an adapter without the cap the test only checks the plain textures; it needs no game data and returns early without a device.
VICTORY_SRGB_CASTS=0gives the old picture for an A/B.cargo test -p victory-gpu --locked --lib descriptor::host: 97 passed. Both Clippy steps pass with #4297 applied (onmainalone they stop at the findings #4297 fixes).cargo xtask policy: only the existingnative.rsfinding.A second review by GPT-6.2 confirmed that these seven casts are valid under
CastingFullyTypedFormatSupported(BC included, either direction) and suggested keeping the block pairs out ofSRGB, which the second commit does.Checked for overlap
cb191f38(the cast log).🤖 Generated with Claude Code
144c951adfto2f4040899dView 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.