From ffc2130ee6fdfc05ffe08a58582e8db3ca8c36c9 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sat, 1 Sep 2018 15:54:13 +0200 Subject: [PATCH] [d3d11] Pass format swizzle to render target views Fixes missing caterpillars in World of Tanks (#410). --- src/d3d11/d3d11_view_rtv.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/d3d11/d3d11_view_rtv.cpp b/src/d3d11/d3d11_view_rtv.cpp index 2a46898985e..8d9f52318ed 100644 --- a/src/d3d11/d3d11_view_rtv.cpp +++ b/src/d3d11/d3d11_view_rtv.cpp @@ -13,10 +13,14 @@ namespace dxvk { : m_device(pDevice), m_resource(pResource), m_desc(*pDesc), m_d3d10(this) { ResourceAddRefPrivate(m_resource); + DXGI_VK_FORMAT_INFO formatInfo = pDevice->LookupFormat( + pDesc->Format, DXGI_VK_FORMAT_MODE_COLOR); + DxvkImageViewCreateInfo viewInfo; - viewInfo.format = pDevice->LookupFormat(pDesc->Format, DXGI_VK_FORMAT_MODE_COLOR).Format; - viewInfo.aspect = imageFormatInfo(viewInfo.format)->aspectMask; - viewInfo.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; + viewInfo.format = formatInfo.Format; + viewInfo.aspect = imageFormatInfo(viewInfo.format)->aspectMask; + viewInfo.swizzle = formatInfo.Swizzle; + viewInfo.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; switch (pDesc->ViewDimension) { case D3D11_RTV_DIMENSION_TEXTURE1D: