1#ifndef NNGN_GRAPHICS_VULKAN_INSTANCE_H
2#define NNGN_GRAPHICS_VULKAN_INSTANCE_H
43 VkInstance
id()
const {
return this->
h; }
54 VkDevice d,
T obj, std::string_view
name, std::size_t
n,
55 std::string *buf)
const;
59 VkDevice d, std::span<T>
v, std::string_view
name)
const;
63 VkDevice d,
T obj, std::string_view
name, std::size_t
n)
const;
67 VkDevice d, VkObjectType t,
68 std::uint64_t obj, std::string_view
name)
const;
70 VkDevice d, VkObjectType t,
71 std::uint64_t obj, std::string_view
name, std::size_t
n,
72 std::string *buf)
const;
85 std::vector<Graphics::Layer>
layers = {};
99 if constexpr(std::is_base_of_v<Handle, T>)
102 return reinterpret_cast<std::uintptr_t
>(obj);
107 VkDevice d,
T obj, std::string_view
name
115 VkDevice d,
T obj, std::string_view
name, std::size_t
n
123 VkDevice d,
T obj, std::string_view
name, std::size_t
n,
132 VkDevice d, std::span<T>
v, std::string_view
name
134 std::string buf = {};
136 for(std::size_t
i = 0,
n =
v.size();
i <
n; ++
i)
local class const
Definition animation.lua:7
name
Definition cathedral.lua:11
Owning wrapper for a Vulkan instance.
Definition instance.h:19
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.
Definition instance.cpp:116
void(void *) ErrorFn
Definition instance.h:21
void set_error()
Called by the debug callback when an error is received.
Definition instance.h:45
bool set_obj_name(VkDevice dev, T obj, std::string_view name) const
Sets the debug name of an object.
Definition instance.h:106
void * error_data
Definition instance.h:77
VkInstance h
Definition instance.h:73
VkDebugUtilsMessengerEXT messenger
Definition instance.h:74
static auto obj_handle(T o)
Definition instance.h:98
ErrorFn * error_fn
Definition instance.h:76
PFN_vkSetDebugUtilsObjectNameEXT set_obj_name_f
Definition instance.h:75
R get_proc_addr(const char *name) const
Retrieves a function pointer by name, cast to R.
Definition instance.cpp:155
for i
Definition font.lua:5
local n
Definition dump_lights.lua:5
init
Definition img_common.lua:34
constexpr empty vk_obj_type
Maps types to VkObjectType values.
Definition types.h:54
v[1]
Definition math.lua:22
#define NNGN_MOVE_ONLY(x)
Definition utils.h:39
Definition graphics.h:155
Definition graphics.h:138
Aggregate type for information about an instance.
Definition instance.h:81
void init_devices(VkInstance i)
Initializes device data.
Definition instance.cpp:217
void init_layers()
Definition instance.cpp:199
void init_extensions()
Definition instance.cpp:192
std::uint32_t version
Definition instance.h:83
std::vector< Graphics::Layer > layers
Definition instance.h:85
std::vector< Graphics::Extension > extensions
Definition instance.h:84
bool init()
Initializes instance-independent data.
Definition instance.cpp:185
std::vector< VkPhysicalDevice > physical_devs
Definition instance.h:86
bool check_version(Graphics::Version v) const
Verifies that the given version is supported.
Definition instance.cpp:221