Commit Graph

51 Commits

Author SHA1 Message Date
ad41fd5175 Merge pull request #2059 from qhukz13/cont/test-serialize-win10
d3d12_title_va_test, d3d12_compute_test: serialize root signatures through the shared helper, so the heap-directly-indexed cases run on Windows 10
2026-11-26 02:25:52 +01:00
9f98dcc617 Improve post-load GPU memory and pipeline handling (RT-POST-LOAD-GPU-MEMORY)
Fall back to a dedicated buffer allocation when the shared arena fills.
Update console descriptors and resource backing, preserve pipeline cache
entries, and replay mesh records using bounded indirect arguments. Keep
scripted input available until read and cover the runtime and translator
paths with synthetic tests.

Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-authored-by: ivanepsilondelta <264061546+ivanepsilondelta@users.noreply.github.com>
2026-11-25 14:30:51 -06:00
f2e3a77fea d3d12_title_va_test, d3d12_compute_test: serialize root signatures through the shared helper, so the heap-directly-indexed cases run on Windows 10
Both tests carried their own copy of serialize(), which calls the in-box
D3D12SerializeVersionedRootSignature directly. Windows 10's d3d12.dll
(10.0.19041) refuses CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED at root signature
1.0 and 1.1 (E_INVALIDARG, "Unsupported bit-flag set"), so the cases that
set it stopped at an empty blob before reaching the code they test.
d3d12test::serialize_root_signature (d3d12_test_shaders.h) already retries
without the flags and puts them back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:06:10 +02:00
5115f08879 Merge main into RT-DIRECT-HEAP-COMPUTE (#1064)
main already supplies the directly indexed heaps to compute dispatches (integration #984, the tree this
pull request was split from): with_direct_heaps()/compute_user_data() on Dispatch and the ExecuteIndirect
dispatch path, RootArgumentLayout::compute_arguments_end (kNoSgpr for a spilled signature),
LEONIDA_COMPUTE_DIRECT_HEAPS=0, and the first form of this test (direct dispatch, indirect after a
resource-only rebind, the GPU read through the heap). That form stays. What this pull request adds beyond
it is carried onto it: the review-round reports, the extra recorded-argument checks, the census tool and
its evidence.

Conflicts:
- runtime/shims/d3d12_com.cpp: main's with_direct_heaps()/compute_user_data() and its one-argument
  note_direct_heap_indexing(). Carried: compute_user_data() makes the note itself, so an ExecuteIndirect
  dispatch with no heap bound is reported too (record_dispatch's own call removed), and a heap with no
  inline dword left is reported once per heap kind ("compute root arguments leave no inline SGPR for the
  resource/sampler heap"); a spilled signature (main: kNoSgpr) gets one note of its own. Dropped: the PR's
  GetEnvironmentVariableA switch (main's direct_heaps_enabled) and its "graphics heap-base SGPR is not
  supplied" notes (main supplies the graphics heaps).
- runtime/shims/d3d12_com.h, runtime/shims/d3d12_vulkan_device.cpp: main's (compute_arguments_end and
  graphics_arguments_end with their comment; compute_arguments_end only when the compute arguments do
  not spill).
- runtime/test/glsl/cs_user_data.comp: main's; its direct-indexing mode (s5 = 0xFFFFFFFC, heap at s9)
  is this pull request's, byte for byte.
- runtime/test/d3d12_compute_test.cpp: the PR's block replaces main's earlier form of it (a superset:
  adds the bundle dispatch that inherits the parent's heaps, an indirect dispatch with only the sampler
  heap, signatures ending at s30 and s31, and the LEONIDA_COMPUTE_DIRECT_HEAPS=0 expectations).
- docs/d3d12_vulkan.md: main's section 3.4 (the BatchCull s7 and PreSkin s9 evidence), with the PR's
  census paragraph (tools/compute_heap_layout_census.py, the seven paired layouts, the heap order as a
  hypothesis) and the no-room and spill reports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:09:38 -05:00
154e4ec034 Merge the #984 result (main + RT-PROTON-STORY-LOAD) into #939
The base is 8a242efeb, the merge of main and #984. 68 files conflicted; they were resolved in seven groups by
one rule: the same change in two forms keeps the base's form, everything only #939 has is kept, and where the
two solve one problem in two ways the base's is the frame and #939's plugs into it.

A, the Xbox proxy (d3d12_xs_device.cpp/.h, d3d12_xs.cpp, d3d12_xs_pso_stream.cpp/.h, d3d12_xs_alloc_size.h,
d3d12_xs_desc_clean.h, device_proxy_test.cpp, queue_proxy_test.cpp): the base's files with #939's additions
ported in. Device slot 57 asks #939's NativeGraphicsFactory first and falls back to the base's
proxy_create_graphics_pipeline_from_native_code on E_NOTIMPL. Kept from #939: the providers (texture lease,
raw texture view, resource by address, constant view, descriptor mapping, depth-stencil UAV, texture pages),
the title-backed descriptor mirror, slot 13's feature answers, GPU labels on list slots 71/72. Dropped: #939's
duplicates of the boot ladder routes, its fallback window, its slot 133 stand-in.

A2 (xs_proxy_mock_test.cpp): the base's test with #939's slot 70 raw-buffer case; presentation cases follow
#939's rule that a device which ever had a handler has no queue fallback.

B1, the Vulkan device (d3d12_vulkan_device.cpp, d3d12_com.cpp/.h, shader_library.h, queue_families.h,
pipeline_cache_file.h, startup_trace.h): one lazy-pipeline mechanism, the base's; #939's pending_base_compile
and first_use_backend_pipelines dropped, prepare_on_bind and cold_graphics_compile kept. create_texture keeps
the base's signature; #939's deferred backing is folded into the base's placed-memory binder. #939's quad
lists as triangle indices.

B2, the D3D12 tests (d3d12_existing_heap, a8_dimensions, pipeline_cache_seed, title_va, rect_list,
shader_library, loader_tls_index0, draw, compute, xmem_placed, shader_library_corpus): the base's tests where
both carry the same case, #939's cases added (rebound tables, linear texture map, large vertex batch,
executable shaders, default A8 views).

C, the backend (vulkan_replay.h, vulkan_backend.h, vulkan_bindless.h, vulkan_scratch.h, vulkan_present.h,
rect_list_geometry.h, vk_test_device.h, vk_pipeline_check.cpp, vk_store_test.cpp, bindless_sizing_test.cpp,
replay_texture_barrier_test.cpp): the base's prepare_draw and lazy compute, its #1055 release rule and its
rectangle generator; #939's rectangle variants, GPU quad index expansion, 1D/3D and depth-stencil UAVs, the
label fence on the base's submit.

D, memory, services, presentation (xmem.cpp/.h, xg_xs.cpp, xg_xs_test.cpp, title_va_alias.h and its test,
main.cpp, frame_pacer.h, xbox_present.cpp/.h; xgameruntime_offline.cpp for one comment): the base's xmem with
#939's label hooks, file-backed sections and pin_mapped_data; both texture computers in xg_xs.cpp, the base's
answering first; --first-run-ui kept without host speech in its profile.

E, build, tools, docs (runtime/CMakeLists.txt, make_game.py, tools/rdna2spirv.py, tools/shader_disasm.py,
scripts, tests, docs; docs/README.md and tests/test_exe_shaders_stage.py beyond the conflicts): the base's
v_dot4 decode, #281's disassembler form and tests/semantic/test_fspx_dot4_op_sel_disasm.py dropped; the
base's executable-shader step with #939's cache fix; 366 registered tests.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 20:26:00 -05:00
c8f7515e2e d3d12: supply directly indexed heaps to compute dispatches (RT-DIRECT-HEAP-COMPUTE)
Compute shaders using direct resource indexing received a zero heap
pointer. Snapshot each bound heap offset after the explicit inline root
arguments on direct and indirect dispatches, so each command retains the
bindings it had when recorded. When the explicit arguments leave no
SGPR, keep them and report the missing heap slot once.

The placement is a hypothesis with partial evidence. Of 2,959
direct-indexing compute entries, seven could be paired with recorded
layouts. All seven resource reads agree with the predicted slot. The
other 2,952 have no paired layout, and no paired sampler read
establishes the relative heap order. tools/compute_heap_layout_census.py
reproduces the count, with synthetic tests for agreement, disagreement
and missing evidence.

Built gta6rt and d3d12_compute_test with clang-cl. The Proton Vulkan
fixture passed 64 buffer reads and 64 null controls on an RTX 4070. With
the rollback switch, all 128 controls read zero. Both runs check the
recorded arguments for bundle inheritance, indirect heap rebinding and
the last inline SGPR. The synthetic SPIR-V fixture passed validation.

AI-assisted (Codex and Claude Code agents).

Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 15:01:43 -06:00
273b3bdf9d [integration] Linux/Proton and native Windows: boot through the story load (RT-PROTON-STORY-LOAD)
One squashed commit of a fork that was developed on a Linux/Proton machine and
tested on two native Windows machines. On all of them the retail 1.0.2.1
package now launches, shows its launch movie, first-run pages and landing
prompt, runs the story load to its end with the loading slideshow drawing its
artwork, and enters the world phase. A first world frame is not verified yet.
docs/linux_proton.md has the setup, a healthy boot's timeline, the machines
and where it stops.

Runtime: frames in the title's own window; DirectStorage pinned reads,
page-list scatter/gather, BCPack and unshuffle with a locally generated
predictor file; pooled, device-local and deferred image backing for streamed
and placed textures; enhanced barriers into LAYOUT_UNDEFINED; a bindless table
that degrades instead of refusing a submission; a descriptor hash finalizer
(off until a library carries it); directly indexed heap offsets for compute
dispatches and VS/PS/GS draws; title buffer windows outside a fragmented
arena; opt-in device-local copies of streamed buffer views; write-fault
retries under the tracker lock, shared trackers and write-watched title memory
for native Windows; device-loss, compute-input and memory probes.

Translator: loop bounds at structured exits, the eight FidelityFX programs
that use a packed-dot form the disassembler skips, buffer bounds modes per
view kind, a compaction option, the hash finalizer option.

Tools and scripts: Linux boot scripts (Wine/Proton, no network), a Windows
boot script, the paired compute translation script.

No game data. AI-assisted (Claude Code and Codex agents), reviewed and booted
by people on the machines named in docs/linux_proton.md.

Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 11:42:12 -06: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
175dc3f2da Merge branch 'pr2490' into ladder
# Conflicts:
#	runtime/shims/d3d12_xs_device.cpp
#	runtime/test/xs_proxy_mock_test.cpp
2026-11-23 18:52:49 +01:00
e76640014a docs: the AMD driver took 34 minutes on LeafRehydration's dispatch-loop module; the current translation compiles in 3 s (SHADER-995) (#6739)
Squash-merged after diff review of PR #6739
2026-11-23 10:49:09 -06:00
08490f05d2 d3d12_xs: console-ABI command lists, upload arena, PC-list fixture path
The d3d12_xs shim's device now hands callers console-shaped command
lists (160-slot vtable, object body at +0x18 with the write cursor
pinned at the record limits, console slots 27-30 recorded not
forwarded, slot map measured to the PC table: 60->58, 61->59,
146->80). Queue layout detection is atomic and device-wide; SignalX
(slot 23/25 by layout) forwards as Signal, PresentX (30/32) reaches
the presentation core, and ambiguous slot 18 serves the timestamp-
frequency getter until the layout is proven.

AllocateUploadMemory (console slot 148) carves a bump arena out of
persistently-mapped UPLOAD-heap buffers; the six root-VA setters and
the IA/SO view setters translate arena pointers to buffer device
addresses in proxy-owned copies. Impossible sizes and non-power-of-
two alignments are refused before any arithmetic that could wrap.

PC-compiled callers opt into real PC-shaped lists with
console_lists=false on create_device_proxy, and PC-compiled guests
with LEONIDA_D3D12_LISTS=pc — the fixture path check_tiny_frame.py
sets, so a guest ClearRenderTargetView at PC slot 48 reaches the
real list. The GPU tests take the flag; unmeasured console slots
stay console-shaped for the title path.

docs/d3d12_xs_console_abi.md records the measured ABI.

Split from #2490 (third of three): fixes the run_tiny_frame failure
the revert reported. AI-assisted. Hardware verification on the
earlier identical code is in #2490's thread (RTX 3060 Ti-5080, RX
7600/9060/9070/7900 XT, Intel UHD, RADV; 177/177). Wine/clang-cl on
the build host: xs_proxy_mock PASS incl. the overflow regression,
queue_proxy child-runner section fails identically on unmodified
main (Wine env), loader_test 86/0 upstream count.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-23 09:24:20 -07:00
57c175391d Revert #2490: its console-ABI list proxy breaks run_tiny_frame (please rebase and split)
With it, d3d12_xs reads list slot 48 as the console's IASetVertexBuffers, so the PC-shaped fixture list's
ClearRenderTargetView never runs and Close fails. The branch also changes runtime/src/pe_loader.cpp and carried
committed conflict markers in docs/fssm_crosscheck.md. Its docs rows go with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 04:42:53 -05:00
f54c6395ed Merge pull request #4312 from Victor Garcia
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-22 23:13:27 -05:00
714b80329c Merge pull request #3865 from shelbykb2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:09:02 -05:00
f173fc0df3 d3d12: cap the GPU address arena at the device's maxBufferSize and maxMemoryAllocationSize
create_arena clamped LEONIDA_ARENA_MB to 16..4095 MiB and never read the device's buffer limits. The RX 6800
(AMD 26.11.2) reports 2 GiB for both, so LEONIDA_ARENA_MB=3000 made d3d12_compute_test fail under
LEONIDA_VK_VALIDATION=1: one vkAllocateMemory over maxMemoryAllocationSize per device. The size is now decided by
src/arena_size.h (min of the request, maxBufferSize and, for the buffer's memory requirement, maxMemoryAllocationSize,
rounded down to MiB), read with the device's other Vulkan 1.3 properties into VulkanDeviceInfo (0: query; a test sets
a smaller one), and logged once when a limit cuts the request. arena_size_test checks the decision on the CPU;
d3d12_compute_test checks the arena against the real limits and a simulated 32 MiB maxMemoryAllocationSize. Tested
on an RX 6800, Windows 11, AMD 26.11.2: ctest 133/133, and the 3000 MiB validation run now passes with no errors.

Co-Authored-By: Claude Opus <noreply@anthropic.com>
2026-11-22 20:40:03 -07:00
fa5f26db8e Merge origin/main: DXGI device fields coexist with the console-ABI device state 2026-11-22 20:39:59 -07:00
7cc353106f d3d12_xs: PC-shaped lists for PC callers, atomic queue layout, S_OK queue tail
Review findings from shdann's Windows run of the new console queue/list
work:

- d3d12_debug_markers (and every GPU harness compiled against the PC
  headers) drove lists through the console-shaped proxy, so PC slots past
  26 — including the PIX markers at 56-58, which have no console
  counterpart — reached unrelated console methods or were dropped.
  create_device_proxy gains console_lists: false hands the real
  (PC-shaped) list back from CreateCommandList. The GPU tests pass false;
  the title path keeps the console default.
- queue_proxy asserted E_NOTIMPL for the queue's console tail, but those
  slots deliberately answer S_OK now — frame pacing flows through them.
  The test's contract is updated; the fence tail stays refused.
- ChildProxy::queue_layout was a plain unsigned char read and written
  from many threads; it is atomic like the device-wide detection it
  caches.

xs_proxy_mock_test and loader_test pass under Wine; the modified test
objects compile clean under clang-cl. The GPU harnesses need a real
adapter — covered by shdann's Windows run.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-22 18:41:23 -07:00
7c2252609d D3D-448: console root-argument layout, measured for compute and used there
rt::rootsig::pack_stage() lays a root signature out for one stage the
way the console compiler does: root order from the stage base, a table
one dword (its 32-bit VA), a root view two, constants one per value,
and the first parameter that does not fit refused (the spill array
behind s[0:1] is not modelled).

