AMD's Windows shader compiler for RDNA2 crashes (access violation in
vkCreateComputePipelines) on many --wave64-emulate compute shaders with LDS
(#857). auto turns emulation on when any device is 32-wide, so an Intel iGPU
next to an RX 6000 card gets emulated modules, and the runtime then runs them on
the RX 6000.
tools/vk_subgroup_info.py now reports vendor_id, device_id, driver_id and
rdna2_amd_windows for the runtime's GPU (RDNA2 by PCI device ID, AMD proprietary
driver). auto leaves emulation off when that GPU is one and runs wave64
natively; on and off are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--full-check is the one make_game.py flag with no mention in README.md,
docs/ or CONTRIBUTING.md; it only appears in --help. It is the way to
verify a copy's data with SHA-256, so add it next to --check in the
terminal command block.
Docs only, no game data, no CI change.
find_dumps() built its roots from the home folder only. With OneDrive's Known
Folder Move, Explorer's Desktop and Documents are ~\OneDrive\Desktop and
~\OneDrive\Documents, two levels below the home root, so a copy kept in them
was never found and Build.bat fell back to asking for the folder.
On Windows, add the folders SHGetKnownFolderPath reports for Downloads,
Desktop and Documents (ctypes, standard library) to the search roots. Folders
that aren't moved are the same as the home-folder roots and are visited once.
default_out() is unchanged, so the port and its work folder never land in a
OneDrive-synced folder.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Opens the system folder dialog (tkinter, standard library), re-asks until the
folder is a supported version, and fails with a pointer to --game when Tk or a
display is missing or the dialog is cancelled. --pick and --game are exclusive.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016AjctnXX86CYbSh3uZNaNy
Distributions that install LLVM as clang-cl-21, lld-link-21 and so on (Debian,
Ubuntu) were reported as having none of the five tools, so the runtime stage
was dropped or refused. Preflight now accepts the newest full set with one
version suffix and passes it to a new build folder as the toolchain's
CMAKE_<var> overrides (docs/testing.md). A runtime/build/windows whose cached
compiler still exists needs no tools on PATH: it keeps what it was configured
with.
- `translate()` takes `fallbacks` (the --no-float-controls/--bary-fallback/--texel-offset-fallback/--mesh-compute flags), keeps them in the shard plan, and passes them to every shard; shards finished under other flags restart.
- `shaders()` records the flags in spirv/translator_flags.txt like wave64_emulate.txt and re-translates when they change; `shader_outputs_reusable()` and `preflight()` count a folder with other flags as not reusable.
- New `--no-float-controls`, `--bary-fallback`, `--texel-offset-fallback` and `--mesh-compute` options; `fallback_flags()` maps them in a stable order.
- Tests: 13 new in tests/test_make_game_translator_flags.py (all 13 fail on main 426023a5 as the negative control); mocks in the resume/argparse suites take the new keyword.
Adds an "Other languages" entry as the first item of the README nav,
pointing at docs/i18n/README.md. The landing page had no link to the
community quickstarts; the index stays the source of truth for which
languages exist, so a new translation does not need another README edit.
Docs only: one line, no build/CI changes, no game data.
Off Windows the runtime stage refused to run without --runtime-build. It now
cross-builds gta6rt.exe and gta6rt_tls_host.dll into runtime/build/windows
with runtime/cmake/clang-cl-xwin.cmake (XWIN_DIR, or ~/.local/share/xwin-sdk
as in docs/testing.md), then packages them with the Wine launcher as before.
Preflight lists what the cross-build lacks (cmake, the LLVM tools, clang-cl
older than 19, an xwin splat without VC/Tools/MSVC or Windows Kits um/x64)
and then configures it, so any toolchain error stops the run before the
shader stage. Without the tools the default stages still leave runtime out;
asking for it lists what is missing. The pipelines stage's vk_pipeline_check
is built natively into runtime/build/linux at the end of preflight, for the
same reason.
Record the llvm-mc command and version after successful disassembly. If either changes, refresh disassembly and SPIR-V translation while reusing the extracted shader inputs.
AI-assisted with Codex. Covered by synthetic LLVM version-change and interrupted-resume tests on Windows and WSL.
The status row listed BC1, BC3, BC4 and BC5. tools/bcpack.py has rebuilt all
six codecs since #576, as docs/textures.md says; most BC6H and BC7 chunks
need a history table the repository does not ship.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- PE loader and import shims: the GameInput shim on SDL3 (#680) and
gta6rt --trace-d3d12 (#701) are on main; neither was mentioned.
- Xbox D3D12 -> Vulkan: 3D render targets and texture views, depth- and
stencil-plane views, packed formats (B5G6R5, B4G4R4A4, R9G9B9E5),
predication and CPU-side texture reads and writes are on main. The
"not yet" list now also names placed resources and 1D textures, which
are still missing.
Each point checked against the code on main (b0befb4).
(cherry picked from commit 4f5559d3a91e7f8157004c29e54e815ea69320eb)
CreateQueryHeap makes one VkQueryPool per heap: occlusion (OCCLUSION and
BINARY_OCCLUSION queries), timestamp and copy-queue timestamp, and pipeline
statistics (all eleven Vulkan counters, whose order is the field order of
D3D12_QUERY_DATA_PIPELINE_STATISTICS). Other heap types are logged and
refused with E_NOTIMPL.
BeginQuery, EndQuery and ResolveQueryData are recorded in the command-list
IR with D3D12's rules for the calls, and replayed as vkCmdResetQueryPool +
vkCmdBeginQuery/vkCmdEndQuery, vkCmdWriteTimestamp at BOTTOM_OF_PIPE and
vkCmdCopyQueryPoolResults (64-bit, WAIT). Heap types, index ranges and the
destination buffer are checked before anything is written. A query that was
never ended resolves to zeros instead of stalling the GPU on WAIT_BIT.
GetTimestampFrequency is 1e9 / timestampPeriod. The devices enable
occlusionQueryPrecise and pipelineStatisticsQuery where the GPU has them.
Overlapping queries of one kind (valid D3D12, one active query per type in
Vulkan) are refused as unsupported, and binary occlusion is not clamped to
0/1 yet; both are written down in docs/d3d12_vulkan.md section 4.6.
Tested on an RTX 5070 (driver 621.01) under VK_LAYER_KHRONOS_validation.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--runtime-build DIR takes a Windows build of runtime/ (gta6rt.exe and
gta6rt_tls_host.dll, e.g. the Runtime workflow's runtime-windows
artifact) instead of building it. Off Windows the runtime stage then
runs instead of failing: it copies both files into --out and writes
gta6rt.sh, which starts gta6rt.exe with wine (or $WINE). Without the
option nothing changes. Preflight checks the folder before any work.
README: Running the loader on Linux.
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>
README: the GPU-test row counts the 30+ entries now in #166 (adds AMD
GCN3/RDNA1/RDNA4, Intel Gen9, llvmpipe) and drops the cs_w64x_partial
note that #204 fixed; the translation row says wave64 emulation makes
compute and mesh exact on 32-wide GPUs; the texture row names the
BCPack decoder from #312 and that the export doesn't use it yet; the
D3D12 row lists texture views, samplers and resolves (#228, #328).
docs/design.md: the TTPF row points at the decoder instead of calling
BCPack the hard blocker. docs/textures.md: drop the superseded
'no decoder is added' paragraph left above the new one.
AI-assisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D7JEiKsTUaHQbCTdc4Eghy
CreateReservedResource (and 1 and 2) reserve the whole resource linearly, as
docs/d3d12_vulkan.md section 4.2 plans for the first boot: a committed
resource on a default heap underneath, so every tile is backed and starts
zeroed. D3D12's description rules are kept as measured on the PC runtime
(ROW_MAJOR buffers, 64KB swizzle layouts for textures, a format with a tile
shape; GetHeapProperties is E_INVALIDARG on a reserved resource). The Xbox
tiled layout word 0x101 is accepted as 64KB_UNDEFINED_SWIZZLE.
GetResourceTiling comes from src/resource_tiling.h: the standard 64 KiB tile
shapes, standard and packed mips, per-mip tile counts and the tile order. The
device test compares it with the host PC runtime for 18 buffer, 2D, array,
block-compressed and volume layouts; resource_tiling_test checks the same
arithmetic without a GPU. Packed-mip tile counts are the driver's choice and
are this layer's own rule (tight linear size in whole tiles).
UpdateTileMappings and CopyTileMappings log once and do nothing; what that
loses (aliasing, unmapped tiles keeping data) is written down in section 4.2.
Tested on an RTX 5070 (driver 621.01) under VK_LAYER_KHRONOS_validation.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gta6rt --run <exe> [-- args] maps and binds the executable, initialises its
modules and calls its entry point on a game thread. shims/process.cpp answers
the process-level imports through the game's own import table: argv/argc and
GetCommandLine are the game's (UCRT api-set/ucrtbase and msvcrt forms), and
exit/_exit/quick_exit/ExitProcess/abort end the run with that exit code
instead of the host. gta6rt then exits with the game's code directly, so the
game's atexit handlers don't run during host shutdown.
tiny_game.exe (CTest run_tiny_game, run_tiny_game_exit_code) does what a title
does in its first second: arguments, a static initializer, a 4 MiB allocation,
a file round trip, a thread, and xgameruntime.dll imports, which the shim
registry answers instead of the link-time stub. thread_local and a C++
exception are opt-in (LEONIDA_RUN_TLS / LEONIDA_RUN_EH) until #93 and #176.
- The mode file is written before the translation starts (index.json is absent
then), not after it: a stop between the merge and the old write left an index
with no mode, which counted as "off" and either re-translated hours of work
or passed emulated shaders off as native.
- auto keeps shaders that were translated with emulation when this run would
not emulate (a GPU asleep or hidden, vulkaninfo missing): they are exact on
every GPU. An explicit --wave64-emulate off still translates natively.
- auto turns emulation on when tools/vk_subgroup_info.py says the runtime's GPU
can't be made to run compute and mesh 64-wide (subgroupSizeControl, both stage
bits: vk_pipeline_check's can_require_sg); it never turns it off.
- smallest_max_subgroup gives None (unknown, so on) when a device prints no
subgroup size instead of leaving it out of the minimum.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Compute, mesh and geometry system-value layouts are implemented and all
26,503 shaders translate (docs/design.md translator contract). Point
contributors at what is still open: the unverified VS input layout (NGG)
and wave64 cross-half code in VS/PS/GS on 32-wide subgroups.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011jW1LkcxdgoMR14Ng7tzCo
Every GDK title calls XGameRuntimeInitialize first and builds its async work on
XTaskQueue/XAsync. Add an xgameruntime.dll shim table for those, ahead of the
executable: XGameRuntimeInitialize/Uninitialize (reference counted),
XSystemGetDeviceType (Series X; LEONIDA_DEVICE_TYPE overrides) and
XSystemGetConsoleId (placeholder), plus the 23 XTaskQueue/XAsync functions.
XTaskQueue/XAsync come from microsoft/libHttpClient (MIT), copied unmodified
into third_party/xtaskqueue (task queue only, no HTTP stack); a small pch.h
stand-in lets them build alone. xgameruntime_test drives the table through
the shim registry the way a title boots. Nothing goes online.
- Without --stages, runtime (Windows only for now) is left out off Windows.
Before, the default build ran shaders and assets (hours) and then failed
in runtime, so pipelines never ran.
- Asked for explicitly off Windows, preflight() refuses it before any work.
- pipelines finds vk_pipeline_check where CMake builds it off Windows
(runtime/build/linux as in the README, or runtime/build as in
CONTRIBUTING.md) instead of only vk_pipeline_check.exe, and says how to
build it when it is missing. Windows is unchanged.
- tests/test_make_game_platform.py (9 tests, 6 fail before this change);
test_make_game_preflight.py's all-tools test asks for runtime only on
Windows, since it is now refused elsewhere.
AI-assisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#152 added rdna2spirv.py --wave64-emulate (wave64 compute and mesh shaders exact on any
subgroup size), but the build never passed it, so 32-wide GPUs (NVIDIA, Intel) got the
native translation.
- auto (default) reads the smallest maxSubgroupSize from vulkaninfo and turns emulation on
below 64, or when vulkaninfo is missing or tells nothing (the emulated output is exact
everywhere). on and off are taken as given.
- The mode used is written to spirv/wave64_emulate.txt; a change translates again. A folder
without the file counts as off, which is how it was made.
- translate() passes the flag to every shard.
- Tests: tests/test_make_game_wave64.py (new), resume and argparse tests extended.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>