Preserve explicit RGBA8 sRGB views on capable D3D12 adapters #578

Open
opened 2026-11-25 02:30:29 +00:00 by akimfomin · 0 comments
akimfomin commented 2026-11-25 02:30:29 +00:00 (Migrated from github.com)
Contributor

Imported from fxceless/victory-fork. Originally posted by akimfomin on 2026-11-25T02:30:29Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6595810405 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/issues/578). Originally posted by [akimfomin](https://github.com/akimfomin) on 2026-11-25T02:30:29Z. --- [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.
Sign in to join this conversation.
No labels
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.

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