d3d12_copy_xfmt, d3d12_depth_resolve, d3d12_fence_events, d3d12_indirect_zero,
d3d12_node_mask, d3d12_query_rules and d3d12_resource_desc created their hardware
reference with D3D12CreateDevice(nullptr), the default adapter, and did not read
LEONIDA_HOST_ADAPTER. On a PC with two GPUs the layer then ran on one GPU and the
host driver on the other.
runtime/test/host_adapter.h picks the adapter by the rule d3d12_copy_compare.h
already follows for d3d12_vulkan_device: the adapter LEONIDA_HOST_ADAPTER names
(a name that matches none fails the run; "warp" leaves the hardware pass out),
else the adapter behind the Vulkan device (deviceLUID), else the default adapter.
The tests print the adapter's name instead of "the default adapter".
Measured on a Ryzen 7 9700X iGPU (AMD 32.0.21042.62) next to an RTX 3070
(NVIDIA 610.74, the default adapter): d3d12_depth_resolve with the layer on the
Radeon set aside nine resolves as host quirks before and after, but four of them
were NVIDIA's ("D24S8 stencil as X24_G8"); against the Radeon's own driver the
four are D24S8 depth MIN/MAX. The other six tests print the same results against
either adapter.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- UAV clears of A4B4G4R4: an R4G4B4A4_PACK16 layout row (red in bits
12-15, alpha in 0-3), unit-checked in conversion_checks and cleared end
to end where the layer reports a typed UAV (the driver's call: WARP has
one, AMD's D3D12 driver doesn't).
- FORMAT_SUPPORT reports IA_VERTEX_BUFFER only for formats input layouts
accept (vertex_format), not every format Vulkan can fetch: R8/R16
SNORM/SINT (and R8G8 SNORM/SINT) have no input-layout mapping yet.
- new_format_round_trips: each render-target format is cleared to
(-3, -0.4, 0.25, 7) on the layer and on the host and the bytes compared,
which catches a mapping of the right size but the wrong numeric type
(R16_SNORM as UNORM, R8_SINT as UINT); no value is an exact half step.
The host is the Vulkan device's own adapter, as in
compare_format_support, not the default one.
- A4B4G4R4 is skipped where the Vulkan driver can't sample
R4G4B4A4_UNORM_PACK16 (Vulkan doesn't require it), by the driver's
format properties rather than the layer's answers; B4G4R4A4 and
B5G5R5A1 are never skipped.
- d3d12_copy_xfmt: D16_UNORM <-> R16_UINT and R16_SNORM copies, the new
members of depth_colour_pair, against the host and WARP.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CopyResource and CopyTextureRegion between D32_FLOAT and R32_FLOAT/UINT/SINT,
and between D16_UNORM and R16_FLOAT/UNORM, were refused at execution because
vkCmdCopyImage cannot mix a depth and a colour aspect. Host D3D12 and WARP
copy the bits, and #1134 listed these as not covered.
The replay now stages each such region image -> scratch buffer -> image.
The scratch comes from a new ScratchBuffers pool (vulkan_scratch.h):
device-local chunks handed out while a list is prepared and retired with
the submission's timeline value, like the depth24 converter's scratch, but
enabled on every GPU. Without it the copy is refused as unsupported before
anything is written.
Still refused: depth with stencil (two planes), D24 stored as D32, and
multisampled textures.
Tests: d3d12_copy_xfmt gains five depth <-> colour cases (R16 -> D16 both
ways, D32 -> R32_UINT, three mips, and a D32 -> R16 negative control), and a
depth <-> colour mismatch now fails it. vk_command_replay_test part H runs a
D32 -> R32 -> D32 round trip through the replay, and checks that a list is
refused with no scratch.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The host-comparison tests added since #869 create their host devices with
D3D12CreateDevice themselves, so copycmp::try_create_host's Wine check never
reached them. Under Wine the reference is vkd3d, not Microsoft's runtime,
and they failed on a real GPU for that reason alone.
runtime/test/host_wine.h has the same check (ntdll's wine_get_version) for
them. Under Wine:
- d3d12_fence_events, d3d12_query_rules: the layer's own expectations
still run; only the host references are skipped.
- d3d12_depth_resolve: the layer is still checked against the clears; a
host reference is no longer required.
- d3d12_resource_desc, d3d12_node_mask, d3d12_copy_xfmt,
d3d12_typeless_rtv, d3d12_predicated_copy: every case compares with the
host (or WARP), so they exit 77, which ctest already reads as a skip.
Windows runs them all as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
D3D12 allows CopyTextureRegion/CopyResource between a BC format and an
uncompressed one of the same bit width, one texel standing for one 4x4
block (Format Conversion using Direct3D 10.1); WARP and the RTX 5070 copy
them byte for byte. The replay compared the box with the destination in
texels and the resource shapes texel for texel, so every such copy was
refused, and one invalid uint->BC box reached vkCmdCopyImage out of bounds.
Bounds are now checked in blocks of each side, the extent is in source
texels, and partial BC edge blocks are still refused.