Repository navigation
Runtime: allow cross-format texture copies into partial BC blocks - #3477
Conversation
|
Independent check of
This is a second GPU family (Ampere) for the copy result; the PR's own run was on an RTX 4070 SUPER. No game files. |
Desamodeth
left a comment
There was a problem hiding this comment.
Tested 37ec81da on Windows 11, MSVC 19.44 Release, RTX 5070 (621.24). The unmodified d3d12_copy_xfmt_test reported 46 comparisons, zero differences, with Vulkan synchronization validation enabled.
I also checked 16-byte BC7 blocks. A 3×2 R32G32B32A32_UINT source copied into a 10×6 BC7 mip (level 1), and a 1×3 source into a 3×9 BC7 mip (level 2). All 96 and 48 bytes respectively matched both the row-pattern upload and native D3D12 WARP. Substituting only the replay implementation from main (f847748c) made both byte checks fail with the same fixtures. No Vulkan validation errors on the PR. The native D3D12 debug layer was unavailable. Synthetic inputs only. AI-assisted.
T1spar
left a comment
There was a problem hiding this comment.
Tested 37ec81da on two more GPUs: Windows 11 Pro 26300, MSVC 14.44 (VS 2022 Build Tools 17.14), RelWithDebInfo (Ninja), Vulkan SDK 1.4.363.1, LEONIDA_VK_VALIDATION=1: pass
| GPU | Driver | Result |
|---|---|---|
| NVIDIA GeForce RTX 5070 Ti (Blackwell) | 621.01 | pass |
| AMD Radeon Graphics (Ryzen 7 9800X3D iGPU, RDNA2 gfx1036) | Adrenalin 26.11.2 | pass |
d3d12_copy_xfmt: 46 compared, 0 differ, 0 new Vulkan validation errors on both GPUs. The new edge fixturesR32G32_UINT 3x2 -> BC1 10x6(48 upload bytes) andR32G32_UINT 2x1 -> BC1 12x8 mip 1 (6x4)(16 upload bytes) match the upload pattern and WARP. The six negative controls are refused with 0 new validation errors.d3d12_subresource_copy,replay_copy_offset,vk_bc_zero_init: pass on both GPUs with validation on.vk_sync_validationpasses too, so synchronization validation was active.- Full
cteston both GPUs: 0 failed out of 140 (8 skipped on the 5070 Ti, 7 on the iGPU,gameinputdisabled), the same asmainatf847748c. - Baseline: the same five tests also pass on
main(f847748c) on both GPUs.
Implicit layers were disabled (VK_LOADER_LAYERS_DISABLE=~implicit~), and the device was picked with LEONIDA_VK_DEVICE.
|
Tested on Windows 11 with two GPUs on one machine (runtime built from this PR's head merged with main f847748, MSVC 14.51):
Only this test was built and run, not the full ctest. No concerns. |
|
Code review of 37ec81d (read only, no runs): the staged path looks right to me.
For merge order: #2928 moves AI-assisted (Claude Code). |
|
Windows + GPU check: AMD Radeon RX 9070 (RDNA4), Windows 11, MSVC Release, Vulkan SDK 1.4.363. Tested head 37ec81d merged onto AI-assisted (Claude Code); runs on my machine. |
What changes
Valid cross-format
CopyTextureRegioncalls can copy an uncompressed texel into a partial block at the edge of a BC mip. Leonida rejected these copies and skipped the command list. Coordination claim.Use the existing transfer scratch to read the uncompressed texels and write the same bytes into the BC blocks. The destination extent ends at the logical mip edge, while each scratch row still holds whole blocks. Aligned copies continue to use the direct image-copy path.
Validation
R32G32_UINT 3x2 → BC1 10x6andR32G32_UINT 2x1 → BC1 mip 1 (6x4)succeeded. Before this patch both left Leonida's readback at its sentinel value. The new fixtures compare 48 and 16 bytes against a deterministic upload pattern and WARP.d3d12_copy_xfmt,d3d12_subresource_copy,replay_copy_offset, andvk_bc_zero_initpassed on an RTX 4070 SUPER (616.92). The Vulkan tests ran with validation and synchronization validation enabled.AI-assisted. No game files were used.