From b8e49f1eb8222bb450c055cecce9c8fe76efcf38 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sun, 28 Jan 2018 21:13:37 +0100 Subject: [PATCH] [d3d11] Fixed incorrect aspect mask for depth-stencil clear ops Application may specify a clear flag that the image format does not support, in which case it should just be ignored. Fixes validation errors in Microsoft's MultiThreadedRendering demo. --- src/d3d11/d3d11_context.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp index 6b54b21d..15889f1c 100644 --- a/src/d3d11/d3d11_context.cpp +++ b/src/d3d11/d3d11_context.cpp @@ -473,6 +473,10 @@ namespace dxvk { if (ClearFlags & D3D11_CLEAR_STENCIL) aspectMask |= VK_IMAGE_ASPECT_STENCIL_BIT; + const DxvkFormatInfo* formatInfo = + imageFormatInfo(dxvkView->info().format); + aspectMask &= formatInfo->aspectMask; + VkClearDepthStencilValue clearValue; clearValue.depth = Depth; clearValue.stencil = Stencil;