Skip to content

Commit

Permalink
[d3d9] Track if a texture is upgraded to D32f
Browse files Browse the repository at this point in the history
  • Loading branch information
DadSchoorse authored and misyltoad committed Sep 26, 2022
1 parent 6188ffa commit 5684e29
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/d3d9/d3d9_common_texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +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_supportsFetch4 = DetermineFetch4Compatibility();

const bool createImage = m_desc.Pool != D3DPOOL_SYSTEMMEM && m_desc.Pool != D3DPOOL_SCRATCH && m_desc.Format != D3D9Format::NULL_FORMAT;
Expand Down
9 changes: 9 additions & 0 deletions src/d3d9/d3d9_common_texture.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,14 @@ namespace dxvk {
return m_shadow;
}

/**
* \brief Dref Clamp
* \returns Whether the texture emulates an UNORM format with D32f
*/
bool IsUpgradedToD32f() const {
return m_upgradedToD32f;
}

/**
* \brief FETCH4 compatibility
* \returns Whether the format of the texture supports the FETCH4 hack
Expand Down Expand Up @@ -499,6 +507,7 @@ namespace dxvk {
D3D9_VK_FORMAT_MAPPING m_mapping;

bool m_shadow; //< Depth Compare-ness
bool m_upgradedToD32f; // Dref Clamp
bool m_supportsFetch4;

int64_t m_size = 0;
Expand Down

0 comments on commit 5684e29

Please sign in to comment.