summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D/FramebufferManager.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2018-11-28 14:30:47 +1000
committerStenzek <stenzek@gmail.com>2019-01-25 11:15:57 +1000
commite4b205c76937d379cd9043939e2cef1651b1a21b (patch)
tree95bc07fc4ffbb9a9e0aa8d7bbb22163a97a1fd8e /Source/Core/VideoBackends/D3D/FramebufferManager.cpp
parentf1e7fb505bc52fa3d6ed1a13e8c43d44c13cb943 (diff)
Decouple XFB scanout from presentation
Diffstat (limited to 'Source/Core/VideoBackends/D3D/FramebufferManager.cpp')
-rw-r--r--Source/Core/VideoBackends/D3D/FramebufferManager.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/Core/VideoBackends/D3D/FramebufferManager.cpp b/Source/Core/VideoBackends/D3D/FramebufferManager.cpp
index e7e8fa9ddc..5a2088f40d 100644
--- a/Source/Core/VideoBackends/D3D/FramebufferManager.cpp
+++ b/Source/Core/VideoBackends/D3D/FramebufferManager.cpp
@@ -125,6 +125,7 @@ void FramebufferManager::BindEFBRenderTarget(bool bind_depth)
FramebufferManager::FramebufferManager(int target_width, int target_height)
{
+ static constexpr std::array<float, 4> clear_color = {0.0f, 0.0f, 0.0f, 1.0f};
m_target_width = static_cast<unsigned int>(std::max(target_width, 1));
m_target_height = static_cast<unsigned int>(std::max(target_height, 1));
DXGI_SAMPLE_DESC sample_desc;
@@ -154,6 +155,7 @@ FramebufferManager::FramebufferManager(int target_width, int target_height)
D3D::SetDebugObjectName(m_efb.color_tex->GetTex(), "EFB color texture");
D3D::SetDebugObjectName(m_efb.color_tex->GetSRV(), "EFB color texture shader resource view");
D3D::SetDebugObjectName(m_efb.color_tex->GetRTV(), "EFB color texture render target view");
+ D3D::context->ClearRenderTargetView(m_efb.color_tex->GetRTV(), clear_color.data());
// Temporary EFB color texture - used in ReinterpretPixelData
texdesc =
@@ -173,6 +175,7 @@ FramebufferManager::FramebufferManager(int target_width, int target_height)
"EFB color temp texture shader resource view");
D3D::SetDebugObjectName(m_efb.color_temp_tex->GetRTV(),
"EFB color temp texture render target view");
+ D3D::context->ClearRenderTargetView(m_efb.color_temp_tex->GetRTV(), clear_color.data());
// Integer render targets for EFB, used for logic op
CD3D11_RENDER_TARGET_VIEW_DESC int_rtv_desc(m_efb.color_tex->GetTex(),
@@ -222,6 +225,7 @@ FramebufferManager::FramebufferManager(int target_width, int target_height)
D3D::SetDebugObjectName(m_efb.depth_tex->GetTex(), "EFB depth texture");
D3D::SetDebugObjectName(m_efb.depth_tex->GetDSV(), "EFB depth texture depth stencil view");
D3D::SetDebugObjectName(m_efb.depth_tex->GetSRV(), "EFB depth texture shader resource view");
+ D3D::context->ClearDepthStencilView(m_efb.depth_tex->GetDSV(), D3D11_CLEAR_DEPTH, 0.0f, 0);
// Render buffer for AccessEFB (depth data)
texdesc = CD3D11_TEXTURE2D_DESC(DXGI_FORMAT_R32_FLOAT, 1, 1, 1, 1, D3D11_BIND_RENDER_TARGET);