[PR #1184] [CLOSED] OLD-9971: colour MIN and MAX resolves for typed 2D resources (carries #240) #1217

Closed
opened 2026-11-26 20:20:29 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1184
Author: @TimIdle
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: oldpr-9971-color-minmax


📝 Commits (2)

  • d2e7d19 Implement Vulkan color MIN and MAX resolves
  • 4c484ee test: d3d12_vulkan_device expects a colour MAX resolve to be accepted and keeps a non-resolve mode refused

📊 Changes

12 files changed (+730 additions, -11 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+6 -0)
📝 runtime/shims/d3d12_com.cpp (+9 -0)
📝 runtime/shims/d3d12_com.h (+1 -0)
📝 runtime/shims/d3d12_vulkan_device.cpp (+18 -0)
➕ runtime/src/color_resolve.frag (+31 -0)
➕ runtime/src/color_resolve.vert (+6 -0)
➕ runtime/src/color_resolve_spv.h (+199 -0)
📝 runtime/src/vulkan_backend.h (+20 -0)
➕ runtime/src/vulkan_color_resolve.h (+278 -0)
📝 runtime/src/vulkan_replay.h (+119 -8)
📝 runtime/test/d3d12_msaa_draw_test.cpp (+38 -3)
📝 runtime/test/d3d12_vulkan_device_test.cpp (+5 -0)

📄 Description

Claimed in the coordination issue as: OLD-9971 (claim)

What and why

This carries forward old-pr/9971 by @tedin7 (draft #240). The two commits are cherry-picked onto main unchanged, with tedin7 kept as author.

main serves ResolveSubresourceRegion with D3D12_RESOLVE_MODE_MIN and MAX for depth only. A colour MIN or MAX resolve is refused, so the list fails at Close. Core Vulkan has no colour min or max resolve, so this adds a small fragment-shader resolve (runtime/src/vulkan_color_resolve.h, color_resolve.frag) for typed 2D colour resources, recorded in the replay. docs/d3d12_vulkan.md gets the note.

Tested

Native Windows 11 10.0.26300, MSVC 19.44, RelWithDebInfo, LEONIDA_REQUIRE_VULKAN=ON, on main 42537e7 plus the two commits.

Check Result
d3d12_msaa_draw_test with the fix pass (MIN and MAX compared pixel by pixel with the expected extremes, AVERAGE with the 1:3 mix)
d3d12_msaa_draw_test with main's shims and replay fail: line 296: list->Close() == S_OK (measured on 6293c1c, not rerun after this rebase)
d3d12_vulkan_device_test with the fix pass
d3d12_vulkan_device_test with main's shims and replay fail: line 6291: list->Close() == S_OK (measured on 6293c1c, not rerun after this rebase)
full ctest -j 6 401 of 402 passed, gameinput and gameinput_script disabled. The one failure is d3d12_depth_stencil_uav, a segmentation fault after 304 s in the first run after the build, under -j 6 load. Run alone, it passes 3 of 3 in about 6 s. This PR does not touch that code.

GPUs tested: NVIDIA GeForce RTX 2050 (Ampere GA107, laptop), driver 621.24, Windows 11

AI-assisted: yes (Claude Code)

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. (No translator rule here.)

🤖 Generated with Claude Code


🔄 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/1184 **Author:** [@TimIdle](https://github.com/TimIdle) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `oldpr-9971-color-minmax` --- ### 📝 Commits (2) - [`d2e7d19`](https://github.com/ubiquitarianism/leonida/commit/d2e7d19975a352c4e2fa6753167d2aa91f1d65ac) Implement Vulkan color MIN and MAX resolves - [`4c484ee`](https://github.com/ubiquitarianism/leonida/commit/4c484ee1b8ee7dc393c7cd886d11a4617f9880d3) test: d3d12_vulkan_device expects a colour MAX resolve to be accepted and keeps a non-resolve mode refused ### 📊 Changes **12 files changed** (+730 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+6 -0) 📝 `runtime/shims/d3d12_com.cpp` (+9 -0) 📝 `runtime/shims/d3d12_com.h` (+1 -0) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+18 -0) ➕ `runtime/src/color_resolve.frag` (+31 -0) ➕ `runtime/src/color_resolve.vert` (+6 -0) ➕ `runtime/src/color_resolve_spv.h` (+199 -0) 📝 `runtime/src/vulkan_backend.h` (+20 -0) ➕ `runtime/src/vulkan_color_resolve.h` (+278 -0) 📝 `runtime/src/vulkan_replay.h` (+119 -8) 📝 `runtime/test/d3d12_msaa_draw_test.cpp` (+38 -3) 📝 `runtime/test/d3d12_vulkan_device_test.cpp` (+5 -0) </details> ### 📄 Description Claimed in the coordination issue as: OLD-9971 ([claim](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7142338187)) ### What and why This carries forward `old-pr/9971` by @tedin7 (draft #240). The two commits are cherry-picked onto `main` unchanged, with tedin7 kept as author. `main` serves `ResolveSubresourceRegion` with `D3D12_RESOLVE_MODE_MIN` and `MAX` for depth only. A colour MIN or MAX resolve is refused, so the list fails at `Close`. Core Vulkan has no colour min or max resolve, so this adds a small fragment-shader resolve (`runtime/src/vulkan_color_resolve.h`, `color_resolve.frag`) for typed 2D colour resources, recorded in the replay. `docs/d3d12_vulkan.md` gets the note. ### Tested Native Windows 11 10.0.26300, MSVC 19.44, RelWithDebInfo, `LEONIDA_REQUIRE_VULKAN=ON`, on `main` `42537e7` plus the two commits. | Check | Result | |---|---| | `d3d12_msaa_draw_test` with the fix | pass (MIN and MAX compared pixel by pixel with the expected extremes, AVERAGE with the 1:3 mix) | | `d3d12_msaa_draw_test` with `main`'s shims and replay | fail: `line 296: list->Close() == S_OK` (measured on `6293c1c`, not rerun after this rebase) | | `d3d12_vulkan_device_test` with the fix | pass | | `d3d12_vulkan_device_test` with `main`'s shims and replay | fail: `line 6291: list->Close() == S_OK` (measured on `6293c1c`, not rerun after this rebase) | | full `ctest -j 6` | 401 of 402 passed, `gameinput` and `gameinput_script` disabled. The one failure is `d3d12_depth_stencil_uav`, a segmentation fault after 304 s in the first run after the build, under `-j 6` load. Run alone, it passes 3 of 3 in about 6 s. This PR does not touch that code. | GPUs tested: NVIDIA GeForce RTX 2050 (Ampere GA107, laptop), driver 621.24, Windows 11 AI-assisted: yes (Claude Code) ### 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. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (No translator rule here.) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:20:29 +01:00
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#1217
No description provided.