diff options
| author | Stenzek <stenzek@gmail.com> | 2019-07-31 15:33:27 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2019-07-31 15:33:28 +1000 |
| commit | 06daf5803243c5f36069d8f7a936e62857ce1eca (patch) | |
| tree | 473d406f3ce23b7888d7f21b0dc09d98951226fd /Source/Core/VideoCommon/AbstractTexture.cpp | |
| parent | 2698e311aaec09d9b0e34fc659349f3b668a1644 (diff) | |
FramebufferManager: Correctly handle read back D24S8 textures
Needed for the Adreno/Vulkan workaround, and if we ever switch to a D24
texture for the depth buffer w/ unrestricted depth range.
Diffstat (limited to 'Source/Core/VideoCommon/AbstractTexture.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/AbstractTexture.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/Core/VideoCommon/AbstractTexture.cpp b/Source/Core/VideoCommon/AbstractTexture.cpp index d0c27617db..23ade1f99b 100644 --- a/Source/Core/VideoCommon/AbstractTexture.cpp +++ b/Source/Core/VideoCommon/AbstractTexture.cpp @@ -88,20 +88,19 @@ bool AbstractTexture::IsStencilFormat(AbstractTextureFormat format) return format == AbstractTextureFormat::D24_S8 || format == AbstractTextureFormat::D32F_S8; } -AbstractTextureFormat AbstractTexture::GetColorFormatForDepthFormat(AbstractTextureFormat format) +bool AbstractTexture::IsCompatibleDepthAndColorFormats(AbstractTextureFormat depth_format, + AbstractTextureFormat color_format) { - switch (format) + switch (depth_format) { case AbstractTextureFormat::D16: - return AbstractTextureFormat::R16; + return color_format == AbstractTextureFormat::R16; - case AbstractTextureFormat::D24_S8: // TODO: Incorrect case AbstractTextureFormat::D32F: - case AbstractTextureFormat::D32F_S8: - return AbstractTextureFormat::R32F; + return color_format == AbstractTextureFormat::R32F; default: - return format; + return false; } } |
