diff options
author | Chris Robinson <[email protected]> | 2023-05-01 17:11:49 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-05-01 17:11:49 -0700 |
commit | bb08a416f1b0e31292b896f2f8845e365daee6b1 (patch) | |
tree | 065c1ec74167265451fd3396b7557be22f962c16 /al/debug.cpp | |
parent | 89f67ad6f9878ecfb48b49ce0dd69b9ecb065d0b (diff) |
Put the debug filters into a group
Diffstat (limited to 'al/debug.cpp')
-rw-r--r-- | al/debug.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/al/debug.cpp b/al/debug.cpp index 70c7c4db..fc893490 100644 --- a/al/debug.cpp +++ b/al/debug.cpp @@ -222,6 +222,7 @@ FORCE_ALIGN void AL_APIENTRY alDebugMessageControlSOFT(ALenum source, ALenum typ } std::lock_guard<std::mutex> _{context->mDebugCbLock}; + DebugGroup &debug = context->mDebugGroups.back(); if(count > 0) { const uint filterbase{(1u<<srcIndices[0]) | (1u<<typeIndices[0])}; @@ -230,24 +231,23 @@ FORCE_ALIGN void AL_APIENTRY alDebugMessageControlSOFT(ALenum source, ALenum typ { const uint64_t filter{filterbase | (uint64_t{id} << 32)}; - auto iter = std::lower_bound(context->mDebugIdFilters.cbegin(), - context->mDebugIdFilters.cend(), filter); - if(!enable && (iter == context->mDebugIdFilters.cend() || *iter != filter)) - context->mDebugIdFilters.insert(iter, filter); - else if(enable && iter != context->mDebugIdFilters.cend() && *iter == filter) - context->mDebugIdFilters.erase(iter); + auto iter = std::lower_bound(debug.mIdFilters.cbegin(), debug.mIdFilters.cend(), + filter); + if(!enable && (iter == debug.mIdFilters.cend() || *iter != filter)) + debug.mIdFilters.insert(iter, filter); + else if(enable && iter != debug.mIdFilters.cend() && *iter == filter) + debug.mIdFilters.erase(iter); } } else { - auto apply_filter = [enable,&context](const uint filter) + auto apply_filter = [enable,&debug](const uint filter) { - auto iter = std::lower_bound(context->mDebugFilters.cbegin(), - context->mDebugFilters.cend(), filter); - if(!enable && (iter == context->mDebugFilters.cend() || *iter != filter)) - context->mDebugFilters.insert(iter, filter); - else if(enable && iter != context->mDebugFilters.cend() && *iter == filter) - context->mDebugFilters.erase(iter); + auto iter = std::lower_bound(debug.mFilters.cbegin(), debug.mFilters.cend(), filter); + if(!enable && (iter == debug.mFilters.cend() || *iter != filter)) + debug.mFilters.insert(iter, filter); + else if(enable && iter != debug.mFilters.cend() && *iter == filter) + debug.mFilters.erase(iter); }; auto apply_severity = [apply_filter,svrIndices](const uint filter) { |