mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:00:52 +01:00
[PR #240] d3d12: color MIN and MAX resolves for typed 2D resources #291
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#291
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/240
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:old-pr/9971📝 Commits (2)
ab27482Implement Vulkan color MIN and MAX resolves95c52eetest: d3d12_vulkan_device expects a colour MAX resolve to be accepted and keeps a non-resolve mode refused📊 Changes
12 files changed (+730 additions, -12 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 -9)📝
runtime/test/d3d12_msaa_draw_test.cpp(+38 -3)📝
runtime/test/d3d12_vulkan_device_test.cpp(+5 -0)📄 Description
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):What
Vulkan color
D3D12_RESOLVE_MODE_MIN/MAXresolves for typed 2D resources (ResolveSubresourceRegion). The replay now runs a small fullscreen pass (runtime/src/color_resolve.vert/.frag, SPIR-V checked in ascolor_resolve_spv.h, drivervulkan_color_resolve.h) that takes the per-channel min or max over the samples of the source. AVERAGE and the existing depth/stencil path are unchanged. A mode that is not a colour resolve at all (for example ENCODE_SAMPLER_FEEDBACK, value 4) is still refused at Close with E_INVALIDARG.Why
Before this, a command list with a colour MIN or MAX resolve failed at
ExecuteCommandLists("invalid copy or resolve; nothing was submitted"), so any frame that records one is dropped whole. That is a first-frame blocker for titles that use these modes.Rebased cleanly on current main; supersedes
#8685closed during org migration.Tested
Built locally with clang-cl-19 + xwin and run under Wine 10 on lavapipe (llvmpipe, LLVM 19.1.7). No GPU pod: all pods are off.
d3d12_msaa_draw_test: exit 0 with the fix. Output: "MSAA: 4x draws resolved, 4096 pixels matched; 64 of 189 edge pixels are partial". New checks: a 4x target with only sample 0 written resolves to {0,0,0,255} under MIN and {0,255,255,255} under MAX inside the 8x8 rect, and to the 1:3 mix under AVERAGE, all 64 pixels x 3 modes compared byte for byte with a read-back.d3d12_msaa_draw_testexits 1 atline 296: list->Close() == S_OK;d3d12_vulkan_device_testexits 1 at its new line 6280list->Close() == S_OK(colour MAX resolve).d3d12_vulkan_device_test: passes the new MAX-accepted and mode-4-refused checks, then stops at line 6581 (tiles == 1, GetResourceTiling on llvmpipe). The same line 6581 failure occurs on main without my change.d3d12_depth_resolve_testandd3d12_view_slices_testexit 1 on llvmpipe both with and without this change; their full output is line for line identical (47 lines; view_slices "6 failures" on both). No regression, but not a clean pass either.Not verified
#9809/#9815fix it). For the runs I applied a throwaway local patch to those two shim files in a scratch tree; it is not in this PR. I rebased onto the latest main afterwards without rebuilding.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.