mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:45:53 +01:00
[PR #578] d3d12: validate CreateUnorderedAccessView descriptors for buffers and textures (OLD-5327) #621
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#621
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/578
Author: @Taffyyy-ops
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:feat/d3d12-uav-validation📝 Commits (2)
7dc1212d3d12: validate CreateUnorderedAccessView descriptors for buffers and texturesebc26f9d3d12: reject TEXTURE2DARRAY UAV ArraySize == UINT_MAX📊 Changes
3 files changed (+724 additions, -28 deletions)
View changed files
📝
runtime/CMakeLists.txt(+9 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+88 -28)➕
runtime/test/d3d12_uav_validation_test.cpp(+627 -0)📄 Description
Claimed in the coordination issue as: OLD-5327 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7126487215)
What and why
Carried over from the closed upstream
ItsNotRexed/LeonidaPR #5327 and rebased cleanly ontoubiquitarianism/leonidamain(0e888f03b,5f82c7282).Validates
CreateUnorderedAccessViewdescriptors for buffers and textures inruntime/shims/d3d12_vulkan_device.cppso malformed or unsupported views leave a null descriptor rather than crashing or aliasing invalid ranges/formats:D3D12_BUFFER_UAV_FLAGS, raw flag withoutDXGI_FORMAT_R32_TYPELESS, non-zeroStructureByteStrideon non-structured views, zeroNumElements, overflow-safe element-range bounds (FirstElement/NumElements), and overflow-safe counter offset bounds (CounterOffsetInBytes).is_srgb_format) / typeless / depth-stencil / block-compressed / 96-bit /B8G8R8X8view formats, invalid dimensions and mip/plane/array slice bounds (includingD3D12_UAV_DIMENSION_TEXTURE2DARRAYwithArraySize == UINT_MAX), and check storage layer bounds inwrite_image_descriptor(returningfalseand skippingnote_shader_imagewhen refused, including unregistered bindless storage images).main's mutableR9G9B9E5_SHAREDEXP,B5G5R5A1_UNORM, and 8-bit sRGB UAV resource backing (57d08d2fd,0dc7f58e5).runtime/test/d3d12_uav_validation_test.cpp(d3d12_uav_validationinruntime/CMakeLists.txt).Tested
Built cleanly with MSVC 19.44 / Ninja (
cmake --build runtime/build, 0 new/W4warnings on modified files) and tested on Windows 11 + NVIDIA GeForce RTX 5060 Laptop GPU (driver 621.24, validation off locally):d3d12_uav_validation-> Passed (0.73 s)d3d12_uav_clear-> Passedd3d12_b5g5r5a1_uav-> Passed (0.55 s)d3d12_srgb_uav-> Passed (0.71 s)d3d12_r9g9b9e5_uav-> Passedd3d12_descriptor-> Passed (0.47 s; sampling shader skipped: noglslangValidator)d3d12_texture1d-> Passed (1.22 s)python -I scripts/check_no_game_data.py-> exit 0git diff --check upstream/main..HEAD-> exit 0GPUs tested: NVIDIA GeForce RTX 5060 Laptop GPU (driver 621.24, Windows 11, validation layers not installed locally)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.