|
nngn
|
Owning wrapper for a VkDevice. More...
#include <device.h>
Public Member Functions | |
| Device (void)=default | |
| ~Device (void) | |
| Releases the device object. | |
| VkPhysicalDevice | physical_dev (void) const |
| VkDevice | id (void) const |
| std::uint32_t | graphics_family (void) const |
| Family of the queue returned by graphics_queue. | |
| std::uint32_t | present_family (void) const |
| Family of the queue returned by present_queue. | |
| VkQueue | graphics_queue (void) const |
| Queue used for graphics operations. | |
| VkQueue | present_queue (void) const |
| Queue used for presentation, may be the same as graphics_queue. | |
| bool | init (const Instance &inst, VkPhysicalDevice physical_dev, std::uint32_t graphics_family, std::uint32_t present_family, std::span< const char *const > extensions, std::span< const char *const > layers, const VkPhysicalDeviceFeatures &features) |
Creates a logical device associated with dev. | |
| VkSampler | create_sampler (VkFilter filter, VkSamplerAddressMode addr_mode, VkBorderColor border, VkSamplerMipmapMode mip_mode, std::uint32_t mip_levels) const |
| VkShaderModule | create_shader (const Instance &inst, std::string_view name, std::span< const std::uint8_t > src) const |
| Compiles and names a shader module from source. | |
Private Attributes | ||
| VkPhysicalDevice | ph = {} | |
| VkDevice | h = {} | |
| struct { | ||
| std::uint32_t graphics | ||
| std::uint32_t present | ||
| } | families = {} | |
| struct { | ||
| VkQueue graphics | ||
| VkQueue present | ||
| } | queues = {} | |
Owning wrapper for a VkDevice.
|
default |
| nngn::Device::~Device | ( | void | ) |
Releases the device object.
| VkSampler nngn::Device::create_sampler | ( | VkFilter | filter, |
| VkSamplerAddressMode | addr_mode, | ||
| VkBorderColor | border, | ||
| VkSamplerMipmapMode | mip_mode, | ||
| std::uint32_t | mip_levels ) const |


| VkShaderModule nngn::Device::create_shader | ( | const Instance & | inst, |
| std::string_view | name, | ||
| std::span< const std::uint8_t > | src ) const |
Compiles and names a shader module from source.


|
inline |
|
inline |
Queue used for graphics operations.

|
inline |

| bool nngn::Device::init | ( | const Instance & | inst, |
| VkPhysicalDevice | physical_dev, | ||
| std::uint32_t | graphics_family, | ||
| std::uint32_t | present_family, | ||
| std::span< const char *const > | extensions, | ||
| std::span< const char *const > | layers, | ||
| const VkPhysicalDeviceFeatures & | features ) |
Creates a logical device associated with dev.
Must be called before any other operation. All arguments must be valid options for the device (DeviceInfo can be used to determine if they are).


|
inline |

|
inline |
|
inline |
Queue used for presentation, may be the same as graphics_queue.

| struct { ... } nngn::Device::families |
| std::uint32_t nngn::Device::graphics |
| VkQueue nngn::Device::graphics |
|
private |
|
private |
| std::uint32_t nngn::Device::present |
| VkQueue nngn::Device::present |
| struct { ... } nngn::Device::queues |