CMake turns every PATH entry <prefix>/bin into a find_package prefix, so
with MSYS2's ucrt64/bin on PATH (a common way to get an AMDGPU llvm-mc on
Windows) configure found MinGW's SDL3 for the GameInput shim and MSVC then
failed on the mingw headers. NO_SYSTEM_ENVIRONMENT_PATH drops only those
PATH prefixes; SDL3_DIR, CMAKE_PREFIX_PATH and the system prefixes still
work, as docs/gameinput.md describes.
Found, and the fix proposed, by @Proudnoob4 in #634.
(cherry picked from commit 19a424233ba34e6f7714e892b442690c939b39fb)
prepare() gates every optional ReplayFunctions entry except the two image
clears, so a whole-view render-target, depth-stencil or texture UAV clear,
or the zero-clear detail::initialize runs on an image the tracker holds in
UNDEFINED, called a null pointer when the caller left them unset. The
whole-view clears are now checked in prepare(); the zero-clear, which depends
on the tracker, in replay() before emit. Both return unsupported.
(cherry picked from commit 86e6ca72d9748206476c31cb61f9d1e3f43952bd)
It fails on NVIDIA on the tie rounding #521 fixes (kapitche's RTX 4080 SUPER
run and mine), which would turn ctest red there in the meantime. The test
still exits 77 without a GPU, ready to register.
(cherry picked from commit f2e3bfea672331b9bf5c192f398b6dfe3f1c92b9)
d3d12_clear, d3d12_com, d3d12_descriptor, d3d12_method_variants,
d3d12_resource_desc, d3d12_sampler2, d3d12_typeless_rtv and d3d12_uav_clear were
built but never added with add_test, so ctest and CI never ran them. Each now
exits 77 when there is no Vulkan GPU (DeviceStatus::unavailable), as
d3d12_vulkan_device_test does, and is registered with SKIP_RETURN_CODE 77.
(cherry picked from commit 2af37e5da368dd130ba23db385e812635cb1a768)
The host D3D12 runtime reports NodeMask 1 for a direct, compute or copy
queue created with 0 on a single adapter, as #838 made descriptor heaps and
resources do. d3d12_node_mask_test now compares the six queue cases with
the default adapter and WARP.
NumFeatureLevels 0 returned DXGI_ERROR_UNSUPPORTED, and a null
pFeatureLevelsRequested with a count was read. The host D3D12 runtime
(NVIDIA and WARP) returns E_INVALIDARG for both. When no requested level
is supported the host also writes MaxSupportedFeatureLevel 0 next to
DXGI_ERROR_UNSUPPORTED; the layer left the field as it was.
prepare_buffer_uav_clear gave vkCmdFillBuffer/UpdateBuffer/CopyBuffer the
view's offset, which is relative to the resource, without the binding's
buffer_offset. ResourceBinding documents that a buffer may be a range of a
larger VkBuffer (the GPU address arena holds many), and copies, atomic
copies and buffer_at already add it; a clear of such a resource wrote from
the start of the VkBuffer, over whatever lives there. Latent on main (the
device binds buffer_offset 0), live once buffers sit in the arena.
The offset is added after the D3D12 alignment check (relative to the view)
and before the transfer alignment, which needs the absolute offset.
replay_uav_clear_offset_test checks raw, R8, RGBA32 and rectangle clears
with fake transfer functions; no GPU.
copy_layout has to order a transfer write that finds its range already in
the transfer layout, because a texture can stay in COPY_DEST and be copied
into again; D3D12 orders copies on the queue and needs no barrier from the
application. That ordering landed in 5ec780c without a test, and the BC7
copy case in d3d12_vulkan_device_test reaches it: on a tree without it the
case reports ten WRITE_AFTER_WRITE hazards under synchronization
validation.
Part G records two buffer-to-image copies into the same subresource with no
transition between them and reads the texture back, so the missing
dependency shows up as a validation error and as the wrong texels.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Explicit-LOD gathers use four texel fetches that bypass the Vulkan sampler. Decode its 4.8 LOD bounds before selecting the mip so clamped gathers agree with a sampler-backed draw.
Measured on an AMD Radeon RX 6800 (gfx1030) with the hw-oracle tool from the
AnyPS5 project, all four IEEE/DX10_CLAMP combinations, wave32 and wave64:
- v_min/v_max f32/f16, each half of v_pk_min/max_f16, and v_min3/v_max3 now
emit NMin/NMax (one NaN operand gives the other) instead of FMin/FMax.
- v_med3_f32/_f16: FClamp(z, NMin(x,y), NMax(x,y)), and with OpIsNan of each
operand that can be a NaN, select NMin(NMin(x,y), z) (hardware: min3 when
any operand is NaN). Non-NaN constants get no check; no select when none.
- v_fract_f32: Fract, then 1.0 -> 0x3f7fffff by compare and select (the NaN
of fract(+-inf) is kept). v_fract_f16: the same, then a packed 0x3c00 ->
0x3bff (not after an output multiplier).
Other FMin/FMax/FClamp uses (clamp bit, LOD and conversion clamps) are
unchanged. GPU fixtures ps_fnan_med3 and ps_fnan_fract read their inputs
from memory; on the RX 6800 the two med3 words differed before this change.
tests/semantic/test_float_nan_fract.py runs the measured rows; both
interpreters gain NMin/NMax, and spirv_mini_interp OpIsNan and exact Fract.
tests/semantic/test_alu_med3.py (merged after this branch was cut): its float
reference used Python min/max, which return the first argument for equal
zeros. Hardware orders -0 below +0 (RX 6800: med3(-0, +0, 1.0) = +0,
med3(+0, -0, -1.0) = -0 in every operand order), so the reference now sorts
with that order, and spirv_mini_interp's FMin/FMax/FClamp order zeros the same
way as its NMin/NMax.
Rebased onto 8df277f. Two upstream tests were written against the old
behaviour and are updated: tests/semantic/test_valu_f32_min3_max3_mad.py
(its min3/max3 reference used first-operand order for mixed zeros, and its
negative control replaced FMin/FMax; now -0 < +0, as measured on the RX 6800,
and the control swaps NMin/NMax) and tests/semantic/test_valu_f16_round.py
(it asserted that the interpreter rejects Fract; it now asserts the value).
Upstream had added an OpIsNan/OpIsInf branch to spirv_mini_interp, so this
commit's own OpIsNan branch is dropped (it shadowed upstream's). docs/design.md
notes that an output modifier on v_fract_f16 is applied before narrowing to
f16, an order not measured on hardware.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
compare_options1 created the host D3D12 device on the default adapter. On a PC with an AMD
iGPU and an NVIDIA card, a run on the AMD (VK_LOADER_DRIVERS_SELECT=*amd*) compared its 32..64
lanes with the NVIDIA's 32..32 and failed (WaveLaneCountMax: ours 64, host 32). It now uses
create_host_device_for_physical, like compare_feature_options: LUID, then PCI ids, then the
default adapter as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runtime/test/test_runtime_types.cpp held 595 lines of D3D12/XMem size,
alignment and member-offset checks against the Windows SDK, but no CMake
target referenced it, so none of its static_asserts or 53 runtime checks
ever compiled or ran. Add runtime_types_test with the src/shims include
directories and a ctest entry. The test passes as committed.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
The occlusion-query block from #858 declared a D3D12_QUERY_HEAP_DESC
named heap_desc inside the function that already has a
D3D12_DESCRIPTOR_HEAP_DESC heap_desc (line 2107), and MSVC /W4 warned
C4456. Rename it to query_heap_desc.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The address decoder already preserves the full offset VGPR before reading the packed coordinates. Let the existing offset path use those operands, and compare asymmetric packed UVs to the full-precision texel on the GPU.
In a partial wave, lanes that were never launched don't vote but their
bits are 0 in the mask, so the vote called vcc_hi = 0xff "all ones".
Keep the vote for 0 only; -1 goes through wave_mask(). GPU tests for a
40-thread wave64 and a 20-thread wave32.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--dry-run --run set both flags, so the dry run initialised the modules
and called the entry point. gta6rt now takes exactly one mode and prints
the usage (exit 2) otherwise. Three ctest cases run the stand-in game
with two modes and fail if it is mapped or run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the Compatibility Pack installed, Windows enumerates Mesa's D3D12
translation layer next to the real GPU, and Dozen reports DISCRETE_GPU. Every
harness used "the last discrete device wins", so it selected the wrapper and
the resulting failures looked like translator bugs (#915). One shared rank now
treats Microsoft's vendor as a translation layer, then prefers discrete over
integrated over virtual over CPU, keeping the first device on a tie. A CPU-only
test covers the reported enumeration without needing the Compatibility Pack.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
The skip message said 'lacks ... or the without-format reads/writes', which cost kapitche a vulkaninfo round trip on an Intel UHD 770. It now prints the exact features that are missing, plus the reason when the without-format ones are involved: the translated image_load declares those capabilities for every shader, because its uint/sint path is chosen from the T# FORMAT at run time.
AI-assisted. docs/shader_validation.md said "Not covered yet: images", and
FUZZ-1..13 touch VALU, memory, LDS, crosslane and control flow but not a single
image instruction. This is the first slice of that gap:
- runtime/test/vk_image_fuzz.cpp: headless harness that binds one 2D sampled
image from a key=value spec (format, size, texels, T# key) through the
bindless set and the descriptor table, draws a 64x64 full-screen triangle with
a caller-supplied VS/PS, and dumps RGBA32F. It enables the without-format
storage-image reads/writes and fragment atomics the translated image path
declares, and fails on validation errors with LEONIDA_VK_VALIDATION=1.
- tools/image_fuzz.py: assembles a pixel shader that reads one texel with
image_load (dmask 0xf, T# in s[8:15]), translates it with rdna2spirv.py, runs
the harness, and compares every pixel with an independent CPU oracle for the
T# format. A fetch is a memory read, so the oracle is exact.
- tests/test_image_fuzz.py: the oracle, the texel mapping, the T# word and the
generated shader, without a GPU.
Covered: R8G8B8A8_UNORM, R16G16B16A16_SFLOAT, R32G32B32A32_SFLOAT and
R32_SFLOAT, at 8/16/32/64 square sizes that divide the draw; a fifth of the
values are NaN, +-inf, +-0 or denormals.
Not covered yet: dmask variants, UINT/SINT formats (they read through the
storage views), mips, 1D/2D-array/3D/cube, image_sample/gather with filters and
borders, and texel offsets with VK_KHR_maintenance8.
Verified on an NVIDIA RTX 2060 SUPER (Linux, 620.73.04, Vulkan 1.4.357):
40/40 programs match under LEONIDA_VK_VALIDATION=1; ctest 11/11; the GPU suite
is unchanged with a clean build. Synthetic fixtures only, no game data.
#850 moved the waits to a counter, but the 1D-texture block still signalled 8 and #858's predication block
12/13. Once the counter had passed those values, SetEventOnCompletion returned at once and the blocks read results
the GPU had not written yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pending multisample fixture already owns the next slots on the common heap. Give the two typeless views their own CPU descriptors so both sampling regressions can run in the same command list.