Repository navigation
Recreate frame buffers when the pixel size changes (Mario Tennis shadows) - #2992
Open
JoeysRetroHandhelds wants to merge 1 commit into
Open
JoeysRetroHandhelds wants to merge 1 commit into
JoeysRetroHandhelds wants to merge 1 commit into
Conversation
…ows) Mario Tennis draws each player's shadow into a small aux buffer: it fills the buffer as a 16-bit image, sets the same address as an 8-bit color image and draws the silhouette, then samples it as an I8 texture. saveBuffer kept the 16-bit buffer and only relabelled it 8-bit, so the silhouette went into an RGBA texture that the 8-bit (single channel) paths can't read: the shadow showed as a dark box, or as stripes when loaded from RDRAM, flickering between the two with async color copy. Now a pixel size change recreates the buffer with the right texture format and clears it with the fill color, as the relabel path did. Shadows match parallel-RDP.
JoeysRetroHandhelds
force-pushed
the
fix-mario-tennis-shadows
branch
from
November 6, 2026 04:07
c2d446b to
c3bddae
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mario Tennis draws each player's shadow into a small aux buffer: it fills the buffer as a 16-bit image, then sets the same address as an 8-bit color image, draws the silhouette, and samples it back as an I8 texture.
FrameBufferList::saveBufferkept the existing 16-bit buffer for the 8-bit color image and only relabelled it (m_size, textureformat/size), so the silhouette was drawn into an RGBA texture that the 8-bit (single channel) paths can't read. The shadow showed as a dark box, or as stripes when loaded from RDRAM, and flickered between the two with async color buffer copy.Change: when the pixel size of the current buffer changes, the buffer is removed and recreated (the same path a width or scale change already takes), so it gets the right texture format. Like the old relabel path, the new buffer is cleared with the fill color when only the pixel size changed. The
m_size < _sizecheck becomesm_size != _size, so a 16 -> 8 change is covered too.Testing: Mario Tennis (U) through the libretro core (mupen64plus-next) on Android: the shadows now match parallel-RDP, in both color copy modes. I've only checked Mario Tennis; other games that reuse a buffer at a different pixel size now get a new buffer instead of a relabelled one, so a wider check would be welcome.
src/FrameBuffer.cppon this branch (master a04081a + this commit) compiles cleanly with clang (NDK 27.3, arm64); I haven't run a full standalone build.