Commit Graph

4163 Commits

Author SHA1 Message Date
1df2488045 Merge pull request #520 from xroneyaa/fix/vulkan-scratch-align-overflow
VULKAN-SCRATCH-ALIGN-OVERFLOW: avoid uint64 overflow when aligning chunk.used
2026-11-24 09:37:55 -05:00
909051f61b Merge pull request #773 from moffington/fix/loader-tls-ga-fixture
runtime: retain the TLS directory in the /GA test fixture
2026-11-24 09:37:44 -05:00
c156e77c46 xgameruntime: XPersistentLocalStorageGetPath reports the required size on a short buffer (RT-712)
The (size, buffer, used) convention of the XSystem id getters: a short buffer learns the path length with its NUL
in *path_used, the buffer stays untouched, the HRESULT is unchanged.

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
2026-11-24 16:23:35 +02:00
5668f16b49 wave64 emulate: a cross-lane read of a missing lane in a partial wave gives 0
Restores old upstream PR 7450, ported onto main.

With --wave64-emulate, every read of another lane's exchange slot (ds_swizzle,
ds_bpermute, ds_permute, readlane, ...) now selects 0 when the source lane does
not exist in a partial last wave (Gen.x_lane_word), instead of relying on the
prologue's zeroed slot. RADV (Mesa 26.3.1) turned the store, barrier and load of
an exchange behind a branch into masked_swizzle_amd with fetch_inactive, so in a
40-thread group lanes 32-39 of a SWAP 8 swizzle read the missing lanes'
registers. Full waves emit the same module as before.

scripts/run_gpu_tests.py now runs the partial-wave fixtures emulated at subgroup
32, as check.py's partial_wave_test does. It left the subgroup size to the
driver, and RADV picks 64 for compute, where the new fixture passed even without
the fix.

GPU test cs_w64x_partial_swizzle (words measured on gfx1036 through
tools/hw_oracle), semantic test test_w64x_partial_swizzle with a hand-written
fixture, and a contract-table row in docs/design.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 09:18:49 -05:00
7cee65bc7c Keep explicit heap ranges and cache keys compatible in the integrated runtime
Use the validated console heap range when the title has no allocation hooks. Preserve partially committed buffer reservations, compare CBVs produced through the same ABI, and use the runtime's image robustness setting in the offline pipeline checker.
2026-11-24 22:10:54 +08:00
99168a5fae Run the VCC scalar-address readback through the standard GPU checks
Seed eight words in the synthetic shader and check them in both GPU runners. Keep the desktop TFE load cases registered alongside the volume-view cases.
2026-11-24 21:59:18 +08:00
a213a232b8 w64_graphics, design: add the GFX1201 measurement and explicit wave starts from old upstream PR 7354 (TEST-1700)
Combines old upstream PR 7354 into this change: the wave64 and wave32 VS
waves start at vertices 0, 64, 126, 190 ... and 0, 32, 64, 96, 126 ...,
and on an RX 9070 XT (GFX1201, RDNA4, RADV Mesa 26.2.6) every wave32 wave
lies inside one half of a wave64 wave, measured on GFX1201 by sperm in
old upstream PR 7354. Both "GFX12 not measured" clauses now cite that
measurement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 08:58:53 -05:00
91adf9e317 w64_graphics, design: the wave32 VS run is the halves of the wave64 waves, not a repacking (TEST-1700)
vs_w64_c_lane_id over 960 vertices on RADV Mesa 26.3.1 gives the same
packing on a gfx1036 iGPU (Raphael) and an RX 7900 XTX (NAVI31, RDNA3):
waves of 64, 62, 64, 62 ... at wave64 and 32, 32, 32, 30 ... with
gewave32, a period of 126 vertices both ways, and every vertex's wave32
lane equal to its wave64 lane & 31. So the 32-lane run is the cut into
halves, not "a repacking ... a stricter test". Say what was measured,
on which devices, and note the lane ^ 2 trap for new VS fixtures.

Found by sskver. w64_graphics.py: 29/29 ok on both GPUs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 08:57:33 -05:00
e59cc2e655 Distinguish desktop and Xbox feature queries while retaining the D16/S8 paths
Keep the desktop HRESULTs for Xbox-only formats. Check both console and desktop vtable callers in the mock, and exercise the full rectangle target for a derived PSO with a zero sample mask.
2026-11-24 21:46:19 +08:00
d0da7dade8 Merge pull request #404 from ubiquitarianism/feat/acphal-xma2-decoder
acphal: ACP message queue and background XMA ring decoding with the Rust XMA2 decoder (RT-ACPHAL-XMA2)
2026-11-24 08:44:46 -05:00
89e0ea9b55 Merge pull request #402 from ubiquitarianism/feat/xs-frame-pacing-presentx
d3d12_xs: add multi-event FramePacer TOKEN_ON_TIMEOUT and wire XboxPresentation to device/queue slots (RT-XS-FRAME-PACING-PRESENTX)
2026-11-24 08:44:42 -05:00
05318a387c Merge pull request #401 from ubiquitarianism/feat/gdk-speech-display-lifecycle
xgameruntime_offline: one silent speech voice with WAVE streams, display power requests for timeout deferrals (RT-GDK-SPEECH-DISPLAY-LIFECYCLE)
2026-11-24 08:44:39 -05:00
56245df40c Merge pull request #360 from ubiquitarianism/feat/xs-device-vm-options
d3d12_vulkan_device: accept the console's 0x40-byte D3D12_OPTIONS query (RT-XS-DEVICE-VM-OPTIONS)
2026-11-24 08:44:20 -05:00
dd4be16087 Merge pull request #359 from ubiquitarianism/feat/xs-device-stops-7-9
d3d12_xs_device: slot 73 creates the console ID3D12GraphicsCommandListX IID as ID3D12GraphicsCommandList (RT-XS-DEVICE-STOPS-7-9)
2026-11-24 08:44:17 -05:00
de223bed9e Merge pull request #357 from ubiquitarianism/feat/ws2-offline-shim
runtime: add offline loopback-only Winsock2 (ws2_32.dll) shim
2026-11-24 08:44:13 -05:00
27781f7f9b d3d12: replay programmable sample positions (D3D-SAMPLE-POSITIONS) 2026-11-24 18:41:32 +05:00
1b1d4edd2d Merge current main and retain mesh statistics in the first-run rendering context 2026-11-24 21:40:18 +08:00
abbd7d9b27 Document the boot profile and verify descriptor guards and per-device GPU completion
Keep completion batches with their owning Vulkan context. Test switching primitives, caller overrides, and the dynamic EXEC and uniform null-descriptor guards used for dimension-specific storage views.
2026-11-24 21:40:02 +08:00
47c6511747 Merge pull request #577 from Mby159/feature/d3d-mesh-clipping-counter
Merging.

**Why merged:** Stacked on #540: the clipping invocations of a mesh segment now come from a mesh-pipeline query, so CInvocations/CPrimitives stay correct for mixed vertex + mesh work. sodove verified the exact head, including the disconnected-feature negative control that found (and now proves fixed) a gap in the test.

**Why it's good:** The embedded SPIR-V in statistics_sum_spirv.h was recompiled from the PR's .comp: all 431 words are identical and spirv-val passes. d3d12_mesh with validation: 0 errors, mixed C 12 vs vertex-only C 2, so the mesh share is 10, as expected.

Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (21625bca8 or 51f316092) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c242f (git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones).

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 08:38:08 -05:00
3bb46d658b Merge pull request #540 from Mby159/d3d-291-mesh-statistics
Merging.

**Why merged:** Fixes the mesh half of #506: the statistics pool active during vkCmdDrawMeshTasksEXT no longer enables the two clipping counters that VUID-vkCmdDrawMeshTasksEXT-pipelineStatistics-07076 forbids. Verified on an RTX 5070 Ti (sodove), RTX 4080 (quartz-heron-58) and RX 7900 XTX (bvtterbroot), all with validation on; the rebase to 916dbc619 is byte-identical (range-diff checked). Merged on its own first because #577 is stacked on it.

