FramebufferManager: Copy all EFB layers to the XFB framebuffer.
This commit is contained in:
parent
5526b39320
commit
12412ac5b7
|
@ -509,17 +509,20 @@ void XFBSource::CopyEFB(float Gamma)
|
||||||
g_renderer->ResetAPIState();
|
g_renderer->ResetAPIState();
|
||||||
|
|
||||||
// Copy EFB data to XFB and restore render target again
|
// Copy EFB data to XFB and restore render target again
|
||||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, FramebufferManager::GetEFBFramebuffer());
|
|
||||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, FramebufferManager::GetXFBFramebuffer());
|
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, FramebufferManager::GetXFBFramebuffer());
|
||||||
|
|
||||||
// Bind texture.
|
for (int i = 0; i < m_layers; i++)
|
||||||
FramebufferManager::FramebufferTexture(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_ARRAY, texture, 0);
|
{
|
||||||
|
// Bind EFB and texture layer
|
||||||
|
glBindFramebuffer(GL_READ_FRAMEBUFFER, FramebufferManager::GetEFBFramebuffer(i));
|
||||||
|
glFramebufferTextureLayer(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texture, 0, i);
|
||||||
|
|
||||||
glBlitFramebuffer(
|
glBlitFramebuffer(
|
||||||
0, 0, texWidth, texHeight,
|
0, 0, texWidth, texHeight,
|
||||||
0, 0, texWidth, texHeight,
|
0, 0, texWidth, texHeight,
|
||||||
GL_COLOR_BUFFER_BIT, GL_NEAREST
|
GL_COLOR_BUFFER_BIT, GL_NEAREST
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Return to EFB.
|
// Return to EFB.
|
||||||
FramebufferManager::SetFramebuffer(0);
|
FramebufferManager::SetFramebuffer(0);
|
||||||
|
|
|
@ -68,7 +68,7 @@ public:
|
||||||
static GLuint GetEFBColorTexture(const EFBRectangle& sourceRc);
|
static GLuint GetEFBColorTexture(const EFBRectangle& sourceRc);
|
||||||
static GLuint GetEFBDepthTexture(const EFBRectangle& sourceRc);
|
static GLuint GetEFBDepthTexture(const EFBRectangle& sourceRc);
|
||||||
|
|
||||||
static GLuint GetEFBFramebuffer() { return m_efbFramebuffer[0]; }
|
static GLuint GetEFBFramebuffer(unsigned int layer = 0) { return (layer < m_EFBLayers) ? m_efbFramebuffer[layer] : m_efbFramebuffer[m_EFBLayers - 1]; }
|
||||||
static GLuint GetXFBFramebuffer() { return m_xfbFramebuffer; }
|
static GLuint GetXFBFramebuffer() { return m_xfbFramebuffer; }
|
||||||
|
|
||||||
// Resolved framebuffer is only used in MSAA mode.
|
// Resolved framebuffer is only used in MSAA mode.
|
||||||
|
|
Loading…
Reference in New Issue