Commit Graph

75 Commits

Author SHA1 Message Date
c0c0e8d98d Merge pull request #1741 from Kam471 2026-11-22 09:14:59 -05:00
17b36d7604 docs: attribute the 26,503 shader result to dcd8ecf, not the 26,501 run 2026-11-22 13:46:18 +00:00
70abc4c5c1 Merge pull request #1697 from BetterJdue 2026-11-22 08:38:31 -05:00
95a89a75d3 make_game: --wave64-emulate auto leaves emulation off on RDNA2 under the AMD Windows driver (#857)
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>
2026-11-22 14:15:04 +01:00
1e58e0bfea Update README with status of various features 2026-11-22 21:10:04 +08:00
0b009a318f Merge pull request #1358 from liang-kai-shui 2026-11-22 05:37:55 -05:00
080cee9036 Merge pull request #1342 from ICUMADETHIS 2026-11-22 05:37:50 -05:00
1aa8e266e5 Merge pull request #1335 from opit80 2026-11-22 05:37:46 -05:00
b2c8fc1c48 Note the clang-cl 22.1.7/22.1.8 exception next to the LLVM 19+ requirement 2026-11-22 13:34:02 +03:00
59d5b4d495 docs: mention make_game.py --full-check in the README
--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.
2026-11-22 18:32:24 +08:00
4b63e03b47 make_game: search the real Downloads, Desktop and Documents for the game
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>
2026-11-22 10:24:32 +00:00
3cf44713e9 make_game.py: add --pick to choose the game folder in a folder dialog
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
2026-11-22 12:12:50 +02:00
779aa4ae80 Merge pull request #1273 from Kevin Morales 2026-11-22 04:37:59 -05:00
5e9f17c6b3 make_game.py: accept versioned LLVM tools for the Linux cross-build
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.
2026-11-22 02:27:17 -07:00
c91b571031 Merge origin/main into build/make-game-translator-flags
Keep both sides: preflight/main() take fallbacks and jobs; argparse mock
asserts fallbacks=() and jobs=6 together.
2026-11-22 01:23:07 -08:00
f5a073213f make_game: forward the translator's fallback flags and record them beside the translation
- `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.
2026-11-22 01:19:27 -08:00
fa85600392 Merge pull request #1245 from liang-kai-shui 2026-11-22 04:07:51 -05:00
141c65bf58 docs: link the community quickstarts from the README nav
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.
2026-11-22 16:57:59 +08:00
273886db50 make_game.py: build the runtime stage on Linux with clang-cl and xwin
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.
2026-11-22 01:36:05 -07:00
cdd3124fd5 Merge pull request #1119 from Tayar 2026-11-22 02:47:46 -05:00
8c9ea9fc6a docs: cite post-fix shader validation results 2026-11-22 04:14:33 -03:00
3ab8477b4d docs: update LLVM 23 shader translation status 2026-11-22 04:11:56 -03:00
d8e4df46ff Merge pull request #1090 from Samu3k 2026-11-22 02:09:03 -05:00
e6373238dc Refresh shader disassembly when llvm-mc changes
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.
2026-11-22 07:39:12 +01:00
cd4c3edf12 README: the BCPack decoder rebuilds BC6H and BC7 too
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>
2026-11-22 13:25:10 +07:00
931eb80df5 README: status rows match what main has merged
- 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)
2026-11-22 00:33:48 -05:00
7079108182 Runtime: query heaps on Vulkan (D3D-15)
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>
2026-11-21 21:30:47 -06:00
ffbae3f5aa Merge pull request #768 from Ayoze Torres 2026-11-21 22:08:45 -05:00
6eaf8b6fa8 make_game: runtime stage on Linux with --runtime-build and a Wine launcher
--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.
2026-11-22 02:39:10 +00:00
77aae6f0bb Refresh completed shaders when translation sources change 2026-11-21 19:27:36 -07:00
8de2522899 README: the full translation count is with LLVM 21; LLVM 23 rejects 1,471 for now (#644)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 20:37:36 -05:00
a8fffc8830 Merge pull request #598 from curnpoo 2026-11-21 20:09:29 -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
5cd151c551 docs: refresh the README status table and stale BCPack rows (PROC-9)
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
2026-11-22 00:33:19 +00:00
8119d8deed Merge pull request #433 from SombraSoft 2026-11-21 19:14:03 -05:00
8c8388f599 Runtime: reserved resources and GetResourceTiling on Vulkan (D3D-20)
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>
2026-11-21 17:57:06 -06:00
ad0e4d143b Build: require Python 3.12+ to match CI 2026-11-21 20:32:33 -03:00
0ca9bb8bc0 Runtime: gta6rt --run, and a stand-in game executable run through the loader
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.
2026-11-21 23:50:31 +01:00
383156b0f5 Merge pull request #299 from AlxcBTW 2026-11-21 17:38:42 -05:00
38f17196d3 Merge pull request #282 from Claude
# Conflicts:
#	tools/shader_profile.py
2026-11-21 17:38:22 -05:00
b946e90ba2 make_game.py: wave64 mode survives a kill after the merge; auto keeps emulated shaders; stricter auto detection
- 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>
2026-11-21 23:20:19 +01:00
909fd0ec5d README: update the shader item in Want to help?
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
2026-11-21 22:13:11 +00:00
345465a2d6 Merge pull request #257 from IAmNotSiob 2026-11-21 17:07:42 -05:00
5a7d97f8ad Merge pull request #236 from intelshadow 2026-11-21 17:07:36 -05:00
d51b4f41ff Merge pull request #237 from IAmNotSiob 2026-11-21 17:07:35 -05:00
36bc1200ad Runtime: offline xgameruntime shim (XGameRuntime, XSystem, XTaskQueue, XAsync)
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.
2026-11-21 23:06:10 +01:00
49421fe75b README: shader GPU checks now cover 13 GPUs (#166), not one 2026-11-21 22:49:22 +01:00
c73e25f4b7 make_game.py on Linux: leave the Windows-only runtime stage out by default, refuse it up front, find the Linux vk_pipeline_check
- 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>
2026-11-21 22:48:41 +01:00
6f6ffffa8d make_game.py: --wave64-emulate auto|on|off, on for GPUs without 64-wide subgroups (SHADER-11)
#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>
2026-11-22 08:24:30 +11:00
a0611c9fef Merge pull request #177 from simonbronk 2026-11-21 16:08:07 -05:00