Compute (base s4) is measured: on the package's FidelityFX DLL, whose 29
compute containers carry their RTS0 next to the console-compiled program,
base plus span equals RSRC2 USER_SGPR in 29 of 29, and
root_sig_contract.py --model console finds all 20 translated programs
compatible (the s0 model contradicts 7). VS/PS/GS s8 and MS s16 stay a
census hypothesis.

The compute bind point now uses this layout; graphics keeps pack(),
since every stage reads one push-constant block and a mesh shader (s16)
and a pixel shader (s8) would collide. A signature carries both
layouts; binding it where its layout refused it invalidates the list.

Test fixtures follow: the compute GLSL shaders read the new places, and
the asm fixtures a D3D12 compute PSO runs are built with
LEONIDA_USER_DATA_SHIFT=4 (compute_fixture.py shifts every SGPR and the
RSRC2 user count), so the standalone harness keeps using them at s0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 01:44:40 +01:00
d3ec646a7d Merge pull request #3023 from Jolymmiles 2026-11-22 17:00:25 -05:00
421bf0bf34 d3d12_compute: skip the CachedPSO host comparison under Wine
#1683's comparison expected Wine to have no host D3D12 device or no compiler. Wine has
both (vkd3d and its d3dcompiler_47), but vkd3d's GetCachedBlob is a stub, so
cached_pso_cases returned no answers for each host adapter and `host == layer` failed
on every run (line 388; Apple M3 Max, CrossOver 26.3 / Wine 11 with MoltenVK 1.4.3).
Like the other host comparisons (host_wine.h), it now skips under Wine and says why;
the layer's own 11 answers are still checked against the expected list.
2026-11-23 01:41:31 +04:00
b28832bab4 Tests: give each process its own temp folder for its shader library
d3d12_compute and the other tests that write a translator-style shader library under
the temp directory (d3d12_draw, d3d12_set0_compute, d3d12_msaa_draw, d3d12_fspx_compute,
d3d12_pipeline_library, d3d12_subgroup, d3d12_bundle, d3d12_typeless_families,
shader_library) used one fixed folder name. Two copies running at once (ctest -j, or two
suites in one Wine prefix or TMPDIR) shared it, and one copy's remove_all deleted the
modules the other was loading: on an Apple M3 Max under Wine with MoltenVK 1.4.3, four
copies of d3d12_compute at once failed 6 of 40 runs (PSO creation at lines 245/357, or
exit 3 from an uncaught filesystem_error in copy_file), while 125 runs one at a time all
passed.

