Skip to content

Readback: Only scale a framebuffer down when it's rendered bigger than maxScaleFactor - #22473

Merged
hrydgard merged 1 commit into
masterfrom
readback-maxres-crop
Oct 9, 2026
Merged

hrydgard merged 1 commit into
masterfrom
readback-maxres-crop

Conversation

@hrydgard

@hrydgard hrydgard commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Claude says

ReadFramebufferForDebug scaled the buffer down, cropped to its drawn size, whenever the render width was more than the drawn width times maxScaleFactor. At 1x that's any buffer wider than what has been drawn in it, though nothing needs scaling.

Headless compares at maxScaleFactor 1, so this cut off most of the screen in Gangs of London, which draws a 256 px wide region.

Now it only scales down when the render scale is above maxScaleFactor, and then scales the whole buffer, since a display at an offset can sit past the drawn width.

…caleFactor

ReadFramebufferForDebug scaled the buffer down, cropped to its drawn size,
whenever the render width was more than the drawn width times maxScaleFactor.
At 1x that's any buffer wider than what has been drawn in it, though nothing
needs scaling.

Headless compares at maxScaleFactor 1, so this cut off most of the screen in
Gangs of London, which draws a 256 px wide region: its dumps went from 78 to
62,017 pixels differing from the PSP.

Now it only scales down when the render scale is above maxScaleFactor, and
then scales the whole buffer, since a display at an offset can sit past the
drawn width.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hrydgard hrydgard added this to the v1.21 milestone Oct 9, 2026
@hrydgard hrydgard added the GE emulation Backend-independent GPU issues label Oct 9, 2026
@hrydgard hrydgard changed the title Read back a framebuffer scaled down to maxScaleFactor only when it's rendered above it Readback: Only scale a framebuffer down when it's rendered above maxScaleFactor Oct 9, 2026
@hrydgard hrydgard changed the title Readback: Only scale a framebuffer down when it's rendered above maxScaleFactor Readback: Only scale a framebuffer down when it's rendered bigger than maxScaleFactor Oct 9, 2026
@hrydgard
hrydgard merged commit 0c19569 into master Oct 9, 2026
27 checks passed
@hrydgard
hrydgard deleted the readback-maxres-crop branch October 9, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GE emulation Backend-independent GPU issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant