diff options
| author | Stenzek <stenzek@gmail.com> | 2018-07-17 13:26:37 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2018-07-19 23:30:25 +1000 |
| commit | dae161e1385f6f8904bbcc0803d7ae01fdf4bd8d (patch) | |
| tree | ad8ae5708c2d002d870663e5f329d3edf6275b9a | |
| parent | 3323265d9113c5c2cf4f3ca92766458411ac8b5e (diff) | |
FramebufferManager: Use D24S8 on Adreno when using Vulkan
D32F clears are broken on Adreno, which resulted in smeared geometry
across the screen.
| -rw-r--r-- | Source/Core/VideoCommon/DriverDetails.cpp | 3 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/DriverDetails.h | 7 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/FramebufferManagerBase.cpp | 9 |
3 files changed, 17 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/DriverDetails.cpp b/Source/Core/VideoCommon/DriverDetails.cpp index 1626e24d18..301c73d89f 100644 --- a/Source/Core/VideoCommon/DriverDetails.cpp +++ b/Source/Core/VideoCommon/DriverDetails.cpp @@ -108,7 +108,8 @@ static BugInfo m_known_bugs[] = { -1.0, true}, {API_VULKAN, OS_ALL, VENDOR_IMGTEC, DRIVER_IMGTEC, Family::UNKNOWN, BUG_BROKEN_CLEAR_LOADOP_RENDERPASS, -1.0, -1.0, true}, -}; + {API_VULKAN, OS_ALL, VENDOR_QUALCOMM, DRIVER_QUALCOMM, Family::UNKNOWN, BUG_BROKEN_D32F_CLEAR, + -1.0, -1.0, true}}; static std::map<Bug, BugInfo> m_bugs; diff --git a/Source/Core/VideoCommon/DriverDetails.h b/Source/Core/VideoCommon/DriverDetails.h index 65b6c89fcb..9ace5f83b4 100644 --- a/Source/Core/VideoCommon/DriverDetails.h +++ b/Source/Core/VideoCommon/DriverDetails.h @@ -269,6 +269,13 @@ enum Bug // Started Version: 1.7 // Ended Version: 1.10 BUG_BROKEN_CLEAR_LOADOP_RENDERPASS, + + // BUG: 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. + // Started version: -1 + // Ended version: -1 + BUG_BROKEN_D32F_CLEAR, }; // Initializes our internal vendor, device family, and driver version 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 <memory> #include "VideoCommon/AbstractTexture.h" +#include "VideoCommon/DriverDetails.h" #include "VideoCommon/RenderBase.h" std::unique_ptr<FramebufferManagerBase> 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; } |
