1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 14:52:11 +01:00

[d3d9] Only enable FETCH4 when POINT sampling

Closes #1660
This commit is contained in:
Joshua Ashton 2020-06-14 00:16:07 +01:00
parent cd0a21dda5
commit 9525f53d00
2 changed files with 16 additions and 3 deletions

View File

@ -3531,10 +3531,22 @@ namespace dxvk {
constexpr DWORD Fetch4Disabled = MAKEFOURCC('G', 'E', 'T', '1');
if (Type == D3DSAMP_MIPMAPLODBIAS) {
if (Value == Fetch4Enabled)
if (Value == Fetch4Enabled) {
m_fetch4Enabled |= 1u << StateSampler;
else if (Value == Fetch4Disabled)
if (state[StateSampler][D3DSAMP_MAGFILTER] == D3DTEXF_POINT)
m_fetch4 |= 1u << StateSampler;
}
else if (Value == Fetch4Disabled) {
m_fetch4Enabled &= ~(1u << StateSampler);
m_fetch4 &= ~(1u << StateSampler);
}
}
if (Type == D3DSAMP_MAGFILTER && m_fetch4Enabled & (1u << StateSampler)) {
if (Value == D3DTEXF_POINT)
m_fetch4 |= 1u << StateSampler;
else
m_fetch4 &= ~(1u << StateSampler);
}
}
@ -5759,7 +5771,7 @@ namespace dxvk {
const uint32_t psTextureMask = m_activeTextures & m_psShaderMasks.samplerMask;
uint32_t fetch4 = m_fetch4Enabled & psTextureMask;
uint32_t fetch4 = m_fetch4 & psTextureMask;
uint32_t projected = m_projectionBitfield & psTextureMask;
if (GetCommonShader(m_state.pixelShader)->GetInfo().majorVersion() >= 2)

View File

@ -1048,6 +1048,7 @@ namespace dxvk {
uint32_t m_activeTexturesToGen = 0;
uint32_t m_fetch4Enabled = 0;
uint32_t m_fetch4 = 0;
uint32_t m_lastFetch4 = 0;
uint32_t m_activeHazardsDS = 0;