mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +01:00
[d3d9] Disable fetch4 when binding an incompatible texture
Fixes lighting in Spider-Man: Shattered Dimensions.
This commit is contained in:
parent
d498551a23
commit
9e1ecec79f
@ -3779,13 +3779,20 @@ namespace dxvk {
|
||||
m_dirtySamplerStates |= 1u << StateSampler;
|
||||
}
|
||||
|
||||
if (unlikely(m_fetch4Enabled & (1u << StateSampler) && !(m_fetch4 & (1u << StateSampler)))) {
|
||||
bool textureSupportsFetch4 = newTexture->SupportsFetch4();
|
||||
if (textureSupportsFetch4
|
||||
&& m_state.samplerStates[StateSampler][D3DSAMP_MAGFILTER] == D3DTEXF_POINT
|
||||
&& m_state.samplerStates[StateSampler][D3DSAMP_MINFILTER] == D3DTEXF_POINT) {
|
||||
if (unlikely(m_fetch4Enabled & (1u << StateSampler))) {
|
||||
const bool samplerFetch4 = (m_fetch4 & (1u << StateSampler)) != 0;
|
||||
const bool pointFilter = m_state.samplerStates[StateSampler][D3DSAMP_MAGFILTER] == D3DTEXF_POINT
|
||||
&& m_state.samplerStates[StateSampler][D3DSAMP_MINFILTER] == D3DTEXF_POINT;
|
||||
const bool textureSupportsFetch4 = newTexture->SupportsFetch4();
|
||||
|
||||
if (unlikely(textureSupportsFetch4 && pointFilter && !samplerFetch4)) {
|
||||
// We're swapping a multi channel texture for a single channel texture => turn on fetch4
|
||||
m_fetch4 |= 1u << StateSampler;
|
||||
m_dirtySamplerStates |= 1u << StateSampler;
|
||||
} else if (unlikely(!textureSupportsFetch4 && samplerFetch4)) {
|
||||
// We're swapping a single channel texture for a multi channel one => turn off fetch4
|
||||
m_fetch4 &= ~(1u << StateSampler);
|
||||
m_dirtySamplerStates |= 1u << StateSampler;
|
||||
}
|
||||
}
|
||||
} else if (unlikely(m_fetch4 & (1u << StateSampler))) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user