d3d12: support standard sparse tiles for typed 2D color textures #2283

Closed
github-bot wants to merge 1 commit from github-bot/gh-2283 into main AGit
Owner

@⁠timbot103 on GitHub · 2026-11-26 12:34 UTC · original
timbot103:d3d-sparse-2d-color-formats → main · +887 −31 · 12 files · 1 commits · closed without merging

Claimed in the coordination issue as: D3D-SPARSE-2D-COLOR-FORMATS

What and why

Eligible reserved 2D textures can now map heap pages on 49 additional typed, uncompressed color formats. Previously only R8G8B8A8_UNORM could use real sparse backing. The runtime checks each Vulkan image for the D3D12 64 KiB tile shape, compatible device-local memory and a single tail-free color aspect. The scope is one mip, one array layer and one sample.

The resource records its tile shape and texel size after verifying that their product describes exactly one 64 KiB tile. CopyTiles uses the full tile row pitch at clipped edges and stages linear offsets that Vulkan cannot copy directly. Tile mapping copies use each image’s grid. The original RGBA8 behavior for small images is preserved.

Tested

  • d3d12_sparse_formats_test obtained real sparse backing in all 100 cases on each GPU (50 formats at exact and clipped dimensions). Native D3D12 WARP matched all 100 tilings and the visible transfer bytes for nine representative formats covering all five texel sizes.
  • Tested both transfer directions on DIRECT, COMPUTE and COPY queues. In each configuration, all 114 Vulkan submissions matched the visible bytes from 54 aligned native WARP submissions across the same three queue types. Coverage includes aligned and staged offsets for every texel size, edge padding, unmapped reads, typed aliases, cross-shape mapping copies and fence-ordered remapping. The same fixture linked against pristine main detected committed backing in all 98 newly supported cases.
  • Ran d3d12_sparse_formats_test, d3d12_texture_tiles_test, d3d12_buffer_tiles_test, d3d12_vulkan_device_test, vk_command_replay_test, resource_tiling_test and replay_copy_offset_test in all four GPU and validation configurations. All 28 invocations passed with zero Vulkan validation diagnostics. Validation-on GPU runs enabled Khronos synchronization validation. The two CPU tests were repeated in each configuration.
  • A separate synthetic shader probe checked BGRX, BGRA, B5G5R5A1 and native RGB9E5 through sparse SRVs. All 256 sampled texels per GPU matched. The runtime linked successfully. The changed-file and tracked-tree game-data scans passed.

GPUs tested: NVIDIA GeForce RTX 5080, driver 616.64, and AMD Radeon(TM) Graphics, driver 25.10.30.02, on Windows 11 Pro. Native D3D12 reference: Microsoft Basic Render Driver selected with EnumWarpAdapter.

AI-assisted: yes (Gemini, Codex, Claude)

Checklist

  • Based on current main (a73a57e13).
  • One topic, reserved 2D color textures with standard 64 KiB tiles.
  • No game data, keys or decryption.
  • Translator contract table is inapplicable to this runtime change.
**@⁠timbot103** on GitHub · 2026-11-26 12:34 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2283) `timbot103:d3d-sparse-2d-color-formats` → `main` · +887 −31 · 12 files · 1 commits · closed without merging Claimed in the coordination issue as: [D3D-SPARSE-2D-COLOR-FORMATS](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### What and why Eligible reserved 2D textures can now map heap pages on 49 additional typed, uncompressed color formats. Previously only `R8G8B8A8_UNORM` could use real sparse backing. The runtime checks each Vulkan image for the D3D12 64 KiB tile shape, compatible device-local memory and a single tail-free color aspect. The scope is one mip, one array layer and one sample. The resource records its tile shape and texel size after verifying that their product describes exactly one 64 KiB tile. `CopyTiles` uses the full tile row pitch at clipped edges and stages linear offsets that Vulkan cannot copy directly. Tile mapping copies use each image’s grid. The original RGBA8 behavior for small images is preserved. ### Tested - `d3d12_sparse_formats_test` obtained real sparse backing in all 100 cases on each GPU (50 formats at exact and clipped dimensions). Native D3D12 WARP matched all 100 tilings and the visible transfer bytes for nine representative formats covering all five texel sizes. - Tested both transfer directions on DIRECT, COMPUTE and COPY queues. In each configuration, all 114 Vulkan submissions matched the visible bytes from 54 aligned native WARP submissions across the same three queue types. Coverage includes aligned and staged offsets for every texel size, edge padding, unmapped reads, typed aliases, cross-shape mapping copies and fence-ordered remapping. The same fixture linked against pristine main detected committed backing in all 98 newly supported cases. - Ran `d3d12_sparse_formats_test`, `d3d12_texture_tiles_test`, `d3d12_buffer_tiles_test`, `d3d12_vulkan_device_test`, `vk_command_replay_test`, `resource_tiling_test` and `replay_copy_offset_test` in all four GPU and validation configurations. All 28 invocations passed with zero Vulkan validation diagnostics. Validation-on GPU runs enabled Khronos synchronization validation. The two CPU tests were repeated in each configuration. - A separate synthetic shader probe checked BGRX, BGRA, B5G5R5A1 and native RGB9E5 through sparse SRVs. All 256 sampled texels per GPU matched. The runtime linked successfully. The changed-file and tracked-tree game-data scans passed. GPUs tested: NVIDIA GeForce RTX 5080, driver 616.64, and AMD Radeon(TM) Graphics, driver 25.10.30.02, on Windows 11 Pro. Native D3D12 reference: Microsoft Basic Render Driver selected with `EnumWarpAdapter`. AI-assisted: yes (Gemini, Codex, Claude) ### Checklist - [x] Based on current `main` (`a73a57e13`). - [x] One topic, reserved 2D color textures with standard 64 KiB tiles. - [x] No game data, keys or decryption. - [x] Translator contract table is inapplicable to this runtime change.
Expand real Vulkan sparse 2D texture backing from R8G8B8A8_UNORM to 50 typed uncompressed 1/2/4/8/16-byte standard 64 KiB color formats, carrying each image's validated tile shape through tile grids, CopyTiles, UpdateTileMappings, and CopyTileMappings.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 12:35:47 +00:00
github-bot closed this pull request 2026-11-27 08:01:30 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.