From 432708c15f7f7cc43ce766f137604e319625fc79 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 21 Jun 2018 10:17:59 +0200 Subject: [PATCH] [d3d11] Fix image aspect mask for typeless resolve The DXGI format info only stores the aspect mask for views created with that format, but we're dealing with a raw resource here so we have to query the aspect mask from the Vulkan format in question. Fixes validation errors with typeless resolve if the formats of the two involved images are identical. --- src/d3d11/d3d11_context.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp index f44f32b5..ed3159af 100644 --- a/src/d3d11/d3d11_context.cpp +++ b/src/d3d11/d3d11_context.cpp @@ -1016,13 +1016,16 @@ namespace dxvk { const DXGI_VK_FORMAT_INFO dstFormatInfo = m_parent->LookupFormat(dstDesc.Format, DXGI_VK_FORMAT_MODE_ANY); const DXGI_VK_FORMAT_INFO srcFormatInfo = m_parent->LookupFormat(srcDesc.Format, DXGI_VK_FORMAT_MODE_ANY); + auto dstVulkanFormatInfo = imageFormatInfo(dstFormatInfo.Format); + auto srcVulkanFormatInfo = imageFormatInfo(srcFormatInfo.Format); + const VkImageSubresource dstSubresource = dstTextureInfo->GetSubresourceFromIndex( - dstFormatInfo.Aspect, DstSubresource); + dstVulkanFormatInfo->aspectMask, DstSubresource); const VkImageSubresource srcSubresource = srcTextureInfo->GetSubresourceFromIndex( - srcFormatInfo.Aspect, SrcSubresource); + srcVulkanFormatInfo->aspectMask, SrcSubresource); const VkImageSubresourceLayers dstSubresourceLayers = { dstSubresource.aspectMask,