mirror of https://github.com/PCSX2/pcsx2.git
GSDX-TC: Pass merged output size for scaling
Passes the merged output circuit as the base size for texture cache scaling code. Helps fixing scaling issues where games use both of the output circuits for rendering. Future Note: Alter the behavior of IsEnabled() check always preferring the second output circuit for some weird reason. I plan on changing it to a better auto-output circuit selection mechanism but that could probably be done some time in the future.
This commit is contained in:
parent
761ce60a8e
commit
b56ff3fce7
plugins/GSdx
|
@ -405,7 +405,7 @@ GSVideoMode GSState::GetVideoMode()
|
||||||
return videomode;
|
return videomode;
|
||||||
}
|
}
|
||||||
|
|
||||||
GSVector4i GSState::GetDisplayRect(int i)
|
GSVector4i GSState::GetDisplayRect(int i, bool merged_rect)
|
||||||
{
|
{
|
||||||
if(i < 0) i = IsEnabled(1) ? 1 : 0;
|
if(i < 0) i = IsEnabled(1) ? 1 : 0;
|
||||||
|
|
||||||
|
@ -433,8 +433,16 @@ GSVector4i GSState::GetDisplayRect(int i)
|
||||||
rectangle.right = rectangle.left + width;
|
rectangle.right = rectangle.left + width;
|
||||||
rectangle.bottom = rectangle.top + height;
|
rectangle.bottom = rectangle.top + height;
|
||||||
|
|
||||||
// Useful for debugging games:
|
if ((m_regs->PMODE.EN1 & m_regs->PMODE.EN2) && merged_rect)
|
||||||
//printf("DW: %d , DH: %d , left: %d , right: %d , top: %d , down: %d , MAGH: %d , MAGV: %d\n", m_regs->DISP[i].DISPLAY.DW, m_regs->DISP[i].DISPLAY.DH, r.left, r.right, r.top, r.bottom , m_regs->DISP[i].DISPLAY.MAGH,m_regs->DISP[i].DISPLAY.MAGV);
|
{
|
||||||
|
GSVector4i opposite_output = GetDisplayRect(!i);
|
||||||
|
GSVector4i r_intersect = opposite_output.rintersect(rectangle);
|
||||||
|
GSVector4i r_union = opposite_output.runion_ordered(rectangle);
|
||||||
|
|
||||||
|
if(!(r_intersect.width() && r_intersect.height()) ||
|
||||||
|
r_intersect.xyxy().eq(r_union.xyxy()))
|
||||||
|
return r_union;
|
||||||
|
}
|
||||||
|
|
||||||
return rectangle;
|
return rectangle;
|
||||||
}
|
}
|
||||||
|
|
|
@ -242,7 +242,7 @@ public:
|
||||||
|
|
||||||
void ResetHandlers();
|
void ResetHandlers();
|
||||||
|
|
||||||
GSVector4i GetDisplayRect(int i = -1);
|
GSVector4i GetDisplayRect(int i = -1, bool merged_rect = false);
|
||||||
GSVector4i GetFrameRect(int i = -1);
|
GSVector4i GetFrameRect(int i = -1);
|
||||||
GSVideoMode GetVideoMode();
|
GSVideoMode GetVideoMode();
|
||||||
|
|
||||||
|
|
|
@ -414,8 +414,8 @@ void GSTextureCache::ScaleTexture(GSTexture* texture)
|
||||||
|
|
||||||
if (custom_resolution)
|
if (custom_resolution)
|
||||||
{
|
{
|
||||||
int width = m_renderer->GetDisplayRect().width();
|
int width = m_renderer->GetDisplayRect(-1, true).width();
|
||||||
int height = m_renderer->GetDisplayRect().height();
|
int height = m_renderer->GetDisplayRect(-1, true).height();
|
||||||
int real_height = static_cast<int>(round(m_renderer->GetInternalResolution().y / texture->GetScale().y));
|
int real_height = static_cast<int>(round(m_renderer->GetInternalResolution().y / texture->GetScale().y));
|
||||||
|
|
||||||
// Fixes offset issues on Persona 3 (512x511) where real value of height is 512
|
// Fixes offset issues on Persona 3 (512x511) where real value of height is 512
|
||||||
|
|
Loading…
Reference in New Issue