diff options
| author | JosJuice <josjuice@gmail.com> | 2022-12-18 16:51:32 +0100 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2022-12-18 16:51:32 +0100 |
| commit | 547d9562786360df94e170407864583946a3386b (patch) | |
| tree | 9e7889f0c41201ba73ce648c1ca12b44f5ac3d0c /Source/Core/VideoBackends/D3D/D3DState.cpp | |
| parent | a1c4861ad8666b622f96266a20af6e8e787c9693 (diff) | |
Common: Use C++20 <bit> header in BitSet.h
Diffstat (limited to 'Source/Core/VideoBackends/D3D/D3DState.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D/D3DState.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Core/VideoBackends/D3D/D3DState.cpp b/Source/Core/VideoBackends/D3D/D3DState.cpp index 5712f6fd3c..66ccec2416 100644 --- a/Source/Core/VideoBackends/D3D/D3DState.cpp +++ b/Source/Core/VideoBackends/D3D/D3DState.cpp @@ -5,9 +5,9 @@ #include <algorithm> #include <array> +#include <bit> #include "Common/Assert.h" -#include "Common/BitSet.h" #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" #include "Common/MsgHandler.h" @@ -163,8 +163,8 @@ void StateManager::Apply() void StateManager::ApplyTextures() { - const int textureMaskShift = Common::LeastSignificantSetBit((u32)DirtyFlag_Texture0); - const int samplerMaskShift = Common::LeastSignificantSetBit((u32)DirtyFlag_Sampler0); + const int textureMaskShift = std::countr_zero((u32)DirtyFlag_Texture0); + const int samplerMaskShift = std::countr_zero((u32)DirtyFlag_Sampler0); u32 dirtyTextures = (m_dirtyFlags & @@ -178,7 +178,7 @@ void StateManager::ApplyTextures() samplerMaskShift; while (dirtyTextures) { - const int index = Common::LeastSignificantSetBit(dirtyTextures); + const int index = std::countr_zero(dirtyTextures); if (m_current.textures[index] != m_pending.textures[index]) { D3D::context->PSSetShaderResources(index, 1, &m_pending.textures[index]); @@ -190,7 +190,7 @@ void StateManager::ApplyTextures() while (dirtySamplers) { - const int index = Common::LeastSignificantSetBit(dirtySamplers); + const int index = std::countr_zero(dirtySamplers); if (m_current.samplers[index] != m_pending.samplers[index]) { D3D::context->PSSetSamplers(index, 1, &m_pending.samplers[index]); @@ -221,7 +221,7 @@ void StateManager::SetTextureByMask(u32 textureSlotMask, ID3D11ShaderResourceVie { while (textureSlotMask) { - const int index = Common::LeastSignificantSetBit(textureSlotMask); + const int index = std::countr_zero(textureSlotMask); SetTexture(index, srv); textureSlotMask &= ~(1 << index); } |
