mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-03 04:24:11 +01:00
[util] Add get to bitset
This commit is contained in:
parent
5cc0fd5c25
commit
fae99907da
@ -176,6 +176,19 @@ namespace dxvk::bit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr bool get(uint32_t idx) const {
|
||||||
|
uint32_t dword = 0;
|
||||||
|
uint32_t bit = idx;
|
||||||
|
|
||||||
|
// Compiler doesn't remove this otherwise.
|
||||||
|
if constexpr (Dwords > 1) {
|
||||||
|
dword = idx / 32;
|
||||||
|
bit = idx % 32;
|
||||||
|
}
|
||||||
|
|
||||||
|
return m_dwords[dword] & (1u << bit);
|
||||||
|
}
|
||||||
|
|
||||||
constexpr void set(uint32_t idx, bool value) {
|
constexpr void set(uint32_t idx, bool value) {
|
||||||
uint32_t dword = 0;
|
uint32_t dword = 0;
|
||||||
uint32_t bit = idx;
|
uint32_t bit = idx;
|
||||||
|
Loading…
Reference in New Issue
Block a user