From 6d95122189e27ac20ed122c2aefc9209f2116fd7 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Sun, 21 Oct 2018 19:42:43 +0100 Subject: [PATCH] Do not include Intel counters in the generic ones At this point we don't have Intel GL counters. But the current logic assumes there is only AMD ones (and that if it's not AMD's, it must be the generic ones). --- renderdoc/api/replay/replay_enums.h | 11 +++++++++++ renderdoc/driver/d3d11/d3d11_counters.cpp | 4 +--- renderdoc/driver/gl/gl_counters.cpp | 2 +- renderdoc/driver/vulkan/vk_counters.cpp | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) 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;