Skip to content

Commit

Permalink
Fix some random crashes when using argument buffers
Browse files Browse the repository at this point in the history
Fixes an issue with BitArray enumeration, where it
could iterate over bit indices that weren't set

This would cause issues in descriptor set allocation,
when argument buffers are enabled, where it could
select a set index from the pool that isn't freed,
and try to create a new set on top of the exiting one
  • Loading branch information
WDog367 committed Sep 18, 2024
1 parent 5409e80 commit b16c618
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MoltenVK/MoltenVK/Utility/MVKBitArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class MVKBitArray {
bool enumerateEnabledBits(bool shouldClear, std::function<bool(size_t bitIndex)> func) {
for (size_t bitIdx = getIndexOfFirstSetBit(shouldClear);
bitIdx < _bitCount;
getIndexOfFirstSetBit(++bitIdx, shouldClear)) {
bitIdx = getIndexOfFirstSetBit(++bitIdx, shouldClear)) {

if ( !func(bitIdx) ) { return false; }
}
Expand Down

0 comments on commit b16c618

Please sign in to comment.