mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-26 16:52:46 +01:00
OpenGL: Fix DisplayTransfer accel when input width != output width
Fixes #2246, #2261
This commit is contained in:
parent
4f0f88bc6a
commit
ba7f213655
1 changed files with 10 additions and 1 deletions
|
@ -715,7 +715,11 @@ bool RasterizerOpenGL::AccelerateDisplayTransfer(const GPU::Regs::DisplayTransfe
|
|||
|
||||
CachedSurface src_params;
|
||||
src_params.addr = config.GetPhysicalInputAddress();
|
||||
src_params.width = config.output_width;
|
||||
// It's important to use the correct source input width to properly skip over parts of the input
|
||||
// image which will be cropped from the output but still affect the stride of the input image.
|
||||
src_params.width = config.input_width;
|
||||
// Using the output's height is fine because we don't read or skip over the remaining part of
|
||||
// the image, and it allows for smaller texture cache lookup rectangles.
|
||||
src_params.height = config.output_height;
|
||||
src_params.is_tiled = !config.input_linear;
|
||||
src_params.pixel_format = CachedSurface::PixelFormatFromGPUPixelFormat(config.input_format);
|
||||
|
@ -736,6 +740,11 @@ bool RasterizerOpenGL::AccelerateDisplayTransfer(const GPU::Regs::DisplayTransfe
|
|||
return false;
|
||||
}
|
||||
|
||||
// Adjust the source rectangle to take into account parts of the input lines being cropped
|
||||
if (config.input_width > config.output_width) {
|
||||
src_rect.right -= (config.input_width - config.output_width) * src_surface->res_scale_width;
|
||||
}
|
||||
|
||||
// Require destination surface to have same resolution scale as source to preserve scaling
|
||||
dst_params.res_scale_width = src_surface->res_scale_width;
|
||||
dst_params.res_scale_height = src_surface->res_scale_height;
|
||||
|
|
Loading…
Reference in a new issue