From 888413fbcffe084923dc49a263d964676dce6eab Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Tue, 21 Jun 2022 09:08:30 +0200 Subject: [PATCH] Added an option to get the current vk instance Signed-off-by: Fabian Sauter --- src/Manager.cpp | 6 ++++++ src/include/kompute/Manager.hpp | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/src/Manager.cpp b/src/Manager.cpp index fd6e654e9..f3f66af91 100644 --- a/src/Manager.cpp +++ b/src/Manager.cpp @@ -450,4 +450,10 @@ Manager::listDevices() const return this->mInstance->enumeratePhysicalDevices(); } +std::shared_ptr +Manager::getVkInstance() const +{ + return this->mInstance; +} + } diff --git a/src/include/kompute/Manager.hpp b/src/include/kompute/Manager.hpp index 5ff325225..e154dc9c1 100644 --- a/src/include/kompute/Manager.hpp +++ b/src/include/kompute/Manager.hpp @@ -214,6 +214,14 @@ class Manager **/ std::vector listDevices() const; + /** + * The current Vulkan instance. + * + * @return a shared pointer to the current Vulkan instance held by this + *object + **/ + std::shared_ptr getVkInstance() const; + private: // -------------- OPTIONALLY OWNED RESOURCES std::shared_ptr mInstance = nullptr;