[PR #907] [MERGED] vulkan_replay: clear packed 16-bit UAV textures (VK-UAV-CLEAR-PACK16) #945

Closed
opened 2026-11-26 20:19:35 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/907
Author: @TheGeogeo
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD

Base: main ← Head: fix/uav-clear-pack16


📝 Commits (1)

  • b67109e vulkan_replay: clear packed 16-bit UAV textures

📊 Changes

3 files changed (+104 additions, -0 deletions)

View changed files

📝 runtime/src/uav_clear.h (+4 -0)
📝 runtime/test/d3d12_uav_clear_test.cpp (+4 -0)
📝 runtime/test/replay_uav_clear_offset_test.cpp (+96 -0)

📄 Description

Claimed in the coordination issue as: VK-UAV-CLEAR-PACK16

What and why

runtime/src/uav_clear.h had no layout for R5G6B5, A1R5G5B5 and A4R4G4B4 _UNORM_PACK16 (D3D12 B5G6R5, B5G5R5A1 and B4G4R4A4). ClearUnorderedAccessViewFloat/Uint on such a texture recorded fine, then uav_clear::encode refused it at replay, replay returned unsupported and ExecuteCommandLists dropped the whole submission.

The path measured here is B5G5R5A1_UNORM with ALLOW_UNORDERED_ACCESS on a GPU without native storage for it: the layer backs it with R16_UINT, and its UAV clear still names A1R5G5B5.

The three rows go next to the existing R4G4B4A4 one. WARP supports typed UAV stores and clears for all three formats, and the expected words in the tests come from WARP.

Tested

After a rebase on main 6293c1c4 (b67109eb, same patch as ebfcce66), on Windows 11, MSVC 19.52.37029, RTX 3080, driver 621.24: full ctest -j 1 --timeout 300 257 passed, 3 failed, 12 skipped, gameinput disabled. d3d12_uav_clear, d3d12_short_uav_clear, d3d12_b5g5r5a1_uav and replay_uav_clear_offset passed. The failures are the same three as in the first run below (#954 is open for the two indirect RT tests, #1066 for d3d12_execute_indirect_validation), and the skipped tests are the 12 listed there. The XMA2 decoder was not built on this PC.

Windows 11, MSVC 19.52, main f3e26be7 for the baseline and 3d3770c1 plus this change (rebased on a2892784, where the only new commit is a docs link).

  • New CPU regression in replay_uav_clear_offset_test (real replay() with fake Vulkan functions). Against the old header it exits 1 with 25 FAIL: lines, 8 for each format plus the R16_UINT-backed render target. With the fix it passes. It checks five Float clears and one Uint clear per format, a clear of an image in the format itself, and a decode/encode round trip of all 65536 words.
  • ctest -R uav_clear: 3 of 3 passed, including d3d12_uav_clear (three added literals) and d3d12_short_uav_clear. d3d12_uav_clear skips its A4B4G4R4 device clears here because the device reports no typed UAV for it.
  • Scratch GPU check, not in the diff: a copy of d3d12_b5g5r5a1_uav_test with a whole-view Float clear and a rectangle Uint clear. Before: ExecuteCommandLists failed: unsupported; nothing was submitted. After: exit 0, every texel matches WARP (a2ec, 8443).
  • Full ctest: same results as the baseline, 255 passed and the same three failures (d3d12_execute_indirect_validation, d3d12_indirect_rt, d3d12_indirect_rt_upload_sysmem). Skipped: shader_library_corpus, bink_decode, bink_abi, bink_play_headless, fsr_dispatch, bvh_builder, bink_audio, vk_sync_validation, d3d12_sparse_queue_family_contract, d3d12_rgb9e5_rtv, d3d12_boot_movie, d3d12_first_light. Disabled: gameinput.
  • git diff --check and python -I scripts/check_no_game_data.py on the three files: clean.

Not covered: B5G6R5 and B4G4R4A4 on a GPU (checked on the CPU against WARP words only; which Vulkan drivers have native storage for them was not measured), the Vulkan validation layer, GCC and Clang, and the tests that need glslangValidator, llvm-mc or the SPIR-V tools. Merging #418 onto this branch is clean; #261 conflicts with main itself in three other files.

GPUs tested: NVIDIA GeForce RTX 3080, driver 621.24, Windows 11

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md: not applicable.

🔄 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/907 **Author:** [@TheGeogeo](https://github.com/TheGeogeo) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@QemmHD](https://github.com/QemmHD) **Base:** `main` ← **Head:** `fix/uav-clear-pack16` --- ### 📝 Commits (1) - [`b67109e`](https://github.com/ubiquitarianism/leonida/commit/b67109eb3e30f60549e5d0f7f9deffe46d4c69bd) vulkan_replay: clear packed 16-bit UAV textures ### 📊 Changes **3 files changed** (+104 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `runtime/src/uav_clear.h` (+4 -0) 📝 `runtime/test/d3d12_uav_clear_test.cpp` (+4 -0) 📝 `runtime/test/replay_uav_clear_offset_test.cpp` (+96 -0) </details> ### 📄 Description Claimed in the coordination issue as: [VK-UAV-CLEAR-PACK16](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135170103) ### What and why `runtime/src/uav_clear.h` had no layout for `R5G6B5`, `A1R5G5B5` and `A4R4G4B4` `_UNORM_PACK16` (D3D12 `B5G6R5`, `B5G5R5A1` and `B4G4R4A4`). `ClearUnorderedAccessViewFloat/Uint` on such a texture recorded fine, then `uav_clear::encode` refused it at replay, `replay` returned `unsupported` and `ExecuteCommandLists` dropped the whole submission. The path measured here is `B5G5R5A1_UNORM` with `ALLOW_UNORDERED_ACCESS` on a GPU without native storage for it: the layer backs it with `R16_UINT`, and its UAV clear still names `A1R5G5B5`. The three rows go next to the existing `R4G4B4A4` one. WARP supports typed UAV stores and clears for all three formats, and the expected words in the tests come from WARP. ### Tested After a rebase on `main` `6293c1c4` (`b67109eb`, same patch as `ebfcce66`), on Windows 11, MSVC 19.52.37029, RTX 3080, driver 621.24: full `ctest -j 1 --timeout 300` 257 passed, 3 failed, 12 skipped, `gameinput` disabled. `d3d12_uav_clear`, `d3d12_short_uav_clear`, `d3d12_b5g5r5a1_uav` and `replay_uav_clear_offset` passed. The failures are the same three as in the first run below (#954 is open for the two indirect RT tests, #1066 for `d3d12_execute_indirect_validation`), and the skipped tests are the 12 listed there. The XMA2 decoder was not built on this PC. Windows 11, MSVC 19.52, `main` f3e26be7 for the baseline and 3d3770c1 plus this change (rebased on a2892784, where the only new commit is a docs link). - New CPU regression in `replay_uav_clear_offset_test` (real `replay()` with fake Vulkan functions). Against the old header it exits 1 with 25 `FAIL:` lines, 8 for each format plus the `R16_UINT`-backed render target. With the fix it passes. It checks five Float clears and one Uint clear per format, a clear of an image in the format itself, and a decode/encode round trip of all 65536 words. - `ctest -R uav_clear`: 3 of 3 passed, including `d3d12_uav_clear` (three added literals) and `d3d12_short_uav_clear`. `d3d12_uav_clear` skips its A4B4G4R4 device clears here because the device reports no typed UAV for it. - Scratch GPU check, not in the diff: a copy of `d3d12_b5g5r5a1_uav_test` with a whole-view Float clear and a rectangle Uint clear. Before: `ExecuteCommandLists failed: unsupported; nothing was submitted`. After: exit 0, every texel matches WARP (`a2ec`, `8443`). - Full `ctest`: same results as the baseline, 255 passed and the same three failures (`d3d12_execute_indirect_validation`, `d3d12_indirect_rt`, `d3d12_indirect_rt_upload_sysmem`). Skipped: `shader_library_corpus`, `bink_decode`, `bink_abi`, `bink_play_headless`, `fsr_dispatch`, `bvh_builder`, `bink_audio`, `vk_sync_validation`, `d3d12_sparse_queue_family_contract`, `d3d12_rgb9e5_rtv`, `d3d12_boot_movie`, `d3d12_first_light`. Disabled: `gameinput`. - `git diff --check` and `python -I scripts/check_no_game_data.py` on the three files: clean. Not covered: `B5G6R5` and `B4G4R4A4` on a GPU (checked on the CPU against WARP words only; which Vulkan drivers have native storage for them was not measured), the Vulkan validation layer, GCC and Clang, and the tests that need `glslangValidator`, `llvm-mc` or the SPIR-V tools. Merging #418 onto this branch is clean; #261 conflicts with `main` itself in three other files. GPUs tested: NVIDIA GeForce RTX 3080, driver 621.24, Windows 11 AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`: not applicable. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:19:35 +01:00
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#945
No description provided.