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:
parent
cf6142e782
commit
960d2bd158
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user