Follow-up to #2438 from the review of pwu2775-dev. A failed host FORMAT_SUPPORT query was treated as 'no such texture' without saying so, and the summary printed '(host compared)' even when every comparison was skipped. The query's answer is now printed (E_FAIL on Windows 10 build 19045, E_INVALIDARG seen on another 19041 host, so a single code is not assumed) and the summary says how many formats were compared and how many the host lacks.
Review of the previous commit (@kacper-serewis): the ID3D12Device10
predicate excused any unequal answers for the seven cases on a Windows 10
host, where only one pair was measured. Each case is now marked
windows10_refuses, and windows10_refusal() excuses exactly the layer's
S_OK against the host's E_INVALIDARG on a host without ID3D12Device10.
Any other difference there, and any difference on a newer host, is a
mismatch again.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
d3d12_residency_test runs the same 110 MakeResident / Evict /
SetResidencyPriority / EnqueueMakeResident steps on the Vulkan-backed device
and on the host runtime, with a committed buffer, a heap, a placed buffer, a
descriptor heap, a query heap and a fence of each. It compares every HRESULT,
the device-removed reason after each step, and the value EnqueueMakeResident
leaves the fence at. Steps that leave the host runtime unusable run there in a
child process with a fresh device (--host-step). On main 7 steps differed (RTX
3060, driver 610.88); now none do:
- SetResidencyPriority takes a priority only for objects that own their
memory, committed resources and heaps. A placed resource (a reserved one too,
by the same rule; not measured), a descriptor heap, a query heap or a fence is E_INVALIDARG, also inside a
longer list (the layer accepted all of them). The host also removes its
device then (DXGI_ERROR_INVALID_CALL); the layer doesn't, since a title that
sets priorities on placed resources would lose its device over a hint.
- EnqueueMakeResident accepts a null fence and signals nothing (the layer
answered E_INVALIDARG).
Not compared: a nonzero count with a null array and a null entry in an array,
which the host dereferences; and a value below the fence's current one, which
moves the host's fence back but not the layer's (Vulkan timelines only go up,
already documented).
d3d12_vulkan_device_test's residency checks expected the old answers for a
fence and an allocator's priority and for a null fence, and now expect the
host's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The README asks for "Windows SDK 10.0.26100 or newer", but the SDK's
d3d12.h changed within 10.0.26100: 10.0.26100.6584 ships
D3D12_SDK_VERSION 612, later builds 616. main used names from newer
headers, so it stopped compiling on the older 10.0.26100 builds:
- D3D12_FEATURE_D3D12_OPTIONS21 and its payload, with
D3D12_WORK_GRAPHS_TIER_NOT_SUPPORTED and
D3D12_EXECUTE_INDIRECT_TIER_1_0 (header 613);
- D3D12_INDIRECT_ARGUMENT_TYPE_INCREMENTING_CONSTANT (613);
- D3D12_FEATURE_D3D12_OPTIONS20 with D3D12_RECREATE_AT_TIER_NOT_SUPPORTED,
and D3D12_FEATURE_PREDICATION (611).
They join the two feature values d3d12_feature_compat.h already declares
for the same reason: ABI values and payload structs in rt::d3d12::compat,
used by the device and its test. Where the header has the real
declarations, static_asserts check that the values, sizes and offsets
agree.
The runtime and every test now build against DirectX-Headers v1.610.2,
v1.611.0 and v1.613.0's d3d12.h (put ahead of the SDK's) and against the
SDK's own 616 header. Before this change, 611 failed with 18 errors and
610 with more.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GN11jcpJWD4phrXJyDgED6
Windows 10's D3D12 (no ID3D12Device10) still validates a buffer's initial
state and refuses a HARDWARE_PROTECTED heap, where newer runtimes and the
layer accept them. Seven cases compared those answers without a predicate,
so the test could not pass on a Windows 10 host:
committed: buffer in state 0x80000000
committed: buffer in RENDER_TARGET | UNORDERED_ACCESS state
heap: HARDWARE_PROTECTED
placed: upload buffer in COPY_DEST
placed: readback buffer in GENERIC_READ
placed: default buffer in state 0x80000000
reserved: buffer in state 0x80000000
They now carry the ID3D12Device10 predicate their neighbours already use,
and compare_heap_neighbours gains the same "not comparable on this host"
path as the other two comparisons. Hosts with ID3D12Device10 compare
exactly as before.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Windows 10's host runtime (19045) creates a list of type -1 that Windows
11's refuses with E_INVALIDARG (@MeNoSkills on #2297, RTX 4070 Ti and a
Radeon iGPU). The case now carries the file's +device10 predicate, as the
other answers newer runtimes changed do: on a host without ID3D12Device10
it is printed as not comparable instead of failing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measured against the host D3D12 runtime (RTX 5070, driver 621.14) with
d3d12_vulkan_device_test's compare_invalid_arguments:
- CreateCommandAllocator and CreateCommandList1 took any type (7, 99,
-1); the host refuses types past VIDEO_ENCODE with E_INVALIDARG.
- CreateCommandList and CreateCommandList1 took a node mask with bits
past node 0; the host answers E_INVALIDARG.
- A null output was E_POINTER in all three; the host answers
E_UNEXPECTED, after the argument checks.
compare_invalid_arguments gets 35 "command allocator:", "command list:"
and "command list1:" cases. Video list types are not compared: the host
hands out a video list (E_NOINTERFACE for ID3D12GraphicsCommandList),
while this layer creates a graphics list for them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CreateQueryHeap(D3D12_QUERY_HEAP_TYPE_SO_STATISTICS) returned E_NOTIMPL, so
a title that makes one got nothing. The layer has no stream output (a PSO
with StreamOutput entries is refused, SOSetTargets is not implemented), so
every SO_STATISTICS_STREAM0..3 query counts 0 written and 0 needed.
Such a heap is now made without a VkQueryPool: Begin/EndQuery record nothing
in Vulkan (the D3D12 call rules and the ended tracking still apply), the
queries overlap no occlusion or statistics query, and ResolveQueryData fills
16 zero bytes per query (D3D12_QUERY_DATA_SO_STATISTICS) with no statistics
split. When stream output lands this becomes a
VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT pool.
Mesh-shader statistics (PIPELINE_STATISTICS1) are left to D3D-132.
On a single-node adapter the host runtime and WARP return SizeInBytes UINT64_MAX with 64 KiB alignment
for a visible mask naming a node that does not exist, also for zero resources, and leave the
per-resource array untouched (GetResourceAllocationInfo, 1 and 2). The layer ignored the mask and
returned a real size. Compared with the host in d3d12_vulkan_device_test.
D3D12 committed resources start zeroed unless the heap has
CREATE_NOT_ZEROED. Arena buffers are zeroed through its mapping, but
device-local buffers outside it were not ("default-heap buffers are not
zero-filled yet"). They are now queued on the context and filled with
vkCmdFillBuffer by the next submission on any queue, ahead of its lists.
That submission publishes the same initialisation semaphore as the
storage-image setup, so a list on another queue that uses the buffer first
waits for the fill. A buffer destroyed before any submission leaves the
queue, and a failed submission puts its fills back.
A queue being destroyed now clears that shared semaphore if it published
it: the queue is idle, so the work is done, and a later submission on
another queue would otherwise wait on a destroyed semaphore. With buffer
fills publishing it often, d3d12_vulkan_device_test hit exactly that
(vkQueueSubmit: invalid pWaitSemaphores, then a crash).
d3d12_vulkan_device_test (a device without the arena) reads a fresh
default buffer back as zeros after dirtying recycled memory, and checks
that a CREATE_NOT_ZEROED buffer written in the same list keeps the copy.
The layer clamped every HighestVersion above 1.1 to 1.1 and returned S_OK.
The host only does that for versions it defines: on an RTX 4070 Laptop
(621.24) and WARP, anything above 1.2 is E_INVALIDARG with the value left
unchanged. Keep the clamp for 1.2 and refuse the rest.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d3d12_subresource_copy_test runs the same 117 steps on the Vulkan-backed device
and on the host runtime: textures in write-back and write-combine custom heaps,
a volume, an array, BC1 blocks, a buffer, an upload-heap buffer, a default-heap
texture and a multisampled one; whole and boxed copies, boxes outside, empty,
inverted or cutting a block, subresources past the last, pitches too small or
0, and copies before Map. It records every HRESULT and a hash of the whole
destination of every read, once per copy path (host image copy and staging).
On main 17 steps differed (RTX 3060, driver 610.88); now none do. The host's
rules:
- a box is refused only when its right, bottom or back edge lies past the
mip's, or it cuts a compressed block; an empty or inverted box that passes
those checks is S_OK and copies nothing (the layer refused it);
- the row and depth pitches are not checked: rows or slices that overlap are
copied in order (the layer refused a pitch smaller than a row or slice).
Not compared, and reported as such: null data (the host faults; the layer
still answers E_INVALIDARG), which bytes win when a read's rows overlap (the
driver's copy order, tiled on NVIDIA), and a default-heap texture, which the
host refuses and the layer copies on purpose, as docs/d3d12_vulkan.md says.
d3d12_vulkan_device_test's cpu_copies expected the old refusals for an empty
box and overlapping slices, and now expects S_OK.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aguedou-34 measured on #2462 that an integrated Radeon without DXR (OPTIONS5
reports no ray tracing) refuses a UAV buffer created in
RAYTRACING_ACCELERATION_STRUCTURE state, which an RTX accepts. The layer now
accepts that state only where it has acceleration structures (KHR builds, or
the XDXR records with the GPU address arena), for committed, placed and
reserved resources alike, and refuses it elsewhere.
d3d12_vulkan_device_test compares the existing committed case on the device
main builds (no acceleration structures) only with a host without ray
tracing, and two new cases on the standalone device (committed and placed)
only with a host that has it; otherwise they are reported as not comparable.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measured against the host D3D12 runtime (RTX 5070, driver 621.14):
UNKNOWN is a buffer format (S_OK, Support1 = BUFFER), and a value the
runtime's format table has no entry for is E_FAIL: 116-188, which
includes the planar video formats P208/V208/V408 at 130-132, and 192 and
up. The layer answered DXGI_ERROR_UNSUPPORTED for both.
compare_invalid_arguments gets 11 "format support:" cases, comparing the
HRESULT and Support1. Support2 is not compared, because the host's
TILED is a GPU capability the layer doesn't offer. The local check that
expected UNKNOWN to fail now expects the host's answer. 115, 189 and 191,
the table's edges, must not be E_FAIL.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The placed plain clear (D3D-90/D3D-221) is compared byte for byte with the host
D3D12 runtime when the host is the layer's own adapter. Its 0.5 * 255 = 127.5 is
a tie: NVIDIA's D3D12 driver writes 0x7f, WARP and AMD 0x80, and the D3D11.3
spec (3.2.3.6) permits either within 0.6 ULP. With this branch the layer rounds
normalised clear values itself, to nearest even, so on an NVIDIA adapter it
writes 0x80 and the exact same-adapter comparison failed (RTX 5070, 621.24).
On the same adapter a differing plain byte is now accepted only when it is
exactly the nearest-even code and within 0.6 ULP; every other difference still
fails, and the SRGB-cast comparison is unchanged.
D3D12 only forbids beginning the same query element twice while it runs, so a
command list may overlap two pipeline-statistics queries, or an ordinary
occlusion query and a binary one, on different slots of one heap. The replay
refused all of those with ReplayResult::unsupported. The overlapping-ordinary
occlusion machinery already virtualizes concurrent queries as non-overlapping
physical segments whose results are summed; this extends it to the remaining
cases:
- Binary occlusion joins the ordinary kind in the same physical pool (both are
VK_QUERY_TYPE_OCCLUSION, so one physical query is open at a time and the
shared intersection interval is counted by both logical queries). A binary
resolve of a multi-segment query sums its segments and normalizes the total
to 0/1 (OcclusionResolve::sum_binary; run flag needs_sum_binary).
- Overlapping pipeline-statistics queries split into the statistics pool with
the same one-slot-per-event layout (plan_overlapping_statistics_segments);
every non-timestamp resolve while a query runs closes and reopens the open
segment for D3D-162's helper-dispatch exclusion. The single-list replay()
helper still has no segment pool and refuses such lists outright instead of
running two Vulkan queries of one type whole.
The device test's old pin of the occlusion+binary refusal now expects a
replay; vk_overlapping_occlusion adds crossing statistics queries checked
word-by-word against three unsplit references and an ordinary query around a
binary one; replay_query_predication pins the segment layouts, the composite
binary resolve and the helper's refusal without a GPU. docs/d3d12_vulkan.md
4.6 moves the case out of "Not implemented yet".
AI-assisted: yes
new_format_round_trips (D3D-259, #1914) failed on a Windows 10 host with 'new format 191: the host refuses a texture the layer creates': A4B4G4R4_UNORM is not in Windows 10's D3D12, whose CheckFeatureSupport reports no 2D texture for it, and the test stops there so no later check runs. The host comparison now runs only for a format the host reports as a 2D texture; a host that reports it and still refuses it fails as before.
compare_placed_reserved (d3d12_vulkan_device_test) runs 76 CreatePlacedResource
and CreateReservedResource cases against the host runtime on the standalone
device. On main 31 of them differed (RTX 3060, driver 610.88):
- CreatePlacedResource checked none of the description, initial-state and
clear-value rules CreateCommittedResource has, and checked a plain texture's
size against nothing: a texture larger than its heap, or past its end, was
accepted. A small texture (4 KiB alignment) at a 4 KiB offset was refused.
- CreateReservedResource checked those rules only for textures (through the
committed backing) and never the initial state or clear value.
- Both answered a null output with S_FALSE; the host checks the arguments,
then answers E_UNEXPECTED.
The initial state was not checked for committed resources either. The host
takes exactly GENERIC_READ, one write state alone (RENDER_TARGET,
UNORDERED_ACCESS and DEPTH_WRITE with their flag), or a mix of read states on a
texture; any bits on a buffer except the acceleration-structure state without
UAV access. initial_state_refusal holds that rule, in committed_resource_refusal,
so committed, placed and reserved resources share it; 23 "committed: ... state"
cases pin it in compare_invalid_arguments.
A placed buffer in an upload or readback heap takes any initial state on the
host (a committed one must start in GENERIC_READ or COPY_DEST); UAV access is
refused there as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Apple GPUs MoltenVK samples a vkCmdWriteTimestamp in a blit pass of its own at the end of the current Metal
encoder. Nothing orders the vkCmdCopyQueryPoolResults resolve after that pass. The copy read the old value, or 0 for
a timestamp never written, so d3d12_vulkan_device failed under Wine on a Mac (t1 == 0). A minimal Vulkan program
reproduces it natively on MoltenVK 1.4.3 and 1.4.2: the copy was right 0 to 43 times in 200, in the same command
buffer, the next one or the next submit. KosmicKrisp and llvmpipe were right in every case.
Where driverID is MoltenVK, the queue sets and waits for a fresh VkEvent before each timestamp resolve that copies.
A submission with such a resolve also waits on the queue's timeline for the submission before it. Both measured
200/200 and 500/500. The timestamps are still the GPU's own. The events go back to a pool after a host reset once
their submission completes. d3d12_vulkan_device also checks a resolve in the execution after the write. Documented
in docs/d3d12_vulkan.md section 4.6.
D3D12_FEATURE_SHADER_MODEL echoed a request of 0x52-0x5f back with S_OK.
No runtime defines a model there, and the host runtime refuses them
with E_INVALIDARG (RTX 5070, driver 621.14). Refuse them the same way.
Requests above 6.9 stay clamped to the layer's model, as newer runtimes
accept newer ones. Checked in d3d12_vulkan_device_test's main, not
against the host: the test notes the host crashed on 0x5f elsewhere.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>