<feed xmlns='http://www.w3.org/2005/Atom'>
<title>eglantine-cirakg/src/video_core/buffer_cache, 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-03T06:29:23+00:00</updated>
<entry>
<title>nx2: fewer render pass splits on tiled GPUs, log failed GPU waits (Pokopia) (#361)</title>
<updated>2026-11-03T06:29:23+00:00</updated>
<author>
<name>Alex</name>
<email>78863999+Sssnowyyy@users.noreply.github.com</email>
</author>
<published>2026-11-03T06:29:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=f50099038ee4c95901821e137471a8ce87bf52a4'/>
<id>urn:sha1:f50099038ee4c95901821e137471a8ce87bf52a4</id>
<content type='text'>
* buffer_cache: don't end the render pass after mapped buffer uploads

Every upload set any_buffer_uploaded, and the next draw or dispatch then
recorded a transfer-to-shader barrier outside the render pass. On Vulkan
the uploads are mapped: each copy either records its own barriers
(CopyBuffer with barrier set) or goes to the upload command buffer,
which ends with a barrier before the frame's commands run. The extra
barrier only ended the render pass.

On tiled GPUs every such split writes the attachments out and reads
them back. Pokopia's first gameplay scene had ~50 of these splits a
frame. Without them, an M3 MacBook Air (MoltenVK, 1x docked) goes from
~35 to ~29.5 ms of GPU time a frame and from 28.5 to 32 fps.

OpenGL uploads immediately and keeps the barrier.

Assisted-by: Claude Opus 5.5 (profiling, implementation and commit message)

* vulkan: log a failed GPU wait before it ends the process

When the device is lost, vkWaitSemaphores in MasterSemaphore::Wait
returns VK_ERROR_DEVICE_LOST and the exception goes uncaught on the
fence thread or the GPU thread, so the process aborts without a line in
the log: ReportLoss is only reached from submit and present. A Pokopia
crash on macOS left the log ending a second before the abort, with no
hint that the GPU was lost.

Log the wait's result before rethrowing. On macOS, MoltenVK prints the
Metal reason (a GPU hang or page fault) to stderr only.

Assisted-by: Claude Opus 5.5 (diagnosis, implementation and commit message)</content>
</entry>
<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>Merge pull request #337 from Sssnowyyy/nx2-review-fixes</title>
<updated>2026-11-02T22:18:21+00:00</updated>
<author>
<name>Jonas</name>
<email>104419015+jojo-chaechae@users.noreply.github.com</email>
</author>
<published>2026-11-02T22:18:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=155bf34fc297b6b8e4c281ecf7ea5d9ce3140762'/>
<id>urn:sha1:155bf34fc297b6b8e4c281ecf7ea5d9ce3140762</id>
<content type='text'>
nx2: fix pokopia regressions, textures that handle shader computes, and more</content>
</entry>
<entry>
<title>Merge pull request #113 from ymatrix1/fix/storage-buffers-32</title>
<updated>2026-11-02T22:14:50+00:00</updated>
<author>
<name>Jonas</name>
<email>104419015+jojo-chaechae@users.noreply.github.com</email>
</author>
<published>2026-11-02T22:14:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=05259375e0fb436c78882f8d9b95f9e2ce69af13'/>
<id>urn:sha1:05259375e0fb436c78882f8d9b95f9e2ce69af13</id>
<content type='text'>
buffer_cache: allow 32 storage buffers per stage</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>buffer_cache: fix the already-disabled check for uniform buffers</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:39:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=8556e27015ded665ca9a5522071cdeeec20a1575'/>
<id>urn:sha1:8556e27015ded665ca9a5522071cdeeec20a1575</id>
<content type='text'>
DisableGraphicsUniformBuffer tested !current.buffer_id to detect a
binding that is already NULL_BINDING. SlotId converts to true unless it
is the invalid id, and NULL_BUFFER_ID is BufferId{0}, so the check was
false for NULL_BINDING and the early return never triggered. Compare
against NULL_BUFFER_ID instead.

Follow-up to 46b2577bf7.

Assisted-by: Claude Sonnet 5.5 (implementation and commit message)
</content>
</entry>
<entry>
<title>vulkan: repack 69-byte vertices only when needed</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:38:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=13fc5fda26e6b5a9af67f5a654e831187bfa1962'/>
<id>urn:sha1:13fc5fda26e6b5a9af67f5a654e831187bfa1962</id>
<content type='text'>
SetVertexRepackLayout returned old_mask | new_mask, which stays non-zero
on every draw that uses a 69-byte binding. PrepareDraw then re-dirtied the
vertex buffers and vertex input each time, so the repack compute pass ran
and the render pass ended once per draw, which is costly on tiled GPUs.

Return old_mask ^ new_mask so only a layout change re-dirties the
bindings. The repacked copy only stays valid while the source data is
unchanged, so the buffer cache now flags the vertex buffers overlapping a
CPU write, inline or DMA write, or GPU write, and re-dirties the repacked
ones before binding. Command buffer submission already invalidates all
vertex buffer state, which keeps the staging copy within its tick.

Also pass the source buffer size to the repack pass and clamp the
word-rounded storage descriptor range to it; it could run up to three
bytes past the end of the buffer. A binding that does not fit is skipped
like one over the device limits.

Follow-up to e38b738b84.

Assisted-by: Claude Sonnet 5.5 (implementation and commit message)
</content>
</entry>
<entry>
<title>video_core/buffer_cache: reuse unchanged small uniform buffers within command buffer</title>
<updated>2026-11-02T18:58:38+00:00</updated>
<author>
<name>gabrielskaminski</name>
<email>gabriel.skaminski@gmail.com</email>
</author>
<published>2026-11-01T04:49:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=202c6b0356e1fa9366e5b9000df35a63f1eb9dc0'/>
<id>urn:sha1:202c6b0356e1fa9366e5b9000df35a63f1eb9dc0</id>
<content type='text'>
(cherry picked from commit 4aa5cd89fd1862751b3297036f2d21a0dc924b23)
(cherry picked from commit f1bdd5b13a1bdca81243b4aa1d8529f0485d3671)
</content>
</entry>
<entry>
<title>nx2: read GPU-written command lists from copies instead of draining</title>
<updated>2026-11-02T16:24:19+00:00</updated>
<author>
<name>Takoroka</name>
<email>137927095+Takoroka@users.noreply.github.com</email>
</author>
<published>2026-11-02T16:24:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=8f1435f8db104351fa3388551eee9d12d2043b40'/>
<id>urn:sha1:8f1435f8db104351fa3388551eee9d12d2043b40</id>
<content type='text'>
The trees fix (#52) drains the split and flushes for every command list
on a GPU-written page: in a Mario Kart World race ~13,500 lists and ~400
GPU round trips a second, during which the back has nothing to do. The
replay ran at ~40 fps instead of ~45.

The front now marks the pages those lists are on. The buffer cache notes
writes to them; after a compute dispatch or DMA copy that writes one it
copies the page into host memory and submits. The front waits for the
back only up to the last compute or copy work it sent (not everything
queued), then reads the copy once the GPU is done with it.

Pages the GPU wrote once, long before, and the CPU now writes lists to
have no copy: their first list drains and flushes the whole page, which
is then read from guest memory until GPU work writes it again. CPU
writes and inline uploads reach guest memory, so they keep such a page
synced but make a copy stale. A page a draw writes always drains.

Mario Kart World time-trial replay, Radeon 780M: ~40 -&gt; ~45 fps, trees
drawn, no list drains left.
</content>
</entry>
<entry>
<title>buffer_cache: allow 32 storage buffers per stage</title>
<updated>2026-11-02T15:03:06+00:00</updated>
<author>
<name>Yuri Olive</name>
<email>yuriso1994@gmail.com</email>
</author>
<published>2026-10-31T16:54:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=15dd9807110a1b120493962427413a82f4147d1c'/>
<id>urn:sha1:15dd9807110a1b120493962427413a82f4147d1c</id>
<content type='text'>
Native Switch 2 compute shaders (such as Donkey Kong Bananza) bind up to 18 global memory ranges, causing out-of-bounds binding errors:
  HW.GPU &lt;Error&gt; buffer_cache.h:BindComputeStorageBuffer: Storage buffer index 16 exceeds maximum storage buffer count
  HW.GPU &lt;Error&gt; buffer_cache.h:BindComputeStorageBuffer: Storage buffer index 17 exceeds maximum storage buffer count
followed by GPU driver access violations (0xc0000005).

The enabled and written storage buffer bitmasks (enabled_compute_storage_buffers and written_compute_storage_buffers) are already u32, so widening NUM_STORAGE_BUFFERS from 16 to 32 fits naturally within the existing 32-bit masks.
</content>
</entry>
</feed>
