<feed xmlns='http://www.w3.org/2005/Atom'>
<title>eglantine-cirakg/src/video_core/shader_environment.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-02T19:53:47+00:00</updated>
<entry>
<title>video_core: flush GPU-written code when capturing native shaders</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:31:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=a1f781fa24cc16e6d636213a5596cfed4123f493'/>
<id>urn:sha1:a1f781fa24cc16e6d636213a5596cfed4123f493</id>
<content type='text'>
10e7063905 moved native program capture from one ReadBlock per instruction to
ReadBlockUnsafe per 4 KiB page. ReadBlockUnsafe skips the rasterizer flush, so
code that a GPU copy had written and not yet flushed to guest memory was
captured stale. The speed-up comes from reading a page at a time, not from
skipping the flush: read each page (and the odd single instruction outside a
fully mapped page) with ReadBlock, which flushes once per page instead of once
per instruction.

Follow-up to 10e7063905.

Assisted-by: Claude Sonnet 5.5 (implementation and commit message)
</content>
</entry>
<entry>
<title>video_core: read texture handles as header offsets only on Switch 2</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:30:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=e46c6cbfb0f6735ca35f1150338c300f3c9c18fe'/>
<id>urn:sha1:e46c6cbfb0f6735ca35f1150338c300f3c9c18fe</id>
<content type='text'>
049c9633ed made TextureHeaderIndex take index / 32 for any texture index past the
pool that is a multiple of 32, in VisitImageView and in the shader environment.
That was written for Switch 2 handles that hold a header byte offset, but it ran
for Switch 1 games too, where such an out-of-range index used to give a null view
(and fail the shader environment's range check) and now binds an unrelated
header. Pass whether the memory manager uses native tiling, which is how Switch 2
titles are set up, and keep the previous behaviour otherwise.

Follow-up to 049c9633ed.

Assisted-by: Claude Sonnet 5.5 (implementation and commit message)
</content>
</entry>
<entry>
<title>nx2: capture and lower native shader programs once</title>
<updated>2026-11-01T23:11:25+00:00</updated>
<author>
<name>kraibse</name>
<email>33869366+kraibse@users.noreply.github.com</email>
</author>
<published>2026-11-01T02:20:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=10e70639058b9adc4f7fc77e11982bb834fce86b'/>
<id>urn:sha1:10e70639058b9adc4f7fc77e11982bb834fce86b</id>
<content type='text'>
Native programs were captured and lowered when their ShaderInfo was
made and again for every environment built for their pipelines. The
ShaderInfo now keeps the lowered code and the environments adopt it.
Capture also reads a 4 KiB page at a time instead of flushing caches per
instruction, and cached native programs fold bank 1 reads like live ones.

Ported from Wael3rd/Eglantine-MKW (0ae093058e, 65a6aa877a, df076133c4).

Assisted-by: Claude Sonnet 5.5 (porting the fixes)
(cherry picked from commit 3af11ac401ad3061c183281d8c98c16c1d6da456)
</content>
</entry>
<entry>
<title>Merge remote-tracking branch 'origin/fix/nx2-texture-header-offset-handles' into test/linux-all-prs</title>
<updated>2026-11-01T18:26:13+00:00</updated>
<author>
<name>Takoroka</name>
<email>137927095+Takoroka@users.noreply.github.com</email>
</author>
<published>2026-11-01T18:26:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=b91817655ac7e72ae871ff668cea49da8082035e'/>
<id>urn:sha1:b91817655ac7e72ae871ff668cea49da8082035e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>video_core: draw Switch 2 task/mesh pipelines with VK_EXT_mesh_shader</title>
<updated>2026-11-01T16:29:30+00:00</updated>
<author>
<name>Takoroka</name>
<email>137927095+Takoroka@users.noreply.github.com</email>
</author>
<published>2026-10-30T09:02:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=02504aeb37cb3ee07dc421acc0570ad5ba25d53f'/>
<id>urn:sha1:02504aeb37cb3ee07dc421acc0570ad5ba25d53f</id>
<content type='text'>
While SET_MESH_CONTROL is on, a native draw binds a task program in the
vertex slot, its mesh program in the tessellation slot and a header-only
pass-through geometry program naming the per-primitive outputs. Translate
the first two as task and mesh programs with the mesh registers
(SET_MESH_SHADER_A/B, SET_MESH_INIT_SHADER) and that header, key their
pipelines by them, and build pipelines with task/mesh stages and no
vertex input, input assembly or tessellation state. The draw's vertex
count is the number of task workgroups: record vkCmdDrawMeshTasksEXT.
Enable VK_EXT_mesh_shader (task and mesh only) when the host has it; draws
are skipped without it, as they were before.
</content>
</entry>
<entry>
<title>nx2: read texture handles that hold a header byte offset</title>
<updated>2026-10-31T14:31:41+00:00</updated>
<author>
<name>Takoroka</name>
<email>137927095+Takoroka@users.noreply.github.com</email>
</author>
<published>2026-10-31T14:31:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=049c9633edd9b3f7eaed6b4b3a18a4ead0cd18b7'/>
<id>urn:sha1:049c9633edd9b3f7eaed6b4b3a18a4ead0cd18b7</id>
<content type='text'>
Switch Sports' scenery shaders take their 64-bit texture handles from a uniform
register, and the texture part of those handles is the header's byte offset in the
pool (index * 32), not its index: 0x96e46000 names header 8960 (a 640x152 2D
texture), while the plain reading, 286720, runs far past the 33067-entry pool. Eden
skipped them at draw time (null view) and built the shaders for a garbage header, so
the island's ground, cliffs and buildings drew black.

When a handle's index falls past the pool but index / 32 lands inside it, take that
header, both when building the shader and when binding the view. Handles that
already resolve keep their meaning.
</content>
</entry>
<entry>
<title>nx2: log per-call GPU memory, syncpoint and shader lowering lines at debug level</title>
<updated>2026-10-30T03:33:03+00:00</updated>
<author>
<name>Takoroka</name>
<email>137927095+Takoroka@users.noreply.github.com</email>
</author>
<published>2026-10-30T03:33:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=1eb97beca0e7ca4998a24dd57aaddfedd2224947'/>
<id>urn:sha1:1eb97beca0e7ca4998a24dd57aaddfedd2224947</id>
<content type='text'>
GPU memory registration (gpu sub 101) and mapping (211) alone wrote two
info lines per allocation, about 80% of every Switch 2 log (27,000 lines
in five minutes of Mario Kart World), with slot jobs, semaphore pages,
GPU-only region words, syncpoint waits and each lowered shader on top.
They are still there at debug level; one-time messages, the GPU-only
region backing and every warning about unexpected requests stay as
they were.
</content>
</entry>
<entry>
<title>IMAD.SHL as a shift; EDEN_NX2_REJECT; log where rejected programs are bound</title>
<updated>2026-10-28T18:44:18+00:00</updated>
<author>
<name>Takoroka</name>
<email>137927095+Takoroka@users.noreply.github.com</email>
</author>
<published>2026-10-28T18:44:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=8f59920970674c47dcce8866d3e0659ef91a81b4'/>
<id>urn:sha1:8f59920970674c47dcce8866d3e0659ef91a81b4</id>
<content type='text'>
- IMAD by a power of two lowers to SHL imm, the form Eden's jump-table
  tracking expects (a title 1 compute program failed "track indirect branch").
- EDEN_NX2_REJECT=&lt;hex addresses&gt;: treat those native programs as rejected,
  to bisect a behaviour change without rebuilding.
- A rejected graphics program logs its stage slot, header and slot registers
  once (for the task/mesh pipeline setup).
- Notes: rows 87-92, title 1 status.
</content>
</entry>
<entry>
<title>nx2: title 4's intro cutscene renders correctly</title>
<updated>2026-10-28T06:57:31+00:00</updated>
<author>
<name>Takoroka</name>
<email>137927095+Takoroka@users.noreply.github.com</email>
</author>
<published>2026-10-28T06:57:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=f7be55dbf1a313382a28bca067960a0fae95227f'/>
<id>urn:sha1:f7be55dbf1a313382a28bca067960a0fae95227f</id>
<content type='text'>
Native shader capture counted CALL.REL.NOINC as a function call, so a program
using it waited for a RET after its EXIT and read on into the following
shaders until a garbage branch target made it fail. NOINC calls push no
return address (the compiler uses them as jumps; the lowering already treats
them so): count them as forward branches.

That shader builds title 4's 3D colour-grading LUT once per scene; with it
rejected the LUT stayed empty and the tonemap turned every frame black. The
intro cutscene now renders lit and graded, with subtitles, through the
bilinear stand-in for the tensor-core upscaler.

Also: rejected captures dump to EDEN_NX2_SHADER_DUMP as rejected-&lt;addr&gt;.bin
and report the offending instruction.
</content>
</entry>
<entry>
<title>Switch 2: Turing macros, native compute, Ampere shader lowering, native tiling</title>
<updated>2026-10-28T02:26:16+00:00</updated>
<author>
<name>Takoroka</name>
<email>137927095+Takoroka@users.noreply.github.com</email>
</author>
<published>2026-10-28T02:26:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=51207c73c889dbdc4a586a5da23314f6d33e4eb9'/>
<id>urn:sha1:51207c73c889dbdc4a586a5da23314f6d33e4eb9</id>
<content type='text'>
From changes.patch: the TU104/GA10x MME interpreter (shared macro context for
the process's channels, also on the compute class), native compute with QMD
3.0 dependency scheduling, the Ampere-to-Maxwell shader lowering, native
vertex stream sizes, and the console's GOB swizzle for textures, DMA copies
and the host unswizzle shaders. Switch 2 channels turn all of it on at init.

The lowering is widened for title 4 (all 32 of its programs lower): general
TEX (any dimension/LOD/mask, operand split 1+1/2+1/2+2/4+n, any but consistent
descriptor buffer), cube/array, SULD channel masks, 128-bit STG, indexed IPA,
VOTE, SHFL with any immediate or predicate output, R2P/P2R byte select,
uniform ULOP3/ULEA/UBREV/UFLO.SH/UISETP signed/UMOV URZ, IMNMX cbuf, IADD3
and FFMA uniform operands, FMUL /4 /8 x8, and BSSY/BSYNC/BREAK/WARPSYNC as
no-ops. The capture stops at unmapped memory. EDEN_NX2_SHADER_DUMP dumps every
native program; tools in C:\dev\nx2work test the lowering offline.
</content>
</entry>
</feed>
