core::ivk::context class

encapsulated a graphics context.

a context encapsulated a physical device (GPU), as well as a instance of the graphics context on the driver. it is the single point of information that many operations need in Vulkan, so that those operations know who will be executing them. As such, the context class is fundamental, and will be passed around a lot. It is often one of the first objects to be created, and one of the last to be destroyed in a most applications.

member-functions

instance
const public noexcept
device
const public noexcept
physical_device
const public noexcept
properties
const public noexcept
features
const public noexcept
memory_properties
const public noexcept
command_pool
const public noexcept
descriptor_pool
const public noexcept
queue
const public noexcept
graphics_queue_index
const public noexcept
memory_type
const public noexcept
memory_type
const public
flush
flushes all operations on the given commandbuffer and potentially free it at the end.
public
device_index
const public noexcept
acquireNextImage2KHR
const public noexcept

Function documentation

const vk::Instance& core::ivk::context::instance() const noexcept

Returns the vk::Instance of this context.

const vk::Device& core::ivk::context::device() const noexcept

Returns the vk::Device of this context.

const vk::PhysicalDevice& core::ivk::context::physical_device() const noexcept

Returns the vk::PhysicalDevice of this context.

const vk::PhysicalDeviceProperties& core::ivk::context::properties() const noexcept

Returns the physical device properties (for e.g. checking device limits)

const vk::PhysicalDeviceFeatures& core::ivk::context::features() const noexcept

Returns the physical device features (for e.g. checking if a feature is available)

const vk::PhysicalDeviceMemoryProperties& core::ivk::context::memory_properties() const noexcept

Returns the available memory (type) properties for the physical device

const vk::CommandPool& core::ivk::context::command_pool() const noexcept

Returns the command_pool that commands can be enqueued on.

const vk::DescriptorPool& core::ivk::context::descriptor_pool() const noexcept

Returns the descriptor pool for allocating various pipeline descriptors.

const vk::Queue& core::ivk::context::queue() const noexcept

Returns the device queue for enqueuing commands.

uint32_t core::ivk::context::graphics_queue_index() const noexcept

Returns the queue index the graphics pipeline is running on.

vk::Bool32 core::ivk::context::memory_type(uint32_t typeBits, const vk::MemoryPropertyFlags& properties, uint32_t* typeIndex) const noexcept

Parameters
typeBits in the MemoryRequirements you get back from vulkan query operations that resquest the requirements for resources (like textures and buffers).
properties in the MemoryPropertyFlags of the requested memory type (i.e. should it be device local, or host, etc...).
typeIndex in/out the location to store the memory_type index in (on success).
Returns if the current context supports a memory type with the specific properties.

uint32_t core::ivk::context::memory_type(uint32_t typeBits, const vk::MemoryPropertyFlags& properties) const

Parameters
typeBits in the MemoryRequirements you get back from vulkan query operations that resquest the requirements for resources (like textures and buffers).
properties in the MemoryPropertyFlags of the requested memory type (i.e. should it be device local, or host, etc...).
Returns a memory type index that supports the given properties.

void core::ivk::context::flush(vk::CommandBuffer commandBuffer, bool free)

Brief

flushes all operations on the given commandbuffer and potentially free it at the end.

Parameters
commandBuffer in the command buffer to execute the operations on.
free in defines if we should free the command buffer at the end (true) or not (false).

uint32_t core::ivk::context::device_index() const noexcept

Returns the device index of the current physical graphics device.

bool core::ivk::context::acquireNextImage2KHR(optional_ref<uint64_t> out_version = std::nullopt) const noexcept

Parameters
out_version in optionally returns the revision version number.
Returns true in case the given extension is supported.