[d3d9] Use D32 not D32_S8 when upgrading formats without stencil aspect.

This commit is contained in:
Georg Lehmann 2022-09-26 20:27:06 +02:00 committed by Joshie
parent a9bdea72e9
commit 50857537d6
2 changed files with 3 additions and 3 deletions

View File

@ -40,8 +40,8 @@ namespace dxvk {
m_mapMode = DetermineMapMode();
m_shadow = DetermineShadowState();
m_upgradedToD32f = ConvertFormatUnfixed(m_desc.Format).FormatColor != VK_FORMAT_D32_SFLOAT_S8_UINT &&
m_mapping.FormatColor == VK_FORMAT_D32_SFLOAT_S8_UINT;
m_upgradedToD32f = ConvertFormatUnfixed(m_desc.Format).FormatColor != m_mapping.FormatColor &&
(m_mapping.FormatColor == VK_FORMAT_D32_SFLOAT_S8_UINT || m_mapping.FormatColor == VK_FORMAT_D32_SFLOAT);
m_supportsFetch4 = DetermineFetch4Compatibility();
const bool createImage = m_desc.Pool != D3DPOOL_SYSTEMMEM && m_desc.Pool != D3DPOOL_SCRATCH && m_desc.Format != D3D9Format::NULL_FORMAT;

View File

@ -473,7 +473,7 @@ namespace dxvk {
return D3D9_VK_FORMAT_MAPPING();
if (!m_d24s8Support && mapping.FormatColor == VK_FORMAT_D24_UNORM_S8_UINT)
mapping.FormatColor = VK_FORMAT_D32_SFLOAT_S8_UINT;
mapping.FormatColor = mapping.Aspect & VK_IMAGE_ASPECT_STENCIL_BIT ? VK_FORMAT_D32_SFLOAT_S8_UINT : VK_FORMAT_D32_SFLOAT;
if (!m_d16s8Support && mapping.FormatColor == VK_FORMAT_D16_UNORM_S8_UINT)
mapping.FormatColor = m_d24s8Support ? VK_FORMAT_D24_UNORM_S8_UINT : VK_FORMAT_D32_SFLOAT_S8_UINT;