From 0abb84d1487721948f54ccd718aec69f34423059 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Fri, 8 Dec 2023 10:00:48 +0100 Subject: [PATCH 1/2] Spelling fix --- include/vsg/utils/Instrumentation.h | 8 ++--- src/vsg/app/CommandGraph.cpp | 12 ++++---- src/vsg/app/RecordAndSubmitTask.cpp | 12 ++++---- src/vsg/app/RecordTraversal.cpp | 48 ++++++++++++++--------------- src/vsg/app/Viewer.cpp | 38 +++++++++++------------ 5 files changed, 59 insertions(+), 59 deletions(-) diff --git a/include/vsg/utils/Instrumentation.h b/include/vsg/utils/Instrumentation.h index 9b25006cb0..9994f5350e 100644 --- a/include/vsg/utils/Instrumentation.h +++ b/include/vsg/utils/Instrumentation.h @@ -84,9 +84,9 @@ namespace vsg inline ~ScopedInstrumentation() { if (instr) instr->leave(sl, reference); } }; - #define SCOPED_INSTRUMENTASTION(instrumentation) static constexpr SourceLocation s_source_location_##__LINE__ { nullptr, VsgFunctionName, __FILE__, __LINE__, ubvec4(255, 255, 255, 255) }; ScopedInstrumentation __scoped_instrumentation(instrumentation, &(s_source_location_##__LINE__)); - #define SCOPED_INSTRUMENTASTION_N(instrumentation, name) static constexpr SourceLocation s_source_location_##__LINE__ { name, VsgFunctionName, __FILE__, __LINE__, ubvec4(255, 255, 255, 255) }; ScopedInstrumentation __scoped_instrumentation(instrumentation, &(s_source_location_##__LINE__)); - #define SCOPED_INSTRUMENTASTION_C(instrumentation, color) static constexpr SourceLocation s_source_location_##__LINE__ { nullptr, VsgFunctionName, __FILE__, __LINE__, color }; ScopedInstrumentation __scoped_instrumentation(instrumentation, &(s_source_location_##__LINE__)); - #define SCOPED_INSTRUMENTASTION_NC(instrumentation, name, color) static constexpr SourceLocation s_source_location_##__LINE__ { name, VsgFunctionName, __FILE__, __LINE__, color }; ScopedInstrumentation __scoped_instrumentation(instrumentation, &(s_source_location_##__LINE__)); + #define SCOPED_INSTRUMENTATION(instrumentation) static constexpr SourceLocation s_source_location_##__LINE__ { nullptr, VsgFunctionName, __FILE__, __LINE__, ubvec4(255, 255, 255, 255) }; ScopedInstrumentation __scoped_instrumentation(instrumentation, &(s_source_location_##__LINE__)); + #define SCOPED_INSTRUMENTATION_N(instrumentation, name) static constexpr SourceLocation s_source_location_##__LINE__ { name, VsgFunctionName, __FILE__, __LINE__, ubvec4(255, 255, 255, 255) }; ScopedInstrumentation __scoped_instrumentation(instrumentation, &(s_source_location_##__LINE__)); + #define SCOPED_INSTRUMENTATION_C(instrumentation, color) static constexpr SourceLocation s_source_location_##__LINE__ { nullptr, VsgFunctionName, __FILE__, __LINE__, color }; ScopedInstrumentation __scoped_instrumentation(instrumentation, &(s_source_location_##__LINE__)); + #define SCOPED_INSTRUMENTATION_NC(instrumentation, name, color) static constexpr SourceLocation s_source_location_##__LINE__ { name, VsgFunctionName, __FILE__, __LINE__, color }; ScopedInstrumentation __scoped_instrumentation(instrumentation, &(s_source_location_##__LINE__)); } // namespace vsg diff --git a/src/vsg/app/CommandGraph.cpp b/src/vsg/app/CommandGraph.cpp index 6a93d388dc..834043d197 100644 --- a/src/vsg/app/CommandGraph.cpp +++ b/src/vsg/app/CommandGraph.cpp @@ -23,7 +23,7 @@ using namespace vsg; CommandGraph::CommandGraph() { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); } CommandGraph::CommandGraph(ref_ptr in_device, int family) : @@ -31,14 +31,14 @@ CommandGraph::CommandGraph(ref_ptr in_device, int family) : queueFamily(family), presentFamily(-1) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); } CommandGraph::CommandGraph(ref_ptr in_window, ref_ptr child) : window(in_window), device(in_window->getOrCreateDevice()) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); VkQueueFlags queueFlags = VK_QUEUE_GRAPHICS_BIT; if (window->traits()) queueFlags = window->traits()->queueFlags; @@ -50,7 +50,7 @@ CommandGraph::CommandGraph(ref_ptr in_window, ref_ptr child) : CommandGraph::~CommandGraph() { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); } VkCommandBufferLevel CommandGraph::level() const @@ -64,7 +64,7 @@ void CommandGraph::reset() ref_ptr CommandGraph::getOrCreateRecordTraversal() { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); if (!recordTraversal) { @@ -82,7 +82,7 @@ ref_ptr CommandGraph::getOrCreateRecordTraversal() void CommandGraph::record(ref_ptr recordedCommandBuffers, ref_ptr frameStamp, ref_ptr databasePager) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); if (window && !window->visible()) { diff --git a/src/vsg/app/RecordAndSubmitTask.cpp b/src/vsg/app/RecordAndSubmitTask.cpp index 6a49cbf6bf..0095d689e4 100644 --- a/src/vsg/app/RecordAndSubmitTask.cpp +++ b/src/vsg/app/RecordAndSubmitTask.cpp @@ -22,7 +22,7 @@ using namespace vsg; RecordAndSubmitTask::RecordAndSubmitTask(Device* in_device, uint32_t numBuffers) : device(in_device) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); _currentFrameIndex = numBuffers; // numBuffers is used to signify unset value for (uint32_t i = 0; i < numBuffers; ++i) @@ -45,7 +45,7 @@ RecordAndSubmitTask::RecordAndSubmitTask(Device* in_device, uint32_t numBuffers) void RecordAndSubmitTask::advance() { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); if (_currentFrameIndex >= _indices.size()) { @@ -85,7 +85,7 @@ Fence* RecordAndSubmitTask::fence(size_t relativeFrameIndex) VkResult RecordAndSubmitTask::submit(ref_ptr frameStamp) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); if (VkResult result = start(); result != VK_SUCCESS) return result; @@ -103,7 +103,7 @@ VkResult RecordAndSubmitTask::submit(ref_ptr frameStamp) VkResult RecordAndSubmitTask::start() { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); if (earlyTransferTask) earlyTransferTask->currentTransferCompletedSemaphore = {}; if (lateTransferTask) lateTransferTask->currentTransferCompletedSemaphore = {}; @@ -121,7 +121,7 @@ VkResult RecordAndSubmitTask::start() VkResult RecordAndSubmitTask::record(ref_ptr recordedCommandBuffers, ref_ptr frameStamp) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); for (auto& commandGraph : commandGraphs) { @@ -133,7 +133,7 @@ VkResult RecordAndSubmitTask::record(ref_ptr recordedCom VkResult RecordAndSubmitTask::finish(ref_ptr recordedCommandBuffers) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); if (lateTransferTask) { diff --git a/src/vsg/app/RecordTraversal.cpp b/src/vsg/app/RecordTraversal.cpp index 0c661578e1..8dcc5c046b 100644 --- a/src/vsg/app/RecordTraversal.cpp +++ b/src/vsg/app/RecordTraversal.cpp @@ -50,7 +50,7 @@ RecordTraversal::RecordTraversal(uint32_t in_maxSlot, std::set in_bins) : _state(new State(in_maxSlot)) { // instrumentation = Instrumentation::create(); - SCOPED_INSTRUMENTASTION_C(instrumentation, ubvec4(0, 0, 255, 255)); + SCOPED_INSTRUMENTATION_C(instrumentation, ubvec4(0, 0, 255, 255)); _minimumBinNumber = 0; int32_t maximumBinNumber = 0; @@ -71,7 +71,7 @@ RecordTraversal::RecordTraversal(uint32_t in_maxSlot, std::set in_bins) : RecordTraversal::~RecordTraversal() { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); } CommandBuffer* RecordTraversal::getCommandBuffer() @@ -99,7 +99,7 @@ void RecordTraversal::setDatabasePager(DatabasePager* dp) void RecordTraversal::clearBins() { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); for (auto& bin : _bins) { @@ -109,7 +109,7 @@ void RecordTraversal::clearBins() void RecordTraversal::apply(const Object& object) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); //debug("Visiting Object"); object.traverse(*this); @@ -117,7 +117,7 @@ void RecordTraversal::apply(const Object& object) void RecordTraversal::apply(const Group& group) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); //debug("Visiting Group"); #if INLINE_TRAVERSE @@ -129,7 +129,7 @@ void RecordTraversal::apply(const Group& group) void RecordTraversal::apply(const QuadGroup& quadGroup) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); //debug("Visiting QuadGroup"); #if INLINE_TRAVERSE @@ -141,7 +141,7 @@ void RecordTraversal::apply(const QuadGroup& quadGroup) void RecordTraversal::apply(const LOD& lod) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); const auto& sphere = lod.bound; @@ -166,7 +166,7 @@ void RecordTraversal::apply(const LOD& lod) void RecordTraversal::apply(const PagedLOD& plod) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); const auto& sphere = plod.bound; auto frameCount = _frameStamp->frameCount; @@ -246,7 +246,7 @@ void RecordTraversal::apply(const PagedLOD& plod) void RecordTraversal::apply(const CullGroup& cullGroup) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); if (_state->intersect(cullGroup.bound)) { @@ -257,7 +257,7 @@ void RecordTraversal::apply(const CullGroup& cullGroup) void RecordTraversal::apply(const CullNode& cullNode) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); if (_state->intersect(cullNode.bound)) { @@ -268,7 +268,7 @@ void RecordTraversal::apply(const CullNode& cullNode) void RecordTraversal::apply(const DepthSorted& depthSorted) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); if (_state->intersect(depthSorted.bound)) { @@ -282,7 +282,7 @@ void RecordTraversal::apply(const DepthSorted& depthSorted) void RecordTraversal::apply(const Switch& sw) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); for (auto& child : sw.children) { @@ -295,14 +295,14 @@ void RecordTraversal::apply(const Switch& sw) void RecordTraversal::apply(const Light& /*light*/) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); //debug("RecordTraversal::apply(Light) ", light.className()); } void RecordTraversal::apply(const AmbientLight& light) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); //debug("RecordTraversal::apply(AmbientLight) ", light.className()); if (_viewDependentState) _viewDependentState->ambientLights.emplace_back(_state->modelviewMatrixStack.top(), &light); @@ -310,7 +310,7 @@ void RecordTraversal::apply(const AmbientLight& light) void RecordTraversal::apply(const DirectionalLight& light) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); //debug("RecordTraversal::apply(DirectionalLight) ", light.className()); if (_viewDependentState) _viewDependentState->directionalLights.emplace_back(_state->modelviewMatrixStack.top(), &light); @@ -318,7 +318,7 @@ void RecordTraversal::apply(const DirectionalLight& light) void RecordTraversal::apply(const PointLight& light) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); //debug("RecordTraversal::apply(PointLight) ", light.className()); if (_viewDependentState) _viewDependentState->pointLights.emplace_back(_state->modelviewMatrixStack.top(), &light); @@ -326,7 +326,7 @@ void RecordTraversal::apply(const PointLight& light) void RecordTraversal::apply(const SpotLight& light) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); //debug("RecordTraversal::apply(SpotLight) ", light.className()); if (_viewDependentState) _viewDependentState->spotLights.emplace_back(_state->modelviewMatrixStack.top(), &light); @@ -334,7 +334,7 @@ void RecordTraversal::apply(const SpotLight& light) void RecordTraversal::apply(const StateGroup& stateGroup) { - SCOPED_INSTRUMENTASTION_C(instrumentation, ubvec4(255, 255, 0, 255)); + SCOPED_INSTRUMENTATION_C(instrumentation, ubvec4(255, 255, 0, 255)); //debug("Visiting StateGroup"); @@ -355,7 +355,7 @@ void RecordTraversal::apply(const StateGroup& stateGroup) void RecordTraversal::apply(const Transform& transform) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); _state->modelviewMatrixStack.push(transform); _state->dirty = true; @@ -377,7 +377,7 @@ void RecordTraversal::apply(const Transform& transform) void RecordTraversal::apply(const MatrixTransform& mt) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); _state->modelviewMatrixStack.push(mt); _state->dirty = true; @@ -400,7 +400,7 @@ void RecordTraversal::apply(const MatrixTransform& mt) // Vulkan nodes void RecordTraversal::apply(const Commands& commands) { - SCOPED_INSTRUMENTASTION_C(instrumentation, ubvec4(0, 255, 0, 255)); + SCOPED_INSTRUMENTATION_C(instrumentation, ubvec4(0, 255, 0, 255)); _state->record(); for (auto& command : commands.children) @@ -411,7 +411,7 @@ void RecordTraversal::apply(const Commands& commands) void RecordTraversal::apply(const Command& command) { - SCOPED_INSTRUMENTASTION_C(instrumentation, ubvec4(0, 255, 0, 255)); + SCOPED_INSTRUMENTATION_C(instrumentation, ubvec4(0, 255, 0, 255)); //debug("Visiting Command"); _state->record(); @@ -420,7 +420,7 @@ void RecordTraversal::apply(const Command& command) void RecordTraversal::apply(const View& view) { - SCOPED_INSTRUMENTASTION_C(instrumentation, ubvec4(0, 0, 255, 255)); + SCOPED_INSTRUMENTATION_C(instrumentation, ubvec4(0, 0, 255, 255)); // note, View::accept() updates the RecordTraversal's traversalMask auto cached_traversalMask = _state->_commandBuffer->traversalMask; @@ -509,7 +509,7 @@ void RecordTraversal::apply(const View& view) void RecordTraversal::apply(const CommandGraph& commandGraph) { - SCOPED_INSTRUMENTASTION_C(instrumentation, ubvec4(0, 0, 255, 255)); + SCOPED_INSTRUMENTATION_C(instrumentation, ubvec4(0, 0, 255, 255)); if (recordedCommandBuffers) { diff --git a/src/vsg/app/Viewer.cpp b/src/vsg/app/Viewer.cpp index 83735abfa6..0ecefb0e77 100644 --- a/src/vsg/app/Viewer.cpp +++ b/src/vsg/app/Viewer.cpp @@ -33,12 +33,12 @@ Viewer::Viewer() : status(vsg::ActivityStatus::create()), _start_point(clock::now()) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); } Viewer::~Viewer() { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); stopThreading(); @@ -48,7 +48,7 @@ Viewer::~Viewer() void Viewer::deviceWaitIdle() const { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); std::set devices; for (auto& window : _windows) @@ -102,7 +102,7 @@ void Viewer::removeWindow(ref_ptr window) void Viewer::close() { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); _close = true; status->set(false); @@ -112,7 +112,7 @@ void Viewer::close() bool Viewer::active() const { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); bool viewerIsActive = !_close; if (viewerIsActive) @@ -137,7 +137,7 @@ bool Viewer::active() const bool Viewer::pollEvents(bool discardPreviousEvents) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); bool result = false; @@ -152,7 +152,7 @@ bool Viewer::pollEvents(bool discardPreviousEvents) bool Viewer::advanceToNextFrame() { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); if (!active()) return false; @@ -192,7 +192,7 @@ bool Viewer::advanceToNextFrame() bool Viewer::acquireNextFrame() { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); if (_close) return false; @@ -232,7 +232,7 @@ bool Viewer::acquireNextFrame() VkResult Viewer::waitForFences(size_t relativeFrameIndex, uint64_t timeout) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); VkResult result = VK_SUCCESS; for (auto& task : recordAndSubmitTasks) @@ -249,7 +249,7 @@ VkResult Viewer::waitForFences(size_t relativeFrameIndex, uint64_t timeout) void Viewer::handleEvents() { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); for (auto& vsg_event : _events) { @@ -262,7 +262,7 @@ void Viewer::handleEvents() void Viewer::compile(ref_ptr hints) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); if (recordAndSubmitTasks.empty()) { @@ -421,7 +421,7 @@ void Viewer::compile(ref_ptr hints) void Viewer::assignRecordAndSubmitTaskAndPresentation(CommandGraphs in_commandGraphs) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); // now remove any commandGraphs associated with window bool needToStartThreading = _threading; @@ -578,7 +578,7 @@ void Viewer::assignRecordAndSubmitTaskAndPresentation(CommandGraphs in_commandGr void Viewer::addRecordAndSubmitTaskAndPresentation(CommandGraphs commandGraphs) { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); // collect the existing CommandGraphs CommandGraphs combinedCommandGraphs; @@ -599,7 +599,7 @@ void Viewer::addRecordAndSubmitTaskAndPresentation(CommandGraphs commandGraphs) void Viewer::setupThreading() { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); debug("Viewer::setupThreading() "); @@ -751,7 +751,7 @@ void Viewer::setupThreading() void Viewer::stopThreading() { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); if (!_threading) return; _threading = false; @@ -772,7 +772,7 @@ void Viewer::stopThreading() void Viewer::update() { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); for (auto& task : recordAndSubmitTasks) { @@ -789,7 +789,7 @@ void Viewer::update() void Viewer::recordAndSubmit() { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); // reset connected ExecuteCommands for (auto& recordAndSubmitTask : recordAndSubmitTasks) @@ -823,7 +823,7 @@ void Viewer::recordAndSubmit() void Viewer::present() { - SCOPED_INSTRUMENTASTION(instrumentation); + SCOPED_INSTRUMENTATION(instrumentation); for (auto& presentation : presentations) { @@ -833,7 +833,7 @@ void Viewer::present() void vsg::updateViewer(Viewer& viewer, const CompileResult& compileResult) { - SCOPED_INSTRUMENTASTION(viewer.instrumentation); + SCOPED_INSTRUMENTATION(viewer.instrumentation); updateTasks(viewer.recordAndSubmitTasks, viewer.compileManager, compileResult); } From a1acda301e6f108f405439aede6edad23c016f0d Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Fri, 8 Dec 2023 10:01:11 +0100 Subject: [PATCH 2/2] Add rump API for initializing Tracy GPU profiling --- include/vsg/utils/Instrumentation.h | 4 ++++ src/vsg/app/Viewer.cpp | 10 ++++++++++ src/vsg/utils/Instrumentation.cpp | 5 +++++ 3 files changed, 19 insertions(+) diff --git a/include/vsg/utils/Instrumentation.h b/include/vsg/utils/Instrumentation.h index 9994f5350e..79eb3b4d7c 100644 --- a/include/vsg/utils/Instrumentation.h +++ b/include/vsg/utils/Instrumentation.h @@ -25,6 +25,8 @@ namespace vsg # define VsgFunctionName __FUNCSIG__ #endif + class Device; + class Queue; class CommandBuffer; /// SourceLocation structs mark the location in a source file when instrumentation is placed. @@ -45,6 +47,8 @@ namespace vsg Instrumentation(); + // Conceived for the needs of Tracy + virtual void init(vsg::ref_ptr device, vsg::ref_ptr queue, vsg::ref_ptr cmd); virtual void enter(const SourceLocation* sl, uint64_t& reference) const= 0; virtual void leave(const SourceLocation* sl, uint64_t& reference) const = 0; diff --git a/src/vsg/app/Viewer.cpp b/src/vsg/app/Viewer.cpp index 0ecefb0e77..12a5874665 100644 --- a/src/vsg/app/Viewer.cpp +++ b/src/vsg/app/Viewer.cpp @@ -571,6 +571,16 @@ void Viewer::assignRecordAndSubmitTaskAndPresentation(CommandGraphs in_commandGr recordAndSubmitTask->earlyTransferTask->transferQueue = transferQueue; recordAndSubmitTask->lateTransferTask->transferQueue = transferQueue; } + if (instrumentation) + { + auto queueFamily = device->getPhysicalDevice()->getQueueFamily(VK_QUEUE_GRAPHICS_BIT); + // VK_COMMAND_POOL_CREATE_TRANSIENT_BIT might be appropriate too. + auto commandPool = CommandPool::create(device, queueFamily, + VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT); + auto cmd = commandPool->allocate(); + ref_ptr ref_device(device); + instrumentation->init(ref_device, mainQueue, cmd); + } } if (needToStartThreading) setupThreading(); diff --git a/src/vsg/utils/Instrumentation.cpp b/src/vsg/utils/Instrumentation.cpp index 72eaef528d..8a1166dbac 100644 --- a/src/vsg/utils/Instrumentation.cpp +++ b/src/vsg/utils/Instrumentation.cpp @@ -12,6 +12,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #include #include +#include #include using namespace vsg; @@ -24,6 +25,10 @@ Instrumentation::Instrumentation() { } +void Instrumentation::init(vsg::ref_ptr, vsg::ref_ptr, vsg::ref_ptr) +{ +} + Instrumentation::~Instrumentation() { }