[d3d9] Track fixed function sampler bitfields

Cleans some stuff up a little bit and makes FF draws faster when this gets incorrectly invalidated.
This commit is contained in:
Joshua Ashton 2021-08-16 17:09:03 +01:00 committed by Joshie
parent c6a4c41d20
commit 64852f05c3
2 changed files with 5 additions and 10 deletions

View File

@ -5815,12 +5815,8 @@ namespace dxvk {
const uint32_t textureBitMask = 0b11u << offset;
const uint32_t textureBits = textureType << offset;
if ((m_samplerTypeBitfield & textureBitMask) != textureBits) {
m_flags.set(D3D9DeviceFlag::DirtyFFPixelShader);
m_samplerTypeBitfield &= ~textureBitMask;
m_samplerTypeBitfield |= textureBits;
}
m_samplerTypeBitfield &= ~textureBitMask;
m_samplerTypeBitfield |= textureBits;
}
EmitCs([
@ -5842,9 +5838,6 @@ namespace dxvk {
for (uint32_t i : bit::BitMask(mask & pixelShaderMask))
typeMask |= 0b11u << (i * 2u);
if ((m_samplerTypeBitfield & typeMask) != 0) {
m_flags.set(D3D9DeviceFlag::DirtyFFPixelShader);
m_samplerTypeBitfield &= ~typeMask;
}
@ -6570,8 +6563,9 @@ namespace dxvk {
void D3D9DeviceEx::UpdateFixedFunctionPS() {
// Shader...
if (m_flags.test(D3D9DeviceFlag::DirtyFFPixelShader)) {
if (m_flags.test(D3D9DeviceFlag::DirtyFFPixelShader) || m_lastSamplerTypeBitfieldFF != m_samplerTypeBitfield) {
m_flags.clr(D3D9DeviceFlag::DirtyFFPixelShader);
m_lastSamplerTypeBitfieldFF = m_samplerTypeBitfield;
// Used args for a given operation.
auto ArgsMask = [](DWORD Op) {

View File

@ -1211,6 +1211,7 @@ namespace dxvk {
uint32_t m_lastPointMode = 0;
uint32_t m_lastFetch4 = 0;
uint32_t m_lastHazardsDS = 0;
uint32_t m_lastSamplerTypeBitfieldFF = 0;
D3D9ShaderMasks m_vsShaderMasks = D3D9ShaderMasks();
D3D9ShaderMasks m_psShaderMasks = FixedFunctionMask;