1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-30 04:24:11 +01:00

[dxvk] Implement comparison and setting multiple bits for DxvkBindingSet

This commit is contained in:
Philip Rebohle 2019-06-23 23:41:46 +02:00
parent 5e3336d79b
commit b7769759f2
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -77,6 +77,28 @@ namespace dxvk {
for (uint32_t i = 0; i < IntCount; i++)
m_slots[i] = 0;
}
/**
* \brief Enables multiple bindings
* \param [in] n Number of bindings
*/
void setFirst(uint32_t n) {
for (uint32_t i = 0; i < IntCount; i++) {
m_slots[i] = n >= BitCount ? ~0u : ~(~0u << n);
n = n >= BitCount ? n - BitCount : 0;
}
}
bool operator == (const DxvkBindingSet& other) const {
bool eq = true;
for (uint32_t i = 0; i < IntCount; i++)
eq &= m_slots[i] == other.m_slots[i];
return eq;
}
bool operator != (const DxvkBindingSet& other) const {
return !this->operator == (other);
}
private: