mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:40:52 +01:00
[PR #2167] runtime: stage CopyResource into partial BC mip tails #2172
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#2172
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/2167
Author: @timbot103
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:d3d-copyresource-bc-mip-tail📝 Commits (1)
dddf9adruntime: stage CopyResource into partial BC mip tails📊 Changes
4 files changed (+297 additions, -29 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+3 -0)📝
runtime/src/vulkan_replay.h(+51 -12)📝
runtime/test/d3d12_copy_xfmt_test.cpp(+105 -17)📝
runtime/test/replay_copy_offset_test.cpp(+138 -0)📄 Description
Claimed in the coordination issue as: D3D-COPYRESOURCE-BC-MIP-TAIL
What and why
Native D3D12 WARP accepts a four-mip
CopyResourcefrom an 8×1R32G32_UINTtexture into a 32×4BC1_UNORMtexture. At mip 1, the destination is only two texels high and the source still supplies a complete BC block. Vulkan replay previously rejected the whole command asinvalid_copy.Replay now checks that all source blocks fit before choosing how to copy. If any write reaches a partial BC edge, it stages every mip and array layer through one transfer buffer. The read and write use their own physical extents. Fully fitting copies keep the direct
vkCmdCopyImagepath, and a lower mip may still leave destination blocks untouched.Tested
d3d12_copy_xfmt_testcompared BC1 and BC7, both orientations, four mips, and one or two array layers. Each GPU matched native WARP and the synthetic upload in all eight cases, across 48 subresources and 2,160 payload bytes per run. On the original runtime, both GPUs returnedinvalid_copyfor all eight while WARP matched every payload.replay_copy_offset_testchecks the actual transfer regions, scratch offsets, write-to-read barrier, allocation failures, overflow, direct copies, oversized reverse copies, and existing image-copy predication behavior.gta6rtand introduced zero warnings over the baseline.GPUs tested: NVIDIA GeForce RTX 5080 (616.64) and AMD Radeon(TM) Graphics (25.10.30.02), Windows 11 Pro build 26200. Native reference: Microsoft Basic Render Driver (retail WARP).
AI-assisted: yes (Gemini, Codex)
Checklist
main(f1afede5e) and merges cleanly.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.