From b67f4974bee1078092d1f8148c4c83fbddba9c09 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Mon, 24 Feb 2020 06:38:26 +0000 Subject: [PATCH] [d3d9] Fix view formats for conversion formats --- src/d3d9/d3d9_common_texture.cpp | 8 +++++--- src/d3d9/d3d9_format.h | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/d3d9/d3d9_common_texture.cpp b/src/d3d9/d3d9_common_texture.cpp index f52feb940..33be05ead 100644 --- a/src/d3d9/d3d9_common_texture.cpp +++ b/src/d3d9/d3d9_common_texture.cpp @@ -193,8 +193,8 @@ namespace dxvk { Rc D3D9CommonTexture::CreatePrimaryImage(D3DRESOURCETYPE ResourceType, bool TryOffscreenRT) const { DxvkImageCreateInfo imageInfo; imageInfo.type = GetImageTypeFromResourceType(ResourceType); - imageInfo.format = m_mapping.ConversionFormatInfo.VulkanFormat != VK_FORMAT_UNDEFINED - ? m_mapping.ConversionFormatInfo.VulkanFormat + imageInfo.format = m_mapping.ConversionFormatInfo.FormatColor != VK_FORMAT_UNDEFINED + ? m_mapping.ConversionFormatInfo.FormatColor : m_mapping.FormatColor; imageInfo.flags = 0; imageInfo.sampleCount = VK_SAMPLE_COUNT_1_BIT; @@ -427,7 +427,9 @@ namespace dxvk { VkImageUsageFlags UsageFlags, bool Srgb) { DxvkImageViewCreateInfo viewInfo; - viewInfo.format = PickSRGB(m_mapping.FormatColor, m_mapping.FormatSrgb, Srgb); + viewInfo.format = m_mapping.ConversionFormatInfo.FormatColor != VK_FORMAT_UNDEFINED + ? PickSRGB(m_mapping.ConversionFormatInfo.FormatColor, m_mapping.ConversionFormatInfo.FormatSrgb, Srgb) + : PickSRGB(m_mapping.FormatColor, m_mapping.FormatSrgb, Srgb); viewInfo.aspect = imageFormatInfo(viewInfo.format)->aspectMask; viewInfo.swizzle = m_mapping.Swizzle; viewInfo.usage = UsageFlags; diff --git a/src/d3d9/d3d9_format.h b/src/d3d9/d3d9_format.h index eff54b590..525377bd9 100644 --- a/src/d3d9/d3d9_format.h +++ b/src/d3d9/d3d9_format.h @@ -137,7 +137,8 @@ namespace dxvk { struct D3D9_CONVERSION_FORMAT_INFO { D3D9ConversionFormat FormatType = D3D9ConversionFormat_None; VkExtent2D MacroPixelSize = { 1u, 1u }; - VkFormat VulkanFormat = VK_FORMAT_UNDEFINED; + VkFormat FormatColor = VK_FORMAT_UNDEFINED; + VkFormat FormatSrgb = VK_FORMAT_UNDEFINED; }; /**