Boot Marvel's Spider-Man: Miles Morales through the intro movie #427
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!427
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/427/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@itsmemac on GitHub · 2026-08-31 18:41 UTC · original
itsmemac:spiderman-intro-movie→main· +3514 −277 · 89 files · 18 commits · closed without mergingWhat this does
Takes Marvel's Spider-Man: Miles Morales from failing on its third frame to playing the full intro movie, on a stock Windows build with no environment variables set.
Grouped into 18 commits so they can be cherry-picked independently. Each is described below with why it exists. Commits 1 and 11 are the ones to look at first — 1 is an unrelated build fix that stands alone, and 11 is the only one that changes behaviour for every title.
Testing
ctest: 33/35.shader_recompiler_computeandtexture_cache_image_overlapfail — they fail identically on unmodifiedmain, verified by building upstream with only commit 1 applied. This PR introduces no test regressions.masterSemaphore.cpp:56. The menu does not come up yet.mainat a shader CFG failure after 3-5 s; with this PR it gets past that and reaches a different, later failure in PM4 register decode (unknown sh reg at 01169: 0xca). Still not playable, but not a regression.The commits
1.
build: fix clang-cl compile of ResourceTracking—maindoes not compile with clang-cl today.Tracker::IndirectImagePlanis in an anonymous namespace, sostd::projectedcannot be formed and the threestd::rangesalgorithms over it are rejected. CI misses it because it never builds
kyty_emulator. Independent of everything else here.2-5. Self-contained shader fixes —
V_CMP_LT_U64was missing from the VOPC table; wave64 subgroup broadcast needs workgroup-wide lowering becauseOpGroupNonUniformShuffleat Subgroup scope only reaches 32 lanes (DS_BPERMUTEand DS_SWIZZLE deliberately keep the raw subgroup id, being defined on independent halves);
S_CMPagainst an exec mask is the "are any lanes live" idiom and needs a real ballot; buffer loads were clobbering lanes the exec mask had masked off.6-8. Descriptor and control-flow resolution — typed phis and
ReadFirstLanein the SRT walker (the latter only for non-image descriptors, where every lane holds the same handle); loops whose selection merge escapes the body;S_SWAPPC_B64indirect calls resolved from the dispatch side, where the user data is already in hand, which is the only place that breaks the circular dependency described in the commit message.9.
recompiler: allow a shader to be refused instead of aborting- the change that actually unblocks the boot.CompileOptions.non_fatal/CompileResult.unsupported; the three give-up points record and unwind instead ofEXIT. Nothing changes whennon_fatalis clear.10. Tessellation patch control points draws were hardcoded to 3 control points; take the real count from
VGT_LS_HS_CONFIG.HS_NUM_INPUT_CPand key the pipeline cache on it.11.
graphics: size the buffer and page-table constants explicitly- this one changes behaviour for every title and is the one I would question.DOWNLOAD_BUFFER_SIZE32 -> 128 MiB, because this title asks for a single 80 MiB download allocation; andCACHING_ADDRESS_BITS39 where the table previously covered 40 bits, halving the BDA page table to 256 MiB at the cost ofcovering guest addresses only to 512 GiB. Both are tuned against one title. If the 1 TiB window matters elsewhere, take the naming and leave the value at 40.
12-13. Device-memory accounting and tiler scratch — the caches were deciding when to collect from the driver's process-wide estimate, which varied by ~4x between reads of the same moment here; read VMA's own accounting instead.
Tiler scratch was unbounded across a burst of detiles: measured 409 MiB across 40 live buffers while an image allocation was failing 414 MiB short.
14-18. Remaining fixes — image/tiling/video-out, decode and emitter corrections, kernel memory and event-flag paths, runtime linker, and test updates.
Known gaps
S_CMP_{EQ,LG}_U64 against a mask operand and zero is the idiom for 'are any lanes live'. Treating it as a scalar compare loses the per-lane information, so emit an actual ballot for that shape.The callee of an indirect call is not in the shader binary. It lives elsewhere in guest memory and is never dispatched, so it is never compiled - the scan finding zero S_SETPC_B64 across every compiled shader is the same fact seen from the other side. The target arrives through a descriptor chain rooted in user data. Resolving that chain inside the recompiler would need the SRT walk, which needs the shader to translate, which is what the unhandled S_SWAPPC_B64 prevents. Resolving it from the dispatch side, where the user data is already in hand, avoids that circle: find each call site, fetch the callee, and splice it in before recompiling. Each table entry is a {function, context} pair; the caller moves the first half into the call-target registers and the second into the next pair as an argument, so inlining at the call site needs no argument marshalling.@Nmzik on GitHub · 2026-09-24 17:01 UTC · original
Closing this in favor of your #780.
Pull request closed