Merge pull request #169 from sideeffects/opencl_fixes

Fixes for OpenCLCtxScope when not active
This commit is contained in:
Bartosz Taudul 2021-01-22 13:01:03 +01:00 committed by GitHub
commit 9d66abd679
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();