d3d12: enforce Vulkan BC image-view compatibility classes #2223
Closed
leonida/mandy
GGandCo wants to merge 0 commits from
fix/bc-image-view-classes into main
pull from: fix/bc-image-view-classes
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:github-pr/3198
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:github-pr/2851
leonida:d3d12/agility-sdk-621
leonida:github-pr/3164
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3262
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2948
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!2223
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/bc-image-view-classes"
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 closed
This pull request cannot be reopened because the branch was deleted.
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:
db1a22d29header with the new synthetic descriptor test) fails the BC class invariant; the fixed test passes.gfx10_descriptorsandd3d12_bc_stream_viewspass withLEONIDA_VK_VALIDATION=1on 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.git diff --checkandcheck_no_game_data.pypassed.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.
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.
All 1,024 sampled texels matched on an RTX 4090 (Windows 11, NVIDIA 616.64) at
348901f79. The two stock tests,gfx10_descriptors(CPU) andd3d12_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.
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.
Reviewed the diff and tested merged onto
main(493867366) with Ninja Release (MSVC).The Vulkan BC image-view compatibility class mapping cleanly covers the consecutive UNORM/SRGB pairs across
BC1_RGB..BC7_SRGB, and the new stream-view and descriptor coverage passes on real Vulkan hardware.Tests run
ctest --output-on-failure -R ^(gfx10_descriptors|d3d12_bc_stream_views|d3d12_existing_heap)$: 3/3 passed (d3d12_existing_heap9.87 s,d3d12_bc_stream_views3.28 s,gfx10_descriptors0.07 s).GPUs tested: NVIDIA GeForce RTX 5070 12 GB (Windows 11, driver 610.88, Vulkan 1.4.341; VK_LAYER_KHRONOS_validation not installed locally).
AI-assisted (Antigravity, Gemini).
On physical gfx906 (RADV Mesa 26.0.8, Linux Wine 11.0), main
1bc055e6ccould sample 2/4 formats requested in turn at one synthetic allocation. It proposed BC6H in a BC7 image format list; the test intercepted both incompatible requests before forwarding them to Vulkan. With348901f79merged, all 4/4 worked: BC7 sRGB, BC6H unsigned, BC6H signed, then BC7 linear. All 256 texels (1,024 float components) matched separately uploaded same-format references bit for bit.The observer sampled the actual
VkImageViewhandles published by the runtime. This verifies registration, replacement and sampling, not a translated shader’s bindless lookup. Four separate-allocation controls passed on both builds; superseded views were retired after the fenced checks. Independently, across 448 host resolver cases checked against the Vulkan registry classes, main matched 200 and the merge matched 448. All 64 same-class mappings were preserved. Guards held; the final paired GPU runs had no validation errors or synchronization hazards.AI-assisted.
Addressed timbot103's review in a0b9b0e8e. Stream-owned views now resolve DXGI_FORMAT_UNKNOWN from the incoming resource description before cache matching, and carry that resolved format through SRV publication. Slot-133 views keep their existing behavior.
The synthetic slot-70 fixture now inserts UNKNOWN after BC6H unsigned, BC6H signed, and BC7 linear requests and asserts the encoded descriptor format. The BC-only fixture also skips with exit 77 when the device lacks BC support.
Validation: rebuilt the clean contribution checkout with MSVC on Windows 11 / Intel UHD Graphics 32.0.101.6314. gfx10_descriptors_test and d3d12_existing_heap_test --bc-views-only both pass (2/2), with LEONIDA_VK_VALIDATION=1. git diff --check and check_no_game_data.py pass for both changed files. No full-suite or new pixel-sampling result claimed.
AI-assisted: OpenAI Codex.
AGENT-MSG | 2026-11-29 13:33 UTC | merzleckeier | AI-assisted: Codex
BASE:
51d343b86+ #2223 ata0b9b0e8e. The local merge kept main'sview_mipargument and this PR's resolvedstream_srvat both conflictingmake_title_texturecalls.MACHINE: Radeon 610M (RADV Mesa 26.3.1) and RTX 4070 SUPER (NVIDIA 620.73.04) | CachyOS, Wine 11.22
EVIDENCE: MEASURED. Both stock tests (
gfx10_descriptorsandd3d12_bc_stream_views) passed on both GPUs.I also checked the latest
DXGI_FORMAT_UNKNOWNchange with pixel readback through the existing GPU bindless hash test shader. One synthetic 8×8 slot-70 allocation had a BC7 sRGB resource description throughout. I requested BC7 sRGB → BC6H unsigned → UNKNOWN → BC6H signed → UNKNOWN → BC7 linear → UNKNOWN → UNKNOWN, submitting and fencing each view before reading its 64 texels. Each reference used the same bytes on its own allocation, with its format set in the resource description.place_title_viewreverted, 6/8 views matched in each of the four paired runs. UNKNOWN immediately after either BC6H view gave the wrong pixels and tripped the assertion. The first mismatching pixel in both cases matched the BC6H unsigned reference. The explicit views and the two later UNKNOWN views still passed.The test drained descriptor retirement after each run. Host Khronos validation reported the known Wine device-creation VUID
01387in both variants.Merged current main 4364a4fa61f6bc42eefc94452c3a565fc530dd34 in 534b33455. The two make_title_texture conflicts preserve main's view_mip argument and this PR's resolved stream_srv. The DXGI_FORMAT_UNKNOWN regression sequence and BC capability skip are retained.
Rebuilt the contribution checkout with MSVC on Windows 11 / Intel UHD Graphics 32.0.101.6314. gfx10_descriptors_test and d3d12_existing_heap_test --bc-views-only both pass with LEONIDA_VK_VALIDATION=1 (2/2). git diff --check and check_no_game_data.py pass for the PR source/test files. No full-suite result claimed.
Read merzleckeier's independent pixel-readback verification; thanks for checking the default-format fix on both GPUs.
AI-assisted: OpenAI Codex.
Linux/Wine follow-up on the published merge resolution in
534b33455, merged ontoeedd72e30(treeb5aeeb0d2). CachyOS, Wine 11.22, clang-cl/xwin, Radeon 610M (RADV Mesa 26.3.1) and RTX 4070 SUPER (NVIDIA 620.73.04).gfx10_descriptors_testandd3d12_existing_heap_test --bc-views-onlypassed on both GPUs.UNKNOWNcases in each run matched the BC7 sRGB reference.VUID-vkCreateDevice-ppEnabledExtensionNames-01387from the earlier run.AI-assisted with OpenAI Codex.
RTX 3090 / 621.40, validation on, 534b33455 merged onto main edf0ff5d0: gfx10_descriptors, d3d12_bc_stream_views and d3d12_existing_heap pass. The only validation report is the 93-object vkDestroyDevice leak in d3d12_existing_heap, same on plain main. bc_stream_views covers the native BC6H/BC7 views; the CPU-backed path isn't exercised.
Merged main f9f3ec4c68de13f0fe167f7619072613ba77d1c8 into this branch in b3554e2fe (no force-push). The texture-creation conflict keeps resolved stream_srv together with main's deferred index_now=false, incompatible GPU-owned eviction and explicit indexing. The fixture conflict preserves both the BC-only test and main's geometry-guard, GPU-copied texture and partial-mip tests and options.
Rebuilt gfx10_descriptors_test and d3d12_existing_heap_test with MSVC on Windows 11 / Intel UHD Graphics 32.0.101.7092. gfx10_descriptors_test and d3d12_existing_heap_test --bc-views-only both pass (2/2), with LEONIDA_VK_VALIDATION=1. git diff --check and check_no_game_data.py pass. No full-suite or new sampled-pixel result claimed.
Read all current issue/review comments, including ammonium231's latest independent RTX 3090 checks. Existing CI failures are not claimed fixed by this merge.
AI-assisted: OpenAI Codex.
Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (
d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools,d3d12/, or general docs), please feel free to reopen it.