Commit Graph

4696 Commits

Author SHA1 Message Date
0aba6c3611 d3d12_xs: translate title-owned CPU descriptor handles in ListProxy and preserve ClearDepthStencilView FLOAT Depth
#7021 translates title-owned CPU descriptor handles (__XMemAllocationHooks__) on
device slots 17-24, and #2490 wraps console-ABI command lists in ListProxy, but
neither wires translate_cpu_handle into the five graphics command-list methods
that consume CPU descriptor handles:
- console slot 50 (PC 46): OMSetRenderTargets (RTV array / single-range + DSV)
- console slot 51 (PC 47): ClearDepthStencilView (DSV handle)
- console slot 52 (PC 48): ClearRenderTargetView (RTV handle)
- console slot 53 (PC 49): ClearUnorderedAccessViewUint (CPU handle; GPU kept)
- console slot 54 (PC 50): ClearUnorderedAccessViewFloat (CPU handle; GPU kept)

Also installs a typed WINAPI thunk for console slot 51 (ClearDepthStencilView):
on the Windows x64 ABI, FLOAT Depth (4th argument) is passed in XMM3 rather than
R9, so the generic all-uint64_t list_slot template dropped/clobbered Depth before
forwarding to the real list.

Adds synthetic mock coverage across all five slots (including single-range RTVs,
null/zero-RTV cases, count > 8 bounds safety, outside-range passthrough, and
XMM3 float preservation) plus an end-to-end WARP/Vulkan GPU clear and readback
check in device_proxy_test.
2026-11-23 17:41:55 +00:00
39479dfa6c Merge remote-tracking branch 'origin/main' into rt/exe-tls-slot0 2026-11-23 18:39:59 +01:00
4fb24d2faa d3d12: a texture at slot 133 gets an ordinary committed texture instead of E_NOTIMPL
The retail title places textures at slot 133 too, and asserted on the E_NOTIMPL (found in review). A
texture now gets an ordinary committed DEFAULT texture of the same description, as slot 76 gives one,
logged once; it is not on the title's pages. The proxy rewrites a texture's Xbox layout word to
UNKNOWN (a buffer's to ROW_MAJOR), as slot 76 does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 18:37:44 +01:00
eaeee26b39 xapu/chad shims: XDspActivate writes its outputs, open and close commands give results, XApuConnect leaves the title's block alone 2026-11-23 18:37:42 +01:00
75c2b87a75 xmem: take the fault lock before reading or changing a mapped page's record
unmap_page moved the record out of g_mapped before taking the exclusive
lock, so a first-touch fault on that page could read a moved-from
section, and map_page made the view live before recording it, so a
fault in between was not recognised. unmap_page now holds the exclusive
lock from the lookup to the erase, and map_page holds it across mapping
the view and recording it. xmem_test adds four threads writing into a
window while 256 slices of pages are mapped and unmapped under them.
Reported by tupacfan04 in the review of #7556.
2026-11-23 12:37:42 -05:00
c5094e1dc9 xgameruntime: support long package mount paths 2026-11-23 18:37:20 +01:00
ce3f2dbdef Merge #7021 (descriptor heap XMem hooks) into #2490 (console command-list proxy) 2026-11-23 17:34:26 +00:00
228cb9ec6c d3d12: slot 133 imports from the page that holds the address and binds at the offset; uncommitted pages fall back
The title places small buffers inside a page too: a 16-byte UAV at a 64-byte-aligned address on an
RTX 5090 (found in review), which the import refused with E_INVALIDARG, halting the boot. The import now
starts at the page holding the address and the buffer is bound at the offset; an offset off the
buffer's alignment takes the ordinary-buffer fallback. A range not fully committed (xmem commits on
first touch) also falls back instead of failing. Only a null address or a zero width are E_INVALIDARG.

d3d12_existing_heap_test: a buffer 64 bytes into a page reads back the CPU's writes at its own VA; a
1-byte offset and a partly committed range fall back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 18:33:50 +01:00
18b0bfbaf1 d3d12: an A8 render target's castable list takes its own format and refuses the others
castable_view_formats() mapped every castable format through vulkan_format(), which has no
A8_UNORM case, so CreateCommittedResource3/CreatePlacedResource2 with castable={A8_UNORM}
failed with E_INVALIDARG ("castable format not supported yet: 65"). The resource's own format
is always viewable (create_texture adds the image's format), so naming A8_UNORM on an A8
texture is now a no-op.

An A8 render target's VK_FORMAT_A8_UNORM_KHR image is in a compatibility class of its own,
so an R8_UNORM castable entry (same texel size) would have reached its
VkImageFormatListCreateInfo. Any format other than A8_UNORM is now refused with E_INVALIDARG
before Vulkan.

The A8 gate (runtime and vk_test_device.h) also requires TRANSFER_SRC/DST, since every
texture is created with transfer usage.

d3d12_draw_test runs the A8 clear/draw/blend cases on a second target made through
CreateCommittedResource3 with castable={A8_UNORM}, and checks castable={R8_UNORM} returns
E_INVALIDARG. Without the shim change it fails with the reported message.

Reported by tupacfan04 on #7403.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 18:32:40 +01:00
952be9b046 d3d12: A8_UNORM textures in 1D and 3D, as the host makes them
texture_format refused every A8_UNORM texture that was not 2D, so GetResourceAllocationInfo answered
UINT64_MAX for a 1D one (a title's boot sizes a 128-texel 1D A8_UNORM texture and asserts on that size).
The host accepts A8_UNORM in 1D, 2D and 3D (the gap is listed by #4533's host sweep). They are R8_UNORM
images like the 2D ones; the SRV's alpha-only swizzle does not depend on the dimension. Format support
now names TEXTURE1D and TEXTURE3D too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 18:30:31 +01:00
ab03d8dd12 make_game, runtime: translate and load game_scarlett_master.exe embedded shaders 2026-11-23 18:28:36 +01:00
abd85df49f xmem: rt::xmem::commit_physical_pages commits pages by page number
A writer that copies into physical pages through its own view of their
section (a DirectStorage destination given as page numbers, #7652) sees
reserve-only memory for pages the title has not touched yet, and no
fault handler can resolve that address. commit_physical_pages commits
the given pages through each section's own view, one VirtualAlloc per
contiguous run, so such a writer can commit before it copies. Raised by
nurtrino in #7599.
2026-11-23 12:26:16 -05:00
4a86034367 d3d12_xs: a console depth-stencil texture with unordered access is sized and created without it (stand-in)
The console allows ALLOW_DEPTH_STENCIL | ALLOW_UNORDERED_ACCESS on a texture; the PC runtime refuses the pair and
slot 25 answered UINT64_MAX for it. pc_resource_flags drops the UAV bit from depth-stencil textures (slot 25 through
pc_resource_desc, and slot 76). Their UAV views then write no descriptor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 18:19:14 +01:00
57b88dec13 Merge branch 'r6582' into base-stack 2026-11-23 18:17:52 +01:00
9ed836f609 Merge branch 'r4313' into base-stack 2026-11-23 18:17:51 +01:00
1e03b40435 Merge branch 'pr4348' into rebase/4348-on-main
# Conflicts:
#	docs/README.md
#	runtime/CMakeLists.txt
2026-11-23 18:17:51 +01:00
4da716493f d3d12: reject null arrays and invalid lists in ExecuteCommandLists (#6610)
Squash-merged after diff review of PR #6610
2026-11-23 11:16:29 -06:00
afb14d56c6 PresentX: device-side WaitFrameEventX and the frame pacer share one token source
Device slot 80 (WaitFrameEventX, from #6935) numbered its tokens with a
counter of its own, while XboxPresentation's pacer refuses any token above
the ones it issued itself. A title that waits through the device and
presents through the device's XboxPresentation therefore had every
PresentX refused with E_INVALIDARG once its tokens ran ahead of the
pacer's.

leonida::FrameTokenSource is now the counter both use: a pacer takes an
optional shared source (a standalone pacer still owns its own and numbers
as before), the device proxy owns one and exposes it through
rt::d3d12_xs::device_frame_tokens, and XboxPresentation passes a given
source to its pacer. A token that was never issued is still refused.

Reported by rafaelpssz in #7496.
2026-11-23 12:16:11 -05:00
2029116f37 Merge branch 'ItsNotRexed:main' into codex/bvh-cache-maintenance8 2026-11-23 17:15:26 +00:00
ef9d0759d2 d3d12_xs: route console list slot 139 (Reset) to PC slot 10
Pipodi measured the retail title calling console list slot 139 with
(allocator proxy, pso) before recording — Reset, at PC slot 10. Map it
and unwrap the allocator (and a pipeline state the same way); the
unwrap now keys on the PC slot so console-10 and console-139 both land
on the real Reset.

xs_proxy_mock: PASS under Wine

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

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-23 10:14:43 -07:00
f6a00fc4d8 rdna2spirv: --fma khr covers the f64 FMAs (v_div_fmas_f64) with OpFmaKHR on doubles (#6635)
Squash-merged after diff review of PR #6635
2026-11-23 11:10:12 -06:00
6adeaf0b25 Runtime: guard closed-list IA/OM/PSO state setters and expand D3D12 Close parity tests (#6644)
Squash-merged after diff review of PR #6644
2026-11-23 11:07:42 -06:00
5ba2a7f95f xmem: map consecutive physical pages as one view, so a 100,000-page XMemMapPhysicalPages fits the title's hang watchdog under Wine
One view per page cost a placeholder split and a MapViewOfFile3 per 64 KiB page. Under Wine that took
0.36 ms a page and more as views accumulate; the retail boot's 99,776-page call ran past the title's
30-second hang watchdog. Consecutive pages of one allocation now map as one view. A page remapped or
unmapped later splits its view and the neighbours are mapped again from the same section.
2026-11-23 14:06:59 -03:00
0dc7f58e5e d3d12: B5G5R5A1 UAV textures are mutable R16_UINT images where A1R5G5B5 has no storage
A B5G5R5A1_UNORM texture with ALLOW_UNORDERED_ACCESS was refused on a GPU whose
VK_FORMAT_A1R5G5B5_UNORM_PACK16 has no STORAGE_IMAGE (NVIDIA): GetResourceAllocationInfo answered
UINT64_MAX and creation failed. A title's boot creates a 2560x1440 render-target + UAV one and
asserts on that size.

The R9G9B9E5 route generalizes: Format::r9g9b9e5_as_r32_uint becomes Format::uint_backed, the format
a UAV texture stored as a mutable unsigned image is viewed in (E5B9G9R9 for R32_UINT, A1R5G5B5 for
R16_UINT). For B5G5R5A1 the image is R16_UINT with {R16_UINT, A1R5G5B5} listed; its storage view is
R16_UINT in the uint class, SRVs are A1R5G5B5 sampled views, and RTVs and clears go through an
A1R5G5B5 attachment view (ResourceBinding::uint_backed lets replay's color_view_format take it). The
SRV and UAV T#s keep the 1_5_5_5_UNORM format. A shader store still needs the translator to pack
the bits for that view, so CheckFeatureSupport does not advertise the typed UAV yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 18:06:24 +01:00
954fcb1061 xmem: keep PAGE_GUARD in the view protection; only the cache modifiers are dropped
PAGE_GUARD is an access alarm, not a cache modifier (review on #7492). The comment
also says what the write-combine bit does on Windows, where the view is created
write-combined and #7218's import of those pages refuses it.
2026-11-23 14:05:51 -03:00
2c7095ddf5 fix(test): isolate mods scratch directory per process (#6660)
Squash-merged after diff review of PR #6660
2026-11-23 11:03:38 -06:00
a07c8c0e89 xmem: commit physical pages on first touch, not when they are allocated
XMemAllocatePhysicalPages backed each call with one SEC_COMMIT section, so
the title's ~6.1 GiB page-pool request after boot stop 17 was charged in
full at once and fails with ERROR_COMMITMENT_LIMIT on a 16 GB machine.
Mapping the pages right away (as the title does) would charge most of it
within seconds too, so the commit now follows first access.

The section is SEC_RESERVE. A vectored handler commits the faulting 64 KiB
page through a reserve-only view of the whole section when the address
lies in a live mapping, so every view of that page sees it. Faults on
committed pages whose protection forbids the access, and faults outside
the mapped pages, go on to the next handler, and a failed commit is not
swallowed. rt::xmem::commit_physical_range commits a range up front for
shims that hand guest memory to the kernel.

Reported by controldebils and rafaelpssz in #7333.
2026-11-23 12:01:49 -05:00
17cc9a7a92 d3d12: validate and track SetDescriptorHeaps and directly-indexed root flags (#6674)
Squash-merged after diff review of PR #6674
2026-11-23 11:00:10 -06:00
b93ffa5617 shaders: translate the pipeline library's compute pipelines, which the executable creates with slot 67 (RT-5)
The retail executable calls Xbox device slot 67 (DeserializeComputePipelineStateX) itself during boot, and every
call fails with "no translated compute shader": the build only translates the FidelityFX DLL's 29 FSPX programs.
The programs come from the pipeline library in shaders.rpf (docs/shader_library.md), which the title reads through
DirectStorage zlib requests: a compute record's state blob, blob, program and layout blob are FSPX kinds 0, 1, 6
and 7, the four pairs of the slot-67 description.

- tools/shader_library.py writes each compute program's record state blob as fspx/<name>.state, so the index gets
  fspx_state_sha256 (slot 67 always passes kind 0). In 1.0.2.1 each of the 2,684 compute programs has one.
- make_game.py's shaders stage gets library_shaders(): shader_library.py --stages cs --disasm --carve into
  <work>/shaders/library, rdna2spirv.py into <work>/shaders/spirv/library, with the stage's wave64 and fallback
  flags, the FSPX step's key-clash check and its own library_build.json for reuse.
- ShaderLibrary::load also reads <dir>/library/index.json; its entries are found by the same two keys.

Tests: test_library_shaders_stage.py (tool calls, reuse, invalidation, empty index, key clash),
test_shader_library.py (.state contents and both keys), shader_library_test (library entries found by code and
state key, a broken or missing index leaves the others).
2026-11-23 17:59:53 +01:00
28f013c2ff docs/runtime_imports.md: move our paragraph into the RT-5 section so it merges with main's xmem notes 2026-11-23 17:59:12 +01:00
a3da5122fd d3d12: checkpoint slow compute pipeline compiles
Depends on: #7384
AI-assisted: yes (Codex)
2026-11-23 17:59:05 +01:00
a6a7aba987 regen_fixtures: find the generated fixtures by their header instead of the SHADERS list (#6680)
Squash-merged after diff review of PR #6680
2026-11-23 10:58:55 -06:00
242a5dbf14 runtime: serve XboxBvhBuilder.dll with the layer's XDXR builder (RT-5, boot stop 18)
The package's XboxBvhBuilder.dll creates 52 console compute programs as
pipelines in its constructor, on the title's thread. Translated, they take
25-60 s to compile on a cold driver cache (#7231/#7049: 31.2 s for one on
an RTX 4080, 59.5 s for all 52 on an RX 9070 XT), longer than the title's
~30 s startup watchdog, so a first boot ends at the builder.

runtime/shims/xbox_bvh_builder.cpp serves the seven exports the executable
imports (measured statically on 1.0.2.1: constructor 1 call site,
destructor 1, Set64BitMortonCodes 8, GetRaytracingAccelerationStructure-
PrebuildInfo 3, BuildRaytracingAccelerationStructureBatched2X 6,
CopyRaytracingAccelerationStructure 2, RehydrateRaytracingAcceleration-
StructureBatched2X 4) with the layer's own XDXR builder (D3D-178). The
loader binds imports to a shim before a bundled module, so the DLL is not
loaded and its programs are never created.

- each BATCHED_DESC2 element (docs/xdxr.md §1) is one layer build with its
  postbuild descriptions; the offline-statistics type (0x10), which the DLL
  refuses by throwing, skips the element instead (a shim must not throw);
- XDXR stream records and Set64BitMortonCodes tune the console builder's
  heuristics and are ignored (logged once);
- prebuild sizes and copies are the layer's;
- the builder's state is kept in a table keyed by `this`: nothing is
  written into the title's object, whose size isn't known;
- rehydration answers E_NOTIMPL for now (stage 2);
- LEONIDA_BVH_BUILDER=console keeps the bundled DLL.

xbox_bvh_builder_test (12 checks) calls the exports through the shim
registry as the title binds them; xdxr_bvh.py check-build validates the
BLAS, TLAS and compacted BLAS it builds (0/1000 rays differ on each).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 17:57:27 +01:00
59e4bb81ec d3d12: the A8 render-target code compiles and enables maintenance5 with older Vulkan headers
KarolKurzyna found two header gaps on #7403. VK_KHR_maintenance5 was added to the
device extensions inside the maintenance8 #ifdef, so headers with maintenance5
but not maintenance8 (1.3.262 to 1.4.305) chained its feature without enabling
the extension; the two #ifdefs are now separate. texture_format and the PSO named
VK_FORMAT_A8_UNORM_KHR unguarded; they now use kA8UnormFormat, which is
UNDEFINED (and never used, since a8_render_target stays false) without it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 17:56:50 +01:00
c3fe825290 d3d12_existing_heap_test: don't compare the host's heap Alignment, which varies from run to run
The host runtime answers 64 KiB on some runs and 4 MiB on others for the same allocation (RX 9070 XT,
RTX 5090, WARP; found in review), which made the test fail about 1 run in 40. The layer's Alignment
must still be 64 KiB for an opened heap, and the host's either of the two values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 17:55:50 +01:00
c8a102d0cf vk_pipeline_check: match three device features to the runtime so its cache can hit
On an RX 9070 XT (driver 32.0.32029.2010) robustBufferAccess, scalarBlockLayout
and robustImageAccess are each part of the driver's pipeline cache key. The
runtime's device enables none of them, so the checker's no longer does.

New ctest pipeline_cache_seed: the checker compiles one synthetic compute
shader, then the same pipeline is created on the runtime's device from the
saved cache and the creation feedback has to report a hit.

AI-assisted.
2026-11-23 17:55:22 +01:00
04fdf377f0 Refresh the Xbox fence value after a rewind
Refresh the slot 12 mirror when the completion wait times out. Keep the existing pending fence event so a rewind cannot accumulate duplicate registrations.

The mock test covers a CPU rewind followed by progress below the old threshold and a rewind from outside the proxy. Original fails and patched passes in five runs each on Wine 11.20. AI-assisted.
2026-11-23 16:52:09 +00:00
acc4812c20 Match runtime maintenance8 enablement when seeding Vulkan pipelines 2026-11-23 16:51:51 +00:00
7e8e3c1db1 xmem: map physical pages without a cache modifier in the view protection
Three of the retail executable's five physical-page windows carry 0x400
(PAGE_WRITECOMBINE on the PC) next to PAGE_READWRITE. host_protect drops only the
PAGE_GRAPHICS_* range, so map_page passed PAGE_READWRITE | PAGE_WRITECOMBINE to
MapViewOfFile3, which refuses it with ERROR_INVALID_PARAMETER: the first
XMemMapPhysicalPages into such a window failed and the title's descriptor-heap
setup returned false.

view_protect now drops PAGE_WRITECOMBINE, PAGE_NOCACHE and PAGE_GUARD.
xmem_test maps a page into a window reserved with that protection.

AI-assisted.
2026-11-23 13:50:59 -03: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
310773a01c d3d12: slot 133 review fixes: no write-combined import, committed-range check, immediate free, proxy test
- A write-combined (or uncached) page in the range is not imported: an RTX 5090 imported such a range
  and read wrong bytes back (found in review). It takes the ordinary-buffer fallback.
- The whole range must be committed, walked with VirtualQuery across allocations (the retail buffer
  spans three mapped windows); otherwise E_INVALIDARG instead of undefined behaviour in Vulkan.
- The imported memory is freed as soon as the submitted work has retired (wait_retire_ticket), not
  after the next submission: VK_EXT_external_memory_host needs the caller's pages to outlive it, and a
  title may free them right after releasing the resource.
- The PC flag mask is 0x5ff: 0x200, which the host refuses, is dropped. Slot 133 is listed in
  device_slot_overridden.
- xs_proxy_mock_test registers a handler and checks slot 133's argument positions, the flag mask
  (0x20204 -> 0x4), the ROW_MAJOR rewrite and the iid; d3d12_existing_heap_test checks the
  write-combined fallback and the partly committed refusal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 17:49:03 +01:00
5be2fd2873 d3d12_xs: default direct device-proxy callers to PC-shaped lists
create_device_proxy's console_lists default was true, so every test
harness that links the TU and calls it directly got console-shaped
lists and crashed or failed Close on PC vtable indices (kormocicsaba:
d3d12_bindless_churn segfault, d3d12_mesh Close). The console shape is
the title path: D3D12XboxCreateDevice opts in (unless
LEONIDA_D3D12_LISTS=pc), and the default is now false so direct
callers keep the pre-PR behaviour. The mock test pins both: slot 12
on a console_lists=false device returns the real list.
2026-11-23 09:48:58 -07:00
b2902830d4 loader: load() gives already-running threads the executable's slot-0 block too
After #3671 a thread that was already running when load() ran gets each module's TLS block from load()
itself, and install_tls_for_thread is a no-op there. install_on_existing_threads stopped at
kMaxMappedTlsModules, so the executable in kMainImageSlot (#4313) was skipped: such a thread, a thread-pool
worker for instance, kept slot 0 as it was and /GA code on it read the wrong block. The check now covers
kTlsSlotCount. loader_tls_index0's early thread checks the new contract; without the change it fails
(reads no 42 in slot 0 before any install call).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 17:48:54 +01:00
a6b31d51ac d3d12: rectangle list stage emits (v1 v2 v4) (v1 v4 v3) with capability Geometry, log cut-off quads (review fixes) 2026-11-23 17:48:05 +01:00
e0b300f02b d3d12_xs: slot 133's fourth word is a barrier layout; create through CreateCommittedResource3 with it
The word slot 133 passes after the description is a D3D12_BARRIER_LAYOUT, not a resource state:
the title passes all ones (UNDEFINED) for its first buffer and 6 (SHADER_RESOURCE) for 1x1
render-target and depth textures. Read as a state, 6 is INDEX_BUFFER | RENDER_TARGET, which the
PC device refuses for a texture, and the title then asserts on the missing resource.

On a PC device with ID3D12Device10 the resource is created through CreateCommittedResource3 with
the layout as given (UNDEFINED for a buffer). An older device gets CreateCommittedResource with the
legacy state of that layout, COMMON for UNDEFINED and for layouts that have none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 17:47:47 +01:00
0656b0b200 Loader: W lookups find a mapped image by its non-ASCII name; ANSI lookups ignore case outside ASCII (#6754)
Squash-merged after diff review of PR #6754
2026-11-23 10:47:01 -06:00
5a8dc9af66 runtime/README.md: one text for threads that ran before load() after merging main (#3671) 2026-11-23 17:46:20 +01:00
1d8d1d355d d3d12_xs: slot 70 takes its buffer reference under the registry lock and asks for a buffer that holds the whole width (review of the raw view)
AI-assisted.
2026-11-23 17:46:16 +01:00
3dbde4295e Merge remote-tracking branch 'upstream/main' into rebase/4313-on-042c5f378
# Conflicts:
#	runtime/CMakeLists.txt
#	runtime/README.md
#	runtime/src/pe_loader.cpp
2026-11-23 17:46:05 +01:00
86cd0c5f2a d3d12: draw the console's rectangle lists (17, PSO type 19) and quad lists (19) as triangles
A rectangle list is three corners; the fourth is v2 + v3 - v1 for the position and every interpolant, after the vertex stage. A quad list is four vertices per quad. Vulkan has neither. A PSO with topology type 19 was refused (E_INVALIDARG) and the two list topologies drew as a plain triangle list.

Rectangle list: the PSO becomes a triangle-list pipeline with a generated geometry stage (src/rect_list_geometry.h), built from the vertex shader's own SPIR-V outputs, that emits the strip v1 v2 v3 v4. Quad list: one triangle fan per quad (0 1 2, 0 2 3), drawn with the index values 4q..4q+3 so the translated vertex id (VertexIndex - BaseVertex) is right; non-indexed draws read a shared 0, 1, 2, ... buffer reserved in the arena.

Facts from xvalkyrie (GPL-3.0, commit 53af7df77c10); no code copied.
2026-11-23 17:45:10 +01:00