From 70ef09eb52f9921239ac4d0e7d2e542af6e86609 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Mon, 15 Jun 2020 11:11:59 +0300 Subject: [PATCH] Filter out non command scope KHR counters KHR counters come in 3 different scopes (quoting the spec) : * VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_BUFFER_KHR - the performance counter scope is a single complete command buffer. * VK_PERFORMANCE_COUNTER_SCOPE_RENDER_PASS_KHR - the performance counter scope is zero or more complete render passes. The performance query containing the performance counter must begin and end outside a render pass instance. * VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_KHR - the performance counter scope is zero or more commands. The way we're currently using the counters is tied to draw/dispatch commands so we should only use the SCOPE_COMMAND type of counters. --- renderdoc/driver/vulkan/vk_counters.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/vulkan/vk_counters.cpp b/renderdoc/driver/vulkan/vk_counters.cpp index 61701a7b9..62dfab2c1 100644 --- a/renderdoc/driver/vulkan/vk_counters.cpp +++ b/renderdoc/driver/vulkan/vk_counters.cpp @@ -154,7 +154,12 @@ rdcarray VulkanReplay::EnumerateCounters() Unwrap(physDev), 0, &khrCounters, &m_KHRCounters[0], &m_KHRCountersDescriptions[0]); for(uint32_t c = 0; c < khrCounters; c++) - ret.push_back(ToKHRCounter(c)); + { + // Only report counters with command scope. We currently don't + // have use for renderpass ones. + if(m_KHRCounters[c].scope == VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_KHR) + ret.push_back(ToKHRCounter(c)); + } } if(m_pAMDCounters)