1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-29 17:52:18 +01:00

[d3d9] Optimize MarkTextureBindingDirty with tzcnt loop of m_activeTextures

This commit is contained in:
Joshua Ashton 2021-08-09 03:36:36 +01:00 committed by Joshie
parent 242b7b6d9c
commit abba425ed0

View File

@ -5868,7 +5868,8 @@ namespace dxvk {
void D3D9DeviceEx::MarkTextureBindingDirty(IDirect3DBaseTexture9* texture) {
D3D9DeviceLock lock = LockDevice();
for (uint32_t i = 0; i < m_state.textures.size(); i++) {
for (uint32_t tex = m_activeTextures; tex; tex &= tex - 1) {
const uint32_t i = bit::tzcnt(tex);
if (m_state.textures[i] == texture)
m_dirtyTextures |= 1u << i;
}