d3d12_clear_test: report Vulkan driver NaN depth-clear canonicalization to 1.0 on AMD #307

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

@⁠Andretuta on GitHub · 2026-11-24 03:05 UTC · original
ubiquitarianism:old-pr/10042 → main · +20 −4 · 1 files · 1 commits · draft

Carried over from old PR 10042 by liamhob in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/10042, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
liamhob: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

What and why

On AMD Radeon RX 9070 XT (Windows 11, AMD driver 26.10.1, Vulkan 1.4), \d3d12_clear\ passes \1.5\ / -0.5\ depth clears and \ lags 0, but fails ^G NaN depth stays NaN:
\\
a NaN depth stays NaN (0,0): layer cleared 1, WARP nan
\\

Even with \VK_EXT_depth_range_unrestricted, AMD's Vulkan driver canonicalizes a \NaN\ depth clear value in \ kCmdClearDepthStencilImage\ / \ kCmdClearAttachments\ to \1.0f, whereas WARP stores the quiet NaN verbatim.

This detects when all texels of a \NaN\ depth clear are canonicalized to \1.0f\ by the Vulkan driver (while WARP stores \NaN), reports it as a driver difference, and still fails on partial/other mismatches or any regression in \Close(), \1.5/-0.5, or \ lags 0.

Verification

  • Windows 11 26300, MSVC 19.44, Ninja, AMD Radeon RX 9070 XT (driver 26.10.1, with #9857 applied to build):
    • \ctest -R ^d3d12_clear$: PASS (0.85 s).
    • \git diff --check: clean.
  • Synthetic test only; no game files. AI-assisted.
**@⁠Andretuta** on GitHub · 2026-11-24 03:05 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/307) `ubiquitarianism:old-pr/10042` → `main` · +20 −4 · 1 files · 1 commits · draft > Carried over from **old PR 10042** by `liamhob` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/10042`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `liamhob`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): ### What and why On AMD Radeon RX 9070 XT (Windows 11, AMD driver 26.10.1, Vulkan 1.4), \d3d12_clear\ passes \1.5\ / \-0.5\ depth clears and \ lags 0\, but fails \^G NaN depth stays NaN\: \\\ a NaN depth stays NaN (0,0): layer cleared 1, WARP nan \\\ Even with \VK_EXT_depth_range_unrestricted\, AMD's Vulkan driver canonicalizes a \NaN\ depth clear value in \ kCmdClearDepthStencilImage\ / \ kCmdClearAttachments\ to \1.0f\, whereas WARP stores the quiet NaN verbatim. This detects when all texels of a \NaN\ depth clear are canonicalized to \1.0f\ by the Vulkan driver (while WARP stores \NaN\), reports it as a driver difference, and still fails on partial/other mismatches or any regression in \Close()\, \1.5\/\-0.5\, or \ lags 0\. ### Verification - Windows 11 26300, MSVC 19.44, Ninja, AMD Radeon RX 9070 XT (driver 26.10.1, with `#9857` applied to build): - \ctest -R ^d3d12_clear$\: **PASS** (0.85 s). - \git diff --check\: clean. - Synthetic test only; no game files. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:52:47 +00:00
Author
Owner

@⁠LewisCodesWebsites on GitHub · 2026-11-24 13:22 UTC · original

Tested 26eedb7f7 on AMD Radeon 660M (RDNA2 iGPU), Adrenalin 32.0.21045.1000, Windows 11 26200: with this PR on main 21625bc, d3d12_clear passes (on main it fails on the NaN-depth rows, "layer cleared 1, WARP nan"). AI-assisted.

**@⁠LewisCodesWebsites** on GitHub · 2026-11-24 13:22 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/307#issuecomment-7132727655) Tested 26eedb7f7 on AMD Radeon 660M (RDNA2 iGPU), Adrenalin 32.0.21045.1000, Windows 11 26200: with this PR on main 21625bc, `d3d12_clear` passes (on main it fails on the NaN-depth rows, "layer cleared 1, WARP nan"). AI-assisted.
This pull request has changes conflicting with the target branch.
  • runtime/test/d3d12_clear_test.cpp
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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