Commit Graph

20 Commits

Author SHA1 Message Date
d1d23d842d Merge pull request #804 from Jess-Doit 2026-11-22 01:37:54 -05:00
4030a386fb Translator: --bary-fallback for raw barycentrics without VK_KHR_fragment_shader_barycentric (SHADER-98)
The 321 pixel shaders that read the raw barycentric pair are translated to
BuiltIn BaryCoordKHR, so they can't run on a device without the extension
(NVIDIA Pascal, for one). With --bary-fallback the pair comes from an
ordinary vec3 input one location past the shader's attributes; the module
needs neither the capability nor the extension, and the index records the
location as bary_fallback_input. tools/bary_fallback_gs.py writes the
pass-through geometry shader that fills it: Position and the PS's inputs
copied unchanged, plus (1,0,0), (0,1,0), (0,0,1) at the three vertices,
whose perspective interpolation is the BaryCoordKHR value.

- LEONIDA_BARY_FALLBACK=1 for build.py, check.py and run_gpu_tests.py
  (like LEONIDA_W64_EMULATE): translate with the flag, build
  <name>.bary_gs.spv, draw those shaders through it.
- vk_harness: VKH_GS_HELPER=1 keeps VKH_SUBGROUP_SIZE on the fragment
  stage when the GS only feeds the pixel shader under test.
- tests/semantic/test_bary_fallback.py and the ps_bary fixture.
- docs/design.md contract row and index key, docs/testing.md section.

