mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
Renderer: Adjust source rectangle when crop would draw off screen
This prevents us from requiring an oversized and/or negative viewport by shrinking the source rectangle instead.
This commit is contained in:
@ -338,12 +338,14 @@ void Renderer::RenderXFBToScreen(const AbstractTexture* texture, const MathUtil:
|
||||
// Render to staging texture which is double the width of the backbuffer
|
||||
SetAndClearFramebuffer(m_3d_vision_framebuffer.get());
|
||||
|
||||
const auto target_rc = GetTargetRectangle();
|
||||
m_post_processor->BlitFromTexture(target_rc, rc, texture, 0);
|
||||
auto adjusted_rc = rc;
|
||||
auto target_rc = GetTargetRectangle();
|
||||
AdjustRectanglesToFitBounds(&target_rc, &adjusted_rc, m_backbuffer_width, m_backbuffer_height);
|
||||
m_post_processor->BlitFromTexture(target_rc, adjusted_rc, texture, 0);
|
||||
m_post_processor->BlitFromTexture(
|
||||
MathUtil::Rectangle<int>(target_rc.left + m_backbuffer_width, target_rc.top,
|
||||
target_rc.right + m_backbuffer_width, target_rc.bottom),
|
||||
rc, texture, 1);
|
||||
adjusted_rc, texture, 1);
|
||||
|
||||
// Copy the left eye to the backbuffer, if Nvidia 3D Vision is enabled it should
|
||||
// recognize the signature and automatically include the right eye frame.
|
||||
|
Reference in New Issue
Block a user