mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:00:52 +01:00
[PR #213] [MERGED] D3D-78: Support Texture1D, Texture1DArray and Texture3D UAVs #267
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#267
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/213
Author: @Andretuta
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142
Base:
main← Head:old-pr/9948📝 Commits (4)
c0a5d66feat(vulkan): support Texture1D, Texture1DArray and Texture3D UAVs1e63e09test(vulkan): exercise D3D-78 texture UAVs in the GPU runner57cb669fix(vulkan): require formatless reads for all D3D-78 UAVs33f4a5aMerge upstream main and preserve 1D UAV clear compatibility📊 Changes
35 files changed (+2375 additions, -394 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+53 -26)📝
docs/design.md(+3 -1)📝
docs/testing.md(+23 -1)📝
runtime/CMakeLists.txt(+8 -0)📝
runtime/shims/d3d12_com.cpp(+8 -0)📝
runtime/shims/d3d12_com.h(+4 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+257 -85)📝
runtime/src/command_list.h(+1 -0)📝
runtime/src/gfx10_descriptors.h(+20 -0)📝
runtime/src/vulkan_bindless.h(+43 -23)📝
runtime/src/vulkan_replay.h(+9 -2)📝
runtime/test/bindless_sizing_test.cpp(+44 -4)📝
runtime/test/d3d12_r9g9b9e5_uav_test.cpp(+76 -22)📝
runtime/test/d3d12_texture1d_target_test.cpp(+4 -0)📝
runtime/test/d3d12_texture1d_test.cpp(+8 -7)➕
runtime/test/d3d12_texture_uav_oracle.h(+279 -0)➕
runtime/test/d3d12_texture_uav_test.cpp(+620 -0)📝
runtime/test/glsl/cs_r9g9b9e5_uav.comp(+18 -3)📝
runtime/test/shaders/check.py(+27 -2)📝
runtime/test/shaders/cs_imgatomic3d.asm(+2 -2)...and 15 more files
📄 Description
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):Summary
D3D-78, assigned to
@guimsolutions. Adds default and explicitTexture1D,Texture1DArray, andTexture3DUAVs toCreateUnorderedAccessView.Rebased onto upstream
mainatf847748cc76bd3777f9c070c4034eb2fc1c04e64, retaining the two linear D3D-78 commits. D3D-63 is already inmain(c7d5f8e8). The rebased translator keeps upstream A16 2D mip addresses and typed 3D mip loads and uses the existing W-slice guard only for tagged UAVs. The Vulkan harness keeps upstream geometry and push-constant-tail support. The descriptor refusal test now starts its read-only resource inCOMMONto comply with upstream resource-state validation.Implementation
Texture1Duses storage bindings 17ÔÇô19; storage-onlyTexture1DArrayuses 26ÔÇô28 (float, UINT, SINT). Default 1D-array UAVs cover the full array, but 1D-array SRVs remain unsupported. Upstream multisample SRV bindings 20ÔÇô25 are unchanged. Bindless sizing and the pipeline checker account for Vulkan descriptor limits, including update-after-bind limits.{0, 1}for 3D UAVs. Partial W ranges requireVkImageViewSlicedCreateInfoEXT,imageSlicedViewOf3D, androbustImageAccess; otherwise the runtime writes a null descriptor rather than exposing the entire mip. Tagged descriptors carryFirstWSliceand effectiveWSize. Storage coordinates use relative Z; float/UINT/SINT sampled loads rebase Z and return zero outside the range or at nonzero view-relative LOD. Untagged SRVs keep their original coordinates and LOD.R32_UINTvolume UAV whose descriptor SGPR group also feeds volume atomics uses the formatted storage view for load-after-atomic visibility in the same dispatch. Other sampled loads keep upstream visibility rules. 3D stores and atomics cannot write to the shared fallback on a lookup miss.shaderStorageImage{Read,Write}WithoutFormatdevice bits disabled to exercise Vulkan 1.3's per-format path. Emulated RGB9E5 retains its logical sampled format andR32_UINTbacking; generic operations that would need unsupported repacking or unpacking take the safe fallback.Validation for
476ad95fWindows: RTX 4090 (NVIDIA 621.01) and Intel UHD 770 (32.0.101.7088). GPU checks used the Khronos validation layer and synchronization validation.
--filter cs_texture_uavLEONIDA_PC_TAIL_UBO=1modes: 14 cases (10 compared with WARP) on RTX 4090 and 10 cases (8 compared with WARP) on UHD 770. Intel lacks sliced 3D views; rejection of unsupported partial views was verified. No validation errors in the UAV readback test.LEONIDA_W64_EMULATE=1)spirv-val206/206. UHD 770: 168 passed, 33 skipped,spirv-val205/205 translated. No failed GPU checks; each adapter adds two passing cases over exact upstream with unchanged skip counts.#782double-copy replay passed on both GPUs without validation errors; the synchronization self-test confirmed the layer was active.vk_pipeline_checkcompiled compute and geometry fixtures in both push-constant modes on both GPUs.test_all_nan_keeps_src0) and no unexpected failures.compileallandmake_game.py --helppassed.On exact upstream
f847748c, UHD 770 reproduced the same CTest failures:d3d12_descriptor(lod_mismatches == 0, line 2659) andd3d12_subgroup(fragment_default, line 611). The Intel fallback still cannot translateps_ij_computedwithoutPerVertexKHR; every translated module passed validation. CTest skips reflect missing game-derived fixtures, unavailable adapter features, or opt-in validation (run separately); GameInput was disabled without SDL3. Other GPU skips reflect unsupported features or fixtures covered by separate tests. Python skips reflect missing synthetic DXBC fixtures or POSIX-only tests.The requested
scripts/run_gpu_tests.pyintegration is included:--filter cs_texture_uavdispatches the Windows differential test, and the full runner also exercisescs_imgload_mip. Runner unit tests cover pass, fail, missing executables, translation failure, and stale SPIR-V.The regression creates and copies descriptors through the D3D12 shim, then dispatches a Vulkan compute pipeline with Leonida's real bindless set 0; this is not an end-to-end D3D12
Dispatchtest. Coverage includes UINT/FLOAT and typeless views, nonzero mips, invalid descriptors, preservation of neighboring layers and slices, coexistence with a typed 3D SRV, dynamicimage_load_mip, and active/inactive add and compare-and-swap withglc.In a separate earlier native D3D12 probe, the RTX 4090 and UHD 770 clipped writes to the selected W range. WARP
10.0.26100.9818rebased the view but wrote past a finiteWSizeunder overdispatch. The oracle therefore compares in-range writes; Vulkan preservation of neighboring slices is checked independently.Project compliance and AI disclosure
Only independently written synthetic fixtures were used. No proprietary game data, game shaders, keys, or protected content were used or included. AI-assisted implementation and review using OpenCode; validation is recorded above.
Previous contribution:
#773🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.