mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-06 20:58:37 +01:00
[util] Add exchange helper to bitset
This commit is contained in:
parent
cf6142e782
commit
960d2bd158
1 changed files with 6 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue