summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/Util.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@users.noreply.github.com>2018-07-19 23:36:16 +1000
committerGitHub <noreply@github.com>2018-07-19 23:36:16 +1000
commit67872cd2d1e141ab3f666ceff45c5c27fea0a53d (patch)
treead8ae5708c2d002d870663e5f329d3edf6275b9a /Source/Core/VideoBackends/Vulkan/Util.cpp
parentf5e8af7b6ca24962f1a9fea14b989a0092bae210 (diff)
parentdae161e1385f6f8904bbcc0803d7ae01fdf4bd8d (diff)
Merge pull request #7275 from stenzek/d24s8
FramebufferManager: Use D24S8 on Adreno when using Vulkan
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/Util.cpp')
-rw-r--r--Source/Core/VideoBackends/Vulkan/Util.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/Util.cpp b/Source/Core/VideoBackends/Vulkan/Util.cpp
index 9e9060c5a3..4ffa5c0146 100644
--- a/Source/Core/VideoBackends/Vulkan/Util.cpp
+++ b/Source/Core/VideoBackends/Vulkan/Util.cpp
@@ -118,6 +118,9 @@ VkFormat GetVkFormatForHostTextureFormat(AbstractTextureFormat format)
case AbstractTextureFormat::D16:
return VK_FORMAT_D16_UNORM;
+ case AbstractTextureFormat::D24_S8:
+ return VK_FORMAT_D24_UNORM_S8_UINT;
+
case AbstractTextureFormat::R32F:
return VK_FORMAT_R32_SFLOAT;
@@ -133,6 +136,24 @@ VkFormat GetVkFormatForHostTextureFormat(AbstractTextureFormat format)
}
}
+VkImageAspectFlags GetImageAspectForFormat(VkFormat format)
+{
+ switch (format)
+ {
+ case VK_FORMAT_D16_UNORM_S8_UINT:
+ case VK_FORMAT_D24_UNORM_S8_UINT:
+ case VK_FORMAT_D32_SFLOAT_S8_UINT:
+ return VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
+
+ case VK_FORMAT_D16_UNORM:
+ case VK_FORMAT_D32_SFLOAT:
+ return VK_IMAGE_ASPECT_DEPTH_BIT;
+
+ default:
+ return VK_IMAGE_ASPECT_COLOR_BIT;
+ }
+}
+
u32 GetTexelSize(VkFormat format)
{
// Only contains pixel formats we use.