<feed xmlns='http://www.w3.org/2005/Atom'>
<title>eglantine-cirakg/src/video_core/gpu.cpp, branch nx2</title>
<subtitle>Mirror of github.com/cira0100/Eglantine-public nx2, a fork of Djihads80/Eglantine.</subtitle>
<id>https://git.cirakg.xyz/eglantine-cirakg/atom?h=nx2</id>
<link rel='self' href='https://git.cirakg.xyz/eglantine-cirakg/atom?h=nx2'/>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/'/>
<updated>2026-11-02T22:36:01+00:00</updated>
<entry>
<title>Merge pull request #334 from snowstormxd/codex/upstream-mkw-test</title>
<updated>2026-11-02T22:36:01+00:00</updated>
<author>
<name>Jonas</name>
<email>104419015+jojo-chaechae@users.noreply.github.com</email>
</author>
<published>2026-11-02T22:36:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=8362c44ff835d7be73d2adad9ce3e2d4467a6aeb'/>
<id>urn:sha1:8362c44ff835d7be73d2adad9ce3e2d4467a6aeb</id>
<content type='text'>
MKW performance improvements</content>
</entry>
<entry>
<title>nx2: rearm clean read areas when the GPU writes them again</title>
<updated>2026-11-02T20:51:11+00:00</updated>
<author>
<name>snowstormxd</name>
<email>214507868+snowstormxd@users.noreply.github.com</email>
</author>
<published>2026-11-01T14:21:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=06e211e0d0a1634d16f1d74d75682092fc92a5de'/>
<id>urn:sha1:06e211e0d0a1634d16f1d74d75682092fc92a5de</id>
<content type='text'>
Port the coherency changes from alarok/Eglantine 77fc365f2 without its diagnostic framework or shutdown changes. Only GPU-dirty CPU reads become permanently preflushable, clean areas can be trapped on the next write, non-core readers avoid indexing core arrays, and collected CPU writes precede readback.

Assisted-by: Codex (source review, selective integration and verification)
(cherry picked from commit b64e211957180aa218ec6d9a3bcb020332279c3f)
</content>
</entry>
<entry>
<title>nx2: map GPU memory before later command lists are read</title>
<updated>2026-11-02T19:53:47+00:00</updated>
<author>
<name>Sssnowyyy</name>
<email>78863999+Sssnowyyy@users.noreply.github.com</email>
</author>
<published>2026-11-02T18:18:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=9f4f01f76e8556941c0c0c3f57edc1d600ed23ea'/>
<id>urn:sha1:9f4f01f76e8556941c0c0c3f57edc1d600ed23ea</id>
<content type='text'>
837133792d queues the GMMU maps on the GPU thread (GPU::RunInOrder) so the
service thread never waits for the texture cache. With the GPU split
(Low GPU accuracy) the GPU thread defers queued functions to its back, but
its front reads the command lists: it read the lists submitted after a map
through GPU addresses that weren't mapped yet. Pokopia stopped after its
first frame.

Add GPU::MapInOrder for the GMMU maps and the sparse tile remaps. It runs
in order like RunInOrder, and with the split it runs on the front after
draining the back, before the front reads further command lists. The
service thread still never takes the texture cache lock, and the back is
idle while the map changes the caches. Unmaps and the other queued work
still run on the back.

Assisted-by: Claude Opus 5.5 (bisect, fix, testing and commit message)
</content>
</entry>
<entry>
<title>nx2: don't stall presents on a current-frame wait the GPU can't finish</title>
<updated>2026-11-02T19:53:47+00:00</updated>
<author>
<name>Sssnowyyy</name>
<email>78863999+Sssnowyyy@users.noreply.github.com</email>
</author>
<published>2026-11-02T16:34:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=690f80e15f411d8fa46a2eecdfc50ddadc8ed5e0'/>
<id>urn:sha1:690f80e15f411d8fa46a2eecdfc50ddadc8ed5e0</id>
<content type='text'>
0f14696044 made PresentClientBuffer also wait for the current frame's
fence whenever the previous frame's wasn't reached. Mario Kart World's
GPU waits on semaphores its CPU releases only after the present returns,
so in that state the current fence can't be reached until the present
returns, and each such present stalled up to the 4 s deadline.

Wait for the current frame by default, but give up after a few ms once a
GPU channel was seen suspended on a semaphore acquire and wait for the
previous frame instead. EDEN_NX2_FRAMES_AHEAD=1 always waits for the
previous frame (with 0f14696044's current-frame wait when the GPU is
behind), =0 always for the current one. The scheduler gains a lock-free
flag so the present thread can see suspended channels.

Assisted-by: Claude Sonnet 5.5 (implementation and commit message)
</content>
</entry>
<entry>
<title>buffer_cache: no buffer downloads at every fence for Switch 2 titles</title>
<updated>2026-10-30T00:49:47+00:00</updated>
<author>
<name>Takoroka</name>
<email>137927095+Takoroka@users.noreply.github.com</email>
</author>
<published>2026-10-29T10:22:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=be449da3db512f790c71d60a58e027a5898a0446'/>
<id>urn:sha1:be449da3db512f790c71d60a58e027a5898a0446</id>
<content type='text'>
Eden copied every GPU-written buffer range back to guest memory at the next fence.
Title 1 signals a fence per compute dispatch, so that was 250-330 MB/s in 13,000-20,000
ranges a second, with the fencing thread holding the buffer cache while it wrote them.
Measured: the native MME's DMA reads never touched those pages (they read query words
written on the CPU side), and with reactive flushing the guest CPU read GPU-written
memory at most 64 times in 200 s. Without them, for Switch 2 titles (native tiling):
fences ~1.1 us instead of ~5, draw setup 6.1 us instead of 6.4-6.7, macro calls 160 ns
instead of 167-170, GPU-thread lock spinning 1.8% (was 5.5%). Regions stay marked GPU
written and are still flushed on demand. EDEN_NX2_BUFFER_DOWNLOADS=0/1 forces either
way. Reactive flushing reads of GPU-written memory are now counted in the log.
</content>
</entry>
<entry>
<title>Fix the P6 scratch save in R2UR/MATCH/HFMA2.RELU; GPU memory dump tool</title>
<updated>2026-10-28T19:19:44+00:00</updated>
<author>
<name>Takoroka</name>
<email>137927095+Takoroka@users.noreply.github.com</email>
</author>
<published>2026-10-28T19:19:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=8393e2912616ce475619900be8cb29e551ff2997'/>
<id>urn:sha1:8393e2912616ce475619900be8cb29e551ff2997</id>
<content type='text'>
The colour cast on title 1 (magenta/cyan, then red/green, changing per
course) came from the sky/atmosphere volume shader (a pixel shader drawing
a 32^3 RGBA16F table slice by slice), which starts with an unguarded R2UR.
R2UR, MATCH and HFMA2.RELU use P6 as scratch and saved/restored it with the
uniform-guard mask, 1 &lt;&lt; (6 - 7) for an unguarded instruction: undefined, in
practice bit 31, which shifted into the opcode bits and turned the save into
another instruction. They now always save and restore P6.

Debugging aids used to find it:
- EDEN_NX2_DUMP=&lt;present&gt;:&lt;addr&gt;:&lt;size&gt;,...: flush GPU memory ranges at a
  present (on the GPU thread) and save them next to the frame captures;
  nx2work/vol3d.py untiles Switch 2 3D textures from such dumps.
- GPU::RunOnGpuThread.
- Logs of Switch 2 3D images and descriptors.
</content>
</entry>
<entry>
<title>nx2: unmap GPU memory in submission order</title>
<updated>2026-10-28T11:47:45+00:00</updated>
<author>
<name>Takoroka</name>
<email>137927095+Takoroka@users.noreply.github.com</email>
</author>
<published>2026-10-28T11:47:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=598bb7750c71ea1378724ddfe9418f27330fa279'/>
<id>urn:sha1:598bb7750c71ea1378724ddfe9418f27330fa279</id>
<content type='text'>
NormalUnmapGpuMemory4K and destroying GPU memory are jobs the console's
graphics server completes behind the work already submitted. Run the GMMU
unmaps on the GPU thread after the command lists queued before them
(GPU::RunInOrder) and signal the job's event only then, instead of unmapping
and signalling at once while Eden's GPU thread may still be behind.

