vulkan_topology (D3D12 primitive topology -> VkPrimitiveTopology) and
strip_topology (which Vulkan topologies a restart index cuts) had no test. A
wrong mapping draws the wrong primitive; a wrong strip classification restarts an
indexed strip that should not, or fails to restart one that should.
Pins both: every mapped D3D12 topology value to its VkPrimitiveTopology and strip
flag, the triangle-list fallback for list/undefined/unmapped values, and the
strip classification, with the D3D_PRIMITIVE_TOPOLOGY enum values SDK-asserted.
ctest -R d3d12_state_map passes (MSVC /W4 /permissive-, Windows SDK 10.0.26100,
Vulkan headers 1.4.363). Header-only, no GPU, no game files.
CopyTextureRegion between two block-compressed textures copies whole blocks
on the PC runtime. When a mip edge falls inside a block on one side only (a
4x4 box into a 3x3 mip, a 6x6 mip into a 12x12 one), no single Vulkan extent
is a block multiple or reaches the edge of both images, so the layer refused
the copy with invalid_copy (docs/d3d12_vulkan.md, section 3.2 known gaps).
Such a copy now goes through the transfer scratch that depth <-> colour
copies already use (vulkan_scratch.h): vkCmdCopyImageToBuffer with the
source's own cut extent into whole blocks, then vkCmdCopyBufferToImage with
the destination's. The box fits the source's padded mip, so the scratch
holds every block the destination reads. The staged emit path calls the
destination's copy_layout after the scratch write, so every earlier transfer
write is ordered before the destination's (the write-after-write @Vonsek
found under synchronization validation in the first version of #860).
- d3d12_copy_compare: the 8 BC mixed-mip cases that were printed as known
differences must now match the host; two more shapes (a source edge inside
the block, a destination offset to the edge).
- d3d12_state_map_test checks the staged regions on the CPU.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- the DisableThreadLibraryCalls table entry gets its own continued line (it
shared FreeLibrary's, 231 columns wide), and its comment is wrapped to 120;
- dll_thread_calls_test also calls the shim with a shim pseudo-handle (the
handle GetModuleHandleA("xmem.dll") returns), which the Windows function
would refuse: removing the pseudo(module) branch now fails the test.
xmem.cpp is linked into the test only to give the shims a module to own.
Co-Authored-By: Claude Sonnet 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
Review (@Flyander):
- QueryInterface accepted the class id and IXSystemImpl5 only. The IDL
chain is IXSystemImpl5 : IXSystemImpl4 : IXSystemImpl3 : IXSystemImpl2 :
IXSystemImpl (xgameruntime include/xsystem.idl), so every one of them is
served by the same vtable. RuntimeObject now carries a null-terminated
list of interface ids instead of one newer id (XNetworkingImpl's list is
IXNetworkingImpl2).
- XSystemGetXboxLiveSandboxId requires sandboxIdSize >=
XSystemXboxLiveSandboxIdMaxBytes (16); buffers of 7-15 bytes returned
S_OK. copy_id takes the API minimum.
Tests: a 15-byte sandbox buffer is refused, 16 accepted; all five
IXSystemImpl ids give the same object.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The recipe kept two VkPipelineShaderStageRequiredSubgroupSizeCreateInfo, one
per stage of the old VS+PS table; with a GS the PS's subgroup request wrote a
third one past the array, into the recipe's attribute vector (found by
@0xTehuti on #2109). The array now has three entries and a static_assert ties
it to the stage table.
d3d12_geometry_test's PS asks for a 32-wide subgroup, so a VS+GS+PS pipeline
fills the third struct: without the fix the test crashes (3 of 3 runs).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CreateGraphicsPipelineState refused any desc.GS, although all 195 geometry
shaders translate (triangles in, a triangle strip out; docs/design.md
"Geometry shaders"). The stage table now holds VS, GS and PS; a GS needs the
geometryShader feature (enabled on the standalone and test devices where
the GPU has it, E_NOTIMPL otherwise), and the PSO's topology type must be
TRIANGLE, the GS's input (E_INVALIDARG otherwise). The push-constant range
names the geometry stage only where the device has it. Hull, domain and
stream output stay refused.
d3d12_geometry_test (in ctest): a GS that emits each triangle twice, against
a pipeline without one, and a line topology refused.
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.