d3d12: stage title textures when their format or usage rules out host copies #1894

Open
github-bot wants to merge 3 commits from github-bot/gh-1894 into main AGit
Owner

@⁠ecox982745 on GitHub · 2026-11-25 14:52 UTC · original
ecox982745:ecox/title-staged-per-format → main · +128 −23 · 3 files · 3 commits · open

Claimed as RT-TITLE-STAGED-PER-FORMAT in 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.

  • On main 446574e76 with only the new test, d3d12_existing_heap failed both readbacks: the persistently mapped R8 plane and the four-mip, two-slice BC1 array.
  • At 14f04ce2d, both readbacks pass. All three existing heap CTests passed (default, write watch disabled, write watch enabled), including the unmasked controls.
  • At 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 details
  • At the same revision, @⁠qhukz13 reran all three existing-heap tests on a physical GTX 1050 Ti, Windows 10, NVIDIA 582.66. Each test passed three times with Vulkan validation enabled and three times with it disabled (18/18). The tester reported no validation messages. Instrumenting the earlier revision showed an empty memory type mask for R8, RGBA8 and BC1 title images. GTX 1050 Ti results
  • At 2d258c8cd, 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.
  • CPU semantic suite: 6,288 tests across 489 files, zero failing files. Documentation links: 16 passed. Line-ending tests: 3 passed. The no-game-data check and git diff --check passed.

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

  • Based on current main and checked for a clean merge.
  • One topic.
  • No game data, keys or decryption.
  • No shader translator rule changed.
**@⁠ecox982745** on GitHub · 2026-11-25 14:52 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1894) `ecox982745:ecox/title-staged-per-format` → `main` · +128 −23 · 3 files · 3 commits · open Claimed as `RT-TITLE-STAGED-PER-FORMAT` in [the coordination issue](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608). This addresses the format-specific follow-up from the [#1827 merge note](https://git.gtahub.st/github/ubiquitarianism--leonida/pulls/1827). 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](https://git.gtahub.st/github/ubiquitarianism--leonida/pulls/1894) 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. - On main `446574e76` with only the new test, `d3d12_existing_heap` failed both readbacks: the persistently mapped R8 plane and the four-mip, two-slice BC1 array. - At `14f04ce2d`, both readbacks pass. All three existing heap CTests passed (default, write watch disabled, write watch enabled), including the unmasked controls. - At `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 details](https://git.gtahub.st/github/ubiquitarianism--leonida/pulls/1894) - At the same revision, @⁠qhukz13 reran all three existing-heap tests on a physical GTX 1050 Ti, Windows 10, NVIDIA 582.66. Each test passed three times with Vulkan validation enabled and three times with it disabled (18/18). The tester reported no validation messages. Instrumenting the earlier revision showed an empty memory type mask for R8, RGBA8 and BC1 title images. [GTX 1050 Ti results](https://git.gtahub.st/github/ubiquitarianism--leonida/pulls/1894) - At `2d258c8cd`, 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. - CPU semantic suite: 6,288 tests across 489 files, zero failing files. Documentation links: 16 passed. Line-ending tests: 3 passed. The no-game-data check and `git diff --check` passed. 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 - [x] Based on current main and checked for a clean merge. - [x] One topic. - [x] No game data, keys or decryption. - No shader translator rule changed.
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)
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 #1894)

AI-assisted-by: OpenAI Codex (gpt-6.2-astra)
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 #1894)

AI-assisted-by: OpenAI Codex (gpt-6.2-astra)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:10:25 +00:00
Author
Owner

