mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:50:52 +01:00
[PR #1894] d3d12: stage title textures when their format or usage rules out host copies #1908
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#1908
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/1894
Author: @ecox982745
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:ecox/title-staged-per-format📝 Commits (3)
14f04ced3d12: stage title textures when the image cannot take host copies06ba2ebd3d12: stage title images when host transfer has no memory type2d258c8d3d12: log the title staging fallback once per Vulkan format📊 Changes
3 files changed (+128 additions, -23 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+9 -5)📝
runtime/shims/d3d12_vulkan_device.cpp(+27 -18)📝
runtime/test/d3d12_existing_heap_test.cpp(+92 -0)📄 Description
Claimed as
RT-TITLE-STAGED-PER-FORMATin the coordination issue. This addresses the format-specific follow-up from the #1827 merge note.Depends on: #1827 (merged).
What and why
A Vulkan device can expose host image copy and still refuse it for a particular format or combination of image usages. In that case the runtime successfully created the image without host-transfer usage, but a subsequent title-texture refresh skipped its upload. Both a linear movie-plane fixture and a tiled compressed image returned incorrect bytes.
The runtime selects mandatory staging when the format, image usage or compatible memory types rule out host transfer. A GTX 1050 Ti reported no bindable memory type for a host-transfer R8 movie plane. Pascal hardware report A CPU-visible, single-sampled colour title image can use ordinary image memory and queue the upload when host transfer is unavailable. Images that can use either path retain the existing placement heuristic and host-backing retry. An allocation failure on an image that requires staging propagates normally.
Tested
Windows 11, NVIDIA GeForce RTX 4090 (616.64), MSVC 19.44. The test keeps host image copy enabled on the real device. A test shim masks the R8 format feature and separately rejects host-transfer usage in the BC1 image-support query.
446574e76with only the new test,d3d12_existing_heapfailed both readbacks: the persistently mapped R8 plane and the four-mip, two-slice BC1 array.14f04ce2d, both readbacks pass. All three existing heap CTests passed (default, write watch disabled, write watch enabled), including the unmasked controls.06ba2eb2d, a test shim reproduced the Pascal driver's empty memory type mask for a 256×8 R8 image. The previous head failed the pixel check. All three existing-heap CTests passed on the RTX 4090 with the fix, both with and without Vulkan validation. RTX 4090 test details2d258c8cd, the fallback logs the Vulkan format once per process for each affected format. The same three tests passed on the RTX 4090 with validation enabled and disabled (6/6). The shim produced exactly one format 9 (R8) fallback message in each test process.git diff --checkpassed.All texture inputs are synthetic. These tests exercise format-specific uploads and pixel readback on the reported GPUs.
AI-assisted: OpenAI Codex (
gpt-6.2-astra).Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.