From 16fd75a828ac24c9e52a565c043735161eacb479 Mon Sep 17 00:00:00 2001 From: mkot Date: Tue, 6 Aug 2024 12:54:27 +0200 Subject: [PATCH] Only adjust view rect if it uses BackbufferRatio --- src/bgfx.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 3703fffe04..cadbb93b79 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -1413,7 +1413,6 @@ namespace bgfx viewRemap[m_viewRemap[ii] ] = ViewId(ii); View& view = m_view[ii]; - Rect rect(0, 0, uint16_t(m_resolution.width), uint16_t(m_resolution.height) ); if (isValid(view.m_fbh) ) { @@ -1425,20 +1424,17 @@ namespace bgfx if (BackbufferRatio::Count != bbRatio) { + Rect rect(0, 0, uint16_t(m_resolution.width), uint16_t(m_resolution.height) ); + getTextureSizeFromRatio(bbRatio, rect.m_width, rect.m_height); - } - else - { - rect.m_width = fbr.m_width; - rect.m_height = fbr.m_height; - } - } - view.m_rect.intersect(rect); + view.m_rect.intersect(rect); - if (!view.m_scissor.isZero() ) - { - view.m_scissor.intersect(rect); + if (!view.m_scissor.isZero() ) + { + view.m_scissor.intersect(rect); + } + } } }