Commit Graph

5744 Commits

Author SHA1 Message Date
039df7d24f Runtime: upload heaps in Resizable BAR memory when the GPU has it (D3D-96)
Upload-heap buffers asked for HOST_VISIBLE | HOST_COHERENT memory only, so the GPU read every vertex, index and
constant buffer a game uploads over PCIe from system memory. They now prefer DEVICE_LOCAL | HOST_VISIBLE |
HOST_COHERENT when the device has Resizable BAR: such a type in a device-local heap larger than the 256 MiB BAR
window (leonida::resizable_bar, runtime/src/vulkan_memory.h). Without Resizable BAR that type is a window of
256 MiB or less that every upload buffer would share, so they stay in system memory there. A full VRAM heap falls
back to system memory through DeviceState::allocate's existing order.

The device logs where upload heaps live, LEONIDA_UPLOAD_SYSMEM=1 keeps them in system memory for comparison, and
vulkan_memory_flags / device_upload_in_vram report the choice to tests. d3d12_state_map_test checks the detection
on the heap layouts of an RTX 5060 Ti with Resizable BAR, an RTX 3090 without it, a 256 MiB window and an
integrated GPU; d3d12_vulkan_device_test checks that its upload buffer is placed accordingly, and its GPU copies
then read that buffer in both placements.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 21:26:20 -06:00
b74c7f2946 Merge remote-tracking branch 'origin/main' into claude/d3d-30-fences-timing-7ce86f
# Conflicts:
#	runtime/shims/d3d12_com.cpp
#	runtime/shims/d3d12_vulkan_device.cpp
2026-11-22 03:24:05 +00:00
aa110d3989 Merge remote-tracking branch 'origin/main' into fuzz-7-w32-lane-select
# Conflicts:
#	tests/semantic/regen_fixtures.py
2026-11-22 03:23:54 +00:00
ebbce72855 Merge remote-tracking branch 'origin/main' into bpw32-main
# Conflicts:
#	docs/design.md
#	runtime/test/shaders/check.py
#	scripts/run_gpu_tests.py
2026-11-22 04:22:25 +01:00
94e7e24f12 rdna2spirv: exact Wave64 s_cmp on opposite mask halves and mask-vs-scalar operands
# Conflicts:
#	tools/rdna2spirv.py
2026-11-22 00:20:42 -03:00
80186d3578 Audio: preserve recordings across native filesystem name collisions 2026-11-21 20:15:07 -07:00
0251789a8b Merge remote-tracking branch 'origin/main' into d24-on-d32
# Conflicts:
#	runtime/src/vulkan_backend.h
2026-11-22 04:10:13 +01:00
3d4f0df6c4 Merge pull request #787 from 465d6a0eac 2026-11-21 22:09:26 -05:00
ec4840ab36 Merge pull request #786 from Størm 2026-11-21 22:09:24 -05:00
686e131635 Merge pull request #784 from SirAmong 2026-11-21 22:09:21 -05:00
9474059934 Merge pull request #781 from rasptum 2026-11-21 22:09:17 -05:00
824f89f86c Merge pull request #776 from kotorvr 2026-11-21 22:09:06 -05:00
a297365e38 Merge pull request #775 from JavierBlanco23
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-21 22:09:05 -05:00
cc772d6ce8 Merge pull request #771 from bennymxckz 2026-11-21 22:08:51 -05:00
87daf46e46 Merge pull request #767 from Derpbeat 2026-11-21 22:08:43 -05:00
4703774199 docs: d3d12_vulkan.md section 3.2 known gaps match main
- The bindless flush already waits: when flush_needs_idle() is true the
  device waits for idle and frees the retired table buffers (D3D-76,
  e6eaecd). The text still said the queue could not tell the device.
- Reserved resources exist (CreateReservedResource); they were still
  listed as a gap.
