[DX] RWTexture2DArray follow-up (#1077)#1239
Draft
alsepkow wants to merge 8 commits into
Draft
Conversation
Adds a new `Texture2DArray` `ResourceKind` and wires it through the DirectX backend so shaders can `Load` from layered SRVs: * `OutputProperties` gains an `ArraySize` field (default 1) and the YAML size validation now accounts for it. * `getResourceDescription` sets `DepthOrArraySize` from `ArraySize` for `Texture2DArray` resources and rejects mismatched uses of `ArraySize > 1` on non-array kinds. * `getSRVDescription` emits a `TEXTURE2DARRAY` view covering all slices. * The upload path enumerates slices via `CopyTextureRegion` with a per-slice `D3D12_PLACED_SUBRESOURCE_FOOTPRINT`; the host-side data layout is tightly packed slice-major (slice0 rows | slice1 rows | ...). Vulkan and Metal switches gain `Texture2DArray` cases for build completeness; their device implementations remain TODO and the new test is gated `UNSUPPORTED: Vulkan || Metal`. Adds `Feature/Textures/Texture2DArray.Load.test.yaml` exercising a 2x2x3 array with `Load(int4)` and offset variants. Verified passing on d3d12 (NVIDIA RTX 5060 Ti) and warp-d3d12. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Picks up the DriverVer fix (upstream llvm#1228) so clang-tidy stops failing on Device.cpp. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extends Texture2DArray support to RWTexture2DArray: - Pipeline.h: add ResourceKind::RWTexture2DArray; update isTexture, isUAV, getDXKind, getDXDimension switches and YAML enum trait. - Enums.h: API enum value. - DX/Device.cpp: createUAV uses D3D12_UAV_DIMENSION_TEXTURE2DARRAY with FirstArraySlice=0 and ArraySize from OutputProperties. Multi-slice readback via per-slice CD3DX12_TEXTURE_COPY_LOCATION with placed footprint offset (note: requires Width*ElementSize to be 256-aligned; documented in issue plan). - VK/Device.cpp, MTL/MTLDevice.cpp: llvm_unreachable placeholders. Test: RWTexture2DArray.Store.test.yaml verifies a 16x4x2 compute write/readback round-trip. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fixes misc-const-correctness warnings-as-errors from clang-tidy in CI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
# Conflicts: # include/Support/Pipeline.h
Clang HLSL does not yet implement the Texture2DArray / RWTexture2DArray templates. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements DX backend support for #1077 (
Texture2DArray+RWTexture2DArray).Texture2DArrayLoad support landed earlier in 4774832. This PR addsRWTexture2DArrayUAV creation, per-slice upload, and bind/readback, plus unifies theNumSlicesupload loop for both the SRV and UAV paths.Tests:
RWTexture2DArray.Store.testPASS on d3d12.Remaining on parent #1077 (not in this PR):
arrayLayerson the image,VK_IMAGE_VIEW_TYPE_2D_ARRAY, per-slice upload/readback.Texture2DArray/RWTexture2DArray(per-slice mip chain,(mip, slice)subresource indexing).D3D12_TEXTURE_DATA_PITCH_ALIGNMENT.Texture1DArray,TextureCubeArray,RWTextureCubeArray(tracked in [DRAFT] [DirectX] Texture1DArray + TextureCubeArray + RWTextureCubeArray support #1267).Refs #1077
Assisted by Claude Opus 4.7.