diff options
author | Chris Robinson <[email protected]> | 2023-05-01 01:22:29 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-05-01 01:22:29 -0700 |
commit | 931e261fe0944c1876a95a373996351f3424f399 (patch) | |
tree | e5114b184ccaa96a091c2ac51d6cf0db1a955556 /alc | |
parent | 343b2ce1b3395a672608552d5fe2b1a312c100b1 (diff) |
Implement debug message filtering for IDs
Diffstat (limited to 'alc')
-rw-r--r-- | alc/context.cpp | 11 | ||||
-rw-r--r-- | alc/context.h | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/alc/context.cpp b/alc/context.cpp index 66de19d6..d4019bc9 100644 --- a/alc/context.cpp +++ b/alc/context.cpp @@ -366,6 +366,17 @@ void ALCcontext::sendDebugMessage(DebugSource source, DebugType type, ALuint id, throw std::runtime_error{"Unexpected debug severity value "+std::to_string(al::to_underlying(severity))}; }; + auto iditer = mDebugIdFilters.find(id); + if(iditer != mDebugIdFilters.end()) + { + const uint filter{(1u<<(DebugSourceBase+al::to_underlying(source))) + | (1u<<(DebugTypeBase+al::to_underlying(type)))}; + + auto iter = std::lower_bound(iditer->second.cbegin(), iditer->second.cend(), filter); + if(iter != iditer->second.cend() && *iter == filter) + return; + } + const uint filter{(1u<<(DebugSourceBase+al::to_underlying(source))) | (1u<<(DebugTypeBase+al::to_underlying(type))) | (1u<<(DebugSeverityBase+al::to_underlying(severity)))}; diff --git a/alc/context.h b/alc/context.h index 031e061e..c626160b 100644 --- a/alc/context.h +++ b/alc/context.h @@ -6,6 +6,7 @@ #include <memory> #include <mutex> #include <stdint.h> +#include <unordered_map> #include <utility> #include "AL/al.h" @@ -145,6 +146,7 @@ struct ALCcontext : public al::intrusive_ref<ALCcontext>, ContextBase { ALDEBUGPROCSOFT mDebugCb{}; void *mDebugParam{nullptr}; std::vector<uint> mDebugFilters; + std::unordered_map<uint,std::vector<uint>> mDebugIdFilters; std::deque<LogEntry> mDebugLog; ALlistener mListener{}; |