nngn
Loading...
Searching...
No Matches
nngn::Device Class Reference

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 = {} 
 

Detailed Description

Owning wrapper for a VkDevice.

Constructor & Destructor Documentation

◆ Device()

nngn::Device::Device ( void )
default

◆ ~Device()

nngn::Device::~Device ( void )

Releases the device object.

Member Function Documentation

◆ create_sampler()

VkSampler nngn::Device::create_sampler ( VkFilter filter,
VkSamplerAddressMode addr_mode,
VkBorderColor border,
VkSamplerMipmapMode mip_mode,
std::uint32_t mip_levels ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_shader()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ graphics_family()

std::uint32_t nngn::Device::graphics_family ( void ) const
inline

Family of the queue returned by graphics_queue.

Here is the caller graph for this function:

◆ graphics_queue()

VkQueue nngn::Device::graphics_queue ( void ) const
inline

Queue used for graphics operations.

Here is the caller graph for this function:

◆ id()

VkDevice nngn::Device::id ( void ) const
inline
Here is the caller graph for this function:

◆ init()

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).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ physical_dev()

VkPhysicalDevice nngn::Device::physical_dev ( void ) const
inline
Here is the caller graph for this function:

◆ present_family()

std::uint32_t nngn::Device::present_family ( void ) const
inline

Family of the queue returned by present_queue.

Here is the caller graph for this function:

◆ present_queue()

VkQueue nngn::Device::present_queue ( void ) const
inline

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

Here is the caller graph for this function:

Member Data Documentation

◆ [struct]

struct { ... } nngn::Device::families

◆ graphics [1/2]

std::uint32_t nngn::Device::graphics

◆ graphics [2/2]

VkQueue nngn::Device::graphics

◆ h

VkDevice nngn::Device::h = {}
private

◆ ph

VkPhysicalDevice nngn::Device::ph = {}
private

◆ present [1/2]

std::uint32_t nngn::Device::present

◆ present [2/2]

VkQueue nngn::Device::present

◆ [struct]

struct { ... } nngn::Device::queues

The documentation for this class was generated from the following files: