Repository navigation
Conversation
3656123 to
1998e81
Compare
|
Thanks. I tried this on current main and it conflicts with main's newer handling of depth readers: |
…Country: Tropical Freeze Its depth reads in place give wrong tiles under Apple's lossless compression (seedds#676): background rectangles flicker. fb_prepare gives such a draw a copy of the depth attachment from the snapshot cache. The copy ends the pass, so it is on by default only in that game; elsewhere a draw that only reads depth stays in its pass, as main's depth-reader handling (seedds#988, seedds#1068) and t_feedback expect. DM_NVN_FB_DEPTH=1/0 forces it on or off; t_feedback covers both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1998e81 to
587542b
Compare
|
Thanks, you're right: with the copy on, those |
|
@nobz226 a heads-up, since I'd like to build on this. In Ocarina of Time about 72 of 175 render passes a frame end because shaders that read textures through the texture pool count as depth readers (#1385; counters and an opt-in narrowing in draft #1396). The narrowing can't help there: the game registers a view of its own depth buffer in the pool those draws read. A throwaway build that never ends those passes (unsound, measurement only) took frame p50 from 33.7 to 27.4 ms on an M4. Giving those draws a copy of the depth, the way this PR does for draws that sample the depth attachment, looks like the sound way to get that back: about 4 copies a frame instead of 72 pass ends. Pool reads would need the table entries of the depth's IDs to point at the copy, so the change is larger. I'm starting on it as a follow-up stacked on this PR, with credit. If you're already extending it to pool reads, say so and I'll test yours instead. Drafted with Claude; reviewed by me. |
|
@nobz226 an update on what I said above: I built the pool-table snapshot on top of this PR (the pool draws read a copy of the depth through their tables instead of ending the pass). It's sound, but in Ocarina of Time it gains nothing over lunks's #1430, which removes the same passes without copies (frame p50 −5.0 ms for the snapshot against −5.6 ms for #1430, same run), so I'm not opening it. The numbers are on #1430. This PR stands on its own; thanks for it. Drafted with Claude; reviewed by me. |
|
Main now has a general depth rule,
A draw that samples the depth attachment first in its pass, before anything in that pass writes it, still reads it directly. If Note also that Could you run Tropical Freeze on current main at levels 1-3, 2-1, 2-2 and the world 1 boss? Please post:
I don't have the game on this side to check. |
What and why
Part of #676: the flickering background rectangles. The audio half is #894.
Donkey Kong Country: Tropical Freeze draws rectangles or squares flickering over the background in levels 1-3, 2-1, 2-2 and the world 1 boss.
Two fragment shaders (
976bc74475e9443b,dbd64ad1611ed4c9) sample the 1920×1080 Depth32Float buffer attached to their own pass.fb_prepareonly handled colour attachments. Turning off lossless compression on that one buffer cleared the picture but cost frame rate, about 50 fps instead of 60 at the boss.DM_NVN_UNWRITTEN_DC=0did not clear it.fb_preparenow gives such a draw a copy of the depth buffer from the existing snapshot cache, for a single-level, single-layer 2D view, including a swizzled view of the buffer (Breath of the Wild samples its depth that way).DM_NVN_FB_DEPTH=0turns it off.I don't know why compression makes the direct read wrong. The link comes from these tests and the pass dump.
Checked
make -C dm/gfx/tests GAME=0100C1F0051B6000 check_t_feedback: 69 checks, 0 failed. It has no depth case, so this path has no test of its own.0100C1F0051B6000, v131072, including the world 1 boss. The player reports it looks and plays right. The worst 300-frame median was 17.4 ms, against about 20.9 ms with compression off on all textures. The log shows the snapshot taken on both shaders.a662f29eplusc692ba05), 30 fps as set, no crash or red line in that session. That shows the view path running; it does not show it was needed there.scripts/regress.py: not run, although this touches a path every game uses.Docs
docs/reference/rendering.mdand the game note,docs_symptoms.pywas run, and the switch is indocs/env_switches.tsv🤖 Generated with Claude Code