From dae161e1385f6f8904bbcc0803d7ae01fdf4bd8d Mon Sep 17 00:00:00 2001 From: Stenzek Date: Tue, 17 Jul 2018 13:26:37 +1000 Subject: FramebufferManager: Use D24S8 on Adreno when using Vulkan D32F clears are broken on Adreno, which resulted in smeared geometry across the screen. --- Source/Core/VideoCommon/FramebufferManagerBase.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/FramebufferManagerBase.cpp') diff --git a/Source/Core/VideoCommon/FramebufferManagerBase.cpp b/Source/Core/VideoCommon/FramebufferManagerBase.cpp index d33f72b2d8..530aac7584 100644 --- a/Source/Core/VideoCommon/FramebufferManagerBase.cpp +++ b/Source/Core/VideoCommon/FramebufferManagerBase.cpp @@ -7,6 +7,7 @@ #include #include "VideoCommon/AbstractTexture.h" +#include "VideoCommon/DriverDetails.h" #include "VideoCommon/RenderBase.h" std::unique_ptr g_framebuffer_manager; @@ -17,5 +18,11 @@ FramebufferManagerBase::~FramebufferManagerBase() = default; AbstractTextureFormat FramebufferManagerBase::GetEFBDepthFormat() { - return AbstractTextureFormat::D32F; + // 32-bit depth clears are broken in the Adreno Vulkan driver, and have no effect. + // To work around this, we use a D24_S8 buffer instead, which results in a loss of accuracy. + // We still resolve this to a R32F texture, as there is no 24-bit format. + if (DriverDetails::HasBug(DriverDetails::BUG_BROKEN_D32F_CLEAR)) + return AbstractTextureFormat::D24_S8; + else + return AbstractTextureFormat::D32F; } -- cgit v1.2.3