The game's translated RT shaders read the console's XDXR records, which a
VkAccelerationStructureKHR is not (docs/d3d12_vulkan.md 4.8). The standalone
Vulkan device now builds them with src/xdxr_build.h, unless LEONIDA_RT_AS=khr
keeps #743's KHR builds (the proposal in the maintainer decisions of #1548).
- VulkanDeviceInfo::xdxr_acceleration_structures; the standalone device sets
it with bufferDeviceAddress and then leaves the KHR extensions off, so
acceleration-structure buffers keep their console VAs.
- VulkanContext owns an XdxrBuilder; replay checks the inputs while the list
is prepared (R32G32B32/R32G32 vertices, none/R16/R32 indices, addresses,
counts) and records the build with heap_base added to every VA and as the
bias for instance BLAS addresses.
- GetRaytracingAccelerationStructurePrebuildInfo answers from XdxrLayout,
exactly; an update rebuilds, so it needs the same scratch.
- The geometry's vertex format is mapped per DXGI format (an unknown one is
refused instead of read as R32G32B32), and its D3D12 flags reach the build.
- test/d3d12_xdxr_rt_test.cpp: a two-geometry BLAS (a soup; an R16-indexed
grid with stride 16 and a transform) and a TLAS of three instances through
the D3D12 API; ctest d3d12_xdxr_rt + d3d12_xdxr_rt_check.
- tools/xdxr_bvh.py: check-build compares TLAS hits by (geometry, primitive),
and skips (77) when the build step wrote no cases.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Map B8G8R8X8_UNORM, _UNORM_SRGB and _TYPELESS to the B8G8R8A8 Vulkan formats, so
creation, copies, footprints and clears work as for BGRA8. Shader views of the family
read alpha as 1 (the T# selects one for the alpha channel), and views between the
B8G8R8X8 and B8G8R8A8 typeless families are refused, although both land on the same
VkFormat.
Compared with the host D3D12 runtime on an RX 9060 XT: it reports no typed UAV for the
family and refuses typed B8G8R8X8 textures that allow unordered access (the typeless
format is accepted). The BGRA8 image would have advertised storage, so
CheckFeatureSupport now leaves the typed UAV bits out, texture creation refuses typed
B8G8R8X8 with ALLOW_UNORDERED_ACCESS, CreateUnorderedAccessView gives a null descriptor
for the family, and its images get no storage usage. WARP writes the clear's alpha into
the X byte, as Vulkan does, so clears need no change.
Tests: d3d12_clear_test clears B8G8R8A8_UNORM and B8G8R8X8_UNORM against WARP;
d3d12_vulkan_device_test compares B8G8R8X8 footprints, the typed UAV bits and UAV/RTV
resource creation with the host runtime; d3d12_descriptor_test samples a B8G8R8X8 and a
B8G8R8A8 texture with the same bytes through the bindless set (alpha 1 against the
stored byte) and checks the refused views.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two i18n PRs merged as "both" left docs/README.md with two quickstart lines (test_i18n_index); #1551's link in
runtime/README.md pointed at runtime/runtime_imports.md instead of docs/ (test_docs_links).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cs_w64x_saveexec_b64 checks the new EXEC per lane, D (old or new EXEC) and SCC, with old EXEC and S0
different in each 32-lane half. test_saveexec_b64.py runs the four ops on all 64 lanes for both sources
against the ISA lines, and the fixture.
AI-assisted.
Float -> UNORM at an exact tie (0.5 * 255 = 127.5) may map to either code
(D3D11.3 functional spec 3.2.3.6, 0.6 ULP tolerance). Native D3D12 gives 0x7f on
NVIDIA (RTX 3080 616.64, RTX 3090 610.88; Vulkan too) and 0x80 on Radeon and
WARP, so comparing the layer on NVIDIA with a host on another adapter failed
the placed plain clear. The host is now the layer's own adapter (LUID, then PCI
ids) unless LEONIDA_HOST_ADAPTER names one, and the output says which adapter
it was and whether it is the layer's. Against a different adapter or WARP an
exact tie may differ by one code; every other byte stays exact. The layer is
unchanged.
Measurements and review by @Rainmaker33 and @Flyander.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The layer reports NumQualityLevels = 1 for every supported sample count, so only quality 0 is valid. Reject desc.SampleDesc.Quality != 0 with E_INVALIDARG and add regression checks for {4, 1} and {1, 1} in d3d12_draw_test.
AI Assisted.
The D3D12 layer and its GPU tests took only Vulkan 1.3 devices, for dynamicRendering and synchronization2.
CrossOver's MoltenVK on macOS (1.2.10, the driver its Wine uses) is Vulkan 1.2 with VK_KHR_dynamic_rendering
and VK_KHR_synchronization2, the same features under their extension names, so every Vulkan-backed test
skipped there. src/vulkan13_features.h picks the core features on 1.3 and the two extensions on 1.2, and
device_proc_or_khr falls back to the ...KHR entry points (vkCmdPipelineBarrier2KHR, vkCmdBeginRenderingKHR),
which a 1.2 device serves instead of the core names. The translated shaders are SPIR-V 1.5 validated for
Vulkan 1.2 already. On a 1.3 device the feature chain is the one it was.
Tested in a CrossOver Preview arm64 bottle (FEX) on an Apple M2 Max, cross-built with clang-cl 22.1.8 and
xwin: against main at the same commit, no test that passed fails, and d3d12_com, d3d12_multithread,
d3d12_method_variants, d3d12_uav_clear, d3d12_debug_markers, d3d12_fence_timing, d3d12_sampler2,
d3d12_typeless_rtv, d3d12_predicated_copy and depth24_convert now run and pass. Ten more now run and
fail: comparisons with Wine's host D3D12, and MoltenVK 1.2.10 limits (vk_binary_occlusion and
vk_overlapping_occlusion fail the same way natively on that driver and pass on MoltenVK 1.4.2). The
1.3 path of create_vulkan_device_standalone was not run on a 1.3 device here.
AI-assisted. No game files.
An EXE without .reloc can only run at its ImageBase (0x140000000 by default; RT-22 asks whether the game's
is one). Under arm64 Wine on macOS (CrossOver's arm64 bottles, x86-64 code under FEX) the process's own
start-up allocations sit at 0x100000000 and up before gta6rt runs, so such an image failed with "preferred
base is taken". gta6rt now starts itself again suspended when the image has no relocations and its range is
not free, reserves [ImageBase, ImageBase + SizeOfImage) in the new process, resumes it and returns its exit
code; the loader commits the image inside that reservation. LEONIDA_BASE_RESERVED tells the new process,
which does not start itself again. Where the range is free at start-up (Windows, x86-64 Wine) nothing
changes.
tiny_game_fixed is the stand-in game linked /FIXED at 0x140000000; run_tiny_game_fixed and
run_tiny_game_fixed_exit_code run it. Arm64 bottle (CrossOver Preview 20260821, M2 Max): it maps at
0x140000000 and both tests pass, --dry-run and --init exit 0; with the relaunch disabled it fails as
before. The Rosetta (x86-64) bottle passes them too. The in-process loader tests that build relocation-less
images (loader, pe_loader_bounds, unimplemented_policy) still fail on arm64.
AI-assisted. No game files.
The bitonic sort padded the keys to a power of two and needed O(log^2 n)
dispatches, so one triangle past a power of two doubled its work (2.1 ms ->
5.2 ms at 262,144 -> 262,145 triangles on an RTX 3060, reported on #1572).
It is now a stable LSD radix sort: 8 passes of 4-bit digits over the 30-bit
Morton keys, each a count per 2048-element tile, one exclusive scan and a
scatter; 24 dispatches whatever the count, shared memory only.
- vk_xdxr_build_test: a 5000-triangle case (three sort tiles, the last
partial); stale cases from an earlier run are removed first, so a failed
build cannot be checked against old files.
- tools/xdxr_bvh.py: validate reports a leaf reached twice; a case may ask
check-build for fewer rays.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NVIDIA's own D3D12 driver rounds the 127.5 tie down too (RTX 3090, 610.88),
so D3D12 has no single tie rule and the layer passes clear values through
as before. The mismatch was a host device on another adapter.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1545 added ps_ij_computed and its check to check.py only, so run_gpu_tests.py failed it with "no checker defined".
The check is now check.ij_computed_problem, used by both runners; run_gpu_tests also skips it under
--bary-fallback like check.py. Passes in both GPU runs on an RTX 4060 Ti.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sampling an integer image through a float view makes D16 convert the wrong numeric values. Compute the quad derivatives before branching to the matching view so implicit minification still chooses the correct level.
SetRotation returned S_OK without storing the mode and GetRotation always reported identity. Store it and return E_INVALIDARG for a null output, matching the other getters. Cover the default, a 90-degree round-trip and the null argument in dxgi_swapchain.
Verified on Windows 11 with an RX 7900 XTX: dxgi_swapchain_test passes. No game files.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
IDXGISwapChain1::SetBackgroundColor and IDXGISwapChain2::SetMatrixTransform returned S_OK without storing anything, and their getters returned E_NOTIMPL. Store both values and return the DXGI defaults, transparent black and the identity matrix. Null pointers return E_INVALIDARG.
Cover the defaults, round-trips and null arguments in dxgi_swapchain. Verified on Windows 11 with an RX 7900 XTX: dxgi_swapchain_test passes. No game files.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
The FidelityFX DLL's messages around the slot-67 call name it
DeserializeComputePipelineStateX ("DeserializeComputePipelineStateX
FAILED ... falling back to NewBE"). The slot name, the one-time log line
and the comment use that name and point at docs/fspx.md for the desc:
the root signature, then pointer/size pairs for the FSPX entries with the
native program at +0x28. Behaviour is unchanged: the proxy still refuses
it with E_NOTIMPL.
The test hangs the GPU (TDR) on an AMD Radeon 8060S on Windows (#1540) and
passes everywhere else. --bisect runs its seven query patterns (crossing,
nested, unwritten, binary, predicated, chunked, replace) one per submission
and waits for each, printing the phase before it runs, so the last line before
a hang or a lost device names the pattern. --gated queues them all behind one
CPU-signalled semaphore as the full test does; named phases run only those.
Without --bisect the test is unchanged.
D3D12 converts a float clear to the nearest UNORM code with a tie going up
(0.5 * 255 = 127.5 is 0x80, per WARP and the Radeon host). Vulkan leaves the
tie to the GPU and NVIDIA rounds it down (0x7f), so the placed castable clear
in d3d12_vulkan_device_test differed on the RTX 5070. render_target_clear_color
now hands Vulkan the code above an exact tie (code / max) for the 8- and 16-bit
UNORM formats; every other value is passed through. Pinned in
replay_clear_gate_test; clear_color_test expects the same.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>