vulkan_replay: sRGB render-target clears are encoded in the layer, as WARP encodes them (D3D-CLEAR-SRGB-ENCODE) #1179

Open
github-bot wants to merge 1 commit from github-bot/gh-1179 into main AGit
Owner

@⁠MalexAson on GitHub · 2026-11-24 19:40 UTC · original
MalexAson:fix/srgb-rtv-clear-encode → main · +231 −16 · 6 files · 1 commits · open

Claimed in the coordination issue as: D3D-CLEAR-SRGB-ENCODE

What and why

ClearRenderTargetView on R8G8B8A8_UNORM_SRGB and B8G8R8A8_UNORM_SRGB handed the linear float to vkCmdClearColorImage or vkCmdClearAttachments and the GPU encoded it, so the stored byte depended on the GPU. Against WARP, d3d12_clear_formats differed in 10 clears and d3d12_srgb_uav in 2 on an Intel Iris Xe (0.5 is bb there and bc on WARP).

What I measured (the new "sRGB RTV clears" item in docs/d3d12_vulkan.md has the details):

  • No driver is wrong. D3D permits FLOAT → SRGB 0.6 of a step of tolerance (Direct3D 11.3 functional specification, 3.2.3.8), and each implementation puts the 255 steps between two codes somewhere else. Of 60 000 random values the Iris Xe stores another byte than WARP for 6 649 and an RTX 4060 for 3 648, never more than one code away. The RTX 4060 passes on main only because the five test colours miss those values.
  • WARP takes the value to 12 bits first (x * 4095 in single precision, rounded half up) and then takes the nearest code of the sRGB curve. All 255 floats at which its byte changes are the ones this rule gives, and 84 582 further values agree.
  • WARP and both GPUs store the linear value of a code as that code, for all 256 codes.
  • Each GPU's own D3D12 driver stores exactly what its Vulkan driver stores (84 582 of 84 582 values, on both GPUs).

The change: render_target_clear_color encodes the colour channels itself by WARP's rule (srgb8_from_linear) and hands Vulkan the linear value of that code (srgb8_linear). Alpha is unchanged. This is what quantize_unorm does for UNORM ties.

One thing for a maintainer to decide. A GPU's own D3D12 driver encodes as its Vulkan driver does, so the layer used to equal that driver and differ from WARP; now it equals WARP on every GPU and differs from that driver where the driver differs from WARP. I followed what the layer does for UNORM ties and D24: the layer converts, WARP is the reference, and a host that does otherwise is a host quirk. If you would rather keep the GPU's encoding, the alternative is to leave the layer alone and compare the sRGB colour channels with WARP within one code in the two tests. Say so and I will redo it that way.

d3d12_state_sweep_test compares with the same adapter's D3D12 driver and cleared its sRGB targets to 0.2, 0.4 and 0.6, of which Intel's driver stores the first two as 123 and 169 where WARP has 124 and 170. With the layer change it differed in 4 of 482 cases on the Iris Xe, so its sRGB targets now start from the values of codes 124, 170 and 203, which every implementation measured stores alike. The sweep is about blending.

Not changed: a draw into an sRGB target is still encoded by the GPU, and d3d12_clear_test still compares castable sRGB views within 1.

Tested

On main 6293c1c4f with MSVC 14.50 (Build Tools 2026), RelWithDebInfo, WARP 10.0.26100.5074, each on both GPUs through LEONIDA_VK_DEVICE:

  • d3d12_clear_formats: before, 241 matched WARP and 10 differ on the Iris Xe (251 and 0 on the RTX 4060). With the extended sRGB colours on the unfixed layer, 178 of the 352 sRGB cases differ on the Iris Xe and 170 on the RTX 4060. After: 593 matched and 0 differ on both.
  • d3d12_srgb_uav: before, 2 of 4 clears differ on the Iris Xe; after, 0 failures on both.
  • clear_color (no GPU): 567 checks pass.
  • A scratch sweep (not in this pull request) of 84 838 values through the fixed layer against WARP: 0 differ on both GPUs, for both formats, as a whole view and as a rectangle, on plain render targets and on UAV ones backed by a UNORM image.
  • ctest for the 23 tests that clear or present sRGB targets or use the changed code (d3d12_clear, d3d12_clear_restricted_depth, d3d12_clear_formats, d3d12_srgb_uav, d3d12_uav_clear, d3d12_short_uav_clear, d3d12_typeless_rtv, d3d12_typeless_families, d3d12_typeless_depth, d3d12_state_sweep, d3d12_draw, d3d12_present, d3d12_close_parity, d3d12_vulkan_device, dxgi_swapchain, xbox_present, xs_proxy_mock, vk_presenter_sync, typeless_rtv, clear_color, replay_clear_gate, replay_uav_clear_offset, d3d12_rgb9e5_rtv): on both GPUs 21 pass, d3d12_rgb9e5_rtv skips and d3d12_vulkan_device fails. It fails the same way without this change (three resource-flag cases of compare_invalid_arguments against the host runtime), which has nothing to do with clears.
  • Not run: the whole ctest (only these targets were built), LEONIDA_VK_VALIDATION=1 (no validation layer on this PC), an AMD GPU, Linux.

GPUs tested: Intel Iris Xe (Raptor Lake-P, 8086:a7a0), Intel 32.0.101.7092, Windows 11 build 26100; NVIDIA GeForce RTX 4060 Laptop GPU, NVIDIA 616.92, Windows 11 build 26100

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (not applicable: no translator change)

🤖 Generated with Claude Code

