summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-09-16 03:16:30 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-09-16 03:16:30 +0000
commitc9034f3e357db139f6264ccd24a71a15734e7a6b (patch)
tree192ceecf892d5d8e4a28716c482d5c6f9a64b10c /Graphics/GraphicsEngineVulkan
parentFixed typo (diff)
downloadDiligentCore-c9034f3e357db139f6264ccd24a71a15734e7a6b.tar.gz
DiligentCore-c9034f3e357db139f6264ccd24a71a15734e7a6b.zip
Improved format support tests in Vulkan backend
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp
index e2580500..ccbc8e5f 100644
--- a/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp
@@ -467,11 +467,10 @@ void RenderDeviceVkImpl::TestTextureFormat(TEXTURE_FORMAT TexFormat)
if (vkRtvFmtProps.optimalTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT)
{
- TexFormatInfo.BindFlags |= BIND_RENDER_TARGET;
-
VkImageFormatProperties ImgFmtProps = {};
if (CheckFormatProperties(vkRtvFormat, VK_IMAGE_TYPE_2D, VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT, ImgFmtProps))
{
+ TexFormatInfo.BindFlags |= BIND_RENDER_TARGET;
TexFormatInfo.SampleCounts = ImgFmtProps.sampleCounts;
}
}
@@ -487,11 +486,12 @@ void RenderDeviceVkImpl::TestTextureFormat(TEXTURE_FORMAT TexFormat)
vkGetPhysicalDeviceFormatProperties(vkPhysicalDevice, vkDsvFormat, &vkDsvFmtProps);
if (vkDsvFmtProps.optimalTilingFeatures & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT)
{
- TexFormatInfo.BindFlags |= BIND_DEPTH_STENCIL;
-
VkImageFormatProperties ImgFmtProps = {};
if (CheckFormatProperties(vkDsvFormat, VK_IMAGE_TYPE_2D, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, ImgFmtProps))
{
+ // MoltenVK reports VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT for
+ // VK_FORMAT_D24_UNORM_S8_UINT even though the format is not supported.
+ TexFormatInfo.BindFlags |= BIND_DEPTH_STENCIL;
TexFormatInfo.SampleCounts = ImgFmtProps.sampleCounts;
}
}
@@ -507,7 +507,11 @@ void RenderDeviceVkImpl::TestTextureFormat(TEXTURE_FORMAT TexFormat)
vkGetPhysicalDeviceFormatProperties(vkPhysicalDevice, vkUavFormat, &vkUavFmtProps);
if (vkUavFmtProps.optimalTilingFeatures & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT)
{
- TexFormatInfo.BindFlags |= BIND_UNORDERED_ACCESS;
+ VkImageFormatProperties ImgFmtProps = {};
+ if (CheckFormatProperties(vkUavFormat, VK_IMAGE_TYPE_2D, VK_IMAGE_USAGE_STORAGE_BIT, ImgFmtProps))
+ {
+ TexFormatInfo.BindFlags |= BIND_UNORDERED_ACCESS;
+ }
}
}
}