Also EDEN_NX2_FRAMES_AHEAD (experimental): wait for the previous frame's
fence at present instead of this one's.
</content>
</entry>
<entry>
<title>[video_core, settings] readback for nce invalidations (#4490) optimization and nuke toggles (#4502) (#4531)</title>
<updated>2026-10-26T16:24:28+00:00</updated>
<author>
<name>xbzk</name>
<email>xbzk@eden-emu.dev</email>
</author>
<published>2026-10-26T16:24:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=0e11fe8b5e3d3b563946726ed06cb44b2bf5ccb3'/>
<id>urn:sha1:0e11fe8b5e3d3b563946726ed06cb44b2bf5ccb3</id>
<content type='text'>
- [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions).
- [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md).
- [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.

-------------------

Follow up for #4490: Originally i was racing locks between dirty and clean invalidations, but +94% were clean so it was causing useless locks. Solutioin was to share locks between both.

P.S.: THIS IS INTENDED TO FIX RANDOM CRASHES IN UE, OBJECTIVELY REPRODUCIBLE IN ENDER MAGNOLIA IN ANDROID.

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4531
Reviewed-by: CamilleLaVey &lt;camillelavey99@gmail.com&gt;
Reviewed-by: Shinmegumi &lt;shinmegumi@eden-emu.dev&gt;
</content>
</entry>
<entry>
<title>[settings] add PR4490 &amp; PR4492 toggles (#4502)</title>
<updated>2026-10-05T20:37:30+00:00</updated>
<author>
<name>xbzk</name>
<email>xbzk@eden-emu.dev</email>
</author>
<published>2026-10-05T20:37:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=10bcd2d849843b146a79c61a21df615e1bdcfcde'/>
<id>urn:sha1:10bcd2d849843b146a79c61a21df615e1bdcfcde</id>
<content type='text'>
- [X] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions).
- [X] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md)
- [X] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.

-------------------
TEMPORARY! Pushed under Camille's instruction. Will be dropped as soon as they get optimized.
Aimed to avoid reported perf impact from PRs 4490 and 4492 on 30-sep-2026 nightly,

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4502
Reviewed-by: MaranBr &lt;maranbr@eden-emu.dev&gt;
Reviewed-by: CamilleLaVey &lt;camillelavey99@gmail.com&gt;
</content>
</entry>
<entry>
<title>[video_core] buffer cache readback for nce invalidations (#4490)</title>
<updated>2026-09-30T20:13:37+00:00</updated>
<author>
<name>xbzk</name>
<email>xbzk@eden-emu.dev</email>
</author>
<published>2026-09-30T20:13:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=8e2d26c272681d6cafe6d5e703dafdc8200c7b65'/>
<id>urn:sha1:8e2d26c272681d6cafe6d5e703dafdc8200c7b65</id>
<content type='text'>
- [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions).
- [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md)
- [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.

-------------------

This is a follow up of 4473, a fix for the next Ender Magnolia known crash, the shackled beast's vaper crash, but specific for NCE.

Imma try to be short:

NCE invalidation was dooming whole guest pages when it shouldn't. If the GPU buffer cache owns some bytes on a page, invalidating first discards their ownership, and the retrying CPU can then observe stale data. On Android, this was corrupting some indirect draw packets and causing huge invalid index count reach staging memory allocation.

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4490
Reviewed-by: CamilleLaVey &lt;camillelavey99@gmail.com&gt;
Reviewed-by: lizzie &lt;lizzie@eden-emu.dev&gt;
</content>
</entry>
</feed>
