Skip to content

Commit

Permalink
[d3d9] Use D32 not D32_S8 when upgrading formats without stencil aspect.
Browse files Browse the repository at this point in the history
  • Loading branch information
DadSchoorse authored and misyltoad committed Sep 27, 2022
1 parent a9bdea7 commit 5085753
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/d3d9/d3d9_common_texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/d3d9/d3d9_format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5085753

Please sign in to comment.