@⁠Tyrannys on GitHub · 2026-11-25 18:12 UTC · original · edited 2026-11-25 18:55 UTC

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: main fe1553456 (already contains #1827 and #1893), plus #674, #1662, #1851, #1849, #1905, #1957, #1950, #1886 and #1894. All of them merged without conflicts.

Shaders: translated on 3de22a190 + #674 + #1662 with --wave64-emulate. 29,279 of 29,280 translated, and all 29,279 pass spirv-val. That is 2,683 library programs and 29 of 29 FSPX. main's translator changes since then are correctness fixes only.

Pipeline cache: warm and complete, 26,503 of 26,503 (9.6 GB).

  • Three library compute programs took 30 to 32 minutes each to build alone: the ScreenProbes ActivateRays, ActivateProbes and ActivateProbesTarget programs of indirect diffuse lighting.
  • Building all three at once crashed the NVIDIA compiler ("NVVM compilation failed: 3", after 22 minutes).

Recipe: scripts/windows-boot/boot.ps1 -Seconds 480, LEONIDA_KEYBOARD_PAD=1 LEONIDA_SKIP_INT3=1 LEONIDA_TITLE_WINDOWS_MB=1024 LEONIDA_MAP_READBACK=1, LEONIDA_PIPELINE_CACHE_DIR pointing at the offline cache. Host image copy: off (auto: NVIDIA) from #1851. One run per row.

run 1 run 2 (+ LEONIDA_TITLE_WATCHDOG=0)
end 344 s: the title's hang watchdog (null write at game_scarlett_master.exe+0x23cf683) full 484 s, stopped by the script
device loss / fault report none none
D3D12 calls 330,487 375,686
ExecuteCommandLists 5,490 6,017
Dispatch / DrawIndexedInstanced 2,435 / 2,726 2,779 / 6,026
PresentX 1,358 ok, 0 failed 1,465 ok, 0 failed
captures 23, all non-black 25, all non-black
indirect draws recorded / emitted / skipped 64 / 0 / 5,092 128 / 34 / 9,244 (#429 not included)
  • WRITE_INVALID: the world-start WRITE_INVALID did not happen in either run. On this machine it ended an earlier run with host image copies on (main 42537e7b6 + #1631; my run table of 07:54 in #1608).
  • #1950 / #1886: in run 1 the exit filter ran on the title's fatal exception: "1 pipeline build(s) still running at exit; writing the pipelines finished so far". It then refused the write: "pipeline cache is 9722912321 bytes, over the 4294967296-byte write limit". With a seeded offline cache, the union is past 4 GiB, so nothing from the session was kept. This is the seeded case raised on #1886. No session file was written in either run.

AI-assisted (Claude Code).

**@⁠Tyrannys** on GitHub · 2026-11-25 18:12 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1894#issuecomment-7170582625) · edited 2026-11-25 18:55 UTC 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:** `main` `fe1553456` (already contains #1827 and #1893), plus #674, #1662, #1851, #1849, #1905, #1957, #1950, #1886 and #1894. All of them merged without conflicts. **Shaders:** translated on `3de22a190` + #674 + #1662 with `--wave64-emulate`. 29,279 of 29,280 translated, and all 29,279 pass `spirv-val`. That is 2,683 library programs and 29 of 29 FSPX. `main`'s translator changes since then are correctness fixes only. **Pipeline cache:** warm and complete, 26,503 of 26,503 (9.6 GB). - Three library compute programs took 30 to 32 minutes each to build alone: the ScreenProbes `ActivateRays`, `ActivateProbes` and `ActivateProbesTarget` programs of indirect diffuse lighting. - Building all three at once crashed the NVIDIA compiler ("NVVM compilation failed: 3", after 22 minutes). **Recipe:** `scripts/windows-boot/boot.ps1 -Seconds 480`, `LEONIDA_KEYBOARD_PAD=1 LEONIDA_SKIP_INT3=1 LEONIDA_TITLE_WINDOWS_MB=1024 LEONIDA_MAP_READBACK=1`, `LEONIDA_PIPELINE_CACHE_DIR` pointing at the offline cache. Host image copy: `off (auto: NVIDIA)` from #1851. One run per row. | | run 1 | run 2 (+ `LEONIDA_TITLE_WATCHDOG=0`) | |---|---|---| | end | 344 s: the title's hang watchdog (null write at `game_scarlett_master.exe+0x23cf683`) | full 484 s, stopped by the script | | device loss / fault report | none | none | | D3D12 calls | 330,487 | 375,686 | | ExecuteCommandLists | 5,490 | 6,017 | | Dispatch / DrawIndexedInstanced | 2,435 / 2,726 | 2,779 / 6,026 | | PresentX | 1,358 ok, 0 failed | 1,465 ok, 0 failed | | captures | 23, all non-black | 25, all non-black | | indirect draws recorded / emitted / skipped | 64 / 0 / 5,092 | 128 / 34 / 9,244 (#429 not included) | - **WRITE_INVALID:** the world-start WRITE_INVALID did not happen in either run. On this machine it ended an earlier run with host image copies on (`main` `42537e7b6` + #1631; my run table of 07:54 in #1608). - **#1950 / #1886:** in run 1 the exit filter ran on the title's fatal exception: "1 pipeline build(s) still running at exit; writing the pipelines finished so far". It then refused the write: "pipeline cache is 9722912321 bytes, over the 4294967296-byte write limit". With a seeded offline cache, the union is past 4 GiB, so nothing from the session was kept. This is the seeded case raised on #1886. No session file was written in either run. AI-assisted (Claude Code).
Author
Owner

@⁠ecox982745 on GitHub · 2026-11-25 18:46 UTC · original · edited 2026-11-25 20:24 UTC

Updated for 06ba2eb2d (Pascal memory-type fix). I rebuilt this head with #2020 e500e9949. There is still one conflict in Resource::create_texture. Keep #1894's side of the conflicting hunk and use const bool can_stage = can_stage_title && (!shared_zero_ || no_host_copy);. All three existing-heap CTests passed on the RTX 4090 with Vulkan validation enabled, including the new zero-memory-type R8 fixture and #2020's shared BC placement checks.

I tested this PR (14f04ce2d) together with DadaCap's #2020 (e500e9949) on an RTX 4090, Windows 11, NVIDIA 616.64. The two heads have one merge conflict, in Resource::create_texture. Git merged the documentation and test changes cleanly.

For whoever rebases the second PR, the resolution I tested was to keep #1894's side of the conflicting hunk and replace !shared_zero_ in can_stage with (!shared_zero_ || no_host_copy). The resulting declaration is:

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 LEONIDA_PLACED_IMAGE_DEFER=0, the default CTest also passed and reported eager allocation with the same 512 bytes intact. These are synthetic GPU readbacks. AI-assisted verification with OpenAI Codex.

**@⁠ecox982745** on GitHub · 2026-11-25 18:46 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1894#issuecomment-7171384333) · edited 2026-11-25 20:24 UTC **Updated for `06ba2eb2d` (Pascal memory-type fix).** I rebuilt this head with #2020 `e500e9949`. There is still one conflict in `Resource::create_texture`. Keep #1894's side of the conflicting hunk and use `const bool can_stage = can_stage_title && (!shared_zero_ || no_host_copy);`. All three existing-heap CTests passed on the RTX 4090 with Vulkan validation enabled, including the new zero-memory-type R8 fixture and #2020's shared BC placement checks. I tested this PR (`14f04ce2d`) together with DadaCap's #2020 (`e500e9949`) on an RTX 4090, Windows 11, NVIDIA 616.64. The two heads have **one merge conflict**, in `Resource::create_texture`. Git merged the documentation and test changes cleanly. For whoever rebases the second PR, the resolution I tested was to keep #1894's side of the conflicting hunk and replace `!shared_zero_` in `can_stage` with `(!shared_zero_ || no_host_copy)`. The resulting declaration is: ```cpp 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 `LEONIDA_PLACED_IMAGE_DEFER=0`, the default CTest also passed and reported eager allocation with the same 512 bytes intact. These are synthetic GPU readbacks. AI-assisted verification with OpenAI Codex.
Author
Owner

@⁠qhukz13 on GitHub · 2026-11-25 19:57 UTC · original

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 9f9a7c5f3, with and without this PR (14f04ce2d, merged cleanly), d3d12_existing_heap* 3x each, plain and with LEONIDA_VK_VALIDATION=1.

Result is the same on both sides: d3d12_existing_heap, _no_write_watch and _write_watch fail, d3d12_host_prefix passes, no validation messages. The failure is the persistent slot-133 plane on the real (unmasked) device:

[rt] d3d12: texture memory unavailable: 2048 bytes, alignment 1024, type bits 0x0 (vk format 9 256x8)
persistent slot-133 plane line 1395: std::all_of(pixels.begin(), pixels.end(), [&](auto value) { return value == 61 * pass; })

The PR's own masked-R8 device and the host_image_copy = false device pass the same check here, so the new path works; it is just not taken for this case. Reading Resource::create_texture at 14f04ce2d: for a placed LINEAR title image whose format does take host transfer, host_transfer_ stays true, so needs_staging is false; the placement heuristic is skipped by !linear_placement; the image is created with HOST_TRANSFER; bind_texture_memory gets memoryTypeBits == 0; and can_retry_host is false, so create_texture returns E_OUTOFMEMORY. The recreate-without-HOST_TRANSFER fallback from #1364 lives only in the origin == ordinary branch, so it never runs for title images.

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 can_stage && host_transfer_, check device_.memory_requirements(info, with) up front and, if with.memoryTypeBits == 0, drop VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT, set host_transfer_ = false and take the needs_staging branch (any compatible type). This is the case Pascal hits for a movie plane, which is on the boot path. Happy to rerun a fix here.

AI-assisted (Claude Code).

**@⁠qhukz13** on GitHub · 2026-11-25 19:57 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1894#issuecomment-7172992761) 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 `9f9a7c5f3`, with and without this PR (`14f04ce2d`, merged cleanly), `d3d12_existing_heap*` 3x each, plain and with `LEONIDA_VK_VALIDATION=1`. Result is the same on both sides: `d3d12_existing_heap`, `_no_write_watch` and `_write_watch` fail, `d3d12_host_prefix` passes, no validation messages. The failure is the persistent slot-133 plane on the real (unmasked) device: ``` [rt] d3d12: texture memory unavailable: 2048 bytes, alignment 1024, type bits 0x0 (vk format 9 256x8) persistent slot-133 plane line 1395: std::all_of(pixels.begin(), pixels.end(), [&](auto value) { return value == 61 * pass; }) ``` The PR's own masked-R8 device and the `host_image_copy = false` device pass the same check here, so the new path works; it is just not taken for this case. Reading `Resource::create_texture` at `14f04ce2d`: for a placed LINEAR title image whose format does take host transfer, `host_transfer_` stays true, so `needs_staging` is false; the placement heuristic is skipped by `!linear_placement`; the image is created with HOST_TRANSFER; `bind_texture_memory` gets `memoryTypeBits == 0`; and `can_retry_host` is false, so `create_texture` returns `E_OUTOFMEMORY`. The recreate-without-HOST_TRANSFER fallback from #1364 lives only in the `origin == ordinary` branch, so it never runs for title images. 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 `can_stage && host_transfer_`, check `device_.memory_requirements(info, with)` up front and, if `with.memoryTypeBits == 0`, drop `VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT`, set `host_transfer_ = false` and take the `needs_staging` branch (any compatible type). This is the case Pascal hits for a movie plane, which is on the boot path. Happy to rerun a fix here. AI-assisted (Claude Code).
Author
Owner

@⁠ecox982745 on GitHub · 2026-11-25 20:22 UTC · original

@⁠qhukz13, could you rerun d3d12_existing_heap, d3d12_existing_heap_no_write_watch and d3d12_existing_heap_write_watch on the GTX 1050 Ti at 06ba2eb2d? Your unmasked device is the check that matters here.

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 VK_LAYER_KHRONOS_validation enabled. The original format and usage restrictions are also covered in those runs. All inputs were synthetic.

AI-assisted with OpenAI Codex (gpt-6.2-astra).

**@⁠ecox982745** on GitHub · 2026-11-25 20:22 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1894#issuecomment-7173571345) @⁠qhukz13, could you rerun `d3d12_existing_heap`, `d3d12_existing_heap_no_write_watch` and `d3d12_existing_heap_write_watch` on the GTX 1050 Ti at `06ba2eb2d`? Your unmasked device is the check that matters here. 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 `VK_LAYER_KHRONOS_validation` enabled. The original format and usage restrictions are also covered in those runs. All inputs were synthetic. AI-assisted with OpenAI Codex (`gpt-6.2-astra`).
Author
Owner

@⁠qhukz13 on GitHub · 2026-11-25 21:01 UTC · original

Rerun at 06ba2eb2d on the GTX 1050 Ti (Windows 10 Pro 19045, NVIDIA 582.66, MSVC RelWithDebInfo), merged onto main 9f9a7c5f3, 3 runs each, plain and with LEONIDA_VK_VALIDATION=1:

test 14f04ce2d 06ba2eb2d
d3d12_existing_heap fails (texture memory unavailable: 2048 bytes ... type bits 0x0 (vk format 9 256x8), plane check at line 1395) passes 3/3, 3/3
d3d12_existing_heap_no_write_watch fails, same passes 3/3, 3/3
d3d12_existing_heap_write_watch fails, same passes 3/3, 3/3
d3d12_host_prefix, d3d12_subresource_copy pass pass 3/3, 3/3

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 14f04ce2d, same tests) took that branch for title images of vk format 9 (R8_UNORM), 37 (R8G8B8A8_UNORM) and 133 (BC1_RGBA_UNORM_BLOCK), so "Pascal gives a HOST_TRANSFER image no memory type" is the general case here, not an R8 quirk. Your head does not log that branch, so I could not count it there; a log_once on it would make the next report easier.

AI-assisted (Claude Code).

**@⁠qhukz13** on GitHub · 2026-11-25 21:01 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1894#issuecomment-7174515492) Rerun at `06ba2eb2d` on the GTX 1050 Ti (Windows 10 Pro 19045, NVIDIA 582.66, MSVC RelWithDebInfo), merged onto main `9f9a7c5f3`, 3 runs each, plain and with `LEONIDA_VK_VALIDATION=1`: | test | `14f04ce2d` | `06ba2eb2d` | |---|---|---| | `d3d12_existing_heap` | fails (`texture memory unavailable: 2048 bytes ... type bits 0x0 (vk format 9 256x8)`, plane check at line 1395) | passes 3/3, 3/3 | | `d3d12_existing_heap_no_write_watch` | fails, same | passes 3/3, 3/3 | | `d3d12_existing_heap_write_watch` | fails, same | passes 3/3, 3/3 | | `d3d12_host_prefix`, `d3d12_subresource_copy` | pass | pass 3/3, 3/3 | 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 `14f04ce2d`, same tests) took that branch for title images of `vk format 9` (R8_UNORM), `37` (R8G8B8A8_UNORM) and `133` (BC1_RGBA_UNORM_BLOCK), so "Pascal gives a HOST_TRANSFER image no memory type" is the general case here, not an R8 quirk. Your head does not log that branch, so I could not count it there; a `log_once` on it would make the next report easier. AI-assisted (Claude Code).
Author
Owner

@⁠qhukz13 on GitHub · 2026-11-26 19:05 UTC · original

One more data point for this PR, from a full ctest baseline on Pascal. On current main the title-placed texture tests fail, and with this PR they pass. GTX 1050 Ti, NVIDIA 582.66, Windows 10, both sides built from main e57bc63bc, the PR merged in cleanly:

test main main + this PR (2d258c8cd)
d3d12_existing_heap fails: persistent slot-133 plane, line 1530 (pixels not 61 * pass) passes
d3d12_existing_heap_no_write_watch fails, same line passes
d3d12_existing_heap_write_watch fails, same line passes
d3d12_mapped_plane_async fails: first use line 1584: filled passes
d3d12_vulkan_device fails, line 7362: heap_mismatches <= 0 fails the same way (separate issue)

On main the log shows slot 133 texture not created (hr 0x80070057, layout 6): dim 3 format 28 64x64x1 mips 12: an R8G8B8A8 texture the title places in its own memory is refused on this card, the HOST_TRANSFER case this PR handles. So the PR matters on Pascal for title-placed textures on that path in general, not only for the movie plane. The d3d12_vulkan_device failure is unrelated: it fails identically on both sides.

AI-assisted (Claude Code).

**@⁠qhukz13** on GitHub · 2026-11-26 19:05 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1894#issuecomment-7201177728) One more data point for this PR, from a full `ctest` baseline on Pascal. On current main the title-placed texture tests fail, and with this PR they pass. GTX 1050 Ti, NVIDIA 582.66, Windows 10, both sides built from main `e57bc63bc`, the PR merged in cleanly: | test | main | main + this PR (`2d258c8cd`) | |---|---|---| | `d3d12_existing_heap` | **fails**: persistent slot-133 plane, `line 1530` (pixels not `61 * pass`) | passes | | `d3d12_existing_heap_no_write_watch` | fails, same line | passes | | `d3d12_existing_heap_write_watch` | fails, same line | passes | | `d3d12_mapped_plane_async` | fails: `first use line 1584: filled` | passes | | `d3d12_vulkan_device` | fails, `line 7362: heap_mismatches <= 0` | fails the same way (separate issue) | On main the log shows `slot 133 texture not created (hr 0x80070057, layout 6): dim 3 format 28 64x64x1 mips 12`: an R8G8B8A8 texture the title places in its own memory is refused on this card, the HOST_TRANSFER case this PR handles. So the PR matters on Pascal for title-placed textures on that path in general, not only for the movie plane. The `d3d12_vulkan_device` failure is unrelated: it fails identically on both sides. AI-assisted (Claude Code).
Author
Owner

@⁠robot00f on GitHub · 2026-11-27 05:57 UTC · original

Independent check on real Pascal hardware of head 2d258c8c, for the case @⁠qhukz13 reported on 14f04ce2d (that commit predates the memory-type fix, so it could not have covered it).

Machine: Windows 10 Pro 22H2 (19045), Intel Core i7-2600, 4 GB GeForce GTX 1050 Ti, NVIDIA 582.28, MSVC 19.44 RelWithDebInfo.

Setup: main d1dff794, with only the two runtime files of this PR applied (clean 3-way apply; no commit, nothing pushed). The test binary was rebuilt from both trees with the same build directory.

Before (main d1dff794): d3d12_existing_heap failed 3 of 3 runs, exit 1, at the persistent slot-133 plane check (std::all_of(pixels..., value == 61 * pass)), with this line twice per run:

[rt] d3d12: texture memory unavailable: 2048 bytes, alignment 1024, type bits 0x0 (vk format 9 256x8)

That is the real driver's memoryTypeBits == 0 for the 256x8 R8 plane, not the test shim, and it lands on the title-image branch (d3d12_vulkan_device.cpp, the origin != TitleImageOrigin::ordinary path) that had no recreate-without-host-transfer step.

After (2d258c8c): the same test passed 3 of 3 runs, exit 0, and the new line appeared 3 times per run:

[rt] d3d12: title image has no host-transfer memory type, using staging for Vulkan format ...

ctest -R "^d3d12_existing_heap" then reported 3 of 3 passed (the default, _no_write_watch and _write_watch entries). I stopped the repeated CTest iterations there, so the three CTest entries have one full pass each rather than three.

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).

**@⁠robot00f** on GitHub · 2026-11-27 05:57 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1894#issuecomment-7211090914) Independent check on real Pascal hardware of head `2d258c8c`, for the case @⁠qhukz13 reported on `14f04ce2d` (that commit predates the memory-type fix, so it could not have covered it). **Machine:** Windows 10 Pro 22H2 (19045), Intel Core i7-2600, 4 GB GeForce GTX 1050 Ti, NVIDIA 582.28, MSVC 19.44 RelWithDebInfo. **Setup:** `main` `d1dff794`, with only the two runtime files of this PR applied (clean 3-way apply; no commit, nothing pushed). The test binary was rebuilt from both trees with the same build directory. **Before (`main` `d1dff794`):** `d3d12_existing_heap` failed 3 of 3 runs, exit 1, at the persistent slot-133 plane check (`std::all_of(pixels..., value == 61 * pass)`), with this line twice per run: ``` [rt] d3d12: texture memory unavailable: 2048 bytes, alignment 1024, type bits 0x0 (vk format 9 256x8) ``` That is the real driver's `memoryTypeBits == 0` for the 256x8 R8 plane, not the test shim, and it lands on the title-image branch (`d3d12_vulkan_device.cpp`, the `origin != TitleImageOrigin::ordinary` path) that had no recreate-without-host-transfer step. **After (`2d258c8c`):** the same test passed 3 of 3 runs, exit 0, and the new line appeared 3 times per run: ``` [rt] d3d12: title image has no host-transfer memory type, using staging for Vulkan format ... ``` `ctest -R "^d3d12_existing_heap"` then reported 3 of 3 passed (the default, `_no_write_watch` and `_write_watch` entries). I stopped the repeated CTest iterations there, so the three CTest entries have one full pass each rather than three. **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).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1894/head:github-bot/gh-1894'
git switch 'github-bot/gh-1894'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1894'
git switch 'github-bot/gh-1894'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1894'
git switch 'github-bot/gh-1894'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1894'
git switch 'main'
git merge --squash 'github-bot/gh-1894'
git switch 'main'
git merge --ff-only 'github-bot/gh-1894'
git switch 'main'
git merge 'github-bot/gh-1894'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.