Repository navigation
Description
Symptom
Since main's uniform read bound (26062f9e, from #1860), Ocarina of Time draws long white streaks from the horses at Lon Lon Ranch and from Link's slingshot. Parts of the slingshot and of the ReDeads' faces also flicker, dropping out for a frame and coming back. With the bound off, all of it is gone.
with #2219
CleanShot.2026-11-10.at.10.26.15.mp4
How it can look
- Long white or coloured lines, spikes or stretched polygons from a model to one point of the screen, mostly on animated models: the horses and Epona at Lon Lon Ranch, and Link's slingshot when aimed.
- Parts of a model missing for a frame and coming back, like the slingshot's tips or the ReDeads' faces, which looks like flicker.
- Possibly more of the white clouds over the ground mist from Ocarina of Time (Mac): white clouds over the ground mist on the way between Kokiri Forest and Hyrule Field. The mist shader
5ad65c0eefd09c7fdivides by its zero density sum, and the bloom spreads the NaNÂ #1839.
There's no [RED] line. The quickest check is a build from before 26062f9e, or with #2219.
In the host, this is main's uniform read bound for constant buffers: the zero padding of short bindings (ub_padded) and the size table at bank 25 (DMSH_CBSIZE_BANK) for reads at computed offsets. The Switch 2's NVN (NVN2) doesn't seem to stop a read at the size passed to nvnCommandBufferBindUniformBuffer.
Setup
- MacBook Pro M5 Max, macOS 27.0,
0400486024DEC000v131072. - My own branch: main from this morning plus some changes of my own. The bound code is main's, unchanged.
What we tested
We ran three variants of the bound in the same places:
| Bound | Stretching | Flicker |
|---|---|---|
| main's, the size the game binds | yes | yes |
| the size taken as 4-byte words, at most 64 KB | gone | still on the slingshot and the ReDeads' faces |
none, as before 26062f9e |
gone | gone |
Two things pointed at the words idea first. The mesh shaders read up to 16,384 bytes of slots bound with 4,096, and pixel shaders read up to 20,480 of 5,120, which is exactly 4× in both cases. But with the words bound, 5,179 slots across 465 shaders could still read past it at computed offsets, and the flicker stayed. The bound sizes themselves are 16, 64, 256 and 1,024 bytes, which look like plain byte sizes.
So it looks like the Switch 2 doesn't stop a uniform read at the size the game binds, and the game relies on that. Switch 1 games like Paper Mario do need the bound, so I'd keep it for them.
Related
- Ocarina of Time (Mac): white clouds over the ground mist on the way between Kokiri Forest and Hyrule Field. The mist shader
5ad65c0eefd09c7fdivides by its zero density sum, and the bloom spreads the NaN #1839, the white clouds over the ground mist: with the bound on, we saw them too, and turning it off cleared them in our build. That issue was reported before the bound existed, though, so its root cause is the game's own divide by zero, which A NaN colour at alpha 0 is returned as 0, as NVIDIA's blender takes a zero factor: Ocarina of Time's white clouds over the ferns are gone #2030 fixes. - The uniform bounds guard (26062f9e) halves Donkey Kong Bananza's frame rate on an M4: 55 → 30 fps #2066: the bound's cost in Donkey Kong Bananza, also a Switch 2 game.
- Bound translated fragment uniform reads to the NVN binding length #1909: another PR that bounds pixel shader uniform reads.
I've opened #PR to turn the bound off for Switch 2 games.

Activity
The symptom index, the uniform bound's entry and Ocarina of Time's no…
[-]Ocarina of Time (Switch 2): vertices stretch and flicker with the uniform read bound on (26062f9e)[/-][+]Ocarina of Time (Switch 2): vertices streak to the origin and models flicker or drop out with the uniform read bound on (26062f9e)[/+]The symptom index, the uniform bound's entry and Ocarina of Time's no…
fix: a Switch 2 game's uniform reads are not bounded by the size it b…
A uniform slot is bounded at its bound size rounded up to 256 bytes, …
seedds commentedon Nov 11, 2026
Thanks for the report and the three-way test, which narrowed this a lot.
What I found. The Switch 2's driver does give the GPU a size for each uniform binding, so the bound itself exists there too. But both drivers round that size up to 256 bytes first, and the host did not:
nbytessdk,nvnCommandBufferBindUniformBufferat 0x67bc80((n + 0xff) >> 8) << 20sdk, 0x467170(n + 0xff) & ~0xffSo a read between the bound size and the next multiple of 256 gets the memory there on the console, and got 0 on the host. Ocarina binds 16, 64, 144, 192, 464, 976, 16,960 and 41,600 bytes, all of which this changes.
What changed. 1d090a6 on main rounds the size up to 256 for both parts of the bound (the zero-padded copy and the size table), for every game. No shader rebuild is needed.
What I do not know. I could not reproduce the streaks or the flicker on my Mac, with or without the change: the slingshot aimed at Link's house and the ReDeads in adult Castle Town both drew correctly, on the older form of the bound and on main. So I cannot say this fixes it. It does not change your 4,096-byte slots read up to 16,384, which are already multiples of 256; if those are the cause, the streaks will remain.
Could you retest on main (1d090a6 or later), plain, without #2219? If the streaks or the flicker are still there, these would pin it:
uniform slot N of shader K (stage S) is bound with B bytes (R readable, a multiple of 256) and read up to byte E at fixed offsets, from a run that shows the streaks at the horses or with the slingshot;The issue stays open until then.
A uniform slot is bounded at its bound size rounded up to 256 bytes, …
Merge branch 'pr-2219' into oot-stack
Know-It-All-Brother commentedon Nov 12, 2026
I'm closing this because the cause was in my build, not in main. I tested on main and didn't see the streaks or the flicker.
Root cause. My build carried an older fast path from another fork, which handles a draw that only rebinds uniform buffers by copying the shader's previous argument table and rewriting just the uniform slots. It was written before the uniform read bound (26062f9), so it didn't know about either part of it:
This also explains the three-way test above. Taking sizes as 4-byte words made the stale sizes big enough to hide most of it, and turning the bound off hid all of it, which is why #2219 looked like a fix. I've closed #2219. Main's own version of that path (adaff73,
args_cbuf_only) rewrites the size table, so main doesn't have this bug.Thanks @seedds for digging into the drivers, and to everyone who tested.