Repository navigation
Small fixes from Fritchii v5: fastmem on low-memory PCs, channel deadlock, guest memory reserve (on) - #53
Merged
Conversation
…g fastmem (#645) * common: retry the Windows fastmem backing allocation instead of losing fastmem HostMemory charges the whole backing (14 GiB for Switch 2 programs) to the commit limit with one SEC_COMMIT CreateFileMapping2. When the free commit is only just above that size, the call fails with ERROR_NO_SYSTEM_RESOURCES and a system-managed page file is not grown. HostMemory then falls back to a plain VirtualAlloc of the same size, which does grow the page file and succeeds, but the session runs without fastmem: every guest memory access goes through the page table. On Ocarina of Time that costs 20-25% of the frame rate for the whole session. On a failure, commit the same size privately once (this grows the page file), release it and try the section again, up to five times. Each failure is logged with the error code and the free commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * common: wait before each fastmem backing retry, not after the last attempt Review feedback on #645: sleep after failed attempts 1-4 so the first retry also gets time for the page file to grow, and fall back without a pointless wait after the final attempt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…omb red line, port of #722) (#820) * shader: interpolate noperspective varyings perspective-correct (#441) Ocarina of Time draws water volumes whose vertex shader writes a screen-space coordinate (clip.xy / clip.w) as a noperspective varying. When a vertex sits next to or behind the camera (w close to 0), the primitive is clipped and the attribute has to be re-interpolated at the clip points. On AMD (RDNA3, Windows driver) that produces wrong values: the fragment shader samples its depth input far off, computes a negative distance and exp2 overflows to the R11G11B10 maximum. This is the red dotted line in the Royal Family's Tomb. Emulate noperspective with perspective interpolation instead: the last pre-rasterization stage (vertex, tessellation evaluation or geometry) writes the value times Position.w, and the fragment stage reads it perspective-correct and multiplies by FragCoord.w (1/w). The result is the same screen-linear value, and clipping now interpolates it correctly. Mesh pipelines are left unchanged: the fragment stage only converts its inputs when the previous stage scaled them. EDEN_NX2_NOPERSP_AS_SMOOTH=0 turns the emulation off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * shader: keep noperspective emulation out of XFB, indexed loads and repeated EmitVertex Review follow-ups for the perspective-correct noperspective emulation: - Skip the emulation when transform feedback is enabled or the fragment program reads attributes indexed. Transform feedback would capture the value times Position.w, and the indexed load path does not multiply by FragCoord.w. Producer and fragment stage decide together, so those pipelines keep native noperspective interpolation. - Geometry shaders keep output values across EmitVertex. An output that is written once and emitted several times was scaled by every vertex's w in turn. Restore the unscaled values after each EmitVertex, like the fixed pipeline point size. - Assert instead of silently skipping the FragCoord.w multiply; only float inputs are marked and DefineInputs forces FragCoord for them. - Wrap three lines to the 100-column limit. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * shader: always interpolate noperspective varyings perspective-correct Drop the EDEN_NX2_NOPERSP_AS_SMOOTH switch from #722 so the fix ships unconditionally. * shader: keep native noperspective varyings with passthrough geometry A passthrough geometry shader can write generics outside its passthrough mask, and those aren't scaled by Position.w, so the fragment stage must not divide them. --------- Co-authored-by: justin-wq1337 <352978534+justin-wq1337@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…) (#609) ib_enable, dma_increment_once, signal_sync and synced were 1-bit fields in one byte. The fence callback sets synced on the fence thread, and a bitfield store rewrites the whole byte, so it could write back a stale dma_increment_once = true after the GPU thread cleared it. The next Increasing header then ran non-incrementing, its SET_REPORT_SEMAPHORE query word was never written, and the channel deadlocked on its own acquire. Make them separate fields and synced a std::atomic<bool>. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Log2Floor(0) wraps to 0xFFFFFFFF, so Log2Ceil(0) shifted by that much and returned a huge index. A zero-size staging request (the null image's upload in the crash #910 fixed) then read StagingBufferPool's 64-entry cache far out of range. Log2Ceil now returns 0 for 0. Refs #904, #910
…reserved, committed on use (Windows, off by default) SEC_COMMIT charged the whole 14 GiB section against the commit limit at boot (41 GB of commit on the owner's PC with 5 GB of it resident), which on a 16 GB PC with a small pagefile can fail allocations. With the switch the section is SEC_RESERVE and its 64 KiB granules are committed through the backing view as the kernel hands pages out: MarkUsed (so ClearBackingRegion too), Map, the INI range, and at kernel init everything outside the user pools (slab heaps, page table heap, pool management), before the slab heaps are set up. Commit never goes back down. A first vectored handler is the safety net: a fault on a reserved page of the backing or virtual view (a missed commit) commits the 64 KiB around it and retries, instead of dynarmic taking it for a fastmem miss and moving the instruction to the slow path for good. The memory log line prints the section's commit and that handler's count, which must stay 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WzPMHjWo2FbkicE8Ky2Vda
Fritchii v5.1 rolled it back (9b30eec8ca): noperspective varyings emulated as perspective times Position.w turned the fog volume at the Hyrule Field drawbridge solid white on an RTX 4080 and drew rare lines in Kokiri Forest fog, and it is suspected in an RX 6600 boot crash on a cached tessellation pipeline. The AMD tomb line stays until a fix is tested on AMD. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WzPMHjWo2FbkicE8Ky2Vda
Fritchii v5 (b59b8a860d) and CheezerWheezer's AMD Superior build 9 (ab795780d4) ship it on: committing the whole 14 GiB guest section at boot left 16 GB PCs out of commit (Windows error 1455) loading a save. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WzPMHjWo2FbkicE8Ky2Vda
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the Fritchii v5 release lists that Nyamu was missing.
dma_increment_once(a rare channel deadlock).Log2Ceil(0)returns the smallest bucket instead of wrapping.EDEN_NX2_SEC_RESERVE(Windows, now on by default,=0turns it off):Built (video_core, core, Qt app) and tested together with all open PRs: 731 of 733 tests pass and 1 is skipped (the one failure is the usual libopus check). The Windows-only parts of
host_memory.cppcouldn't be compiled here, so please check your local Windows build.🤖 Generated with Claude Code
https://claude.ai/code/session_01WzPMHjWo2FbkicE8Ky2Vda