From be3a6a5dfb084640344d67e6f43c9ebd4496305d Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 20 Jan 2021 20:54:08 +0000 Subject: [PATCH] Set counter-fetching mode around IHV counters on OpenGL * This mode suppresses the default behaviour to end unbalanced things like transform feedback and queries, and also stops the capture from using queries that might be in use outside. --- renderdoc/driver/gl/gl_counters.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/renderdoc/driver/gl/gl_counters.cpp b/renderdoc/driver/gl/gl_counters.cpp index 7a565ab64..82d9eb1a3 100644 --- a/renderdoc/driver/gl/gl_counters.cpp +++ b/renderdoc/driver/gl/gl_counters.cpp @@ -566,6 +566,8 @@ rdcarray GLReplay::FetchCounters(const rdcarray &allC std::copy_if(allCounters.begin(), allCounters.end(), std::back_inserter(counters), [](const GPUCounter &c) { return IsGenericCounter(c); }); + m_pDriver->SetFetchCounters(true); + if(m_pAMDCounters) { // Filter out the AMD counters @@ -602,6 +604,8 @@ rdcarray GLReplay::FetchCounters(const rdcarray &allC ret = FetchCountersARM(armCounters); } + m_pDriver->SetFetchCounters(false); + if(counters.empty()) { return ret;