mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Merge pull request #7406 from AdmiralCurtiss/xfb_rect_scale_from_ram
Correctly adjust the rendered XFB region at non-native internal resolutions when XFB was loaded from console RAM.
This commit is contained in:
commit
ce9e9186f7
@ -676,7 +676,16 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, const
|
||||
m_last_xfb_ticks = ticks;
|
||||
|
||||
auto xfb_rect = texture_config.GetRect();
|
||||
xfb_rect.right -= EFBToScaledX(fbStride - fbWidth);
|
||||
|
||||
// It's possible that the returned XFB texture is native resolution
|
||||
// even when we're rendering at higher than native resolution
|
||||
// if the XFB was was loaded entirely from console memory.
|
||||
// If so, adjust the rectangle by native resolution instead of scaled resolution.
|
||||
const u32 native_stride_width_difference = fbStride - fbWidth;
|
||||
if (texture_config.width == xfb_entry->native_width)
|
||||
xfb_rect.right -= native_stride_width_difference;
|
||||
else
|
||||
xfb_rect.right -= EFBToScaledX(native_stride_width_difference);
|
||||
|
||||
m_last_xfb_region = xfb_rect;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user