mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 21:10:42 +00:00
Fix validation issues around KHR performance query
* Set sType for query-return structures. * Ignore pass boundaries to not mix queries inside and outside of renderpass boundaries. * Wait for idle before fetching KHR results (don't think it should be necessary with VK_QUERY_RESULT_WAIT_BIT but validation expects it).
This commit is contained in:
@@ -165,6 +165,11 @@ rdcarray<GPUCounter> VulkanReplay::EnumerateCounters()
|
||||
m_KHRCounters.resize(khrCounters);
|
||||
m_KHRCountersDescriptions.resize(khrCounters);
|
||||
|
||||
for(VkPerformanceCounterKHR &count : m_KHRCounters)
|
||||
count.sType = VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR;
|
||||
for(VkPerformanceCounterDescriptionKHR &desc : m_KHRCountersDescriptions)
|
||||
desc.sType = VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR;
|
||||
|
||||
ObjDisp(physDev)->EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(
|
||||
Unwrap(physDev), 0, &khrCounters, &m_KHRCounters[0], &m_KHRCountersDescriptions[0]);
|
||||
|
||||
@@ -629,14 +634,23 @@ struct VulkanKHRCallback : public VulkanActionCallback
|
||||
}
|
||||
void PreMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) override
|
||||
{
|
||||
// ignore renderpass boundaries as it's illegal to start and end queries across the boundary
|
||||
if(flags & ActionFlags::PassBoundary)
|
||||
return;
|
||||
PreDraw(eid, flags, cmd);
|
||||
}
|
||||
bool PostMisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) override
|
||||
{
|
||||
// ignore renderpass boundaries as it's illegal to start and end queries across the boundary
|
||||
if(flags & ActionFlags::PassBoundary)
|
||||
return false;
|
||||
return PostDraw(eid, flags, cmd);
|
||||
}
|
||||
void PostRemisc(uint32_t eid, ActionFlags flags, VkCommandBuffer cmd) override
|
||||
{
|
||||
// ignore renderpass boundaries as it's illegal to start and end queries across the boundary
|
||||
if(flags & ActionFlags::PassBoundary)
|
||||
return;
|
||||
PostRedraw(eid, flags, cmd);
|
||||
}
|
||||
void AliasEvent(uint32_t primary, uint32_t alias) override
|
||||
@@ -736,6 +750,8 @@ rdcarray<CounterResult> VulkanReplay::FetchCountersKHR(const rdcarray<GPUCounter
|
||||
m_pDriver->SetSubmitChain(NULL);
|
||||
}
|
||||
|
||||
m_pDriver->vkDeviceWaitIdle(dev);
|
||||
|
||||
rdcarray<VkPerformanceCounterResultKHR> perfResults;
|
||||
perfResults.resize(cb.m_Results.size() * counters.size());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user