**Why it's good:** On the 4070 SUPER with LEONIDA_VK_VALIDATION=1: plain main fails d3d12_mesh with 3x VUID-...-07076; main + #540 + #577 passes d3d12_mesh, replay_query_edges and replay_query_predication with 0 validation errors, and the counters match sodove's numbers (mesh-only C 8/0, PS 1024).

Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (21625bca8 or 51f316092) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c242f (git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones).

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 08:37:58 -05:00
1052aad6c1 runtime: retain the TLS directory in the /GA test fixture
Force the CRT TLS directory into tiny_ga_tls when /GA removes the last _tls_index reference. Reject the unassigned TLS index in the test so missing metadata fails the index check.
2026-11-24 08:34:03 -05:00
b358d9062d lifecycle: suspend callbacks on window close and fit the title window (split from #401)
RegisterAppStateChangeNotification / UnregisterAppStateChangeNotification under
api-ms-win-core-psm-appnotify-l1-1-0/-l1-1-1 and kernelbase.dll, and CreateWindowExW/A under
user32.dll and ext-ms-win-rtcore-ntuser-window-l1-1-0/-l1-1-1, plus CreateWindowExA under
ext-ms-win-rtcore-ntuser-window-ansi-l1-1-0, the set the title's import table names. The title's
first top-level window is fitted to the work area and hooked: SC_CLOSE runs the suspend callbacks
(quiesced TRUE) and ends the run through the title's ExitProcess, with a 1 s deadline.

Split from #401 (a02134a9c), as the maintainer asked for one topic per pull request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 10:33:06 -03:00
d7354f2b91 xgameruntime_offline: one silent voice, drop XAppCaptureImpl and the lifecycle shim (#401 review)
- Speech is consistent now: XSpeechSynthesizerEnumerateInstalledVoices calls back once with a silent
  voice (XSpeechSynthesizerVoiceInformation in the GDK reference's layout), and SetCustomVoice accepts
  that voice id only. The enumeration takes (context, callback), the GDK reference's order; main read
  them the other way round.
- XAppCaptureImpl is left to #537, which serves it in xgameruntime.cpp with its full layout.
- The lifecycle shim (app-state callbacks, CreateWindowEx hook) moves to its own pull request.
- docs/runtime_imports.md: the speech and launcher bullets match the code; the launcher's display power
  request is called out as a side effect on the host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 10:33:05 -03:00
5112ec1a84 file_system: a GAME: name inside a missing folder fails with ERROR_PATH_NOT_FOUND, as on the host
Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
2026-11-24 16:32:20 +03:00
a5bb4b9b8c feat: d3d12_xs exports D3D12CreateVersionedRootSignatureDeserializer, clearing the Xbox RTS0 flags
Upstream PR #8814
2026-11-24 16:31:56 +03:00
a744fa8ab1 d3d12: SYNC_COPY waits for the CLEAR stage too (D3D-838)
An enhanced barrier's D3D12_BARRIER_SYNC_COPY mapped to VK_PIPELINE_STAGE_2_COPY_BIT only. Two D3D12
copy-scope commands are not Vulkan copies: WriteBufferImmediate is recorded as vkCmdUpdateBuffer and
ResolveQueryData's never-written queries as vkCmdFillBuffer, and synchronization2 runs both in the CLEAR
stage. A SYNC_COPY barrier after either therefore did not order it, and a copy after the barrier could read
the word before the write landed.

vulkan_sync now maps SYNC_COPY to COPY | CLEAR. vk_command_replay_test part K records WriteBufferImmediate,
a SYNC_COPY -> SYNC_COPY buffer barrier and a CopyBufferRegion of the written word; under
LEONIDA_VK_VALIDATION=1 it is a read-after-write hazard without this change. d3d12_state_map_test and
docs/d3d12_vulkan.md follow the new mapping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 16:28:34 +03:00
aa8be9aef2 Integrate the offline first-run UI runtime with current main and the published renderer fixes
Use the tagged pipeline variants and indexed quad expansion from #722 and #682 with the shared shader cache. Retain title-backed index uploads, cross-queue scratch sharing, amd64 console return conventions and the PC/console caller discriminator. The local shader build indexes native containers and includes the executable's embedded stages.
2026-11-24 21:26:25 +08:00
db19bbd345 runtime: connect native pipelines and title resources to the offline first-run UI
Build on the public frame-loop integration in #321. Carry the texture-view and depth work from #213 and #261, the layout provider from #461, the responsive window from #526, and the rectangle generator from #682. Integrate the Xbox constant-buffer row addressing measured in #513 and the draw-time rectangle selection in #722. Keep all fixtures synthetic.

The Windows GPU path resolves title-owned shader objects, retires geometry uploads per submission, materializes texture views on use, maps linear surfaces, and delivers completed GPU label writes. A first-run UI launch selects the tested settings for these paths.
2026-11-24 21:19:30 +08:00
be767b6889 Integrate #682 for the Windows first-run UI 2026-11-24 21:17:26 +08:00
3c7927ea26 Integrate #526 for the Windows first-run UI 2026-11-24 21:17:25 +08:00
65b8569bbc Integrate #461 for the Windows first-run UI 2026-11-24 21:17:13 +08:00
abed2e1938 Integrate #722 for the Windows first-run UI 2026-11-24 21:17:13 +08:00
ed5ed7afe4 Translate VCC used as the address of a scalar memory load 2026-11-24 21:12:08 +08:00
c55ecc9cbf d3d12: expand rectangle draws through triangle-family pipelines
Select the geometry-stage variant when the input assembler requests an Xbox rectangle and cache it alongside the attachment-format variants. Keep a shared snapshot of the linked vertex program for that draw. Exercise alternating rectangle and triangle draws through the same PSO and compare the complete target after each switch.
2026-11-24 20:49:20 +08:00
51f3160923 Merge pull request #590 from JiyouProt/codex/gpu-valu64-shifts
tests: GPU readback for dynamic 64-bit vector shifts (GPU-VALU64-SHIFTS)
2026-11-24 07:47:23 -05:00
92977eee6c tests: require a positive mesh clipping count when the feature is on
sodove's negative control on this head showed the gap: with the layer reporting the feature but the
mesh-primitives pool never created, both counts stay at 0 and the enabled-feature assertion still held,
because it compared 0 >= 0. The count has to be positive to show the wiring is there. How many primitives
the mesh shader emits is the driver's, so the test asks for a positive count and not for a number.

The disabled case stays pinned at zero. AI-assisted.
2026-11-24 12:35:29 +00:00
916dbc619d d3d12/vulkan: the mesh statistics pool enables no forbidden counter (D3D-291) 2026-11-24 12:35:29 +00:00
1bb23a2803 d3d12/vulkan: a mesh segment's clipping invocations come from a mesh-primitives query (D3D-MESH-CLIPPING-COUNTER)
Where the device has the meshShaderQueries feature of VK_EXT_mesh_shader, the number of
primitives the mesh shader emitted comes from a VK_QUERY_TYPE_MESH_PRIMITIVES_GENERATED_EXT
query run around each mesh segment, and it is added as the clipping invocations of that
segment. CPrimitives stays 0: Vulkan has no clipped-primitive counter, and D3D12's
CPrimitives is the clipper's output.

Claim: D3D-MESH-CLIPPING-COUNTER
Depends on: #540
2026-11-24 12:35:29 +00:00
296508e19d d3d12_indirect_rt: check arena AS addresses, also on a driver whose address is not buffer address + offset
Every AS resource's GPU VA must be the driver's vkGetAccelerationStructureDeviceAddressKHR value for the structure
behind it; the test checks that for the BLAS and both TLAS resources.

Envyre's review of old upstream PR 8414: the branch that takes the driver's address when it differs only ran on such
a driver. The test creates a second device whose get_instance_proc hands out a
vkGetAccelerationStructureDeviceAddressKHR that answers the real address plus 256 MiB (the device's existing
function-lookup hook, no change to the runtime), creates one AS resource on it and checks that its GPU VA is the
driver's address, that the arena address still names the structure, and that releasing the resource forgets both.
No builds run on that device.

The checks sit right after the TLAS lookups, before the CLONE/COMPACT section main has added since.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 07:26:36 -05:00
1f88b25d9a ws2_offline: loopback-bind unbound sends, refuse multicast joins and WSAJoinLeaf groups
Closes the gaps from the security review on #357:

- sendto, WSASendTo, WSASendMsg (both exports) and WSAJoinLeaf on an
  unbound socket made the host bind it to the wildcard address
  (Microsoft's sendto remarks), so its port took datagrams from other
  hosts. The shim now binds such a socket to 127.0.0.1, ::1 or
  ::ffff:127.0.0.1 first and fails with WSAEADDRNOTAVAIL if it stays
  unbound.
- setsockopt (ws2_32 name and #21) refuses IP_ADD_MEMBERSHIP,
  IP_ADD_SOURCE_MEMBERSHIP, IPV6_ADD_MEMBERSHIP, MCAST_JOIN_GROUP and
  MCAST_JOIN_SOURCE_GROUP with WSAEADDRNOTAVAIL. wsock32's setsockopt is
  its own export (dumpbin on Windows 10 22H2: not a forwarder) that remaps
  the Winsock 1.1 IP_ numbers (Wine dlls/wsock32/socket.c has the same
  table), so it gets its own wrapper that also refuses the 1.1 join (5)
  and forwards everything else to the host wsock32.
- WSAJoinLeaf gets connect's loopback check, so a group is refused.

Tested: ws2_offline_test 71 checks, 0 failures, MSVC 14.44 / SDK
10.0.26100 on Windows 10, including a control check that the host sendto
alone binds to 0.0.0.0; docs tests 47 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 09:19:38 -03:00
de8cb53d54 file_system: RemoveDirectory and a create inside the folder are ordered as on the host
Restores old upstream PR 9215 in ItsNotRexed/Leonida (closed unmerged when that repository went private), ported
onto the current main: the write-open keeps main's long-path disk_path() for its overlay path, and the new race test
sits after main's tests that recreate a removed package folder.

A GAME: write-open checked that its folder exists, mirrored it into the overlay and then opened the file, and
RemoveDirectory checked that the folder was empty and wrote its marker, neither under a lock. A remove that ran
between the open's check and its host CreateFile succeeded on an empty folder, and the open then made the folder
and the file again: both calls succeeded and the removed folder was back. CreateDirectory of a folder inside it had
the same gap. On Windows one of the two fails: the create with ERROR_PATH_NOT_FOUND or the remove with
ERROR_DIR_NOT_EMPTY.

A striped lock keyed by the folder's upper-cased name (64 namespace-scope std::mutex, no function-local static):
write_target holds the lock of the folder it opens in from the parent check until the Target is gone, after the
host CreateFile/CreateFile2; CreateDirectory holds the parent's from its check to the host call; RemoveDirectory
holds the folder's from its view to the marker. Reads take no lock.

file_system_test races the two calls on two threads, 2,000 rounds each for a creating CreateFileW (CREATE_NEW,
CREATE_ALWAYS, OPEN_ALWAYS) and for CreateDirectoryW, and checks that they never both succeed, that the loser
fails with the host's error and that a removed folder stays removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 07:05:40 -05:00
1d37e033eb file_system: reserve T:'s folder with a create-only call, never reuse one
Xiiano's review of old upstream PR 8161: the folder name (start time to
the millisecond plus process id) is not guaranteed unique, and earlier
runs' folders are kept, so a reused id in the same millisecond would
land in a stale folder and bring ERROR_FILE_EXISTS back. Under Wine
every fresh run gets the same small ids (both run_tiny_game_dir runs
here were pid 32).

rt::fs::reserve_unique_dir(base, stem) makes base\stem with
CreateDirectoryW and takes success as ownership; on ERROR_ALREADY_EXISTS
it tries stem-2, stem-3, ... up to 1000 names, and fails with the Win32
error otherwise. T:'s folder is reserved once per overlay under a mutex
(the first T: call or rt::fs::scratch_dir(), which the startup line
calls), so concurrent first calls share it. A failed reservation is
printed once and T: paths fail with ERROR_INVALID_NAME.
rt::fs::scratch_stem() gives the first name tried.

file_system_test: with stem and stem-2 taken, reserve_unique_dir makes
stem-3, new and empty, then stem-4; a file with the next name counts as
taken; max_tries names taken fail with ERROR_ALREADY_EXISTS; a missing
base is made. T: with folders of this process's own stem and stem-2
already kept takes stem-3 and CREATE_NEW succeeds; eight threads making
their first T: call at once reserve one folder. The second-process test
stays.

Restored from old upstream PR 8161 and ported onto the new main: the
base folder and every candidate go through main's win32_io_path, like
the other creates in file_system.cpp, so a long overlay root keeps
working.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 06:54:37 -05:00
297ad86854 file_system: T: is a folder of each process's own in the overlay
T:\ mapped to <overlay>\.gta6rt-temp, one folder shared by every run and
kept between runs. The title makes its crash dump and crash log there
with CREATE_NEW, and a name an earlier run (or a second process) had
left failed with ERROR_FILE_EXISTS (80), so no report landed (old
upstream issue 7913, measured by Spacecer2 under Wine 11.22).

T:\ now names <overlay>\.gta6rt-temp\<YYYYMMDD-HHMMSS-mmm>-pid<id>, the
process's start time in UTC and its id, made on the first T: call. The
start time keeps a reused process id (Wine hands each fresh prefix the
same small ids) out of an old run's folder. T:\.. cannot climb into the
shared folder, T:\ itself still cannot be removed or moved, and earlier
runs' folders are kept so their crash files can be read. GAME: and G:
are unchanged.

rt::fs::scratch_dir() returns the folder, and the startup line names it:
"console paths: GAME: -> ..., writes -> ..., T: -> ...". The two CMake
checks of that line (run_tiny_game_console_paths, run_tiny_game_dir)
and the synthetic test of the first now expect the T: part.

file_system_test: a CREATE_NEW of a name earlier runs left in
.gta6rt-temp succeeds and lands in the process's own folder; the folder
is stable for the process; a second process (the test started again)
creating the same name on the same overlay succeeds in a folder of its
own; GAME: reads and writes are unchanged. On main these fail with
ERROR_FILE_EXISTS (80), in this process and in the second one.

Restored from old upstream PR 8161 and ported onto the new main: the
folder is made through main's win32_io_path, so long overlay roots keep
working, and the scratch-folder check of the write-open path is kept.
Main's long-overlay T: check now finds scratch.bin in the process's own
folder below .gta6rt-temp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 06:54:36 -05:00
2bd97967ba d3d12: align standalone shader-addressable quad index buffers 2026-11-24 06:49:48 -05:00
3769fd6b50 root_sig_public_flags_test: allow 1.2 "host refuses, shim succeeds" only on a host without 1.2
The allowance is for runtimes that serialize only up to 1.1, where the shim rewrites 1.2 as 1.1. On a host that
serializes 1.2 itself it hid a real difference: under a mask that also clears 0x80, the host refuses all twelve
flags and the shim accepts 0xF7F. The host is now probed once with an empty 1.2 description, and the allowance
applies only when it refuses that too (review of old upstream PR 7234).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 06:39:47 -05:00
558206bb09 d3d12_xs: pin that the root-signature flag mask keeps every public flag (old upstream PR 7140)
The shims clear bits 24-31 of a root signature's flags on every descriptor and RTS0 blob. Old upstream PR 7140 asks
to make that conditional on the blob's origin, since the retail executable's root signatures carry no 0x03000000
(one 1.1 description with Flags 0x80, and a decoder whose Flags is a 16-bit read). Every public
D3D12_ROOT_SIGNATURE_FLAGS value is in bits 0-11, so the mask can't change those descriptors and no behaviour change
is needed.

root_sig_public_flags_test pins it:
- the descriptor helpers (1.0, 1.1, 1.2, legacy) keep all 65536 flag values in [0, 0xFFFF], and an RTS0 blob with
  such flags is not rewritten;
- the registered serializer shims give the host's blob byte for byte for each public flag, 0x80 and all twelve, and
  the deserializer shim returns the host's flags;
- a blob with 0x03000080 comes back as 0x80 with a valid container hash and no other byte changed;
- static_asserts that no public flag is in kXboxRootSignatureFlagHighByte.

docs/d3d12_vulkan.md: the executable's answer to the open question, and why the mask stays unconditional.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 06:39:38 -05:00
55b5d737f5 vk_compute_test: VKC_HEAP_FILE refuses an offset of 2^32 and a file that runs past the 4 GiB heap (RT-439)
- vk_compute_test: VKC_HEAP_FILE refuses an offset of 2^32 and a file that runs past the 4 GiB heap (RT-439)
- vk_compute_test: check VKC_HEAP_FILE's size on the open file before reading it (old PR 5878)

Carried over from old-pr/9943 (old upstream PR 9943), rebased on main.
2026-11-24 08:15:59 -03:00
d52ab6b5b3 d3d12_xs_device: map only the measured console list IID at slot 73
The slot 73 fallback retried every IID the PC device refused, so asking for
a public list revision the backend lacks (ID3D12GraphicsCommandList9 on a
revision-8 device) returned S_OK and a base list instead of E_NOINTERFACE
(review on #359). Only the console ID3D12GraphicsCommandListX IID
{c3827890-4024-474c-98cf-645b51dc4874} (#445) is now created as
ID3D12GraphicsCommandList, in one call, and the list proxy answers
QueryInterface for it. Every other IID reaches the device unchanged.

Tested: xs_proxy_mock (List9 and an unknown IID keep E_NOINTERFACE with a
null output; the console IID is created once and is queryable) and
d3d12_vulkan_device with MSVC 14.44 / SDK 10.0.26100; docs tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 08:15:02 -03:00
b464a2c529 FramePacer: at most latency frames in flight while armed (mailbox replace)
commit_present_token and note_untokened_present appended a slot for every
present, each one period after the last, so presents made with no
WaitFrameEventX between them grew the queue without limit and the next wait
blocked until the first of them was shown: at latency 2, 1000 blank presents
left 1000 frames in flight and the next wait passed 999 periods later.

A present into a full queue now replaces the newest queued frame and takes
its vblank, like a mailbox: the replaced frame is never shown (no display
statistic), the older frames keep their vblanks, and the queue never reaches
further than `latency` vblanks ahead, so the next wait passes when the oldest
frame is shown. A queue longer than a lowered latency is cut back the same
way at the next present. Presents before the event is armed stay unpaced
(old upstream PR 4419), and a frame behind a queued one still cannot be
shown at once.

frame_pacer_test: 1000 untokened presents after one wait at latency 1, 2
and 3, tokened presents beyond the latency (the older ones keep their
vblanks, the replaced one has no display statistic), the one-present-per-wait
cadence, and a lowered latency. xbox_present_test expected the blank present
after a frame at latency 1 to make 2 frames in flight; it is 1 now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 06:13:38 -05:00
a634430fec root_signature: accept root constants of 0 values, as the host does (D3D-942)
pack() and pack_stage() refused a 32-bit-constants parameter with Num32BitValues == 0, so CreateRootSignature
failed where host D3D12 answers S_OK (the serializer warns for versions 1.0 and 1.1; both devices create it).
Such a parameter now takes no dwords and no cost: it gets no provenance entry in pack(), and in pack_stage() it
shares its first SGPR with the next parameter, so every other offset is unchanged. The Vulkan push-constant range
is the fixed ShaderUserData block, not per parameter, so no zero-size range is created; the command list already
refuses any write past a parameter's constant count. 65 constants stay refused by the 64-dword cost limit.

root_signature_test: zero-value constants alone, between other parameters and from a hand-built RTS0 blob (both
packers); 64 constants pass the cost limit and are refused only as a spill; 65 by the cost limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 06:05:46 -05:00