present: fix short-band letterbox for native display modes + UV edge bleed - #74
Merged
Merged
Conversation
Two present-path fixes: 1. The short GP1(07h)-band letterbox (MotK 128-line FMV) fired for any frame under 240 lines, which also catches games whose native display mode is short full-time (Xenogears runs 320x216): every 4:3 menu/load and every FMV got a ~10% vertical squash. No numeric threshold separates the cases (216 < 224 too), so split by purpose: 15-bit game frames never shrink (adjustment removed from gl_renderer_present_vram), and the FMV paths keep the correction only for genuinely windowed video bands (gl_renderer_present, and the SDL path gated on pin_43 && depth24_frame) with the band under 80% of the 240-line field. MotK's 128-line FMV keeps its aspect fix; native 216/224-line display modes fill the rect as before. 2. present_target_quad mapped quad corners to texel edges, so with GL_LINEAR the outermost dest pixels blend the border texel with neighboring VRAM outside the content rect (visible 1-2px edge stripes with linear present filtering, e.g. menu frames showing the adjacent framebuffer). Center-map the UVs with a half-texel inset; interior sampling is unchanged. Covers both callers (canonical VRAM present and wide-FBO present).
Merged
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.
Two independent present-path fixes, one commit each logical change.
1. Short-band letterbox squashes native short display modes
The short
GP1(07h)-band letterbox (for MotK's 128-line FMV) fired forany frame shorter than 240 lines. That also matches games whose native
display mode is short full-time — Xenogears runs 320×216 — so every 4:3
menu/load screen and every FMV got a ~10% vertical squash.
Fix, split by purpose:
gl_renderer_present_vramgl_renderer_present(depth24 CPU path) and the SDL present(
pin_43 && depth24_frame), and only for genuinely windowed video bands— under 80% of the 240-line field (
< 192). MotK's 128-line FMV keepsits aspect fix; native 216/224-line modes fill the rect as on hardware.
2. Present UV rect bleeds edge pixels with GL_LINEAR
present_target_quadmapped quad corners to texel edges. WithGL_LINEARand a scaled present, the outermost dest pixels blend the border texel with
whatever VRAM neighbors the content rect — visible 1–2 px stripes at image
edges with linear present filtering (e.g. menu frames showing columns of
the adjacent framebuffer at the right edge).
Fix: center-map the UVs with a half-texel inset
(
(x + 0.5) / tex_w…(x + w - 0.5) / tex_w). Edge samples stay insidethe content rect; interior sampling is unchanged. Covers both callers
(canonical VRAM present and wide-FBO present).
Verification
height again; 16:9 gameplay unchanged; edge stripes gone with linear
filtering on.
gl_renderer_presentkeeps the bandcorrection; only the band threshold moved to
< 192).