feat(bindless): Expose Vulkan instance & device

This commit is contained in:
PancakeTAS 2026-04-25 22:32:13 +02:00
parent ff7dbb1ce9
commit 333522ac62
No known key found for this signature in database
3 changed files with 25 additions and 1 deletions

View file

@ -7,6 +7,10 @@
#include <memory>
#include <string>
#ifdef LSFGVK_PRIV
#include <vulkan/vulkan_core.h>
#endif // LSFGVK_PRIV
namespace lsfgvk {
/// Forward declaration of implementation classes
@ -40,6 +44,16 @@ namespace lsfgvk {
bool allowFP16
);
#ifdef LSFGVK_PRIV
/// Get the underlying Vulkan instance handle
/// @return Vulkan instance
[[nodiscard]] VkInstance _instance() const;
/// Get the underlying Vulkan device handle
/// @return Vulkan device
[[nodiscard]] VkDevice _device() const;
#endif // LSFGVK_PRIV
// Non-copyable, non-movable
Instance(const Instance&) = delete;
Instance& operator=(const Instance&) = delete;

View file

@ -1,6 +1,5 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
#include "lsfg-vk/lsfgvk.hpp"
#include "lsfgvk.hpp"
#include "modules/library.hpp"
#include "modules/pipeline.hpp"
@ -228,4 +227,12 @@ Context::~Context() {
}
}
VkInstance Instance::_instance() const {
return this->m_priv->vk.instance.get();
}
VkDevice Instance::_device() const {
return *this->m_priv->vk.device;
}
Instance::~Instance() = default;

View file

@ -2,6 +2,9 @@
#pragma once
#define LSFGVK_PRIV
#include "lsfg-vk/lsfgvk.hpp" // IWYU pragma: export
#include "modules/pipeline.hpp"
#include "modules/library.hpp"
#include "utility/vkhelper.hpp"