mirror of https://github.com/PCSX2/pcsx2.git
Merge pull request #1693 from ssakash/framebuff
GSDX: Pass total height of framebuffer on GetOutput()
This commit is contained in:
commit
648cc2bb39
|
@ -169,7 +169,7 @@ GSTexture* GSRendererCL::GetOutput(int i, int& y_offset)
|
||||||
const GSRegDISPFB& DISPFB = m_regs->DISP[i].DISPFB;
|
const GSRegDISPFB& DISPFB = m_regs->DISP[i].DISPFB;
|
||||||
|
|
||||||
int w = DISPFB.FBW * 64;
|
int w = DISPFB.FBW * 64;
|
||||||
int h = GetFrameRect(i).height();
|
int h = GetFramebufferHeight();
|
||||||
|
|
||||||
// TODO: round up bottom
|
// TODO: round up bottom
|
||||||
|
|
||||||
|
|
|
@ -345,7 +345,7 @@ GSTexture* GSRendererCS::GetOutput(int i, int& y_offset)
|
||||||
const GSRegDISPFB& DISPFB = m_regs->DISP[i].DISPFB;
|
const GSRegDISPFB& DISPFB = m_regs->DISP[i].DISPFB;
|
||||||
|
|
||||||
int w = DISPFB.FBW * 64;
|
int w = DISPFB.FBW * 64;
|
||||||
int h = GetFrameRect(i).height();
|
int h = GetFramebufferHeight();
|
||||||
|
|
||||||
// TODO: round up bottom
|
// TODO: round up bottom
|
||||||
|
|
||||||
|
|
|
@ -219,7 +219,7 @@ GSTexture* GSRendererHW::GetOutput(int i, int& y_offset)
|
||||||
|
|
||||||
GSTexture* t = NULL;
|
GSTexture* t = NULL;
|
||||||
|
|
||||||
if(GSTextureCache::Target* rt = m_tc->LookupTarget(TEX0, m_width, m_height, GetFrameRect(i).height()))
|
if(GSTextureCache::Target* rt = m_tc->LookupTarget(TEX0, m_width, m_height, GetFramebufferHeight()))
|
||||||
{
|
{
|
||||||
t = rt->m_texture;
|
t = rt->m_texture;
|
||||||
|
|
||||||
|
|
|
@ -165,7 +165,7 @@ GSTexture* GSRendererSW::GetOutput(int i, int& y_offset)
|
||||||
const GSRegDISPFB& DISPFB = m_regs->DISP[i].DISPFB;
|
const GSRegDISPFB& DISPFB = m_regs->DISP[i].DISPFB;
|
||||||
|
|
||||||
int w = DISPFB.FBW * 64;
|
int w = DISPFB.FBW * 64;
|
||||||
int h = GetFrameRect(i).height();
|
int h = GetFramebufferHeight();
|
||||||
|
|
||||||
// TODO: round up bottom
|
// TODO: round up bottom
|
||||||
|
|
||||||
|
|
|
@ -473,6 +473,20 @@ GSVector4i GSState::GetFrameRect(int i)
|
||||||
return rectangle;
|
return rectangle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int GSState::GetFramebufferHeight()
|
||||||
|
{
|
||||||
|
const GSVector4i output[2] = { GetFrameRect(0), GetFrameRect(1) };
|
||||||
|
// Framebuffer height is 11 bits max according to GS user manual
|
||||||
|
const int height_limit = (1 << 11);
|
||||||
|
int max_height = std::max(output[0].height(), output[1].height());
|
||||||
|
int frame_memory_height = std::max(max_height, output[0].runion_ordered(output[1]).height() % height_limit);
|
||||||
|
|
||||||
|
if (frame_memory_height > 1024)
|
||||||
|
GL_PERF("Massive framebuffer height detected! (height:%d)", frame_memory_height);
|
||||||
|
|
||||||
|
return frame_memory_height;
|
||||||
|
}
|
||||||
|
|
||||||
bool GSState::IsEnabled(int i)
|
bool GSState::IsEnabled(int i)
|
||||||
{
|
{
|
||||||
ASSERT(i >= 0 && i < 2);
|
ASSERT(i >= 0 && i < 2);
|
||||||
|
|
|
@ -242,6 +242,7 @@ public:
|
||||||
|
|
||||||
void ResetHandlers();
|
void ResetHandlers();
|
||||||
|
|
||||||
|
int GetFramebufferHeight();
|
||||||
GSVector4i GetDisplayRect(int i = -1, bool merged_rect = false);
|
GSVector4i GetDisplayRect(int i = -1, bool merged_rect = false);
|
||||||
GSVector4i GetFrameRect(int i = -1);
|
GSVector4i GetFrameRect(int i = -1);
|
||||||
GSVideoMode GetVideoMode();
|
GSVideoMode GetVideoMode();
|
||||||
|
|
Loading…
Reference in New Issue