Repository navigation
d3d12: stage title textures when their format or usage rules out host copies - #1894
ecox982745 wants to merge 3 commits into
Conversation
Select the upload path after checking both format features and image usage. Keep required staging available for mapped linear textures and only retry host backing when the image supports it. Exercise both capability failures with synthetic GPU readback. AI-assisted-by: OpenAI Codex (gpt-6.2-astra)
|
Test report from a combined build on a second NVIDIA machine. Counts only. Machine: Windows 11, RTX 4070 SUPER, NVIDIA 621.01, 64 GB, own 1.0.2.1 copy. Build: Shaders: translated on Pipeline cache: warm and complete, 26,503 of 26,503 (9.6 GB).
Recipe:
AI-assisted (Claude Code). |
|
Updated for I tested this PR ( For whoever rebases the second PR, the resolution I tested was to keep #1894's side of the conflicting hunk and replace const bool can_stage = stage_title && allow_staged_title && (!shared_zero_ || no_host_copy) && cpu_copyable &&
origin != TitleImageOrigin::ordinary && format.aspects == VK_IMAGE_ASPECT_COLOR_BIT;This keeps #2020's shared zero image eligible for a later staged upload when host image copies are disabled. It also keeps #1894's fallback when the device supports host image copies but the particular texture cannot use them. The rest of the source merged automatically. All three existing-heap CTests passed on that resolution (default, write watch off, write watch on). They exercised the R8 format restriction, the BC1 image-usage restriction, and the device-wide host-copy-off case. With deferral enabled, the compressed placements shared the initial image and retained all 512 checked bytes after a CPU write and GPU copy. With |
|
Ran this on a GPU where the driver itself takes host image copy for the format but gives the HOST_TRANSFER image no memory type: Windows 10 Pro 19045, GeForce GTX 1050 Ti (Pascal, 4 GB, no Resizable BAR), NVIDIA 582.66, MSVC RelWithDebInfo. Base main Result is the same on both sides: The PR's own masked-R8 device and the This predates the PR, but the PR is the natural place for it: treat "HOST_TRANSFER leaves no memory type" like "the format refuses host transfer". For example, when AI-assisted (Claude Code). |
Check the host-transfer memory requirements before selecting the backing for a CPU-fillable title texture. Exercise the mapped linear R8 plane with a driver shim that returns no compatible memory types for the host-transfer image. Reported-by: qhukz13 (PR ProjectLeonida#1894) AI-assisted-by: OpenAI Codex (gpt-6.2-astra)
|
@qhukz13, could you rerun The runtime now checks which memory types the host-transfer image can bind before choosing its backing. If the driver returns zero types, a CPU-fillable colour title image takes the staged upload path. This includes the mapped linear R8 plane from your report. On the RTX 4090 (Windows 11, NVIDIA 616.64), a Vulkan test shim made only the 256×8 R8 host-transfer image report zero memory types. The previous PR head reproduced your 2,048-byte allocation failure and failed the pixel check. At the new head, all three CTests passed with validation off and all three passed with AI-assisted with OpenAI Codex ( |
|
Rerun at
No validation messages. So the real unmasked device is fixed, thanks. One more data point for the docs or the comment: on this driver it is not only the R8 plane. A variant of the same check that logs (a local commit of mine on top of AI-assisted (Claude Code). |
Record which title image formats have no bindable host-transfer memory type. Document the three formats observed on the GTX 1050 Ti by qhukz13. Suggested-by: qhukz13 (PR ProjectLeonida#1894) AI-assisted-by: OpenAI Codex (gpt-6.2-astra)
|
One more data point for this PR, from a full
On main the log shows AI-assisted (Claude Code). |
|
Independent check on real Pascal hardware of head Machine: Windows 10 Pro 22H2 (19045), Intel Core i7-2600, 4 GB GeForce GTX 1050 Ti, NVIDIA 582.28, MSVC 19.44 RelWithDebInfo. Setup: Before ( That is the real driver's After (
Not covered by this check: validation layers were not enabled, other tests were not run, and only the memory-type branch above was exercised (the shim-forced paths were left alone). AI-assisted (OpenCode, DeepSeek). |
…#1150) Five rows of the previous tables re-run three times each on the same GTX 1050 Ti / Windows 10 19045 host: d3d12_subresource_copy and d3d12_r9g9b9e5_uav now pass, d3d12_existing_heap needs ProjectLeonida#1894, and both remaining heap rows (d3d12_heap_properties ALLOW_ALL and the d3d12_vulkan_device HARDWARE_PROTECTED row) are the tier-1 host gate that ProjectLeonida#1389 covers. AI-assisted (OpenCode, DeepSeek).
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