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>
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>
Measured against the host D3D12 runtime (RTX 5070, driver 621.14) with
d3d12_vulkan_device_test's compare_invalid_arguments, five answers
differed:
- CreateRootSignature took a node mask other than node 0 (host:
E_INVALIDARG), took a DXBC blob passed with more bytes than its own
size (host: E_INVALIDARG), and answered a null output with E_POINTER.
The host answers a null output with S_FALSE before it looks at the
blob or the node mask.
- CreateQueryHeap answered an unknown type (past PIPELINE_STATISTICS1)
with E_NOTIMPL (host: E_INVALIDARG), and a null output with S_FALSE
(host: E_UNEXPECTED, after the description checks).
compare_invalid_arguments gets 30 "query heap:" and "root signature:"
cases. The root signature blobs come from the host's serializer.
d3d12_vulkan_device_test's own null-output check now expects
E_UNEXPECTED. Known query types this layer has no path for stay
E_NOTIMPL, and more than 32 root dwords stay refused (pack()).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CheckFeatureSupport(MULTISAMPLE_QUALITY_LEVELS) refused the TILED_RESOURCE
flag with E_INVALIDARG. Native D3D12 (RX 7800 XT, a Radeon iGPU and WARP)
answers S_OK: 1x and 4x keep the plain answer, every other count has none,
and a format without a tile shape (96-bit) has none at any count, which is
GetResourceAllocationInfo's tiled rule here (tiled MSAA is 4x only).
128-bit formats tiled at 4x are a driver difference: the AMD drivers answer
0, WARP and NVIDIA allocate them; the layer follows the latter.
d3d12_vulkan_device_test compares the TILED_RESOURCE quality levels of six
formats at five counts with the host's (allowing that one difference). The
allocation side of the AMD failure is c97ae261's host-quality gate.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Address @Flyander's post-merge review feedback on #1817 (D3D-236):
- Only fall back from OpenThreadToken to OpenProcessToken when GetLastError() == ERROR_NO_TOKEN, failing closed on ERROR_CANT_OPEN_ANONYMOUS or any other thread-token error.
- Log the standard-priority Vulkan queue approximation once on the granted global-realtime path.
- Remove the +not_elevated skip predicate from compare_invalid_arguments and add a SecurityAnonymous impersonation regression test.
D3D12_STANDARD_MULTISAMPLE_PATTERN and D3D12_CENTER_MULTISAMPLE_PATTERN
are only in d3d12.h from DirectX-Headers 1.613 (D3D12_SDK_VERSION 613)
on; older Windows SDK 10.0.26100 headers lack them, so gta6rt_d3d12_com
and d3d12_vulkan_device_test stop with C2065 under VS 2022. They are
enum members, so an #ifndef fallback can't detect them. Use the equal
DXGI_STANDARD/CENTER_MULTISAMPLE_QUALITY_PATTERN macros from
dxgicommon.h, which d3d12.h includes on every SDK.