GTX 1060 (Pascal): ps_bary 4096/4096 exact, ps_uniform_branch and
ps_scc_mask32 pass with the fallback (SKIP without it). Pixel-shader corpus:
12,101/12,101 translate and pass spirv-val with and without the flag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SSJXX67xeoorUsLJ2f9zms
2026-11-21 22:28:25 -08:00
6d7bb1755a Tests: shader tools honor LEONIDA_VK_DEVICE
The GPU tools picked a device with the shared ranker but never applied the
name filter the D3D12 tests have used since #861. Filter candidates through
vulkan_device_wanted in vk_device_pick.h, report a filter that matches nothing
instead of dereferencing a null device, and cover the filter cases in the
picker test. docs/testing.md no longer says the tools ignore it.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-22 00:02:29 -06:00
6d6301c1b5 Merge pull request #919 from bobcatchris 2026-11-22 00:33:09 -05:00
7b51dbd9d8 Merge pull request #888 from enx 2026-11-22 00:33:00 -05:00
a030e18ef6 Docs: note the Dozen device order and LEONIDA_VK_DEVICE
The Compatibility Pack lists Mesa's D3D12 layer as a second discrete GPU. The
harnesses now prefer a native ICD (#915), and LEONIDA_VK_DEVICE selects one
explicitly, so record both next to the other known problems.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-21 23:11:58 -06:00
enx
943e5f8048 Build the Windows runtime on Linux with clang-cl and xwin
runtime/cmake/clang-cl-xwin.cmake cross-compiles gta6rt, its shims and
tests with clang-cl and lld-link (LLVM 19+) against an MSVC CRT and
Windows SDK laid out by xwin, and makes ctest run them through Wine (or
Proton's wine). llvm-ml64 stands in for ml64, so the register-
preservation check in unimplemented_policy_test runs too.

Changes that let a cross build work without a Developer Prompt:
- gen_d3d12_stubs.py gets the d3d12.h CMake finds (--header) instead of
  relying on INCLUDE; without one the COM targets are skipped.
- d3d12_trace names the interpreter by path, so ctest doesn't prepend the
  emulator to Python, and check_d3d12_trace.py starts the fixture through
  the emulator (--runner).

docs/testing.md describes the build and the Wine and Proton runs.
2026-11-21 21:09:12 -07:00
77f42e09c0 Runtime tests: LEONIDA_VK_DEVICE picks the Vulkan GPU by name
Two GPUs of one vendor share one driver, so the loader's driver filters
cannot tell them apart, and the D3D12 tests always took the last discrete
GPU (an RTX 3060 next to an RTX 5070 Ti). LEONIDA_VK_DEVICE is part of the
device name, compared without case, read by vk_test_device.h and by the
layer's standalone device. A value that matches no device fails the run
instead of testing another GPU, as LEONIDA_HOST_ADAPTER does. The shader GPU
tools (vk_compute_test, vk_harness, ...) keep their own pickers for now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 04:56:45 +01:00
b5d15862fc docs: valu_fuzz --family f16 needs llvm-mc 21+; 18 runs the rest
docs/testing.md asks for LLVM 21+, but says a distribution's llvm-mc is
enough on Linux, and the fuzzer does not say what it needs. Measured with
Ubuntu 24.04's llvm-18 (18.1.3): valu_fuzz --family mem and lds_fuzz
assemble and run, but every --family f16 program fails, because 18
rejects op_sel on the 16-bit integer VOP3 forms; 23.1.6 assembles them.
Both places now say so.
2026-11-22 02:22:21 +00:00
9ccadeaeaf Merge pull request #622 from SirAmong 2026-11-21 21:08:33 -05:00
a518a2bbf2 docs: testing.md image_load row describes this runtime's real mechanism (PROC-16 review)
Second review of #622: the runtime never reads an image's size out of a T#.
A T# that was not registered (hand-built or zeroed) misses the descriptor
hash table, gets index 0, and index 0 is a 1x1 image of zeros, so even
pixel (0,0) reads 0 here. The "(0,0) only" pattern is from the reporter's own
layer and is now labelled as a report, not reproduced.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-21 21:00:03 -05:00
2b7c576eb6 docs: testing.md image_load row names the right mechanism (PROC-16 review)
The row said the shader bounds-checks image_load against the T# size. The
translator lowers image_load to OpImageFetch/OpImageRead and never compares
coordinates with the T# width/height; it is the runtime that takes the image
size from the T# (stored as size - 1), so a zeroed descriptor is a 1x1 image.
Wording from rafaelpssz's review of #622.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-21 20:42:36 -05:00
23020c40cb Merge pull request #622 from SirAmong 2026-11-21 20:38:59 -05:00
99960989cb docs: re-measure the llvmpipe counts in testing.md
Measured on GitHub's ubuntu-24.04 runner (llvmpipe, LLVM 20.1.2) on
main c432cdc, which already carries the wave32 lane-mask skip: 52/88
with 36 skipped, and 37/39 with 2 skipped under LEONIDA_W64_EMULATE=1.
Lists the new skips (ps_scc_mask32, ps_texoff, cs_wqm_w32,
cs_w32_lane_wrap).

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D7JEiKsTUaHQbCTdc4Eghy
2026-11-22 01:30:40 +00:00
78b8239761 docs: G-buffer targets stay 8-bit UNORM; image_load tests need a real T# size (PROC-16)
Two silent failures reported in #603 by @Silliana, written down as reports
(not reproduced here):
- d3d12_vulkan.md section 4.2: the material shaders pack normal/ID data into
  bytes and the lighting shaders unpack them with * 255 and a truncate, so the
  G-buffer targets must keep the game's 8-bit UNORM format.
- testing.md, Known problems: a hand-built descriptor with no real width and
  height makes image_load return zero except at pixel (0,0).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-21 20:17:48 -05:00
cfc314d233 Docs and CMake: the runtime needs the Windows SDK 10.0.26100 or newer
The runtime uses version 1.2 root signatures (D3D12_ROOT_SIGNATURE_DESC2),
which older SDKs such as 10.0.22621 don't declare, so the build failed
halfway through with a compiler error. The prerequisites now name the SDK,
docs/testing.md has a Known problems row for the error, and CMake checks
for it at configure time and stops with the fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 20:03:14 -05:00
bd15303dc4 Merge pull request #430 from NRXM 2026-11-21 19:14:03 -05:00
49f4958a4b CI: run the GPU tests on Mesa llvmpipe
The linux-gpu-tools job built the GPU test programs but never ran them.
It now installs llvmpipe (software Vulkan), llvm-mc and SPIRV-Tools and
runs scripts/run_gpu_tests.py twice: natively (31 pass, 29 expected
skips: 8-wide subgroups, no fragment barycentrics) and the compute tests
with LEONIDA_W64_EMULATE=1 (33 pass). The emulated mesh tests are left
out because llvmpipe's compiler aborts on them. docs/testing.md gets a
section on running the suite without a GPU.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D7JEiKsTUaHQbCTdc4Eghy
2026-11-21 23:39:29 +00:00
e0d68c8bb2 Docs: link the coordination issue by its title, not its number
The coordination issue (#156) will move to a successor when its thread
gets long. CONTRIBUTING.md, AGENTS.md, the PR template and the testing
guide now find it as the open issue titled "Coordinating who works on
what" (a search link, and a gh command for agents), so they stay right
without an edit each time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:11:59 +01:00
307d5e4c1a Docs: a guide to running the GPU tests
Collects what testers in #166 needed to find out themselves: llvm-mc
with the AMDGPU target per OS, building the test programs, the two ways
to run the suite, wave64 emulation on 32-wide GPUs (set
LEONIDA_W64_EMULATE for build.py too), choosing a GPU, and the problems
reported so far with their fixes. Linked from CONTRIBUTING.md and the
docs index.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 23:50:59 +01:00