Commit Graph

4696 Commits

Author SHA1 Message Date
e2ec3a8448 Runtime: exact minimum-LOD views and full bindless set on Intel Xe-LP (D3D-219)
d3d12_descriptor failed every run on an Intel UHD 770 (101.7092) for two
reasons, both from the driver taking an option the Vulkan spec allows:

- VK_EXT_image_view_min_lod: the driver selects levels with
  minLodInteger = floor(minLod), the spec's "alternative", so a 0.75 or
  1.75 ResourceMinLODClamp read one mip too detailed. On Intel integrated
  GPUs bind_image now passes the clamp rounded to the nearest level,
  which point mip filtering selects exactly.
  LEONIDA_MIN_LOD_INTEGER=1/0 forces it either way.
- The bindless set stayed at its default counts (4096 2D images, 1024
  samplers) because the driver reports maxPerSetDescriptors = 6159 with
  every other limit at 1048576. size_bindings now takes an optional
  layout_supported callback, and past maxPerSetDescriptors the device
  asks vkGetDescriptorSetLayoutSupport about the grown layout.
  bindless::SetLayout describes set 0 once for create_layout and that
  query.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:08:32 +01:00
e6bb76cd58 Reject changes to DXGI swapchain creation flags on resize 2026-11-22 18:06:12 +04:00
eda19ca1d2 feat(runtime): add D3D12 CBV/SRV/UAV buffer views 2026-11-22 11:05:55 -03:00
6684d836ff Runtime: serve the game's command line and ExitProcess under every import name
The UCRT's _get_narrow_winmain_command_line and _get_wide_winmain_command_line
were not shimmed, so a /MD WinMain executable got gta6rt's own command line as
lpCmdLine. GetCommandLineA/W and ExitProcess were shimmed under kernel32.dll
only, and the loader matches DLL names exactly. Imported from kernelbase.dll, or
from the API sets the umbrella libraries bind them to
(api-ms-win-core-processenvironment-l1-1-0, api-ms-win-core-processthreads-l1-1-0),
they went to the host. The package's vcomp140.dll imports ExitProcess from the
latter.

process_cmdline_test checks every name and the WinMain line.
docs/runtime_imports.md: the dry-run table regenerated at this commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:05:53 +00:00
1f32be4f4b Merge remote-tracking branch 'origin/main' into shader-33-vs-inputs
# Conflicts:
#	runtime/test/shaders/check.py
#	scripts/run_gpu_tests.py
#	tests/test_shader_checks.py
2026-11-22 15:04:48 +01:00
9eaddc92be vk_pipeline_check_cli: run the tool through CMAKE_CROSSCOMPILING_EMULATOR
CTest applies CMAKE_CROSSCOMPILING_EMULATOR only to tests whose command is a
target; the script test runs the host CMake, so the cross-build/Proton workflow
in docs/testing.md would execute the tool directly, without Wine. Pass the
emulator list as -DRUNNER and prepend it to both execute_process commands, the
same pattern as check_loaded_async.cmake.
2026-11-22 17:04:38 +03:00
400d976f43 d3d12_xs: name slot 67 descriptor fields as FSPX kinds 0, 1, 6, 7
Name all four pointer and size pairs in the XboxNativeComputePipelineStateDesc
struct as kinds 0, 1, 6, 7 per docs/fspx.md and name the slot
DeserializeComputePipelineStateX in slot_name, matching the DLL's messages.
This prepares the description struct for the runtime FSPX resolver follow-up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:34:10 +05:30
af236e196b d3d12_xs: route slot 67 compute pipeline from native code to CreateComputePipelineState (RT-99)
Xbox device slot 67 takes (desc, riid, out) with IID_ID3D12PipelineState and a console-only
descriptor with the root signature at +0x00 and code blob pointer/size at +0x28/+0x30.
Previously it logged and returned E_NOTIMPL.

Route it to CreateComputePipelineState on the PC device (slot 11) like slot 62, mapping the
console descriptor to D3D12_COMPUTE_PIPELINE_STATE_DESC. On the Vulkan device this resolves
through the translator via fssm_program and ShaderLibrary.

- Implement proxy_create_compute_pipeline_from_native_code in d3d12_xs_device.cpp
- Update device_proxy_test to verify slot 67 thunk, compute PSO creation over WARP, and argument checks
- Update d3d12_compute_test to verify slot 67 compute PSO creation on the Vulkan device
- Update documentation in d3d12_command_objects.md and d3d12_vulkan.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:34:10 +05:30
af0453281d d3d12: support multisampled placed textures (D3D-222) 2026-11-22 15:02:35 +01:00
c97ae2619a test(d3d12): gate tiled MSAA allocation skip on host quality levels (D3D-191) 2026-11-22 15:02:33 +01:00
a178a06b34 salu_diff: s_nand/s_nor/s_xnor_b64 in the generator; hardware-checked nand/nor/xnor
The translator already handles s_nand/nor/xnor_b32 and _b64 (rdna2spirv.py,
tests/semantic), so no translator change. What was missing: the _b64 forms in
salu_diff's generator, a GPU test of the translated output, and a hardware
comparison. Adds the three _b64 ops to salu_diff (and LANE_MASK_OPS),
ps_scc_logic32/64.asm (values and SCC by hand) registered in check.py and
run_gpu_tests.py, and a docs/design.md row with the hardware counts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:00:17 +01:00
84016932e0 Validate DXGI flip-model swapchain buffer counts 2026-11-22 17:59:40 +04:00
f43ced594f Runtime: zero-initialize committed block-compressed textures on first use (D3D-220) 2026-11-22 16:59:06 +03:00
dfdde86773 test(d3d12): skip host-unsupported tiled allocation cases (D3D-191) 2026-11-22 14:57:48 +01:00
0904055f3a dxgi: implement CreateSwapChainForCoreWindow and occlusion status registration
Implements CreateSwapChainForCoreWindow on Factory for UWP / Game Core Scarlett titles by querying ICoreWindowInterop for the underlying Win32 HWND, and implements RegisterOcclusionStatusWindow / RegisterOcclusionStatusEvent returning sequential cookies.

Adds mock ICoreWindow unit tests in dxgi_swapchain_test covering argument validation, null HWND failure, functional swapchain presentation, and occlusion status registration.
2026-11-22 19:27:37 +05:30
22888d4e65 Runtime: test the shader lookup against a translated corpus
shader_library_corpus_test runs src/shader_library.h over the work folder
make_game.py builds from the player's copy (LEONIDA_SHADERS=<work>/shaders/spirv,
containers from <work>/shaders/dxbc or LEONIDA_SHADER_DXBC), as the D3D12
layer does with a PSO's bytecode: inflate the FSSM program, hash it and look
it up under the stage the DXIL program header names. Every container must
find its own index.json entry and a readable .spv, every entry must be
reached, and in containers with more than one 0x0D payload no earlier
payload may be the indexed program.

