d3d12: enforce Vulkan BC image-view compatibility classes #2223

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

@⁠GGandCo on GitHub · 2026-11-26 07:04 UTC · original
GGandCo:fix/bc-image-view-classes → main · +126 −4 · 6 files · 3 commits · draft

Claim: RT-BC-VIEW-COMPATIBILITY (#1608, #1608).

Same-sized compressed blocks were treated as compatible Vulkan image views. In particular, BC6H could enter a BC7 image's format list, and matching channel order could resolve BC7 to a BC1 view. These violate Vulkan compatibility classes even when the block footprint matches.

Restrict BC view resolution and castable lists to each codec's Vulkan compatibility class. Numeric twins within a codec use mutable images. CPU-filled streamed textures requested in another same-footprint BC codec get a replacement image in that requested codec, retaining their original console layout for byte addressing and removing retired codecs from the new format list. Existing uncompressed casts remain unchanged.

Validation:

  • Current-main negative control (db1a22d29 header with the new synthetic descriptor test) fails the BC class invariant; the fixed test passes.
  • Clean contribution build: gfx10_descriptors and d3d12_bc_stream_views pass with LEONIDA_VK_VALIDATION=1 on Intel UHD Graphics, driver 32.0.101.6314, Windows 11. The stream fixture registers BC7 sRGB, BC6H unsigned/signed, then BC7 linear at one synthetic allocation, checks nonzero descriptor indices, and retires the images without validation errors.
  • Combined local integration: texture UAV, view slices, textured M2, and descriptor tests passed. This is additional integration evidence, not a full-suite result.
  • git diff --check and check_no_game_data.py passed.

Limits: the new stream fixture checks native view registration and lifetime, not sampled pixel readback. No main-menu, audio, frame-rate or playability claim. No game data included. The full runtime/translator suites were not run for this C++ image-view change.

GPUs tested: Intel UHD Graphics (32.0.101.6314), Windows 11.
AI-assisted with OpenAI Codex.

Updated onto main a73a57e133 in 348901f79. Focused clean-tree tests repeated: 2/2 pass with Vulkan validation. Preserves upstream asynchronous mapped-plane fixture. Draft only because the repository limits non-maintainers to one ready-for-review PR; #2072 currently occupies that slot.

**@⁠GGandCo** on GitHub · 2026-11-26 07:04 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2223) `GGandCo:fix/bc-image-view-classes` → `main` · +126 −4 · 6 files · 3 commits · draft Claim: RT-BC-VIEW-COMPATIBILITY (#1608, https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608). Same-sized compressed blocks were treated as compatible Vulkan image views. In particular, BC6H could enter a BC7 image's format list, and matching channel order could resolve BC7 to a BC1 view. These violate Vulkan compatibility classes even when the block footprint matches. Restrict BC view resolution and castable lists to each codec's Vulkan compatibility class. Numeric twins within a codec use mutable images. CPU-filled streamed textures requested in another same-footprint BC codec get a replacement image in that requested codec, retaining their original console layout for byte addressing and removing retired codecs from the new format list. Existing uncompressed casts remain unchanged. Validation: - Current-main negative control (`db1a22d29` header with the new synthetic descriptor test) fails the BC class invariant; the fixed test passes. - Clean contribution build: `gfx10_descriptors` and `d3d12_bc_stream_views` pass with `LEONIDA_VK_VALIDATION=1` on Intel UHD Graphics, driver 32.0.101.6314, Windows 11. The stream fixture registers BC7 sRGB, BC6H unsigned/signed, then BC7 linear at one synthetic allocation, checks nonzero descriptor indices, and retires the images without validation errors. - Combined local integration: texture UAV, view slices, textured M2, and descriptor tests passed. This is additional integration evidence, not a full-suite result. - `git diff --check` and `check_no_game_data.py` passed. Limits: the new stream fixture checks native view registration and lifetime, not sampled pixel readback. No main-menu, audio, frame-rate or playability claim. No game data included. The full runtime/translator suites were not run for this C++ image-view change. GPUs tested: Intel UHD Graphics (32.0.101.6314), Windows 11. AI-assisted with OpenAI Codex. Updated onto main a73a57e1339be072baf5522351c8ec7f1482b56b in 348901f79. Focused clean-tree tests repeated: 2/2 pass with Vulkan validation. Preserves upstream asynchronous mapped-plane fixture. Draft only because the repository limits non-maintainers to one ready-for-review PR; #2072 currently occupies that slot.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:22:47 +00:00
Author
Owner

@⁠GGandCo on GitHub · 2026-11-26 07:22 UTC · original

Updated to main a73a57e133 in 348901f79. Resolved the test argument-parsing conflict by preserving both the BC-only fixture and upstream's asynchronous mapped-plane case.

Clean contribution build and focused tests repeated on Windows 11, Intel UHD Graphics 32.0.101.6314: gfx10_descriptors and d3d12_bc_stream_views both pass with LEONIDA_VK_VALIDATION=1 (2/2). git diff --check and check_no_game_data.py pass on the six changed files. No full-suite or sampled-pixel claim.

Kept as a draft because this repository limits users without write access to one open ready-for-review PR; #2072 occupies that slot. This is the reason the prior ordinary PR-creation API requests were denied.

AI-assisted: OpenAI Codex.

**@⁠GGandCo** on GitHub · 2026-11-26 07:22 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2223#issuecomment-7185385087) Updated to main a73a57e1339be072baf5522351c8ec7f1482b56b in 348901f79. Resolved the test argument-parsing conflict by preserving both the BC-only fixture and upstream's asynchronous mapped-plane case. Clean contribution build and focused tests repeated on Windows 11, Intel UHD Graphics 32.0.101.6314: gfx10_descriptors and d3d12_bc_stream_views both pass with LEONIDA_VK_VALIDATION=1 (2/2). git diff --check and check_no_game_data.py pass on the six changed files. No full-suite or sampled-pixel claim. Kept as a draft because this repository limits users without write access to one open ready-for-review PR; #2072 occupies that slot. This is the reason the prior ordinary PR-creation API requests were denied. AI-assisted: OpenAI Codex.
Author
Owner

@⁠ecox982745 on GitHub · 2026-11-26 08:52 UTC · original

All 1,024 sampled texels matched on an RTX 4090 (Windows 11, NVIDIA 616.64) at 348901f79. The two stock tests, gfx10_descriptors (CPU) and d3d12_bc_stream_views (GPU), passed. I then extended the descriptor test locally to read the pixels from the bindless texture views.

For each step, I registered a new slot-70 view of the same 8 × 8 allocation, submitted a command list, waited on its fence, and sampled the 64 texels. A separate allocation created directly in the requested format held identical bytes and provided a fresh reference for each step.

View sequence on one allocation Result per run
BC7 sRGB → BC6H unsigned → BC6H signed → BC7 linear → BC7 sRGB 320/320 matched. The four formats produced four distinct reference images. Returning to sRGB reproduced the first image.
BC2 → BC3 → BC2 192/192 matched. I also checked every reference texel against the expected red and alpha values derived directly from the synthetic block.

I ran this once with staged uploads configured and once with host image copy enabled and staging disabled. Both used synchronous fills. Both completed descriptor retirement and device destruction with exit 0 and no Khronos validation messages in the full logs. This covers synthetic point-sampled RGBA8 output at the tested revision.

**@⁠ecox982745** on GitHub · 2026-11-26 08:52 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2223#issuecomment-7187116462) **All 1,024 sampled texels matched** on an RTX 4090 (Windows 11, NVIDIA 616.64) at `348901f79`. The two stock tests, `gfx10_descriptors` (CPU) and `d3d12_bc_stream_views` (GPU), passed. I then extended the descriptor test locally to read the pixels from the bindless texture views. For each step, I registered a new slot-70 view of the **same 8 × 8 allocation**, submitted a command list, waited on its fence, and sampled the 64 texels. A separate allocation created directly in the requested format held identical bytes and provided a fresh reference for each step. | View sequence on one allocation | Result per run | | --- | --- | | BC7 sRGB → BC6H unsigned → BC6H signed → BC7 linear → BC7 sRGB | 320/320 matched. The four formats produced four distinct reference images. Returning to sRGB reproduced the first image. | | BC2 → BC3 → BC2 | 192/192 matched. I also checked every reference texel against the expected red and alpha values derived directly from the synthetic block. | I ran this once with staged uploads configured and once with host image copy enabled and staging disabled. Both used synchronous fills. Both completed descriptor retirement and device destruction with exit 0 and no Khronos validation messages in the full logs. This covers synthetic point-sampled RGBA8 output at the tested revision.
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/2223/head:github-bot/gh-2223'
git switch 'github-bot/gh-2223'

Merge

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