Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Lynch <jlynch@sidefx.com>2021-01-22 10:16:11 +0300
committerJohn Lynch <jlynch@sidefx.com>2021-01-22 10:16:11 +0300
commite7b3752cab26819a5746ceb4cf44961a9fea90ae (patch)
tree93904c62356a7122c5313f0aee3a57432dd93e66
parent20b2be3b777a47f784bf241df08762af2fd15d37 (diff)
Fixes for OpenCLCtxScope when !m_active.
Both setEvent and the destructor should return immediately when !m_active, as the scope is not properly initialized (m_beginQueryId in particular.)
-rw-r--r--TracyOpenCL.hpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/TracyOpenCL.hpp b/TracyOpenCL.hpp
index 6190f802..8026d0cb 100644
--- a/TracyOpenCL.hpp
+++ b/TracyOpenCL.hpp
@@ -261,6 +261,7 @@ namespace tracy {
tracy_force_inline void SetEvent(cl_event event)
{
+ if (!m_active) return;
m_event = event;
cl_int err = clRetainEvent(m_event);
assert(err == CL_SUCCESS);
@@ -269,6 +270,7 @@ namespace tracy {
tracy_force_inline ~OpenCLCtxScope()
{
+ if (!m_active) return;
const auto queryId = m_ctx->NextQueryId(EventInfo{ m_event, EventPhase::End });
auto item = Profiler::QueueSerial();