Without LEONIDA_SHADERS it prints SKIP and exits 77 (SKIP_RETURN_CODE).
On the 1.0.2.1 corpus: 26,503 containers, all resolve, 195 with more than
one program. With fssm_program switched to the first payload it fails
(391 failures, 26,308 of 26,503 entries reached).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:54:56 +01:00
146a9f02b4 d3d12_vulkan_device_test: 0.6 ULP tolerance for placed SRGB-cast clears (D3D-221)
Against another adapter or WARP, a placed clear byte may differ from the
host when both sides are within 0.6 ULP of the ideal value, the
tolerance D3D11.3 spec 3.2.3.6 (FLOAT -> UNORM) and 3.2.3.8
(FLOAT -> SRGB) allow. The plain tie rule already did this for
0.5 * 255; the SRGB-cast clear's 0.5 encodes to 187.516, where Intel's
Vulkan driver (UHD 770, 101.7092) writes 187 and WARP 188. The layer's
own adapter stays exact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:53:04 +01:00
059511a027 tests: d3d12_indirect_zero's exit 77 is a skip
The test returns 77 when no Vulkan GPU is available and under Wine,
where the host comparison is skipped, but it was registered without
SKIP_RETURN_CODE, so ctest reported it as a failure there. It is the
only d3d12_* test that returns 77 without the property.
2026-11-22 16:52:59 +03:00
41ceb016c2 runtime: remove duplicate bind_image call in write_image_descriptor 2026-11-22 14:50:41 +01:00
ea879b5ca4 d3d12_vulkan_device.cpp: fix swapchain maintenance1 header guard syntax and scope 2026-11-22 14:50:34 +01:00
b40d8039a9 Merge main into test/valu-int-misc (#1492)
Conflicts: tests/semantic/regen_fixtures.py

AI-assisted.
2026-11-22 14:50:01 +01:00
6b67de3599 Merge main into test/coverage-gaps (#1299)
Conflicts: scripts/run_gpu_tests.py, tests/semantic/regen_fixtures.py

AI-assisted.
2026-11-22 14:49:58 +01:00
e451cf248a d3d12_vulkan_device.cpp: guard swapchain maintenance1 features with macro check 2026-11-22 14:49:15 +01:00
e8ac3266e7 d3d12_vulkan_device.cpp: guard swapchain maintenance1 features with macro check 2026-11-22 14:48:21 +01:00
db9b0904f0 Runtime: O(1) LayoutTracker rollback and unlock tracker_mutex before vkQueuePresentKHR in VulkanPresenter 2026-11-22 16:47:54 +03:00
be6ebf0e91 runtime: set binding.va and host_readable on placed buffers 2026-11-22 14:45:46 +01:00
19b261bb99 Merge remote-tracking branch 'origin/main' into runtime-vulkan12-khr
# Conflicts:
#	runtime/shims/d3d12_vulkan_device.cpp
#	runtime/test/vk_test_device.h
2026-11-22 13:45:11 +00:00
a72cc827e6 Merge remote-tracking branch 'origin/main' into runtime-reserve-fixed-base
# Conflicts:
#	runtime/CMakeLists.txt
#	runtime/src/main.cpp
2026-11-22 13:44:03 +00:00
86afc220f1 test(d3d12): rename shadowed loop variable host_desc (C4456) 2026-11-22 14:43:53 +01:00
f3a4450592 vk_pipeline_check: reject malformed option values (TEST-250) 2026-11-22 16:43:50 +03:00
fa687fda48 d3d12_vulkan_device_test: sampler heap size and realtime priority gates 2026-11-22 14:43:26 +01:00
52c3a88947 GPU test: image atomics in a pixel shader (ps_imgatomic)
1,018 of the corpus's 1,038 image-atomic shaders are pixel shaders, but every GPU test of image atomics ran in a
compute shader (found by @aslan2142). ps_imgatomic does the corpus's forms in a pixel shader: image_atomic_umax,
umin and or on three 8x8 2D r32ui images (64 pixels contend for each texel) and umax on a 4x4x4 3D image, each
found through its own T# in the descriptor table and the set-0 r32ui storage arrays. Odd pixels are discarded
after their atomics, which must still count.

vk_bindless_test runs it when given ps_imgatomic.spv: it enables fragmentStoresAndAtomics (exit 77 without it),
clears the images (umin to all ones), draws, and checks all 256 texels against a model of the 4096 pixels and the
render target's discarded columns. run_gpu_tests.py and check.py run it next to ps_tex.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:42:22 +00:00
1eeaa202f9 d3d12_vulkan_device_test: invalid-argument cases a Windows 10 host predates 2026-11-22 14:41:44 +01:00
3f26a95a10 fix(file_system): check is_regular_file for deletion markers so nested deletes do not hide parent directories 2026-11-22 10:41:32 -03:00
fa2712e2b0 xdxr_build: one-workgroup sort for small builds, 256-element radix tiles
The radix sort's fixed latency dominated small builds (2,000 triangles: 0.81
ms with the sort, 0.08 ms without, on an RTX 2050; the 10k regression
@exhawk measured on #1572). Up to 1,024 keys are now sorted in one
workgroup's shared memory (bitonic, ties by element index: the stable
order; 8 KiB, within the 16 KiB minimum with the radix arrays), and the
radix tiles are 256 elements (4 chunks instead of 32 per workgroup).

RTX 2050: 1,000 triangles 0.24 ms, 2,000 0.28 ms (0.83), 10,000 0.38 ms
(0.81), 100,000 2.3 ms (2.5); 1M 21.9 ms (20.3, the larger scan).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:41:25 +01:00
6e8a1400ee vulkan_replay: name the XDXR build branch's binding apart from the KHR one
Two `const auto* build` in one else-if chain: the second hides the first
and MSVC /W4 warns (C4456) in every file that includes the header
(reported by @zneel on #1667).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:41:25 +01:00
5c6ff05950 feat(runtime): implement ID3D12Device::CreateConstantBufferView (GFX10 V#)
Write a 16-byte GFX10 raw buffer V# descriptor (48-bit BufferLocation, stride 0,
num_records = SizeInBytes, GFX10_FORMAT_32_UINT, OobSelect::raw) into the
32-byte CBV_SRV_UAV descriptor slot, zeroing the trailing 16 bytes (or the full
slot for a null description, zero BufferLocation, or zero SizeInBytes).

Verified on Windows 11 with RTX 5080 and Radeon Graphics in d3d12_compute_test:
64/64 dwords matched for CBV A, 32 in-bounds + 32 OOB-zero matched at +128, and
negative controls flipped 64/64 dwords for CBV B and null CBV.

AI Assisted.
2026-11-22 14:41:17 +01:00
40107eb878 Merge pull request #1724 from Vonsek 2026-11-22 08:38:47 -05:00
985a0ee4dc Merge pull request #1719 from waltingford 2026-11-22 08:38:45 -05:00
4e0abc668c Merge pull request #1713 from totonii 2026-11-22 08:38:40 -05:00
acc50aafd0 Merge pull request #1710 from Dominik 2026-11-22 08:38:38 -05:00
089c124df3 Merge pull request #1704 from Jack UK 2026-11-22 08:38:35 -05:00
12952f7e92 Merge pull request #1702 from Sagah123 2026-11-22 08:38:34 -05:00
10cf6ffca6 Merge pull request #1699 from AimLogin
# Conflicts:
#	docs/testing.md
2026-11-22 08:38:33 -05:00
464cff7336 Merge pull request #1698 from Jan Trencansky 2026-11-22 08:38:32 -05:00
aa5ff92859 Merge pull request #1696 from SHAURYASANYAL3 2026-11-22 08:38:31 -05:00
6bce2fe30f Merge pull request #1691 from totonii 2026-11-22 08:38:29 -05:00
cd4ac9c785 Merge pull request #1689 from Codex 2026-11-22 08:38:27 -05:00
3f2dc6dd17 Merge pull request #1687 from Vonsek 2026-11-22 08:38:26 -05:00
1352cffcda Merge pull request #1684 from Emirhan Karaca 2026-11-22 08:38:23 -05:00