<feed xmlns='http://www.w3.org/2005/Atom'>
<title>eglantine-cirakg/src/shader_recompiler, 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-02T23:40:18+00:00</updated>
<entry>
<title>Merge pull request #304 from rdenno/fix/hw-shader-lowering</title>
<updated>2026-11-02T23:40:18+00:00</updated>
<author>
<name>Jonas</name>
<email>104419015+jojo-chaechae@users.noreply.github.com</email>
</author>
<published>2026-11-02T23:40:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=efa7c19e59839f0d464c2e9bd41f9ca8f867fef0'/>
<id>urn:sha1:efa7c19e59839f0d464c2e9bd41f9ca8f867fef0</id>
<content type='text'>
shader: lower F2I.F16, TLD/TLD4.F16 and partial-mask TXD (Hyrule Warriors black gameplay)</content>
</entry>
<entry>
<title>shader: drop the slots of a failed handle subtree with its code</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:29:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=0ed4a3a9e795896a4751d0330c78958a309d1aa0'/>
<id>urn:sha1:0ed4a3a9e795896a4751d0330c78958a309d1aa0</id>
<content type='text'>
When BuildHandleProgram failed on a subtree it truncated the code back to where
the subtree started, which removed the Tee ops of the values the subtree had
kept, but their entries stayed in g_handle_slots. A Phi tries its other inputs
after the first one fails; if one of them reused a value from the dropped
subtree, it emitted a Load of a slot that nothing wrote, so the handle read 0.

Number slots with a counter instead of counting map entries, and on failure
erase the entries numbered from the subtree's first slot on and rewind the
counter, so such a value is built again.

Follow-up to 561f87abec.

Assisted-by: Claude Sonnet 5.5 (implementation and commit message)
</content>
</entry>
<entry>
<title>shader: restore the handle build depth when a build throws</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:29:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=8b0666b74868da8221d9e3ef3995f3a862ee24b6'/>
<id>urn:sha1:8b0666b74868da8221d9e3ef3995f3a862ee24b6</id>
<content type='text'>
BuildHandleProgram incremented g_handle_depth and decremented it at the end, so
a NotImplementedException from BuildHandleNode left the thread-local depth above
zero. That thread never cleared g_handle_slots again, and stale IR::Inst* keys
from an earlier program could match instructions of a later one (a freed
instruction's address can be reused). Do the decrement and the outermost clear in
SCOPE_EXIT.

Follow-up to e23b0f2fab.

Assisted-by: Claude Sonnet 5.5 (implementation and commit message)
</content>
</entry>
<entry>
<title>shader: evaluate handle programs for image and texture buffer descriptors</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:28:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=bda49e810b5955bff8474e7b8f2b09eab51e9be2'/>
<id>urn:sha1:bda49e810b5955bff8474e7b8f2b09eab51e9be2</id>
<content type='text'>
561f87abec only gave TextureDescriptor a handle_program. Image load/store/atomics
and texture/image buffers whose handle comes from a storage buffer still got the
placeholder constant buffer address (index 0, offset 0), so the pipelines read
cbuf 0 word 0 as the handle (and asserted if cbuf 0 was unbound). Add
handle_program to TextureBufferDescriptor, ImageBufferDescriptor and
ImageDescriptor, compare it when merging, and let all four pipelines evaluate it
for every descriptor kind instead of only TextureDescriptor.

ImageQueryDimensions on such a handle was always declared Color2D, so array,
cube and 3D views got a 2D declaration. The instruction carries no type, so take
it from another instruction using the same handle program, falling back to
Color2D when there is none.

Follow-up to 561f87abec. The OpenGL pipeline edits are the same change as the
Vulkan ones but were not compiled here.

Assisted-by: Claude Sonnet 5.5 (implementation and commit message)
</content>
</entry>
<entry>
<title>shader: tell handle-program textures apart when adding descriptors</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:19:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=c83eb1d1f5c14d0842a165de431ac6367dff2909'/>
<id>urn:sha1:c83eb1d1f5c14d0842a165de431ac6367dff2909</id>
<content type='text'>
Every texture whose handle is computed per draw gets the same placeholder
constant buffer address (index 0, offset 0), and Descriptors::Add did not
compare handle_program. Two such textures of the same type and depth in one
shader therefore shared a descriptor, so the second sampled the first, and one
could also merge with a real texture bound at constant buffer 0 offset 0.
Compare handle_program too.

The pixel-format-integer lookup cached its last answer by (index, offset), which
has the same problem for handle programs; skip that cache for them.

Follow-up to 561f87abec.

Assisted-by: Claude Sonnet 5.5 (implementation and commit message)
</content>
</entry>
<entry>
<title>Merge branch 'nx2-experimental' into fix/hw-shader-lowering</title>
<updated>2026-11-02T14:26:01+00:00</updated>
<author>
<name>rdenno</name>
<email>rhysdenno@gmail.com</email>
</author>
<published>2026-11-02T14:26:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=2786bdf580e41bf0ba6e2a6452db73c4f5b97ed2'/>
<id>urn:sha1:2786bdf580e41bf0ba6e2a6452db73c4f5b97ed2</id>
<content type='text'>
nx2-experimental lowers partial-mask TXD as well (Splatoon Raiders).
Keep its RZ second destination and this branch's odd register for a
lone third channel; take its wider F2I mode check with the .H1 source.

Assisted-by: Claude Opus 5.5 (conflict resolution)
</content>
</entry>
<entry>
<title>shader: lower TXD with any channel mask</title>
<updated>2026-11-02T13:46:35+00:00</updated>
<author>
<name>rdenno</name>
<email>rhysdenno@gmail.com</email>
</author>
<published>2026-11-02T13:42:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=7ac108e2571d7cb39585c58994524131dd9d8c22'/>
<id>urn:sha1:7ac108e2571d7cb39585c58994524131dd9d8c22</id>
<content type='text'>
TXD was only lowered with all four channels (and rejected any
instruction without a second destination, as RZ &amp; 1 is set).
Hyrule Warriors: Age of Imprisonment's gradient-sampling programs
fetch one channel into Rd, or three channels with the third in the
second destination, and were rejected ("native gradient texture
mode"), so their draws were skipped.

Pass the channel mask on to Maxwell TXD. The first two enabled
channels go to Rd, Rd+1 and the others to the second destination;
when those aren't consecutive, write to scratch and move them as the
four-channel case already did.

Assisted-by: Claude Opus 5.5 (diagnosis, fix and testing)
</content>
</entry>
<entry>
<title>shader: lower TLD and TLD4 with half-precision results</title>
<updated>2026-11-02T13:46:35+00:00</updated>
<author>
<name>rdenno</name>
<email>rhysdenno@gmail.com</email>
</author>
<published>2026-11-02T13:07:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=8b8d0fc85f1267dc93d069c5a331c4f24ac3a835'/>
<id>urn:sha1:8b8d0fc85f1267dc93d069c5a331c4f24ac3a835</id>
<content type='text'>
TLD.SCR and TLD4 with .F16 (bit 79) return their components packed in
pairs: components 0 and 1 in Rd, 2 and 3 in the second destination.
The lowering rejected them ("native texel fetch mode", "native texture
gather mode"), so the compute programs using them never ran.

In Hyrule Warriors: Age of Imprisonment these are compute programs
that run once gameplay starts, and gameplay stayed black (the pause
menu, drawn another way, showed the scene).

Lower the F32 form into R248/R249 and R246/R247, then pack each pair
the way F2FP.PACK_AB is lowered.

Assisted-by: Claude Opus 5.5 (diagnosis, fix and testing)
</content>
</entry>
<entry>
<title>shader: lower F2I from a half with a sign or high-half selector</title>
<updated>2026-11-02T13:46:35+00:00</updated>
<author>
<name>rdenno</name>
<email>rhysdenno@gmail.com</email>
</author>
<published>2026-11-02T13:07:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=9e368c29181cfa0ce23cf61c9b5b654917842dd0'/>
<id>urn:sha1:9e368c29181cfa0ce23cf61c9b5b654917842dd0</id>
<content type='text'>
F2I from an F16 source was only lowered unsigned and from the low
half. F2I.F16 (signed, bit 72) and F2I.U32.F16 Rd, Rs.H1 (bits 60-61)
were rejected ("native float-to-integer conversion mode"); Hyrule
Warriors: Age of Imprisonment has 24 such programs.

Accept bit 72 as the other F2I forms do, and pick the high half for
.H1.

Assisted-by: Claude Opus 5.5 (diagnosis, fix and testing)
</content>
</entry>
<entry>
<title>Merge nx2 into nx2-experimental</title>
<updated>2026-11-02T13:43:01+00:00</updated>
<author>
<name>kraibse</name>
<email>33869366+kraibse@users.noreply.github.com</email>
</author>
<published>2026-11-02T12:50:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=c0cb3325e22756edb65c87d33ef298349ade0ad3'/>
<id>urn:sha1:c0cb3325e22756edb65c87d33ef298349ade0ad3</id>
<content type='text'>
Resolved by area:
- audio feature_support.h: nx2's native revision handling.
- fiber.cpp: ours, which also drops the unused rewind stack.
- host_memory.cpp: ours granule bitmap and HintCold, plus nx2's
  fallocate hole punching per whole dirty granule on Linux.
- texture_cache.h: nx2's old-age eviction pass, then our Collect().
- kepler_compute.cpp: shared upscale slots, then Fortune's Weave's,
  then the Kirby Air Riders scan.
- nx2_gsv.h: ours, plus nx2's GetBufferMaxResolution and graphics
  device ids (1-based).
- nvhost_ctrl_gpu.cpp: engine support flag bits 40-44.
- lower_to_maxwell.h: ours as the base, with nx2's seven lowering
  commits applied one at a time. Second texture descriptor buffers
  are read bindless in TEX, TLD.SCR (level zero) and SUST; FSEL
  keeps its operand modifiers; TXD takes any channel mask.

lower_to_maxwell.h lowers 837 Fortune's Weave and 1183 Mario Kart
World shader dumps with the same rejects as nx2 and ours (12 and 0).

Assisted-by: Claude Sonnet 5.5 (conflict analysis and drafting)
</content>
</entry>
</feed>
