gpu(native): decode RGB9E5 in HDR diagnostic dumps #426

Open
opened 2026-11-27 17:43:08 +00:00 by theappartment · 2 comments
theappartment commented 2026-11-27 17:43:08 +00:00 (Migrated from github.com)
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by theappartment on 2026-11-27T17:43:08Z.


DXGI 67 (R9G9B9E5_SHAREDEXP) reaches the byte-preview fallback in VICTORY_TRACE_PASSES and is skipped by VICTORY_DUMP_TARGETS. Its bytes pack three 9-bit mantissas and one shared exponent, so displaying individual bytes produces misleading colors.

A synthetic texel with mantissas [256, 128, 64] and exponent 16 represents linear RGB [1.0, 0.5, 0.25]. The current pass preview emits [0, 1, 129]. The existing HDR tone map would emit [180, 147, 114] after decoding. The existing Metal resource test confirms those synthetic linear values through a texture view. DXGI 67 was present in 59 traced frames across two local windowed runs.

I plan to decode the shared exponent in the existing HDR path, use it in both diagnostic dump entry points, and add a synthetic regression for channel order and exponent.

Microsoft DirectXMath reference decoder

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6651762453 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/426). Originally posted by [theappartment](https://github.com/theappartment) on 2026-11-27T17:43:08Z. --- DXGI 67 (`R9G9B9E5_SHAREDEXP`) reaches the byte-preview fallback in `VICTORY_TRACE_PASSES` and is skipped by `VICTORY_DUMP_TARGETS`. Its bytes pack three 9-bit mantissas and one shared exponent, so displaying individual bytes produces misleading colors. A synthetic texel with mantissas `[256, 128, 64]` and exponent `16` represents linear RGB `[1.0, 0.5, 0.25]`. The current pass preview emits `[0, 1, 129]`. The existing HDR tone map would emit `[180, 147, 114]` after decoding. The existing Metal resource test confirms those synthetic linear values through a texture view. DXGI 67 was present in 59 traced frames across two local windowed runs. I plan to decode the shared exponent in the existing HDR path, use it in both diagnostic dump entry points, and add a synthetic regression for channel order and exponent. [Microsoft DirectXMath reference decoder](https://github.com/microsoft/DirectXMath/blob/main/Inc/DirectXPackedVector.inl#L1127-L1141)
theappartment commented 2026-11-27 17:43:24 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by theappartment on 2026-11-27T17:43:24Z.


/claim

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7224716961 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/426#issuecomment-7224716961). Originally posted by [theappartment](https://github.com/theappartment) on 2026-11-27T17:43:24Z. --- /claim
github-actions[bot] commented 2026-11-27 17:43:35 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T17:43:35Z.


Claimed by @theappartment. Open a draft pull request with Refs #426 in its description within 24 hours, or the claim expires.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7224720165 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/426#issuecomment-7224720165). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-27T17:43:35Z. --- Claimed by @theappartment. Open a draft pull request with `Refs #426` in its description within 24 hours, or the claim expires.
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
LakshanSivakumar/Native-Victory-macOS#426
No description provided.