- The first "Known gaps" list was cut off mid-sentence by a merge, right
  before the 3D render-target paragraph, and listed volume attachment
  views, which that paragraph describes as supported. It is folded into
  the complete list after the paragraph.
2026-11-22 03:08:21 +00:00
316e2773f7 Merge pull request #715 from Vonsek 2026-11-21 22:08:19 -05:00
b288ad9638 Merge pull request #680 from kotorvr 2026-11-21 22:08:12 -05:00
dee21a01ac Merge pull request #592 from SirAmong 2026-11-21 22:08:00 -05:00
d549d2d117 Merge pull request #417 from kotorvr 2026-11-21 22:07:52 -05:00
aa73dd7df1 Merge current runtime targets into the standalone Vulkan build option 2026-11-22 00:07:04 -03:00
fc1bfab95f Docs: the mrtz depth rule in the inputs and outputs row 2026-11-21 23:07:02 -04:00
4859a809b3 chore(merge): integrate current Vulkan descriptor tests
Keep the upstream 3D texture uploads alongside the unaligned BC sample and preserve the expanded feature-query documentation.
2026-11-22 04:06:58 +01:00
e9a8203d45 Merge main and preserve volume views and HRESULT tracing in A8 coverage 2026-11-22 00:06:32 -03:00
cd6ade80c9 Gamedata: PAMH 0x08 is padding, add a tile census (ASSET-58) 2026-11-22 00:06:28 -03:00
0ff02e0630 docs: V# OOB_SELECT bounds measured on RDNA2 (SHADER-116)
docs/buffer_bounds.md records which buffer accesses are out of range per the
V# OOB_SELECT field, measured natively on a Ryzen 7 9800X3D iGPU (gfx1036,
RDNA2) with raw buffer_load_dword / buffer_store_dword: 732 cases (modes 0-3,
stride 0/16/18, NUM_RECORDS 0/3/18/48, offen / idxen / both, raw with
soffset), three identical runs.

RDNA2 follows Mesa's GFX11 column, not GFX10 (729 vs 696 of 732): mode 0
checks offset + 4 > stride and raw mode offset + 4 > N. Raw mode also counts
soffset. Modes 1 and 2 match both columns. Loads and stores agree. The
console's gfx1013 (GFX10.1) is left open: it needs an RDNA1 card.

docs/README.md lists the new note.

AI-assisted (Claude Code).
2026-11-21 22:04:38 -05:00
d8c909a404 docs: permlane hyp_only wording, only a mismatching program is filed apart (follow-up to #645)
matheuskshn's review of #645: tools/crosslane_fuzz.py counts a program as
match first (`if not bad`), and only a mismatching program that has a
hypothesis op becomes hyp_only. The text said any program that hits the case
is filed as hyp_only.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012LCSkZnZuvsgYRtNiPTBBo
2026-11-21 22:03:39 -05:00
1b6cc3f2c2 Translator: ds_read_u8/i8_d16[_hi] 8-bit LDS reads into a 16-bit half (SHADER-85)
ds_read_u8_d16, ds_read_u8_d16_hi, ds_read_i8_d16 and ds_read_i8_d16_hi
(RDNA2 DS opcodes 162-165) were rejected. They reuse the u8/i8/u16_d16
path: the byte is zero- or sign-extended 8->16 into one half of the
destination and the other half is kept.

Tests: CPU value test on the new cs_w32_lds_u8_d16 fixture (mini
interpreter now accepts Workgroup variables for one invocation), GPU
dump cs_w32_lds_u8_d16.asm registered in check.py and run_gpu_tests.py,
lds_fuzz generates the four reads. Contract row in docs/design.md and
shader_validation.md updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 22:02:47 -05:00
d5e00415f6 D3D-86: answer CheckFeatureSupport OPTIONS2-5, 7, 9, 11, 13-16, 18-21 2026-11-22 04:00:58 +01:00
f9addf5739 Depth-plane T# of a D24 texture is 8_24_UNORM even when stored as D32
image_descriptor named the depth-plane SRV's format from the stored Vulkan
format, so a D24 texture the layer keeps as D32_SFLOAT_S8_UINT (no D24 on the
GPU, the Radeon 880M) got the X24_8_32_FLOAT code instead of the 8_24_UNORM the
console's own descriptor has, and d3d12_descriptor_test failed there. The T#
now carries the format of the texture as created; bind_image views the image
as stored (its own format, depth aspect), since a D24 view of a D32 image is
not valid. A depth-plane view of a texture of the other depth family is
refused.

The D24 comparison test checks the T# codes of the depth and stencil plane
SRVs instead of printing a known gap (depth-plane and stencil-plane views
exist on main now); the docs say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 03:59:18 +01:00
71812aac05 GameInput shim: download SDL3 only when asked (LEONIDA_SDL3_FETCH)
The shim is built with an installed SDL3 (find_package) or with
-DLEONIDA_SDL3_FETCH=ON / FETCHCONTENT_SOURCE_DIR_SDL3; otherwise configure
prints a message, gta6rt builds without it, and CTest lists gameinput as
disabled. build_runtime.ps1 gains -FetchSdl3 and warns that its cl.exe
fallback never builds the shim. Review nits: delivering_thread is atomic,
and SDL's own GameInput joystick driver is pinned off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:58:46 +00:00
96404ac97a Merge main into D3D-26: unordered-access clears on main
Keeps both sides; the discard emit now passes the binding to image_barrier
as main's version takes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:58:23 +00:00
4fa0fb7dee Runtime: ID3D12Resource::GetDesc fills in a defaulted Alignment, as the host does
A resource created with Alignment 0 read back Alignment 0 from the Vulkan-backed
device. The PC runtime and WARP report the placement alignment instead: 64 KiB,
or 4 MiB for a multisampled texture, and keep one the description asked for.

d3d12_resource_desc_test compares every GetDesc field of 26 committed and
reserved descriptions with the default adapter and WARP.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 21:56:53 -05:00
deae7cc736 Merge remote-tracking branch 'origin/main' into claude/d3d-24-debug-markers-457bab
# Conflicts:
#	runtime/shims/d3d12_com.cpp
#	runtime/src/command_list.h
2026-11-22 02:56:52 +00:00
0c46a83525 Merge remote-tracking branch 'origin/main' into claude/d3d-30-fences-timing-7ce86f
# Conflicts:
#	runtime/shims/d3d12_com.cpp
2026-11-22 02:55:57 +00:00
c7e450fc69 D3D-26: keep a null discard region apart from an explicit UINT_MAX count
A region with NumSubresources = UINT_MAX was recorded like a null region and
skipped the FirstSubresource check. DiscardResource now has a whole flag;
explicit ranges are checked in 64-bit at recording and replay. Tests at the
UINT_MAX boundary in command_list_test, part F and the COM device test.
Found by matheuskshn in review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:55:44 +00:00
d8397aa3ee Runtime: keep the multiple-fence countdown unsigned (D3D-30 review)
SetEventOnMultipleFenceCompletion narrowed its UINT count to int for the
ALL countdown, so a count past INT_MAX started negative, looked done and
never set the event. The waiter now counts down a std::atomic<UINT> that
stops at zero, so later ANY hits do not wrap. It moves to
shims/d3d12_fence_waiter.h, and the new ctest d3d12_fence_waiter checks
counts past INT_MAX, ALL, and hits past zero without a GPU.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:55:30 +00:00
0317b8d5fb docs/psin: LSCH/LENM layouts measured over every archive (ASSET-50)
All 18,640 PSIN streams in package 1.0.2.1 (every archive but the raw
AWC audio.rpf): 17,664 whole LSCH and 17,641 whole LENM sections, all
decoded with no schema error. Counts and layouts only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:55:05 +00:00
8b23fa2732 Runtime: GetPrivateData returns the needed size with DXGI_ERROR_MORE_DATA
A buffer too small for an entry now gets the size to retry with, for byte
and interface entries alike, as vkd3d-proton's private store does. The
test retries with the returned size for both kinds. Review on #419.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:55:00 +00:00
0e59c75b7b Runtime: GameInput shim on SDL3 (any controller; DualSense trigger effects, lightbar)
GameInputCreate and the v0 IGameInput/IGameInputDevice/IGameInputReading/IGameInputDispatcher surface a title uses
for gamepads, served from SDL3 gamepads so DualSense, DualShock 4, Switch Pro and Xbox pads all work. Rumble goes to
SDL_RumbleGamepad, impulse-trigger rumble to SDL_RumbleGamepadTriggers, and on a DualSense to adaptive-trigger effects
through SDL_SendGamepadEffect (LEONIDA_DS_TRIGGERS=off|rumble|resistance). Lightbar via LEONIDA_DS_LIGHTBAR.

SDL3 (zlib) comes from an installed package or a pinned, hash-checked release tarball via FetchContent;
-DLEONIDA_SDL3=OFF skips the shim. gameinput_test covers the shim on SDL virtual joysticks; gameinput_probe is the
manual check on a real pad. docs/gameinput.md has the mapping, settings and VERIFY list.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:54:55 +00:00
f848e21eee Merge remote-tracking branch 'origin/main' into fuzz-7-w32-lane-select
# Conflicts:
#	tests/semantic/regen_fixtures.py
2026-11-22 02:54:47 +00:00
ff354a556b Report and exercise A8 texture mip support 2026-11-21 23:51:24 -03:00
ff650ecefd feature_scan.py: count v_perm_b32 selector byte classes and document corpus counts 2026-11-22 02:50:50 +00:00
9f755a30fa Runtime: depth-plane SRVs only on their own depth family (#678 follow-up)
#678 (D3D-84) took R24_UNORM_X8_TYPELESS and R32_FLOAT_X8X24_TYPELESS on any
texture with a depth aspect, so the other family's view (an X8X24 view of an
R24G8 texture, or the reverse) got a live descriptor of the texture's own
depth format. D3D12 refuses both. Each depth view format now belongs to its
own DXGI family only (R24G8_TYPELESS / D24_UNORM_S8_UINT, R32G8X24_TYPELESS /
D32_FLOAT_S8X24_UINT), checked on the resource's DXGI format, so a D24
texture backed by D32_SFLOAT_S8_UINT still takes the R24 view. The other
family's view falls through to the existing "view format not supported"
path and leaves the slot null.

d3d12_descriptor_test checks both cross pairs give a null descriptor, and
takes the expected depth T# from the texture's backing: a GPU without a
usable D24 (the layer's depth_usable rule) backs R24G8 with
D32_SFLOAT_S8_UINT, where the old expectation of 8_24_UNORM failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 20:42:28 -06:00
5879d22055 Merge remote-tracking branch 'origin/main' into shader-36-gather-wrap
# Conflicts:
#	scripts/run_gpu_tests.py
#	tests/test_shader_checks.py
2026-11-22 03:41:57 +01:00
875aecb46e Merge remote-tracking branch 'origin/main' into bpw32-main
# Conflicts:
#	docs/design.md
#	runtime/test/shaders/check.py
#	scripts/run_gpu_tests.py
#	tests/test_run_gpu_tests.py
2026-11-22 03:38:09 +01:00
f584a2a29d Merge pull request #755 from BetterJdue
# Conflicts:
#	docs/design.md
2026-11-21 21:38:01 -05:00
69ed76dad0 Merge pull request #754 from Rafael 2026-11-21 21:37:59 -05:00
0320b4004d Merge pull request #752 from kotorvr 2026-11-21 21:37:59 -05:00
fd22f01ca2 Merge pull request #750 from kotorvr
# Conflicts:
#	docs/design.md
2026-11-21 21:37:59 -05:00