nngn
|
Owning wrapper for a Vulkan instance. More...
#include <instance.h>
Public Types | |
using | ErrorFn = void(void*) |
Public Member Functions | |
Instance (void)=default | |
~Instance (void) | |
Destroys the VkInstance and debug objects. | |
bool | init (Graphics::Version version, std::span< const char *const > extensions) |
Initializes an instance with no debug capabilities. | |
bool | init_debug (Graphics::Version version, std::span< const char *const > extensions, std::span< const char *const > layers, ErrorFn error_fn, void *error_data, Graphics::LogLevel log_level) |
Initializes an instance in debug mode. | |
VkInstance | id () const |
Provides access to the underlying Vulkan handle. | |
void | set_error () |
Called by the debug callback when an error is received. | |
template<typename R > | |
R | get_proc_addr (const char *name) const |
Retrieves a function pointer by name, cast to R . | |
template<typename T > | |
bool | set_obj_name (VkDevice dev, T obj, std::string_view name) const |
Sets the debug name of an object. | |
template<typename T > | |
bool | set_obj_name (VkDevice d, T obj, std::string_view name, std::size_t n, std::string *buf) const |
Sets the debug name of an object. | |
template<typename T > | |
bool | set_obj_name (VkDevice d, std::span< T > v, std::string_view name) const |
Sets the debug name of a range of objects. | |
template<typename T > | |
bool | set_obj_name (VkDevice d, T obj, std::string_view name, std::size_t n) const |
Sets the debug name of a range of objects. | |
Private Member Functions | |
bool | set_obj_name (VkDevice d, VkObjectType t, std::uint64_t obj, std::string_view name) const |
bool | set_obj_name (VkDevice d, VkObjectType t, std::uint64_t obj, std::string_view name, std::size_t n, std::string *buf) const |
Static Private Member Functions | |
template<typename T > | |
static auto | obj_handle (T o) |
Private Attributes | |
VkInstance | h = {} |
VkDebugUtilsMessengerEXT | messenger = {} |
PFN_vkSetDebugUtilsObjectNameEXT | set_obj_name_f = {} |
ErrorFn * | error_fn = {} |
void * | error_data = {} |
Owning wrapper for a Vulkan instance.
using nngn::Instance::ErrorFn = void(void*) |
|
default |
nngn::Instance::~Instance | ( | void | ) |
Destroys the VkInstance and debug objects.
R nngn::Instance::get_proc_addr | ( | const char * | name | ) | const |
Retrieves a function pointer by name, cast to R
.
|
inline |
Provides access to the underlying Vulkan handle.
bool nngn::Instance::init | ( | Graphics::Version | version, |
std::span< const char *const > | extensions ) |
Initializes an instance with no debug capabilities.
bool nngn::Instance::init_debug | ( | Graphics::Version | version, |
std::span< const char *const > | extensions, | ||
std::span< const char *const > | layers, | ||
ErrorFn | error_fn, | ||
void * | error_data, | ||
Graphics::LogLevel | log_level ) |
Initializes an instance in debug mode.
extensions
and layers
must be supported by the implementation (see InstanceInfo).
error_fn | Called when the debug callback reports an error. |
error_data | Argument for error_fn . |
|
inline |
Called by the debug callback when an error is received.
|
inline |
Sets the debug name of a range of objects.
|
inline |
Sets the debug name of a range of objects.
|
inline |
Sets the debug name of an object.
|
private |
|
private |
|
inline |
Sets the debug name of an object.
|
private |
|
private |
|
private |
|
private |
|
private |