FramebufferManagerBase: Only allocate one layer for Real XFB.
This commit is contained in:
parent
a9364cd5db
commit
b109b31f61
|
@ -162,11 +162,11 @@ void FramebufferManager::CopyToRealXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, c
|
|||
s_xfbEncoder.Encode(dst, fbWidth, fbHeight, sourceRc, Gamma);
|
||||
}
|
||||
|
||||
XFBSourceBase* FramebufferManager::CreateXFBSource(unsigned int target_width, unsigned int target_height)
|
||||
XFBSourceBase* FramebufferManager::CreateXFBSource(unsigned int target_width, unsigned int target_height, unsigned int layers)
|
||||
{
|
||||
return new XFBSource(D3DTexture2D::Create(target_width, target_height,
|
||||
(D3D11_BIND_FLAG)(D3D11_BIND_RENDER_TARGET|D3D11_BIND_SHADER_RESOURCE),
|
||||
D3D11_USAGE_DEFAULT, DXGI_FORMAT_R8G8B8A8_UNORM, 1, FramebufferManager::GetEFBLayers()), FramebufferManager::GetEFBLayers());
|
||||
D3D11_USAGE_DEFAULT, DXGI_FORMAT_R8G8B8A8_UNORM, 1, layers), layers);
|
||||
}
|
||||
|
||||
void FramebufferManager::GetTargetSize(unsigned int *width, unsigned int *height, const EFBRectangle& sourceRc)
|
||||
|
@ -218,4 +218,4 @@ void XFBSource::CopyEFB(float Gamma)
|
|||
g_renderer->RestoreAPIState();
|
||||
}
|
||||
|
||||
} // namespace DX11
|
||||
} // namespace DX11
|
||||
|
|
|
@ -82,7 +82,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
XFBSourceBase* CreateXFBSource(unsigned int target_width, unsigned int target_height) override;
|
||||
XFBSourceBase* CreateXFBSource(unsigned int target_width, unsigned int target_height, unsigned int layers) override;
|
||||
void GetTargetSize(unsigned int *width, unsigned int *height, const EFBRectangle& sourceRc) override;
|
||||
|
||||
void CopyToRealXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc,float Gamma) override;
|
||||
|
|
|
@ -531,7 +531,7 @@ void XFBSource::CopyEFB(float Gamma)
|
|||
|
||||
}
|
||||
|
||||
XFBSourceBase* FramebufferManager::CreateXFBSource(unsigned int target_width, unsigned int target_height)
|
||||
XFBSourceBase* FramebufferManager::CreateXFBSource(unsigned int target_width, unsigned int target_height, unsigned int layers)
|
||||
{
|
||||
GLuint texture;
|
||||
|
||||
|
@ -540,9 +540,9 @@ XFBSourceBase* FramebufferManager::CreateXFBSource(unsigned int target_width, un
|
|||
glActiveTexture(GL_TEXTURE0 + 9);
|
||||
glBindTexture(GL_TEXTURE_2D_ARRAY, texture);
|
||||
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAX_LEVEL, 0);
|
||||
glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, target_width, target_height, m_EFBLayers, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
|
||||
glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, target_width, target_height, layers, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
|
||||
|
||||
return new XFBSource(texture, m_EFBLayers);
|
||||
return new XFBSource(texture, layers);
|
||||
}
|
||||
|
||||
void FramebufferManager::GetTargetSize(unsigned int *width, unsigned int *height, const EFBRectangle& sourceRc)
|
||||
|
|
|
@ -92,7 +92,7 @@ public:
|
|||
static void ReinterpretPixelData(unsigned int convtype);
|
||||
|
||||
private:
|
||||
XFBSourceBase* CreateXFBSource(unsigned int target_width, unsigned int target_height) override;
|
||||
XFBSourceBase* CreateXFBSource(unsigned int target_width, unsigned int target_height, unsigned int layers) override;
|
||||
void GetTargetSize(unsigned int *width, unsigned int *height, const EFBRectangle& sourceRc) override;
|
||||
|
||||
void CopyToRealXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc,float Gamma) override;
|
||||
|
|
|
@ -56,7 +56,7 @@ const XFBSourceBase* const* FramebufferManagerBase::GetRealXFBSource(u32 xfbAddr
|
|||
}
|
||||
|
||||
if (!m_realXFBSource)
|
||||
m_realXFBSource = g_framebuffer_manager->CreateXFBSource(fbWidth, fbHeight);
|
||||
m_realXFBSource = g_framebuffer_manager->CreateXFBSource(fbWidth, fbHeight, 1);
|
||||
|
||||
m_realXFBSource->srcAddr = xfbAddr;
|
||||
|
||||
|
@ -158,7 +158,7 @@ void FramebufferManagerBase::CopyToVirtualXFB(u32 xfbAddr, u32 fbWidth, u32 fbHe
|
|||
|
||||
if (!vxfb->xfbSource)
|
||||
{
|
||||
vxfb->xfbSource = g_framebuffer_manager->CreateXFBSource(target_width, target_height);
|
||||
vxfb->xfbSource = g_framebuffer_manager->CreateXFBSource(target_width, target_height, m_EFBLayers);
|
||||
vxfb->xfbSource->texWidth = target_width;
|
||||
vxfb->xfbSource->texHeight = target_height;
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ protected:
|
|||
static unsigned int m_EFBLayers;
|
||||
|
||||
private:
|
||||
virtual XFBSourceBase* CreateXFBSource(unsigned int target_width, unsigned int target_height) = 0;
|
||||
virtual XFBSourceBase* CreateXFBSource(unsigned int target_width, unsigned int target_height, unsigned int layers) = 0;
|
||||
// TODO: figure out why OGL is different for this guy
|
||||
virtual void GetTargetSize(unsigned int *width, unsigned int *height, const EFBRectangle& sourceRc) = 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue