[PR #2223] d3d12: enforce Vulkan BC image-view compatibility classes #2227

Open
opened 2026-11-26 21:20:29 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2223
Author: @GGandCo
Created: 11/26/2026
Status: 🔄 Open

Base: main ← Head: fix/bc-image-view-classes


📝 Commits (3)

  • d296896 d3d12: keep compressed image views within Vulkan BC classes
  • c93cb1a docs: describe compressed-view constraints and skip unsupported bindless devices
  • 348901f Merge commit 'a73a57e133' into fix/bc-image-view-classes

📊 Changes

6 files changed (+126 additions, -4 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+8 -0)
📝 runtime/CMakeLists.txt (+2 -0)
📝 runtime/shims/d3d12_vulkan_device.cpp (+28 -2)
📝 runtime/src/gfx10_descriptors.h (+14 -1)
📝 runtime/test/d3d12_existing_heap_test.cpp (+55 -1)
📝 runtime/test/gfx10_descriptors_test.cpp (+19 -0)

📄 Description

Claim: RT-BC-VIEW-COMPATIBILITY (#1608, https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7172872105).

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/2223 **Author:** [@GGandCo](https://github.com/GGandCo) **Created:** 11/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/bc-image-view-classes` --- ### 📝 Commits (3) - [`d296896`](https://github.com/ubiquitarianism/leonida/commit/d2968968c60095ef0eaaeaa2d8f0aef8919b267d) d3d12: keep compressed image views within Vulkan BC classes - [`c93cb1a`](https://github.com/ubiquitarianism/leonida/commit/c93cb1abbc9a04f5dcd1612d47eba36042ebb391) docs: describe compressed-view constraints and skip unsupported bindless devices - [`348901f`](https://github.com/ubiquitarianism/leonida/commit/348901f79cbc8a20333962d74ec9e03e01c5946b) Merge commit 'a73a57e1339be072baf5522351c8ec7f1482b56b' into fix/bc-image-view-classes ### 📊 Changes **6 files changed** (+126 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+8 -0) 📝 `runtime/CMakeLists.txt` (+2 -0) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+28 -2) 📝 `runtime/src/gfx10_descriptors.h` (+14 -1) 📝 `runtime/test/d3d12_existing_heap_test.cpp` (+55 -1) 📝 `runtime/test/gfx10_descriptors_test.cpp` (+19 -0) </details> ### 📄 Description Claim: RT-BC-VIEW-COMPATIBILITY (#1608, https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7172872105). 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#2227
No description provided.