Repository navigation
Runtime: support buffer-to-buffer D3D12 texture footprint copies - #4253
pmilewsskiedu-gif wants to merge 1 commit into
Conversation
Kam471
left a comment
There was a problem hiding this comment.
Built and ran this at cdb35aeb on Windows 11, RTX 5070 Ti:
d3d12_footprint_buffer_copy_test-> exit 0: Leonida RTX boxed RGBA8 with unequal pitches 0/32768 payload+padding mismatches; volume RGBA8 two slices 0/32768; BC1 aligned block 0/32768; R8 one-byte row 0/32768; RGB96 packed 12-byte texel 0/32768; RGBA8 typeless-to-typed 0/32768. Every case closes with0x00000000, and the ending comparison reports WARP Close=0, RTX Close=0, validation=0.ctest -R 'd3d12_footprint_buffer_copy|command_list|vk_command_replay'-> 3/3 passed (0.37 s / 0.15 s / 0.03 s).
The both-sides-buffer footprint copy now closes and replays, byte-exact for the tested formats/pitches, and the command-list/replay suites still pass. No blocking issue.
|
Tested
This is a GPU run, not a code review: I did not review the replay bounds logic beyond what the tests exercise. No game files. AI-assisted (Claude Code). |
Flyander
left a comment
There was a problem hiding this comment.
The bounds, dimensions and row/slice pitch handling are coherent for the supported buffer-to-buffer footprint copies. Independent review and Windows WARP/Vulkan runs cover the main formats, padding, slices and BC blocks. The conservative overlap check is documented and is not blocking for this scope.
|
Tested
This is a GPU run, not a code review of the replay bounds logic. No game files. AI-assisted (Claude Code). |
|
Tested cdb35ae on NVIDIA GeForce RTX 4090 (driver 32.0.16.2101), Windows 11, MSVC 14.51: pass. I built the branch with CMake and Ninja, RelWithDebInfo. The build has no Vulkan SDK, thus no validation layers. Negative control: with |
Bug, ownership and production impact
Current upstream
aa2988cc555bad7ecd508b48a702adbb32fe7c95rejectsCopyTextureRegionwhen both D3D12_TEXTURE_COPY_LOCATIONs are PLACED_FOOTPRINT buffer resources, marking the whole command list invalid at Close (0x80070057). Native D3D12 WARP accepts, executes and reads back these copies: D3D12 texture data may be buffer-backed on both sides. This is an independent consequence for command recording, upload/readback staging and buffer-format conversion, not existing PR #4038 no-op copy or #655/#770 placed-resource aliasing. Claimed before editing: #4084 (comment).Complete correction in this scope
runtime/src/command_list.h: allow two valid footprint locations to record when supplied compatible byte/block layout; retain existing validation for images, alignment and invalid metadata.runtime/shims/d3d12_com.cpp: validate matching DXGI typeless format family, obtain bytes per texel/BC block via the same D3D12 device'sGetCopyableFootprints, retain minimal metadata only on the two-buffer path. Typed/typeless RGBA8 and BC families work.runtime/src/vulkan_replay.h: transactional bounds checks on every source/destination footprint row, slice, pitch, 64-bit backing-offset, active byte region and same-VkBuffer alias overlap before recordingVkBufferCopyrow/slice regions. Copy active bytes, never overwrite row/slice padding; use normal Vulkan command-list replay, queue lifetime and submission synchronization.command_listandvk_command_replayCPU regression assertions cover recording metadata, exact boxed row offsets, buffer bounds and overlap. New synthetic COM GPU test and documentation.Deterministic identical-test original-main RED / patched GREEN
Exact SHA-256 identical final test source
9B19B420FCBC780CAE2E189B648A87EB6C6DFF4376226C1A5E051512D761B830compiled in detached test-only original-main worktree and fresh current-main patch worktree with MSVC 19.44 / Ninja RelWithDebInfo.aa2988cc: native WARP all 7 casesClose=S_OK, actual GPU submission/fence, exact payload and padding readbacks. Leonida RTX 4060 Ti: all 7Close=0x80070057, executable exit 1. No illegal GPU copy submitted.cdb35aeb039ba69cf98724a52a5a05adc5c41eea: both WARP and Leonida all 7Close=S_OK, GPU completion, zero payload/padding mismatches, executable exit 0.LEONIDA_VK_VALIDATION=1: zero Vulkan validation errors.0xD5sentinels.command_list,vk_command_replay,d3d12_footprint_buffer_copy,d3d12_subresource_copy,d3d12_copy_xfmt,d3d12_stencil_copy. New COM WARP/RTX regression 12/12 consecutive PASS in 2.38s.git diff --checkclean.Limits and disclosure
Same-VkBuffer overlapping copy regions are deliberately refused rather than violating Vulkan
vkCmdCopyBufferaliasing rules; no claim about undefined native self-overlap, unsupported DXGI formats, multi-queue transfer races, full CTest suite or other GPU brands. No genuine GTA VI game executable (game_scarlett_master.exeremains absent), game data, game-derived assets, shaders or synthetic gameplay masquerading as a boot. AI-assisted source, tests and review.Base
aa2988cc555bad7ecd508b48a702adbb32fe7c95, commitcdb35aeb039ba69cf98724a52a5a05adc5c41eea, 8 files +485/-4; code and entirely original synthetic tests only.