Skip to content

Commit 24f21da

Browse files
committed
Replaced using namespace tracy with local tracy:: usage
1 parent 78eb725 commit 24f21da

1 file changed

Lines changed: 19 additions & 21 deletions

File tree

include/vsg/utils/TracyInstrumentation.h

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
1717

1818
#include <vsg/utils/Instrumentation.h>
1919

20-
using namespace tracy;
21-
2220
namespace vsg
2321
{
2422

@@ -35,7 +33,7 @@ namespace vsg
3533
class TracyContexts : public Inherit<Object, TracyContexts>
3634
{
3735
public:
38-
VkCtx* getOrCreateContext(CommandBuffer& commandBuffer) const
36+
tracy::VkCtx* getOrCreateContext(CommandBuffer& commandBuffer) const
3937
{
4038
std::scoped_lock<std::mutex> lock(mutex);
4139

@@ -79,7 +77,7 @@ namespace vsg
7977
}
8078

8179
mutable std::mutex mutex;
82-
mutable std::map<ref_ptr<Device>, std::pair<VkCtx*, bool>> ctxMap;
80+
mutable std::map<ref_ptr<Device>, std::pair<tracy::VkCtx*, bool>> ctxMap;
8381

8482
protected:
8583
~TracyContexts()
@@ -111,7 +109,7 @@ namespace vsg
111109

112110
ref_ptr<TracySettings> settings;
113111
ref_ptr<TracyContexts> contexts;
114-
mutable VkCtx* ctx = nullptr;
112+
mutable tracy::VkCtx* ctx = nullptr;
115113
bool requiresCollection = false;
116114

117115
ref_ptr<Instrumentation> shareOrDuplicateForThreadSafety() override
@@ -151,9 +149,9 @@ namespace vsg
151149
reference = 1;
152150
# endif
153151

154-
TracyQueuePrepare(QueueType::ZoneBegin);
155-
MemWrite(&item->zoneBegin.time, tracy::Profiler::GetTime());
156-
MemWrite(&item->zoneBegin.srcloc, (uint64_t)slcloc);
152+
TracyQueuePrepare(tracy::QueueType::ZoneBegin);
153+
tracy::MemWrite(&item->zoneBegin.time, tracy::Profiler::GetTime());
154+
tracy::MemWrite(&item->zoneBegin.srcloc, (uint64_t)slcloc);
157155
TracyQueueCommit(zoneBeginThread);
158156
}
159157

@@ -165,8 +163,8 @@ namespace vsg
165163
if (reference == 0) return;
166164
# endif
167165

168-
TracyQueuePrepare(QueueType::ZoneEnd);
169-
MemWrite(&item->zoneEnd.time, tracy::Profiler::GetTime());
166+
TracyQueuePrepare(tracy::QueueType::ZoneEnd);
167+
tracy::MemWrite(&item->zoneEnd.time, tracy::Profiler::GetTime());
170168
TracyQueueCommit(zoneEndThread);
171169
}
172170

@@ -210,12 +208,12 @@ namespace vsg
210208
CONTEXT_VK_FUNCTION_WRAPPER(vkCmdWriteTimestamp(cmdbuf, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, ctx->GetQueryPool(), queryId));
211209

212210
auto item = tracy::Profiler::QueueSerial();
213-
MemWrite(&item->hdr.type, QueueType::GpuZoneBeginSerial);
214-
MemWrite(&item->gpuZoneBegin.cpuTime, tracy::Profiler::GetTime());
215-
MemWrite(&item->gpuZoneBegin.srcloc, (uint64_t)slcloc);
216-
MemWrite(&item->gpuZoneBegin.thread, GetThreadHandle());
217-
MemWrite(&item->gpuZoneBegin.queryId, uint16_t(queryId));
218-
MemWrite(&item->gpuZoneBegin.context, ctx->GetId());
211+
tracy::MemWrite(&item->hdr.type, tracy::QueueType::GpuZoneBeginSerial);
212+
tracy::MemWrite(&item->gpuZoneBegin.cpuTime, tracy::Profiler::GetTime());
213+
tracy::MemWrite(&item->gpuZoneBegin.srcloc, (uint64_t)slcloc);
214+
tracy::MemWrite(&item->gpuZoneBegin.thread, tracy::GetThreadHandle());
215+
tracy::MemWrite(&item->gpuZoneBegin.queryId, uint16_t(queryId));
216+
tracy::MemWrite(&item->gpuZoneBegin.context, ctx->GetId());
219217
tracy::Profiler::QueueSerialFinish();
220218
}
221219

@@ -231,11 +229,11 @@ namespace vsg
231229
CONTEXT_VK_FUNCTION_WRAPPER(vkCmdWriteTimestamp(cmdbuf, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, ctx->GetQueryPool(), queryId));
232230

233231
auto item = tracy::Profiler::QueueSerial();
234-
MemWrite(&item->hdr.type, QueueType::GpuZoneEndSerial);
235-
MemWrite(&item->gpuZoneEnd.cpuTime, tracy::Profiler::GetTime());
236-
MemWrite(&item->gpuZoneEnd.thread, GetThreadHandle());
237-
MemWrite(&item->gpuZoneEnd.queryId, uint16_t(queryId));
238-
MemWrite(&item->gpuZoneEnd.context, ctx->GetId());
232+
tracy::MemWrite(&item->hdr.type, tracy::QueueType::GpuZoneEndSerial);
233+
tracy::MemWrite(&item->gpuZoneEnd.cpuTime, tracy::Profiler::GetTime());
234+
tracy::MemWrite(&item->gpuZoneEnd.thread, tracy::GetThreadHandle());
235+
tracy::MemWrite(&item->gpuZoneEnd.queryId, uint16_t(queryId));
236+
tracy::MemWrite(&item->gpuZoneEnd.context, ctx->GetId());
239237
tracy::Profiler::QueueSerialFinish();
240238
}
241239
};

0 commit comments

Comments
 (0)