1
0
mirror of https://github.com/EduApps-CDG/OpenDX synced 2024-12-30 09:45:37 +01:00

[d3d9] Add unlikelies to rare vendor hacks

This commit is contained in:
Joshua Ashton 2021-08-09 03:16:58 +01:00 committed by Joshie
parent 1ea79cf136
commit ea4aa87336

View File

@ -3666,19 +3666,19 @@ namespace dxvk {
constexpr DWORD Fetch4Enabled = MAKEFOURCC('G', 'E', 'T', '4'); constexpr DWORD Fetch4Enabled = MAKEFOURCC('G', 'E', 'T', '4');
constexpr DWORD Fetch4Disabled = MAKEFOURCC('G', 'E', 'T', '1'); constexpr DWORD Fetch4Disabled = MAKEFOURCC('G', 'E', 'T', '1');
if (Type == D3DSAMP_MIPMAPLODBIAS) { if (unlikely(Type == D3DSAMP_MIPMAPLODBIAS)) {
if (Value == Fetch4Enabled) { if (unlikely(Value == Fetch4Enabled)) {
m_fetch4Enabled |= 1u << StateSampler; m_fetch4Enabled |= 1u << StateSampler;
if (state[StateSampler][D3DSAMP_MAGFILTER] == D3DTEXF_POINT) if (state[StateSampler][D3DSAMP_MAGFILTER] == D3DTEXF_POINT)
m_fetch4 |= 1u << StateSampler; m_fetch4 |= 1u << StateSampler;
} }
else if (Value == Fetch4Disabled) { else if (unlikely(Value == Fetch4Disabled)) {
m_fetch4Enabled &= ~(1u << StateSampler); m_fetch4Enabled &= ~(1u << StateSampler);
m_fetch4 &= ~(1u << StateSampler); m_fetch4 &= ~(1u << StateSampler);
} }
} }
if (Type == D3DSAMP_MAGFILTER && m_fetch4Enabled & (1u << StateSampler)) { if (unlikely(Type == D3DSAMP_MAGFILTER && m_fetch4Enabled & (1u << StateSampler))) {
if (Value == D3DTEXF_POINT) if (Value == D3DTEXF_POINT)
m_fetch4 |= 1u << StateSampler; m_fetch4 |= 1u << StateSampler;
else else