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

Open
opened 2026-11-26 20:17:37 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/307
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: old-pr/10042


📝 Commits (1)

  • 26eedb7 d3d12_clear_test: report Vulkan driver NaN depth-clear canonicalization to 1.0 on AMD

📊 Changes

1 file changed (+20 additions, -4 deletions)

View changed files

📝 runtime/test/d3d12_clear_test.cpp (+20 -4)

📄 Description

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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/307 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/10042` --- ### 📝 Commits (1) - [`26eedb7`](https://github.com/ubiquitarianism/leonida/commit/26eedb7f7359fc3cf1fffb4cdb10ef5ce5548d7c) d3d12_clear_test: report Vulkan driver NaN depth-clear canonicalization to 1.0 on AMD ### 📊 Changes **1 file changed** (+20 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `runtime/test/d3d12_clear_test.cpp` (+20 -4) </details> ### 📄 Description > 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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
starred/leonida#359
No description provided.