OGL: Support stereoscopic XFB blit to screen.
This commit is contained in:
parent
12412ac5b7
commit
a9364cd5db
|
@ -1270,6 +1270,22 @@ void Renderer::ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaE
|
||||||
ClearEFBCache();
|
ClearEFBCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Renderer::BlitScreen(TargetRectangle src, TargetRectangle dst, GLuint src_texture, int src_width, int src_height)
|
||||||
|
{
|
||||||
|
if (g_ActiveConfig.iStereoMode == STEREO_SBS || g_ActiveConfig.iStereoMode == STEREO_TAB)
|
||||||
|
{
|
||||||
|
TargetRectangle leftRc, rightRc;
|
||||||
|
ConvertStereoRectangle(dst, leftRc, rightRc);
|
||||||
|
|
||||||
|
m_post_processor->BlitFromTexture(src, leftRc, src_texture, src_width, src_height, 0);
|
||||||
|
m_post_processor->BlitFromTexture(src, rightRc, src_texture, src_width, src_height, 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_post_processor->BlitFromTexture(src, dst, src_texture, src_width, src_height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Renderer::ReinterpretPixelData(unsigned int convtype)
|
void Renderer::ReinterpretPixelData(unsigned int convtype)
|
||||||
{
|
{
|
||||||
if (convtype == 0 || convtype == 2)
|
if (convtype == 0 || convtype == 2)
|
||||||
|
@ -1473,8 +1489,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co
|
||||||
|
|
||||||
sourceRc.right -= fbStride - fbWidth;
|
sourceRc.right -= fbStride - fbWidth;
|
||||||
|
|
||||||
// TODO: Virtual XFB stereoscopic 3D support.
|
BlitScreen(sourceRc, drawRc, xfbSource->texture, xfbSource->texWidth, xfbSource->texHeight);
|
||||||
m_post_processor->BlitFromTexture(sourceRc, drawRc, xfbSource->texture, xfbSource->texWidth, xfbSource->texHeight, 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1483,19 +1498,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co
|
||||||
|
|
||||||
// for msaa mode, we must resolve the efb content to non-msaa
|
// for msaa mode, we must resolve the efb content to non-msaa
|
||||||
GLuint tex = FramebufferManager::ResolveAndGetRenderTarget(rc);
|
GLuint tex = FramebufferManager::ResolveAndGetRenderTarget(rc);
|
||||||
|
BlitScreen(targetRc, flipped_trc, tex, s_target_width, s_target_height);
|
||||||
if (g_ActiveConfig.iStereoMode == STEREO_SBS || g_ActiveConfig.iStereoMode == STEREO_TAB)
|
|
||||||
{
|
|
||||||
TargetRectangle leftRc, rightRc;
|
|
||||||
ConvertStereoRectangle(flipped_trc, leftRc, rightRc);
|
|
||||||
|
|
||||||
m_post_processor->BlitFromTexture(targetRc, leftRc, tex, s_target_width, s_target_height, 0);
|
|
||||||
m_post_processor->BlitFromTexture(targetRc, rightRc, tex, s_target_width, s_target_height, 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_post_processor->BlitFromTexture(targetRc, flipped_trc, tex, s_target_width, s_target_height);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||||
|
|
|
@ -91,6 +91,8 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void UpdateEFBCache(EFBAccessType type, u32 cacheRectIdx, const EFBRectangle& efbPixelRc, const TargetRectangle& targetPixelRc, const u32* data);
|
void UpdateEFBCache(EFBAccessType type, u32 cacheRectIdx, const EFBRectangle& efbPixelRc, const TargetRectangle& targetPixelRc, const u32* data);
|
||||||
|
|
||||||
|
void BlitScreen(TargetRectangle src, TargetRectangle dst, GLuint src_texture, int src_width, int src_height);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue