Preserve explicit RGBA8 sRGB views on capable D3D12 adapters #578

Open
opened 2026-11-26 03:46:45 +00:00 by github-bot · 0 comments
Owner

@⁠akimfomin on GitHub · 2026-11-25 02:30 UTC · original

PortBridge found one explicit sampled-view conversion that the D3D12 backend narrows to the resource's format in descriptor/host.rs at c96b4f2. An explicit RGBA8 sRGB view can therefore return linear UNORM values, even when D3D12 Options3 reports fully typed casting support.

The source-generated check on an RTX 4070 Ti SUPER sampled a single 0x80 texel through all four resource/view combinations. Both opposite-format views matched the same-format control for their requested view exactly. RGB was 0.5019608 for UNORM and 0.2158203 for sRGB. Alpha stayed 0.5019608. The exact-source CPU checks passed with capability enabled and disabled, both view directions, unrelated formats and UAV controls.

The pinned patch, source fixture and GPU log limit the change to explicit sampled RGBA8 views on reporting adapters. The patch applies to the checked head. The narrow result concerns texture color conversion. Effects on rendered scenes and full integration CI remain unverified. See the D3D12 casting rules.

AI assistance from OpenAI Codex (GPT-6 family) for source analysis, implementation and verification.

**@⁠akimfomin** on GitHub · 2026-11-25 02:30 UTC · [original](https://github.com/fxceless/victory-fork/issues/578) [PortBridge](https://github.com/akimfomin/PortBridge) found one explicit sampled-view conversion that the D3D12 backend narrows to the resource's format in `descriptor/host.rs` at `c96b4f2`. An explicit RGBA8 sRGB view can therefore return linear UNORM values, even when D3D12 Options3 reports fully typed casting support. The source-generated check on an RTX 4070 Ti SUPER sampled a single `0x80` texel through all four resource/view combinations. Both opposite-format views matched the same-format control for their requested view exactly. RGB was 0.5019608 for UNORM and 0.2158203 for sRGB. Alpha stayed 0.5019608. The exact-source CPU checks passed with capability enabled and disabled, both view directions, unrelated formats and UAV controls. The [pinned patch, source fixture and GPU log](https://github.com/akimfomin/PortBridge/blob/f5cd8d918bc4fbe91999d4bf115ce70cc41d731c/research/rendering-night/victory-fork-rgba8-cast/README.md) limit the change to explicit sampled RGBA8 views on reporting adapters. The patch applies to the checked head. The narrow result concerns texture color conversion. Effects on rendered scenes and full integration CI remain unverified. See the [D3D12 casting rules](https://microsoft.github.io/DirectX-Specs/d3d/RelaxedCasting.html). AI assistance from OpenAI Codex (GPT-6 family) for source analysis, implementation and verification.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:46:45 +00:00
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/fxceless--victory-fork#578
No description provided.