mirror of
https://github.com/wolfpld/tracy
synced 2025-04-30 20:53:52 +00:00
Merge pull request #169 from sideeffects/opencl_fixes
Fixes for OpenCLCtxScope when not active
This commit is contained in:
commit
9d66abd679
@ -261,6 +261,7 @@ namespace tracy {
|
|||||||
|
|
||||||
tracy_force_inline void SetEvent(cl_event event)
|
tracy_force_inline void SetEvent(cl_event event)
|
||||||
{
|
{
|
||||||
|
if (!m_active) return;
|
||||||
m_event = event;
|
m_event = event;
|
||||||
cl_int err = clRetainEvent(m_event);
|
cl_int err = clRetainEvent(m_event);
|
||||||
assert(err == CL_SUCCESS);
|
assert(err == CL_SUCCESS);
|
||||||
@ -269,6 +270,7 @@ namespace tracy {
|
|||||||
|
|
||||||
tracy_force_inline ~OpenCLCtxScope()
|
tracy_force_inline ~OpenCLCtxScope()
|
||||||
{
|
{
|
||||||
|
if (!m_active) return;
|
||||||
const auto queryId = m_ctx->NextQueryId(EventInfo{ m_event, EventPhase::End });
|
const auto queryId = m_ctx->NextQueryId(EventInfo{ m_event, EventPhase::End });
|
||||||
|
|
||||||
auto item = Profiler::QueueSerial();
|
auto item = Profiler::QueueSerial();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user