mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-23 06:15:38 +00:00
GPU: Fix 24-bit scanout being cut-off at >1x resolution scale
This commit is contained in:
parent
ba1a5a5ca9
commit
8ffce6ae0b
|
@ -474,12 +474,14 @@ void GPU_HW_OpenGL::UpdateDisplay()
|
||||||
// Because of how the reinterpret shader works, we need to use the downscaled version.
|
// Because of how the reinterpret shader works, we need to use the downscaled version.
|
||||||
if (m_GPUSTAT.display_area_color_depth_24 && m_resolution_scale > 1)
|
if (m_GPUSTAT.display_area_color_depth_24 && m_resolution_scale > 1)
|
||||||
{
|
{
|
||||||
|
const u32 copy_width = std::min<u32>((display_width * 4) / 3, VRAM_WIDTH - vram_offset_x);
|
||||||
|
const u32 scaled_copy_width = copy_width * m_resolution_scale;
|
||||||
m_vram_downsample_texture->BindFramebuffer(GL_DRAW_FRAMEBUFFER);
|
m_vram_downsample_texture->BindFramebuffer(GL_DRAW_FRAMEBUFFER);
|
||||||
m_vram_texture->BindFramebuffer(GL_READ_FRAMEBUFFER);
|
m_vram_texture->BindFramebuffer(GL_READ_FRAMEBUFFER);
|
||||||
glBlitFramebuffer(
|
glBlitFramebuffer(scaled_vram_offset_x, scaled_flipped_vram_offset_y, scaled_vram_offset_x + scaled_copy_width,
|
||||||
scaled_vram_offset_x, scaled_flipped_vram_offset_y, scaled_vram_offset_x + scaled_display_width,
|
|
||||||
scaled_flipped_vram_offset_y + scaled_display_height, vram_offset_x, flipped_vram_offset_y,
|
scaled_flipped_vram_offset_y + scaled_display_height, vram_offset_x, flipped_vram_offset_y,
|
||||||
vram_offset_x + display_width, flipped_vram_offset_y + display_height, GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
vram_offset_x + copy_width, flipped_vram_offset_y + display_height, GL_COLOR_BUFFER_BIT,
|
||||||
|
GL_NEAREST);
|
||||||
|
|
||||||
m_display_texture->BindFramebuffer(GL_DRAW_FRAMEBUFFER);
|
m_display_texture->BindFramebuffer(GL_DRAW_FRAMEBUFFER);
|
||||||
m_vram_downsample_texture->Bind();
|
m_vram_downsample_texture->Bind();
|
||||||
|
|
Loading…
Reference in a new issue