test_temp_dir.h names the folder <temp>/<name>_<pid>, removes it on scope exit (early
returns included), and copies the compiled-in LEONIDA_TEST_*_SPV files with an error
code, so a missing file is reported by name instead of ending the test with abort().
docs/testing.md lists both symptoms.
2026-11-23 01:41:31 +04:00
a3c60bafb8 Merge pull request #2852 from Felix Croasdale 2026-11-22 15:12:36 -05:00
7fded18980 Merge pull request #1773 from Vonsek 2026-11-22 15:09:47 -05:00
07e2293ec0 feat(runtime): implement buffer CreateShaderResourceView (raw, structured, typed GFX10 V#)
Implement D3D12_SRV_DIMENSION_BUFFER in ID3D12Device::CreateShaderResourceView,
writing a 16-byte GFX10 V# descriptor into the 32-byte CBV_SRV_UAV slot:
- Raw (D3D12_BUFFER_SRV_FLAG_RAW, R32_TYPELESS, stride 0): OobSelect::raw,
  num_records = NumElements * 4, GFX10_FORMAT_32_UINT.
- Structured (StructureByteStride > 0, DXGI_FORMAT_UNKNOWN): OobSelect::structured,
  stride = StructureByteStride, num_records = NumElements, GFX10_FORMAT_32_UINT.
- Typed (stride 0, uncompressed color format incl. RGB96): OobSelect::structured,
  stride = element bytes, num_records = NumElements, format_from_vulkan(named),
  Shader4ComponentMapping applied to format_swizzle(named).
- Rejects DENY_SHADER_RESOURCE, null desc on buffer, invalid format/stride/flag
  combinations, and out-of-bounds ranges (leaving the 32-byte slot zeroed).

AI-assisted.
2026-11-22 20:37:10 +01:00
78ea5f8424 d3d12_compute_test: the CachedPSO blob's bytes no longer hide the test's bytes (C4456)
The CachedPSO block (9cc95bff) copies the cached blob into a
std::vector<std::uint8_t> named bytes, which hides the test's
constexpr UINT bytes = elements * 4 (line 285); MSVC reports C4456 at
line 395. The vector is now blob_bytes. No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:30:34 -06:00
c9fe0bd788 Merge pull request #2500 from Codex 2026-11-22 13:15:45 -05:00
0cb7657dff Find packaged shader fixtures in relocated GPU test artifacts 2026-11-22 18:15:36 +01:00
fc2ee62c98 Merge pull request #1683 from requiemsnkrp 2026-11-22 11:40:37 -05:00
9cc95bff0d Runtime: GetCachedBlob and CachedPSO checks like the host runtime
ID3D12PipelineState::GetCachedBlob returns a blob with the adapter, driver, pipelineCacheUUID and a SHA-256 of the description (without Flags; shaders keyed by their DXBC checksum), sealed by a checksum. Create{Compute,Graphics}PipelineState check a supplied CachedPSO before creating the PSO and answer as the PC runtime does, measured on an RTX 3060 and WARP. Rebased onto main (one commit). AI-assisted.
2026-11-22 17:09:44 +01:00
3aee4253f4 Merge pull request #1898 from Dominik 2026-11-22 10:39:14 -05:00
c22cb58380 test(runtime): verify root-signature rebind preserves arguments and switch resets them (TEST-280)
Extend d3d12_compute_test across its three dispatches to verify:

- Rebinding the already-active compute root signature (SetComputeRootSignature with the same ID3D12RootSignature*) preserves previously bound root constants (s0 = 7) while allowing subsequent updates (s1 = 3).

- Calling SetGraphicsRootSignature and SetGraphicsRoot32BitConstant does not clobber compute root arguments.

- Switching to a distinct ID3D12RootSignature* instance resets bound compute root arguments to zero (s0 drops from 100 to 0 in the third dispatch), and rebinding that new root signature afterward preserves arguments bound after the switch (s1 = 5).
2026-11-22 16:32:50 +01:00
9e65c21934 d3d12_compute_test: release the slot-67 PSO before the device reference check
The cleanup before EXPECT(device_proxy_ref_count(device.p) == 1) resets
pso but not pso67, the PSO #1714 (RT-99) creates through slot 67, which
holds a reference to the device like any PSO. On an RX 9070 (Windows) the
test fails at that line on main 6a6704df (count 2); with pso67 (and the
other PSO/root-signature refs of that scope) released it passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:26:15 +00:00
23444e0b07 Merge pull request #1714 from SWAYAM 2026-11-22 09:48:07 -05:00
499c608c0f test(d3d12): reset slot 67 PSOs before device refcount check in d3d12_compute_test 2026-11-22 19:56:14 +05:30
835b43fe9b 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:50:13 +05:30
3d533d6c3f 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:50:12 +05:30
b28487c827 Merge pull request #1729 from Vonsek 2026-11-22 09:14:55 -05:00
da574cb90e Merge pull request #1714 from SWAYAM 2026-11-22 09:14:53 -05: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
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
44288b3033 Merge remote-tracking branch 'origin/main' into w-pso4
# Conflicts:
#	runtime/shims/d3d12_vulkan_device.cpp
#	runtime/test/shaders/check.py
#	runtime/test/vk_test_device.h
#	scripts/run_gpu_tests.py
2026-11-22 14:19:31 +01:00
12eab0b570 Merge pull request #1489 from AlxcBTW 2026-11-22 07:38:00 -05:00
ec6645401d [TEST-200] Make M1 CTest skips accurate 2026-11-22 13:13:38 +01:00
2e7d374cb4 M2: drop pre-#291 leftovers so the branch diff is only M1.5 + M2 on main
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:05:52 +01:00
7b88178d11 Runtime: request the translated subgroup size in compute and graphics PSOs
Device creation enables subgroupSizeControl and computeFullSubgroups where the
GPU has them and keeps minSubgroupSize, maxSubgroupSize, the default
subgroupSize, maxComputeWorkgroupSubgroups and requiredSubgroupSizeStages in
VulkanDeviceInfo::subgroup (also printed at creation). CreateComputePipelineState
and CreateGraphicsPipelineState run decide_subgroup_size() per stage and chain
the result into the stage create-info; the "wave64 compute shader runs
32-wide" log line goes away. A size the device cannot give is logged once per
stage with the first shader's name, and tells the build to use
--wave64-emulate where that exists (compute, mesh).

pipeline_subgroup_requests() exposes what each stage of a PSO asked for.
vktest::Device fills the same properties and the compute and draw tests pass
them on.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 13:05:10 +01:00
40f239be13 M2: pipelines bind the bindless set 0; textured quad through the descriptor path (d3d12_m2_textured_test)
Pipelines (graphics and compute) whose translated shader declares set-0 bindings were refused. Their layout now
holds the device's bindless set 0 and replay binds it at every draw and dispatch. d3d12_m2_textured_test drives
heaps, SRVs, a POINT sampler, two root descriptor tables and DrawIndexedInstanced with a translated PS that
loads the T#/S# from the tables; 4096 of 4096 pixels match, and the descriptor hash table is checked.
d3d12_translated_draw_test is registered with ctest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:34:41 +01:00
4a4acf3e63 Register the compute, draw and present tests with ctest
main's tests/test_ctest_registration.py (#1258) fails on this branch after
the merge: d3d12_compute_test, d3d12_draw_test and d3d12_present_test are
built but no add_test runs them.

They are registered like their neighbours, with SKIP_RETURN_CODE 77, and
return 77 when vktest::Device::initialize() finds no Vulkan device, as the
other registered D3D12 tests do. Without that, the CPU runtime job, whose
runner has no Vulkan driver, would fail on them the way it did on
d3d12_predicated_copy before #1314.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 05:46:39 -05:00
Ryx
2aed144550 Runtime: second round of review fixes, and predication on arena buffers after the rebase onto main
From the reviews and test runs on #291:
- A pipeline without vertex bindings (a full-screen pass from SV_VertexID) no longer declares the vertex-stride
  dynamic state, which nothing would set (VUID-vkCmdDraw-pStrides-04913; aslan2142, AlxcBTW, ezwinxdlmao).
- Logic ops are applied from RenderTarget[0] instead of being logged and ignored (Vonsek's XOR case), and
  DepthClipEnable = FALSE is depth clamping (AlxcBTW). Both need their feature (logicOp, depthClamp), or the
  PSO is refused.
- The standalone device also enables shaderInt64, shaderFloat64, shaderInt16, shaderClipDistance and
  shaderCullDistance where the GPU has them (AlxcBTW, whattheflop: VUID-...-pCode-08740), plus logicOp and
  depthClamp.
- Among index entries for one program, a PSO takes the first that fits and declares no set-0 bindings, as
  pipelines do not bind set 0 yet. This covers the compute group in poke900310's corpus count, where an entry
  with 10 bindings shadowed a binding-free one.
- The command list holds a reference to every root signature and pipeline state it is given until Reset or
  its release, so releasing them right after Set* (as D3D12 allows) no longer leaves dangling layouts or drops
  the submission (AlxcBTW).

After the rebase onto main: main's SetPredication reads the predicate through the resource's VkBuffer, so a
default-heap buffer (a range of the GPU address arena) adds its offset in the arena, and the arena gets the
conditional-rendering usage when the extension is on (lahlousaad4's integration note).

Tests: d3d12_draw_test has a second pass with a full-screen triangle first in its submission and an XOR quad,
and a depth-clamp refusal. d3d12_compute_test releases its root signature and PSO right after setting them,
sets the signature again after the arguments, and has a bound entry ahead of the binding-free one in its
index. Each new fix, undone on its own, fails a test: pStrides-04913, wrong XOR pixels, a heap-corruption
crash without the hold, a refused PSO without the binding-free choice.

Documented as known gaps, not fixed here: wave64 subgroup size (AlxcBTW's follow-up in #313), cross-queue
waits on one VkQueue and CPU fence signals below a pending GPU signal (woreksami), and the linear buffer_at.
2026-11-22 05:01:36 +01:00
Ryx
80e5cacabe Runtime: refuse PSOs below 144 bytes of push constants; push-constant stages from the stage table
Review feedback from IAmNotSiob:
- Both PSO paths declared a 144-byte push-constant range without consulting #224's limit. On a device with
  maxPushConstantsSize 128 (the Vulkan minimum) that breaks VUID-VkPushConstantRange-size-00298 and returns a
  bare E_FAIL. Both paths now refuse with E_NOTIMPL and log the limit until the uniform-buffer tail exists.
  d3d12_compute_test checks this with a device that reports 128 bytes.
- The graphics range's stage flags are now the whole stage table create_graphics accepts, kept in
  GraphicsPipeline::push_stages, and the replay pushes with the same flags. A geometry or mesh stage added to
  the table is covered without another change.

docs/d3d12_vulkan.md section 5.2 now counts code-base readers per stage with the current translator: of the 662
shaders with s_getpc_b64, 53 VS, 92 PS, 246 MS and 263 CS read the code base. VS+PS pairs are only known at
PSO creation.
2026-11-22 05:01:36 +01:00