Repository navigation
runtime: allow explicit Texture1D SRVs on 1D texture arrays to select slice 0 - #1851
Conversation
|
Tested 57f57a8 on NVIDIA GeForce RTX 3060 (driver 32.0.16.2124, Windows, LEONIDA_VK_VALIDATION=1): pass — |
|
Tested
Code review looks clean too: clamping |
|
Tested 57f57a8 on NVIDIA GeForce RTX 3070 Ti (driver 617.42) and AMD Radeon Graphics, Ryzen 7 7800X3D iGPU (driver 32.0.21045.29003), Windows 11 build 26300, MSVC 19.44, Ninja, RelWithDebInfo: pass.
One overlap to be aware of: #1916 (opened after this one) also changes Synthetic inputs only. AI-assisted. |
Serrambi
left a comment
There was a problem hiding this comment.
Code review + verification on 57f57a82: approve.
runtime/shims/d3d12_vulkan_device.cpp: settingview.layer_count = 1forD3D12_SRV_DIMENSION_TEXTURE1D(withfirst_layerzero-initialized) and relaxingimage_descriptor()to(line && view.layer_count != 1)lets an explicit 1D SRV select slice 0 of a 1D texture array (mapping cleanly toVK_IMAGE_VIEW_TYPE_1DwithlayerCount = 1), while default (nullptr) SRVs on 1D arrays remain null descriptors.runtime/test/d3d12_descriptor_test.cpp: covers both thenullptrnull-descriptor check on a 3-layer 1D array and the decodedimage_1d(first_mip = 1,mip_count = 1,first_layer = 0,layer_count = 1) +bindless_hash_lookupcheck (CreateUnorderedAccessView1D /TEXTURE1DARRAYremain separate and out of scope).- Tested on NVIDIA GeForce RTX 5070 Ti (driver
610.88, Windows 11 Pro, MSVC19.50.35719.0, Vulkan SDK1.4.363.0):d3d12_descriptor_test.exepassed cleanly both default (1D SRVs: 64/64 64/64 64/64 64/64) and underLEONIDA_VK_VALIDATION=1(0 validation errors), andctest -R "d3d12_descriptor|descriptor_table|d3d12_com"passed 4/4.
|
Tested 57f57a8 on NVIDIA GeForce RTX 5060 (Blackwell, driver 617.42, Vulkan 1.4.351), Windows 11 Pro build 26300, MSVC (VS 2026), scripts\build_runtime.ps1, then ctest -j 4: pass for this change. d3d12_descriptor passes; 102 of 103 run tests pass. The one failure is d3d12_draw ("fence signal 4 is not above 30"), which fails the same way on main 003e781 on this machine and is fixed by #1807, so it is unrelated to this PR. (Run with an AI coding agent.) |
Summary
Follow-up to
017d2604:ID3D12Device::CreateShaderResourceViewandimage_descriptor()(runtime/shims/d3d12_vulkan_device.cpp):CreateShaderResourceViewpreviously omittedview.layer_count = 1incase D3D12_SRV_DIMENSION_TEXTURE1D:(unlikeD3D12_SRV_DIMENSION_TEXTURE2DandD3D12_SRV_DIMENSION_TEXTURE2DMS), andimage_descriptor()rejectedline && desc.DepthOrArraySize != 1.D3D12_SRV_DIMENSION_TEXTURE1Dview on a 1D texture array (DepthOrArraySize > 1) views array slice 0 (FirstArraySlice = 0, ArraySize = 1), just asD3D12_SRV_DIMENSION_TEXTURE2DandD3D12_SRV_DIMENSION_TEXTURE2DMSview slice 0 of a 2D texture array.view.layer_count = 1for single-layer 1D SRVs (D3D12_SRV_DIMENSION_TEXTURE1Dand defaultnullptrSRVs on non-array 1D textures) and checkline && view.layer_count != 1inimage_descriptor(), while keeping default (nullptr) SRVs on 1D texture arrays rejected until 1D-array SRV bindings land.runtime/test/d3d12_descriptor_test.cpp:nullptr) SRV on a 3-layer 1D texture array writes a null descriptor, while an explicitD3D12_SRV_DIMENSION_TEXTURE1DSRV encodes a 1-layerImageType::image_1dT# for slice 0 and registers itsVK_IMAGE_VIEW_TYPE_1Dview in set 0.Verification
LEONIDA_VK_VALIDATION=1 .\runtime\build\d3d12_descriptor_test.exe: passed (0validation errors).