Depth-stencil attachments can opt out of sampling while remaining valid resources. Leave a reused descriptor null before any view is encoded or registered.
#678 (D3D-84) took R24_UNORM_X8_TYPELESS and R32_FLOAT_X8X24_TYPELESS on any
texture with a depth aspect, so the other family's view (an X8X24 view of an
R24G8 texture, or the reverse) got a live descriptor of the texture's own
depth format. D3D12 refuses both. Each depth view format now belongs to its
own DXGI family only (R24G8_TYPELESS / D24_UNORM_S8_UINT, R32G8X24_TYPELESS /
D32_FLOAT_S8X24_UINT), checked on the resource's DXGI format, so a D24
texture backed by D32_SFLOAT_S8_UINT still takes the R24 view. The other
family's view falls through to the existing "view format not supported"
path and leaves the slot null.
d3d12_descriptor_test checks both cross pairs give a null descriptor, and
takes the expected depth T# from the texture's backing: a GPU without a
usable D24 (the layer's depth_usable rule) backs R24G8 with
D32_SFLOAT_S8_UINT, where the old expectation of 8_24_UNORM failed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Loader::load threw "unsupported relocation type 3" on
IMAGE_REL_BASED_HIGHLOW, which the x64 Windows loader applies: 32-bit
absolute addresses, as /LARGEADDRESSAWARE:NO code has. They are now
moved by the delta like DIR64 ones. Where the moved address no longer
fits in 32 bits, Windows would truncate it; the loader refuses the image
with "a 32-bit (HIGHLOW) relocation does not fit at this base" instead.
Other 32-bit forms (HIGH, LOW, HIGHADJ) stay unsupported.
test_pe_loader_bounds.cpp was never built: it had no CMake target. It
now has one and runs under ctest as pe_loader_bounds (its existing 37
checks pass as they are). Five new checks build an image with a HIGHLOW
entry: the dword moves by exactly the delta, an address past 4 GiB is
refused, and HIGH is still rejected by name. Against the old loader,
three of them fail with "unsupported relocation type 3".
D3D12's baseline is 5.1, and both WARP and the RTX 5070 runtime answer a 5.1 request with S_OK and 5.1; the layer
refused everything below 6.0, so a caller asking for the minimum got E_INVALIDARG. The host comparison now covers
5.1, the test pins it, and the docs record both measurements.
CreateRenderTargetView refused D3D12_RTV_DIMENSION_TEXTURE2DMSARRAY, so after the DSV change in
#683 a multisample array could be a depth target but not a colour target (found by @Derpbeat on
#683). The view is {resource, mip 0, FirstArraySlice, ArraySize}, as for the DSV; the replay
already checks the range and clears through a view of those layers.
d3d12_vulkan_device_test: a 4-layer 4x RGBA8 target is cleared red through a whole-array view and
green through a view of slices 1-2; every slice is resolved and read back, so slices 0 and 3 must
stay red and 1-2 green. A view of slices 3-4 is refused at execute (invalid_subresource). Without
the change the test fails at the captured-range check.
docs/d3d12_vulkan.md: the RTV/DSV bullet lists TEXTURE2DMSARRAY for both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AI-assisted. Set 0 binding 2 is the table every T#/S# lookup probes.
BindlessSet allocated it HOST_VISIBLE | HOST_COHERENT and flush() memcpy'd into
the mapping, so a divergent lookup read it over PCIe: 19.5x slower for T#+S#
pairs and 46.2x for a divergent miss at 100k entries on an RTX 2060 SUPER
(vk_descriptor_bench, #639; 58-796x on the 5080).
The table now lives in DEVICE_LOCAL (HOST_VISIBLE kept as a fallback for a device
without it). flush() takes the command buffer that will use the set and uploads
only what changed: the whole table from a mapped staging buffer when the buffers
were just created (first use or growth), and the changed slots with
vkCmdUpdateBuffer otherwise, which copies the data into the command buffer while
recording so no staging bytes are read at execution. A TRANSFER_WRITE ->
SHADER_READ barrier follows, before the draws. DescriptorTable tracks the slots
that insert, replace, erase, clear and grow touched, including both slots of a
relocation, so a flush no longer rebuilds an 80 MiB table for one descriptor.
A command buffer whose vkQueueSubmit is rejected never runs the upload, so the
set keeps the obligation: VulkanQueue::execute reports the submit result through
a commit callback, and the set rebuilds the table on the next flush, which also
reports flush_needs_idle() and makes the device wait before it. The same wait now
honours the pre-existing contract for replaced/erased entries and for growth
(the device ignored flush_needs_idle() before), and frees the retired buffers
once the queue is idle instead of at teardown.
Verified on an NVIDIA RTX 2060 SUPER, Linux 620.73.04, Vulkan 1.4.357:
- ctest 10/10, including descriptor_table cases for the change list, relocation
marking and consume-once reads.
- vk_bindless_test with LEONIDA_VK_VALIDATION=1: 14 draws (probe depth, erase,
relocation, growth 64 -> 512 slots, rebind, failed-submit retry, other view,
removal) read back exact, table in device-local memory in both
descriptor-indexing configurations. With the retry disabled the test is red.
- GPU suite 64/91 with the same 27 64-wide skips as main, 0 failures; 91/91 with
LEONIDA_W64_EMULATE=1.
No game data; synthetic fixtures only.
Single-sampled attachments and storage images could bypass the device's format limits. Use the same query for allocation info and committed creation so unsupported requests get the same answer before Vulkan allocates an image.
parse_rts0 read 1.1/1.2 descriptor-range records with Flags and
OffsetInDescriptorsFromTableStart swapped (offset at +16, flags at +20).
The PC serializer writes D3D12_DESCRIPTOR_RANGE1 order: type, count, base
register, space, Flags, then the offset. Both values were discarded, so
nothing broke yet, but the descriptor-table layout would have read flags as
offsets.
DescriptorRange now keeps all six fields; the canonical codec stores them
(codec version 2; nothing persists version 1 blobs). The hand-built 1.1
fixture in root_signature_test had the same swap and is corrected; a 1.0
fixture is added, and root_signature_oracle_test checks every range field
against the host serializer for 1.0, 1.1 and 1.2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A depth clear of any D24 texture, native D24 or stored as D32, now clears with
depth24_to_float(depth24_quantize(v)), an exact 24-bit value, so no driver's
tie rounding is left and NVIDIA's native D24 matches WARP and AMD.
- d3d12_depth24_compare.h checks the layer's clears against the reference
(depth24_quantize, stencil value) and fails on a difference; the host is
compared byte for byte only when it agrees with the reference, otherwise
the difference is logged as a host quirk (NVIDIA's D3D12 rounds some ties
the other way: 478 of 5215 values).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under Wine the host EXE stays at its preferred base, so gta6rt and
loader_test at 0x140000000 took the address a mapped EXE without
relocations needs (loader_test: "preferred base is taken"). Link them at
0x10000000000; Windows relocates them with ASLR either way.
loader_tls_test copied its fixture with std::filesystem::copy_file,
which MSVC implements with CopyFile2, missing from Wine 9.
Windows 10's host D3D12 runtime cannot answer unaligned block-compressed GetCopyableFootprints cases (no D3D12_OPTIONS8.UnalignedBlockTexturesSupported) and has no ID3D12GraphicsCommandList7 for ResolveSubresourceRegion. Both comparisons failed before the device checks, so a Windows 10 run stopped at line 1061/1080.
Skip unaligned BC footprint cases when the host lacks the option, and compare only the full ResolveSubresource form when the host list has no list7. The full form still covers every supported format and sample count, and a self-check covers the classification used by the footprint skip.
Recovered from the package DLL's own reads (field accesses, element strides,
the standard-build and prebuild wrappers that construct a BATCHED_DESC2):
BATCHED_DESC2 is the public build desc, the postbuild count and pointer and
a 16-byte XDXR_STREAM_DESC (0x50 bytes); the stream desc is a size and a
pointer to 16-byte typed records, whose offsets, value types, defaults and
lookup rule are measured. The DLL rejects the offline-statistics postbuild
type for every build, so that layout is not in the package.
docs/xdxr.md has the evidence per field (RVAs only, nothing quoted from the
DLL). runtime/src/xdxr_descs.h defines the structs with static_asserts and
the DLL's stream lookup and flag defaults; xdxr_descs_test checks them and,
with a DXR d3d12.h, the public part against the SDK.
#617 and #694 each added the B5G6R5 and R9G9B9E5 cases to the DXGI format map and the copy block table, so the
switch statements had duplicate labels and the Vulkan device tests no longer compiled.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#562/#587 landed the same R9G9B9E5_SHAREDEXP and B5G6R5_UNORM mappings this
branch adds. The textual merge was clean but left duplicate case labels
(MSVC C2196) in texture_format and the block-size table; keep one of each.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>