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.
This commit is contained in:
Lionel Landwerlin
2020-06-15 11:11:59 +03:00
committed by Baldur Karlsson
parent 19c066c6fc
commit 70ef09eb52
+6 -1
View File
@@ -154,7 +154,12 @@ rdcarray<GPUCounter> 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)