diff --git a/renderdoc/api/replay/replay_enums.h b/renderdoc/api/replay/replay_enums.h index 5c5dd418e..08b2e2b17 100644 --- a/renderdoc/api/replay/replay_enums.h +++ b/renderdoc/api/replay/replay_enums.h @@ -2875,6 +2875,17 @@ enum class GPUCounter : uint32_t ITERABLE_OPERATORS(GPUCounter); DECLARE_REFLECTION_ENUM(GPUCounter); +DOCUMENT(R"(Check whether or not this is a Generic counter. + +:param GPUCounter c: The counter. +:return: ``True`` if it is a generic counter, ``False`` if it's not. +:rtype: ``bool`` +)"); +inline constexpr bool IsGenericCounter(GPUCounter c) +{ + return c < GPUCounter::Count; +} + DOCUMENT(R"(Check whether or not this is an AMD private counter. :param GPUCounter c: The counter. diff --git a/renderdoc/driver/d3d11/d3d11_counters.cpp b/renderdoc/driver/d3d11/d3d11_counters.cpp index 9e7932852..216a892f0 100644 --- a/renderdoc/driver/d3d11/d3d11_counters.cpp +++ b/renderdoc/driver/d3d11/d3d11_counters.cpp @@ -576,9 +576,7 @@ vector D3D11Replay::FetchCounters(const vector &count vector d3dCounters; std::copy_if(counters.begin(), counters.end(), std::back_inserter(d3dCounters), - [](const GPUCounter &c) { - return !IsAMDCounter(c) && !IsNvidiaCounter(c) && !IsIntelCounter(c); - }); + [](const GPUCounter &c) { return IsGenericCounter(c); }); if(m_pAMDCounters) { diff --git a/renderdoc/driver/gl/gl_counters.cpp b/renderdoc/driver/gl/gl_counters.cpp index 8edd15ec3..060e8c25a 100644 --- a/renderdoc/driver/gl/gl_counters.cpp +++ b/renderdoc/driver/gl/gl_counters.cpp @@ -382,7 +382,7 @@ vector GLReplay::FetchCounters(const vector &allCount vector counters; std::copy_if(allCounters.begin(), allCounters.end(), std::back_inserter(counters), - [](const GPUCounter &c) { return !IsAMDCounter(c); }); + [](const GPUCounter &c) { return IsGenericCounter(c); }); if(m_pAMDCounters) { diff --git a/renderdoc/driver/vulkan/vk_counters.cpp b/renderdoc/driver/vulkan/vk_counters.cpp index c2372ea8e..79e1fb8a1 100644 --- a/renderdoc/driver/vulkan/vk_counters.cpp +++ b/renderdoc/driver/vulkan/vk_counters.cpp @@ -451,7 +451,7 @@ vector VulkanReplay::FetchCounters(const vector &coun vector vkCounters; std::copy_if(counters.begin(), counters.end(), std::back_inserter(vkCounters), - [](const GPUCounter &c) { return !IsAMDCounter(c); }); + [](const GPUCounter &c) { return IsGenericCounter(c); }); vector ret;