1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-13 19:29:14 +01:00

[util] Add exchange helper to bitset

This commit is contained in:
Joshua Ashton 2020-01-11 03:23:52 +00:00 committed by Joshie
parent cf6142e782
commit 960d2bd158

View File

@ -205,6 +205,12 @@ namespace dxvk::bit {
m_dwords[dword] &= ~(1u << bit);
}
constexpr bool exchange(uint32_t idx, bool value) {
bool oldValue = get(idx);
set(idx, value);
return oldValue;
}
constexpr void flip(uint32_t idx) {
uint32_t dword = 0;
uint32_t bit = idx;