Commit Graph

1284 Commits

Author SHA1 Message Date
227087d250 Fix what the merge round broke: vk_pipeline_check --isolate-batch, its CLI test, a tbuffer format example
- vk_pipeline_check.cpp: #1826's --isolate-batch parsed with the val() helper #1735 replaced, so the checker
  didn't build; it now uses number() like the other options.
- check_vk_pipeline_cli.cmake (#1735) matched "malformed JSON"; #1847's index parser names the file and position
  ("index.json: expected '{' at byte 0"), which the check now matches.
- test_tbuffer_store: BUF_FMT_8_UINT stopped being an unsupported example once #1871 added the 8/16-bit UINT/SINT
  formats; it uses BUF_FMT_8_USCALED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:06:43 -05:00
a9929f9044 Merge pull request #1877 from Dominik 2026-11-22 09:49:01 -05:00
98dc77c4eb Merge pull request #1874 from Serrambi 2026-11-22 09:49:00 -05:00
ae0805f8c8 Merge pull request #1873 from CLHelper 2026-11-22 09:49:00 -05:00
f81a847442 Merge pull request #1868 from Thatters 2026-11-22 09:48:56 -05:00
a37bf235b7 Merge pull request #1866 from SirAmong 2026-11-22 09:48:54 -05:00
33507d493d Merge pull request #1863 from jsthope 2026-11-22 09:48:52 -05:00
60b0d354c5 Merge pull request #1862 from Vonsek 2026-11-22 09:48:52 -05:00
d2a072bc91 Merge pull request #1859 from sovljanskii 2026-11-22 09:48:51 -05:00
c53024be39 Merge pull request #1858 from AlxcBTW
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-22 09:48:50 -05:00
acadbdc5f7 Merge pull request #1853 from sovljanskii 2026-11-22 09:48:46 -05:00
667dbc76c9 Merge pull request #1851 from Alex Arenas 2026-11-22 09:48:45 -05:00
613d90052b Merge pull request #1847 from SirAmong 2026-11-22 09:48:43 -05:00
b566a8652f Merge pull request #1844 from romainveurrier 2026-11-22 09:48:41 -05:00
740a13fbe2 Merge pull request #1830 from AwkGrep256 2026-11-22 09:48:32 -05:00
5a3aca054c Merge pull request #1826 from SirAmong 2026-11-22 09:48:29 -05:00
2daadb7968 Merge pull request #1820 from Tomgamer 2026-11-22 09:48:26 -05:00
fb3e409fe0 Merge pull request #1817 from Alex Arenas 2026-11-22 09:48:25 -05:00
ffd477e9ad Merge pull request #1803 from Vonsek 2026-11-22 09:48:19 -05:00
2d32cd2576 Merge pull request #1801 from Ryderadzeee 2026-11-22 09:48:19 -05:00
381f169cae Merge pull request #1798 from SHAURYASANYAL3 2026-11-22 09:48:18 -05:00
3b7cd5e4bf Merge pull request #1791 from AlxcBTW 2026-11-22 09:48:16 -05:00
c56532da45 Merge pull request #1772 from Alex Arenas 2026-11-22 09:48:13 -05:00
26a0ca32da Merge pull request #1753 from Serrambi 2026-11-22 09:48:10 -05:00
5e532730c2 Merge pull request #1744 from Emirhan Karaca 2026-11-22 09:48:09 -05:00
23444e0b07 Merge pull request #1714 from SWAYAM 2026-11-22 09:48:07 -05:00
bf0ce0d062 Merge pull request #1706 from Ash Hopkins 2026-11-22 09:48:06 -05:00
c034e448c3 Merge pull request #1696 from SHAURYASANYAL3 2026-11-22 09:48:06 -05:00
f8ef313033 Merge pull request #1627 from nonverifiedperson 2026-11-22 09:48:05 -05:00
f38e203e7c Merge pull request #1622 from Ryx 2026-11-22 09:48:04 -05:00
00452cfaa3 Merge pull request #1615 from Ewann 2026-11-22 09:48:04 -05:00
b83f74f6d2 Merge pull request #1612 from mokkymiah 2026-11-22 09:48:03 -05:00
b9e91c2af8 Merge pull request #1398 from ezwinxdlmao 2026-11-22 09:48:00 -05:00
c88423448e xgameruntime: serve XThreadingImpl and XErrorImpl through QueryApiImpl
A GDK title reaches XTaskQueue/XAsync/XThread/XError through
xgameruntime.lib thunks, not named imports: QueryApiImpl(class, class),
one vtable slot with `this` first, then Release. QueryApiImpl refused
every class, so none of those calls could work.

The slot order is xgameruntime-docs' Layout list after IUnknown, and is
measured: the thunks linked into the package's libHttpClient.GDK.dll and
XCurl.dll (disassembled, not run) call IXThreadingImpl slots 3-7 and 9-30
and IXErrorImpl slot 3, each with the argument shape of the documented
function at that position (docs/runtime_imports.md, "Class layouts,
measured").

- XThreadingImpl: 28 slots forwarded to third_party/xtaskqueue (the same
  code the named exports use), a per-thread time-sensitive flag, and the
  two private slots (XAsyncBeginAlloc, XTaskQueueIsEmpty) logged once.
- XErrorImpl: XErrorReport (the docs' "_unknown_" slot; HRESULT + string)
  logs and calls the XErrorSetCallback callback; XErrorSetOptions is S_OK.
- Process-wide singletons; QueryInterface answers IUnknown and the class.
- xgameruntime_test drives both slot by slot; tiny_gdk_load (under
  gta6rt --run) creates and closes a queue through slots 12 and 17.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:46:09 +00:00
e608a1b992 d3d12: support typeless and castable RGBA8 RTVs on MSAA textures 2026-11-22 15:44:41 +01:00
4a20110919 GPU tests: vk_harness skips a device with fewer push-constant bytes than it pushes
vk_harness declared a 144-byte push-constant range (152 with
--mesh-compute) without checking maxPushConstantsSize. On a device with
128 bytes, the Vulkan minimum, that is invalid
(VUID-VkPushConstantRange-size-00298), and on an AMD Radeon 610M on
AMD's Windows driver ms_clip crashed (0xC0000005) and ms_w64x_ballot
under LEONIDA_W64_EMULATE=1 hung until the runner's timeout.

It now checks the limit once, right after it knows whether it runs a
--mesh-compute module, and exits 77 with "unsupported: need N push
constant bytes, device has M", as vk_texture_test (#862) and
vk_bindless_test/vk_image_fuzz (#1113) already do. The range and the
pushes use the same pc_bytes.
2026-11-22 14:44:30 +00:00
fb34337015 d3d12_translated_draw_test: rename the global extent (C4459 against vulkan_replay.h)
The test's global `constexpr UINT extent = 64` is hidden by a local `extent` in runtime/src/vulkan_replay.h,
so every MSVC build of the runtime prints `warning C4459: declaration of 'extent' hides global declaration`.
It came in with #907, whose earlier fix renamed the global `size` to `extent` for the same reason. The
global is now `target_extent`, a name nothing under runtime/ uses; the test is otherwise unchanged.

Tested on Windows 11 Pro 25H2, MSVC 14.51 + Ninja (scripts/build_runtime.ps1), RTX 5070 Ti / 621.24: the
build has no C4459 (main's 49x C4456 in vulkan_replay.h remain; #1743 handles them). d3d12_translated_draw_test
passes with validation off and on: three draws, 4064/4096 exact, 32 edge pixels, 0 VUIDs. Full ctest with
validation: 106/107; the one failure is d3d12_draw's bundle-blend check, which fails on main too (#1793).
No game files. AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 09:43:24 -05:00
27d94d0798 vk_descriptor_bench: --warmup-ms keeps the timed dispatch running for 300 ms before timing (TEST-277)
Five warm-up dispatches are too few to bring the GPU clocks up: with the old
default the first placement of --memory all read 30.4 us/1M (RTX 4050, 1k
uniform T# hit) against 23.3 for the same memory type measured warm. The new
--warmup-ms (default 300, 0 = off, --quick off) re-submits the command that is
about to be timed until the time has passed. Self-test covers the option.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 09:42:20 -05:00
88eaac7c55 D3D-238: compare the valid heap neighbours on the arena-enabled device
compare_invalid_arguments runs on a device without the GPU address arena,
where every heap is E_NOTIMPL, so the ten valid-neighbour heap cases
mismatched the host's S_OK (RTX 5070 Ti and AMD iGPU run on PR #1820).
They move to compare_heap_neighbours, which runs on the standalone device
the CreateHeap tests use. The refusal cases stay in
compare_invalid_arguments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:41:45 +01:00
350328732a xgameruntime: conform XSystemAnalyticsInfo and XPackage APIs to GDK ABI specification 2026-11-22 20:11:42 +05:30
2d27368bb0 bink_audio_test: a movie without audio tracks is a ctest skip, not a pass
It printed "SKIP (movie has no audio tracks)" and returned 0, so ctest counted
a run that checked nothing as passed (#1580 moved the unconfigured cases to 77
but not this one). Return 77, and check in test_ctest_registration.py that a
whole-test SKIP in a test registered with SKIP_RETURN_CODE 77 returns 77.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:40:17 +01:00
1b012a6287 check.py: cs_cvt_f32_sat skips, not fails, where the wave size can't be pinned
cvt_f32_sat_test runs cs_cvt_f32_sat once per input and counted every
truthy result as a wrong input. On a device that can't pin the wave size
the translator recorded (Apple under MoltenVK, subgroups 4..32),
compute_test returns unpinned_subgroup_skip's Skip, so the sweep reported
"16 of 16 inputs wrong, first 0x00000000: SKIP (...)" as a failure.

Return the Skip (or None for unsupported wave64) from the first dispatch;
every input would say the same.

AI-assisted.
2026-11-22 15:38:30 +01:00
Ryx
b9447f31fd Merge upstream/main into runtime/d3d189-occlusion-tdr; drop the occlusion pause
main took db421e6f (the bisect mode) and D3D-162's statistics segments, which
conflicted with this branch in vulkan_replay.h, d3d12_vulkan.md and the test.

The 8060S retest on driver 26.11.2 (#1540) failed 7690b647 3/3: the earlier
c8ea00e4 passes were not reproducible, and a TDR also breaks unrelated tests
until the GPU recovers. With no evidence that the pause helps, vulkan_replay.h
and d3d12_vulkan.md are main's, and the branch keeps only the diagnostics:
--no-draw, --no-resolve, the active phase, the single-query resolve case, and
a lost-device check that now reads is_device_lost() and the gate semaphore
(main removed VulkanContext::retire_timeline). The draw schedule follows main's
statistics lists, then replace and the single case.
2026-11-22 15:37:50 +01:00
2828e0c892 TEST-251: GPU checks of wave64 vertex shaders split into two 32-lane halves
RADV runs the VS stage as wave64 by default and as wave32 with
RADV_PERFTEST=gewave32, so w64_graphics.py now draws seven vs_w64_*
fixtures (tiers A, B and C) both ways and compares the words each vertex
stores to the heap. vs_w64_c_lane_id is the probe that the wave size
changed. vk_harness gets VKH_VERTICES to draw enough vertices to fill
waves. Checked on an RX 9070 XT (GFX1201) and a Ryzen 9800X3D iGPU
(GFX1036), RADV Mesa 26.3.1: 21/21.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:36:08 +03:00
5314dffcef build.py: leave ps_ij_computed out under the PerVertexKHR fallbacks instead of failing the batch
Under LEONIDA_BARY_FALLBACK=1 or LEONIDA_F16_INTERP_FALLBACK=1 the
translator refuses ps_ij_computed (a computed I/J pair needs PerVertexKHR
inputs, which both fallbacks take away). build.py counted that as a
missing module and exited before publishing anything, so check.py then
reported 0 of 147. A Mac needs LEONIDA_F16_INTERP_FALLBACK=1 for the
two-step path, so that path never ran there, and the SKIP check.py gained
in #1680 was never reached.

Leave ps_ij_computed out under either fallback with a "not built" line,
as build.py already does for ms_/gs_ shaders. Without a fallback it is
built as before, and any other missing module still fails the batch.

AI-assisted.
2026-11-22 15:35:24 +01:00
537486c875 Merge remote-tracking branch 'fork/m4-synthetic-gate' into buffer-uav-typed-counter
# Conflicts:
#	docs/d3d12_vulkan.md
#	runtime/shims/d3d12_vulkan_device.cpp
2026-11-22 15:34:07 +01:00
f209d86b8f D3D12 layer: typed buffer UAVs and UAV counters (V# FORMAT, counter V# in the slot), d3d12_buffer_uav_test
CreateUnorderedAccessView on a buffer with a typed Format writes a typed V# (GFX10_FORMAT code, element size as
stride, element count, OOB_SELECT structured, the format's own DST_SEL), and a structured view with pCounterResource +
CounterOffsetInBytes writes a second raw 4-byte V# in the upper 16 bytes of the slot (a hypothesis for the console
contract, documented in section 3.4). The combinations D3D12 documents as invalid leave a null slot.

d3d12_buffer_uav_test runs two hand-written RDNA2 compute shaders through the translator (typed store/load/atomic on
five formats with NUM_RECORDS as the bound; append by 256 lanes and consume by 128 on a counter at offset 4096, read
back with CopyBufferRegion) against a CPU reference, then compares typed-buffer and counter clears with the host D3D12
runtime on the same adapter (LUID).

Depends on: #1791

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:33:50 +01:00
57f57a825f runtime: allow explicit Texture1D SRVs on 1D texture arrays to select slice 0 2026-11-22 15:33:25 +01:00
cd6e21be84 Translator: tbuffer_store_format_* with the instruction's format
tbuffer_store_format_* and its d16 forms were Unsupported, though every
tbuffer_load_format_* form translates. They now go through buffer_store
with the instruction's format, as the loads go through
buffer_load_format:
- only that format is encoded, with no branch on the V#'s FORMAT;
- the bounds check uses its element size;
- a V# whose FORMAT is 0 (INVALID) still disables the store, as measured.
  (@Vonsek covers the MTBUF loads and @opit80 the raw MUBUF accesses
  through such a V#.)

The format parsing the loads did inline becomes mtbuf_format(), shared by
both: no modifier is GFX10's default BUF_FMT_8_UNORM, and a format
FORMATS has no encoder for stays Unsupported. read_before_write_vgprs
now counts a tbuffer store's data VGPRs as reads, as for buffer_store.

cs_tbuffer_store.asm stores into 13 sentinel-filled regions through V#s
whose format differs from the instruction's or is 0, and reads them
back. Every
expected word was measured by running the same body natively on a
Radeon 680M (gfx1035, RDNA2); wave32 and wave64 gave the same 52 words:
- the instruction's format decides the encoding, the element and the
  bounds;
- components the format has but the store doesn't give are 0, and extra
  ones are dropped;
- the default format is one byte, and its neighbours are kept;
- a FORMAT-0 V# leaves the region untouched.

check.py and run_gpu_tests.py compare the dump. The semantic fixture
runs through the interpreter in tests/semantic/test_tbuffer_store.py,
which fails on the old translator (Unsupported). It also fails on
versions that take the bounds from the V#'s element (5 words differ),
take the format from the V#, fill missing components with anything
but 0 (1 word), or drop the FORMAT-0 guard (2 words).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:33:18 +02:00
6933e0c99e Tests: synchronize vk_presenter_sync_test reader with condition_variable and join before EXPECT 2026-11-22 17:33:13 +03:00