File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
filament/backend/src/vulkan Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -46,17 +46,13 @@ fvkmemory::resource_ptr<VulkanTimerQuery> VulkanQueryManager::getNextQuery(
46
46
return {};
47
47
}
48
48
49
- bool found = false ;
50
49
std::pair<uint32_t , uint32_t > queryIndices;
51
- unused.forEachSetBit ([&](size_t index) {
52
- if (found) {
53
- return ;
54
- }
50
+ size_t const firstUnused = unused.firstSetBit ();
51
+ {
55
52
std::unique_lock<utils::Mutex> lock (mMutex );
56
- mUsed .set (index);
57
- found = true ;
58
- queryIndices = std::make_pair (index * 2 , index * 2 + 1 );
59
- });
53
+ mUsed .set (firstUnused);
54
+ queryIndices = { firstUnused * 2 , firstUnused * 2 + 1 };
55
+ }
60
56
return fvkmemory::resource_ptr<VulkanTimerQuery>::construct (resourceManager, queryIndices.first ,
61
57
queryIndices.second );
62
58
}
You can’t perform that action at this time.
0 commit comments