**@⁠MalexAson** on GitHub · 2026-11-24 19:40 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1179) `MalexAson:fix/srgb-rtv-clear-encode` → `main` · +231 −16 · 6 files · 1 commits · open Claimed in the coordination issue as: D3D-CLEAR-SRGB-ENCODE ### What and why `ClearRenderTargetView` on `R8G8B8A8_UNORM_SRGB` and `B8G8R8A8_UNORM_SRGB` handed the linear float to `vkCmdClearColorImage` or `vkCmdClearAttachments` and the GPU encoded it, so the stored byte depended on the GPU. Against WARP, `d3d12_clear_formats` differed in 10 clears and `d3d12_srgb_uav` in 2 on an Intel Iris Xe (0.5 is `bb` there and `bc` on WARP). What I measured (the new "sRGB RTV clears" item in `docs/d3d12_vulkan.md` has the details): - No driver is wrong. D3D permits FLOAT → SRGB 0.6 of a step of tolerance (Direct3D 11.3 functional specification, 3.2.3.8), and each implementation puts the 255 steps between two codes somewhere else. Of 60 000 random values the Iris Xe stores another byte than WARP for 6 649 and an RTX 4060 for 3 648, never more than one code away. The RTX 4060 passes on `main` only because the five test colours miss those values. - WARP takes the value to 12 bits first (`x * 4095` in single precision, rounded half up) and then takes the nearest code of the sRGB curve. All 255 floats at which its byte changes are the ones this rule gives, and 84 582 further values agree. - WARP and both GPUs store the linear value of a code as that code, for all 256 codes. - Each GPU's own D3D12 driver stores exactly what its Vulkan driver stores (84 582 of 84 582 values, on both GPUs). The change: `render_target_clear_color` encodes the colour channels itself by WARP's rule (`srgb8_from_linear`) and hands Vulkan the linear value of that code (`srgb8_linear`). Alpha is unchanged. This is what `quantize_unorm` does for UNORM ties. **One thing for a maintainer to decide.** A GPU's own D3D12 driver encodes as its Vulkan driver does, so the layer used to equal that driver and differ from WARP; now it equals WARP on every GPU and differs from that driver where the driver differs from WARP. I followed what the layer does for UNORM ties and D24: the layer converts, WARP is the reference, and a host that does otherwise is a host quirk. If you would rather keep the GPU's encoding, the alternative is to leave the layer alone and compare the sRGB colour channels with WARP within one code in the two tests. Say so and I will redo it that way. `d3d12_state_sweep_test` compares with the same adapter's D3D12 driver and cleared its sRGB targets to 0.2, 0.4 and 0.6, of which Intel's driver stores the first two as 123 and 169 where WARP has 124 and 170. With the layer change it differed in 4 of 482 cases on the Iris Xe, so its sRGB targets now start from the values of codes 124, 170 and 203, which every implementation measured stores alike. The sweep is about blending. Not changed: a draw into an sRGB target is still encoded by the GPU, and `d3d12_clear_test` still compares castable sRGB views within 1. ### Tested On `main` 6293c1c4f with MSVC 14.50 (Build Tools 2026), RelWithDebInfo, WARP 10.0.26100.5074, each on both GPUs through `LEONIDA_VK_DEVICE`: - `d3d12_clear_formats`: before, 241 matched WARP and 10 differ on the Iris Xe (251 and 0 on the RTX 4060). With the extended sRGB colours on the unfixed layer, 178 of the 352 sRGB cases differ on the Iris Xe and 170 on the RTX 4060. After: 593 matched and 0 differ on both. - `d3d12_srgb_uav`: before, 2 of 4 clears differ on the Iris Xe; after, 0 failures on both. - `clear_color` (no GPU): 567 checks pass. - A scratch sweep (not in this pull request) of 84 838 values through the fixed layer against WARP: 0 differ on both GPUs, for both formats, as a whole view and as a rectangle, on plain render targets and on UAV ones backed by a UNORM image. - `ctest` for the 23 tests that clear or present sRGB targets or use the changed code (`d3d12_clear`, `d3d12_clear_restricted_depth`, `d3d12_clear_formats`, `d3d12_srgb_uav`, `d3d12_uav_clear`, `d3d12_short_uav_clear`, `d3d12_typeless_rtv`, `d3d12_typeless_families`, `d3d12_typeless_depth`, `d3d12_state_sweep`, `d3d12_draw`, `d3d12_present`, `d3d12_close_parity`, `d3d12_vulkan_device`, `dxgi_swapchain`, `xbox_present`, `xs_proxy_mock`, `vk_presenter_sync`, `typeless_rtv`, `clear_color`, `replay_clear_gate`, `replay_uav_clear_offset`, `d3d12_rgb9e5_rtv`): on both GPUs 21 pass, `d3d12_rgb9e5_rtv` skips and `d3d12_vulkan_device` fails. It fails the same way without this change (three resource-flag cases of `compare_invalid_arguments` against the host runtime), which has nothing to do with clears. - Not run: the whole `ctest` (only these targets were built), `LEONIDA_VK_VALIDATION=1` (no validation layer on this PC), an AMD GPU, Linux. GPUs tested: Intel Iris Xe (Raptor Lake-P, 8086:a7a0), Intel 32.0.101.7092, Windows 11 build 26100; NVIDIA GeForce RTX 4060 Laptop GPU, NVIDIA 616.92, Windows 11 build 26100 AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (not applicable: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ClearRenderTargetView on R8G8B8A8_UNORM_SRGB and B8G8R8A8_UNORM_SRGB handed the linear float to
vkCmdClearColorImage or vkCmdClearAttachments and the GPU encoded it. D3D permits FLOAT -> SRGB 0.6 of a step of
tolerance and each implementation puts the steps between two codes somewhere else, so the byte depended on the GPU:
against WARP, d3d12_clear_formats differed in 10 clears and d3d12_srgb_uav in 2 on an Intel Iris Xe (0.5 is bb
there and bc on WARP), and an RTX 4060 passed because the five colours miss the values it encodes differently (3 648
of 60 000 random ones; the Iris Xe 6 649, never more than one code).

render_target_clear_color now encodes the colour channels itself (srgb8_from_linear) the way WARP was measured to:
the value to 12 bits with x * 4095 in single precision rounded half up, then the nearest code of the sRGB curve. All
255 floats at which WARP's byte changes are the ones this gives, and 84 582 further values agree. Vulkan gets the
linear value of that code (srgb8_linear), which both GPUs store as that code for all 256. Alpha is unchanged.

A GPU's own D3D12 driver encodes as its Vulkan driver does, so the layer now differs from that driver where it
differs from WARP, as it does for UNORM ties and D24. d3d12_state_sweep_test compares with that driver and cleared
its sRGB targets to 0.2, 0.4 and 0.6 (0.2 is 124 on WARP, 123 on the Iris Xe); it now starts them from the values of
codes 124, 170 and 203.

clear_color_test pins 38 values to WARP's bytes, the round trip of every code and the result under each rounding
mode. d3d12_clear_formats_test clears the sRGB formats to the value of every code and of every place halfway
between two codes as well: 178 of 352 cases differed from WARP on the Iris Xe and 170 on the RTX 4060 before, none
after.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:41:44 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 19:42 UTC · original · approved these changes

Reviewed and verified. Eliminates vendor-specific 1-ulp clear variations on sRGB render targets (R8G8B8A8_UNORM_SRGB / B8G8R8A8_UNORM_SRGB) by performing software quantization via srgb8_from_linear / srgb8_linear in runtime/src/vulkan_replay.h, matching WARP 12-bit precision across 84,582 values and passing 593/593 cases in d3d12_clear_formats. 100% clean-room.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 19:42 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1179#pullrequestreview-6046144774) · **approved these changes** Reviewed and verified. Eliminates vendor-specific 1-ulp clear variations on sRGB render targets (`R8G8B8A8_UNORM_SRGB` / `B8G8R8A8_UNORM_SRGB`) by performing software quantization via `srgb8_from_linear` / `srgb8_linear` in `runtime/src/vulkan_replay.h`, matching WARP 12-bit precision across 84,582 values and passing 593/593 cases in `d3d12_clear_formats`. 100% clean-room.
Author
Owner

@⁠madhyn on GitHub · 2026-11-24 20:09 UTC · original

Tested e2c13db54 on Arch Linux + Wine 11.22 + NVIDIA RTX 3060 Ti (595.58.03 / Vulkan):

  • clear_color (Linux): Passed (0.01 s)
  • d3d12_state_sweep (Wine): Skipped
  • d3d12_clear (Wine): Failed (6.26 s — host D3D12 under Wine differs from WARP, e.g. R8G8B8A8_UNORM case 0 byte 2: Vulkan 80, WARP 7f, R8G8_UINT case 3 byte 13: Vulkan ff, WARP 00)
  • d3d12_clear_formats (Wine): Failed (clears: 324 matched WARP, 269 differ, 0 failed — Wine host D3D12 vs layer differences on UINT/SINT/D16/D24S8/D32S8)

AI-assisted: yes

**@⁠madhyn** on GitHub · 2026-11-24 20:09 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1179#issuecomment-7143126644) Tested `e2c13db54` on Arch Linux + Wine 11.22 + NVIDIA RTX 3060 Ti (595.58.03 / Vulkan): - `clear_color` (Linux): **Passed** (0.01 s) - `d3d12_state_sweep` (Wine): **Skipped** - `d3d12_clear` (Wine): **Failed** (6.26 s — host D3D12 under Wine differs from WARP, e.g. `R8G8B8A8_UNORM case 0 byte 2: Vulkan 80, WARP 7f`, `R8G8_UINT case 3 byte 13: Vulkan ff, WARP 00`) - `d3d12_clear_formats` (Wine): **Failed** (`clears: 324 matched WARP, 269 differ, 0 failed` — Wine host D3D12 vs layer differences on `UINT`/`SINT`/`D16`/`D24S8`/`D32S8`) AI-assisted: yes
Author
Owner

@⁠Deedlyy on GitHub · 2026-11-24 20:09 UTC · original

Recommendation: [WAIT]

Reasoning: Clears on sRGB render targets now encode the clear colour in the layer the way WARP does, instead of letting each GPU encode it, which removes vendor-dependent bytes (e.g. 0xbb vs 0xbc on Iris Xe). The analysis is thorough and four tests plus docs are updated. But the change affects every sRGB RTV clear, and it has only been measured on the author's Intel/NVIDIA machines with no second-person run. Get one independent run of d3d12_clear_formats/clear_color/d3d12_srgb_uav on AMD or NVIDIA before merging. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with main.

Impact level: 5/10

**@⁠Deedlyy** on GitHub · 2026-11-24 20:09 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1179#issuecomment-7143128558) **Recommendation:** [WAIT] **Reasoning:** Clears on sRGB render targets now encode the clear colour in the layer the way WARP does, instead of letting each GPU encode it, which removes vendor-dependent bytes (e.g. 0xbb vs 0xbc on Iris Xe). The analysis is thorough and four tests plus docs are updated. But the change affects every sRGB RTV clear, and it has only been measured on the author's Intel/NVIDIA machines with no second-person run. Get one independent run of `d3d12_clear_formats`/`clear_color`/`d3d12_srgb_uav` on AMD or NVIDIA before merging. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with `main`. **Impact level:** 5/10
Author
Owner

@⁠MalexAson on GitHub · 2026-11-24 20:26 UTC · original

@⁠madhyn thank you for running this; a Wine run is one I can't do here.

clear_color passing and d3d12_state_sweep skipping are as expected (the sweep already has the host_wine.h skip). The two failures are a comparison with vkd3d, not with WARP: d3d12_clear and d3d12_clear_formats take their reference from EnumWarpAdapter, which under Wine is vkd3d, and on main neither has the host_wine.h skip. #1086 adds it and reports both failing on main under WineHQ 11.22 (integer clears saturate differently, SNORM -1, D32S8 stencil).

What this commit cannot change is every difference you name. In the layer it changes render_target_clear_color only for the three colour channels of R8G8B8A8_UNORM_SRGB and B8G8R8A8_UNORM_SRGB; UNORM, UINT and SINT go through the same branches as on main, depth clears are a separate path, and d3d12_clear_test.cpp changed in two comments only. 80 against 7f is the 0.5 UNORM tie, which the layer already rounds itself on main.

What it can change is the SRGB group of d3d12_clear_formats, and your total shows it did. That group has 352 cases here instead of 10, and only 241 of the 593 cases are outside it, so at least 28 of your 269 are SRGB lines; the five groups you list hold at most 127. I expect that against a reference that lets the GPU encode: the layer now follows WARP's rule, and half of the added values sit where implementations disagree (my RTX 4060's own encoding differed from WARP on 170 of the 352). I haven't measured what vkd3d stores, so that is an expectation, not a result. That comparison is with vkd3d, so it doesn't measure the change against WARP, and with #1086 the test skips under Wine.

Two things from the same setup would let the numbers be split, if you have the time:

  1. d3d12_clear and d3d12_clear_formats on unchanged main (6293c1c4f).
  2. From the run with this commit, how many of the DIFF lines of d3d12_clear_formats start with DIFF SRGB.

On the independent run the triage comment asks for: agreed, and I can't supply it, since both GPUs in the description are mine. (Rerun just now on the RTX 4060, which has moved to NVIDIA 621.40: d3d12_clear_formats 593 matched and 0 differ, d3d12_srgb_uav 0 failures, clear_color passes.) What would settle it is d3d12_clear_formats, d3d12_srgb_uav and clear_color on native Windows, on an AMD GPU or on someone else's NVIDIA one; the first two compare with Microsoft's WARP, so Wine can't stand in.

AI-assisted: yes

**@⁠MalexAson** on GitHub · 2026-11-24 20:26 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1179#issuecomment-7143547923) @⁠madhyn thank you for running this; a Wine run is one I can't do here. `clear_color` passing and `d3d12_state_sweep` skipping are as expected (the sweep already has the `host_wine.h` skip). The two failures are a comparison with vkd3d, not with WARP: `d3d12_clear` and `d3d12_clear_formats` take their reference from `EnumWarpAdapter`, which under Wine is vkd3d, and on `main` neither has the `host_wine.h` skip. #1086 adds it and reports both failing on `main` under WineHQ 11.22 (integer clears saturate differently, SNORM -1, D32S8 stencil). **What this commit cannot change** is every difference you name. In the layer it changes `render_target_clear_color` only for the three colour channels of `R8G8B8A8_UNORM_SRGB` and `B8G8R8A8_UNORM_SRGB`; UNORM, UINT and SINT go through the same branches as on `main`, depth clears are a separate path, and `d3d12_clear_test.cpp` changed in two comments only. `80` against `7f` is the 0.5 UNORM tie, which the layer already rounds itself on `main`. **What it can change** is the SRGB group of `d3d12_clear_formats`, and your total shows it did. That group has 352 cases here instead of 10, and only 241 of the 593 cases are outside it, so at least 28 of your 269 are SRGB lines; the five groups you list hold at most 127. I expect that against a reference that lets the GPU encode: the layer now follows WARP's rule, and half of the added values sit where implementations disagree (my RTX 4060's own encoding differed from WARP on 170 of the 352). I haven't measured what vkd3d stores, so that is an expectation, not a result. That comparison is with vkd3d, so it doesn't measure the change against WARP, and with #1086 the test skips under Wine. Two things from the same setup would let the numbers be split, if you have the time: 1. `d3d12_clear` and `d3d12_clear_formats` on unchanged `main` (6293c1c4f). 2. From the run with this commit, how many of the `DIFF` lines of `d3d12_clear_formats` start with `DIFF SRGB`. On the independent run the triage comment asks for: agreed, and I can't supply it, since both GPUs in the description are mine. (Rerun just now on the RTX 4060, which has moved to NVIDIA 621.40: `d3d12_clear_formats` 593 matched and 0 differ, `d3d12_srgb_uav` 0 failures, `clear_color` passes.) What would settle it is `d3d12_clear_formats`, `d3d12_srgb_uav` and `clear_color` on native Windows, on an AMD GPU or on someone else's NVIDIA one; the first two compare with Microsoft's WARP, so Wine can't stand in. AI-assisted: yes
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-24 21:42 UTC · original

Tested e2c13db54 applied onto main 66d4f5aa3 on an AMD Radeon RX 7900 XT (AMD Radeon RX 7900 XT (RDNA3, gfx1100), AMD proprietary driver 32.0.32029.2010 (26.11.2), Windows 11 build 26300, VS 2022 RelWithDebInfo, Vulkan SDK 1.4.363.0). No game files.

test main 66d4f5aa3 this PR
clear_color (no GPU) 515 checks passed 567 checks passed, sRGB included
d3d12_clear_formats 251 clears matched WARP, 0 differ 593 matched WARP, 0 differ
d3d12_vulkan_device Passed Passed
d3d12_state_sweep, d3d12_typeless_rtv, d3d12_rgb9e5_rtv, d3d12_clear_restricted_depth Passed Passed
d3d12_clear Failed (NaN depth clear, #787) Failed, the same
full ctest 311/314 311/314, the same three failures (d3d12_texture_tiles #964, d3d12_close_parity, since fixed by #1286, d3d12_clear #787)

This answers the open AMD question. d3d12_vulkan_device compares an sRGB-cast clear of {0.25, 0.5, 0.75} on a placed castable resource with the host runtime on the layer's own adapter, here the AMD D3D12 driver. It still passes with the WARP-style encoding:

placed castable formats (D3D-90): SRGB-cast and plain clears read back and compared with the host runtime on AMD Radeon RX 7900 XT (the layer's own adapter); refusals matched the host's

So, for these values at least, AMD's native D3D12 encodes sRGB clears the same way WARP does.

**@⁠adrianmjim** on GitHub · 2026-11-24 21:42 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1179#issuecomment-7145292268) Tested e2c13db54 applied onto main 66d4f5aa3 on an AMD Radeon RX 7900 XT (AMD Radeon RX 7900 XT (RDNA3, gfx1100), AMD proprietary driver 32.0.32029.2010 (26.11.2), Windows 11 build 26300, VS 2022 RelWithDebInfo, Vulkan SDK 1.4.363.0). No game files. | test | main `66d4f5aa3` | this PR | |---|---|---| | `clear_color` (no GPU) | 515 checks passed | 567 checks passed, sRGB included | | `d3d12_clear_formats` | 251 clears matched WARP, 0 differ | **593 matched WARP, 0 differ** | | `d3d12_vulkan_device` | Passed | Passed | | `d3d12_state_sweep`, `d3d12_typeless_rtv`, `d3d12_rgb9e5_rtv`, `d3d12_clear_restricted_depth` | Passed | Passed | | `d3d12_clear` | Failed (NaN depth clear, #787) | Failed, the same | | full `ctest` | 311/314 | 311/314, the same three failures (`d3d12_texture_tiles` #964, `d3d12_close_parity`, since fixed by #1286, `d3d12_clear` #787) | This answers the open AMD question. `d3d12_vulkan_device` compares an sRGB-cast clear of {0.25, 0.5, 0.75} on a placed castable resource with the host runtime on the layer's own adapter, here the AMD D3D12 driver. It still passes with the WARP-style encoding: ``` placed castable formats (D3D-90): SRGB-cast and plain clears read back and compared with the host runtime on AMD Radeon RX 7900 XT (the layer's own adapter); refusals matched the host's ``` So, for these values at least, AMD's native D3D12 encodes sRGB clears the same way WARP does.
Author
Owner

@⁠madhyn on GitHub · 2026-11-24 21:47 UTC · original

@⁠MalexAson Here are the split numbers from the same Arch Linux + Wine 11.22 + RTX 3060 Ti setup:

  1. Unchanged main (6293c1c4f):
    • d3d12_clear_test.exe: exit 1 — d3d12_clear_test: 20 color/depth format(s) differ from WARP
    • d3d12_clear_formats_test.exe: exit 1 — clears: 152 matched WARP, 99 differ, 0 failed (8 DIFF SRGB lines, 91 non-SRGB)
  2. PR head (e2c13db54):
    • d3d12_clear_formats_test.exe: exit 1 — clears: 324 matched WARP, 269 differ, 0 failed
    • DIFF SRGB lines: 178 of 269 (leaving the exact same 91 non-SRGB vkd3d diffs as main).

AI-assisted: yes

**@⁠madhyn** on GitHub · 2026-11-24 21:47 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1179#issuecomment-7145402878) @⁠MalexAson Here are the split numbers from the same Arch Linux + Wine 11.22 + RTX 3060 Ti setup: 1. **Unchanged `main` (`6293c1c4f`):** - `d3d12_clear_test.exe`: exit `1` — `d3d12_clear_test: 20 color/depth format(s) differ from WARP` - `d3d12_clear_formats_test.exe`: exit `1` — `clears: 152 matched WARP, 99 differ, 0 failed` (`8` `DIFF SRGB` lines, `91` non-SRGB) 2. **PR head (`e2c13db54`):** - `d3d12_clear_formats_test.exe`: exit `1` — `clears: 324 matched WARP, 269 differ, 0 failed` - `DIFF SRGB` lines: **178** of 269 (leaving the exact same **91** non-SRGB vkd3d diffs as `main`). AI-assisted: yes
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1179/head:github-bot/gh-1179'
git switch 'github-bot/gh-1179'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1179'
git switch 'github-bot/gh-1179'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1179'
git switch 'github-bot/gh-1179'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1179'
git switch 'main'
git merge --squash 'github-bot/gh-1179'
git switch 'main'
git merge --ff-only 'github-bot/gh-1179'
git switch 'main'
git merge 'github-bot/gh-1179'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.