Skip to content

finite_render_create_device

The finite_render_create_device function creates a logical Vulkan device and stores device queues in the render context.

void finite_render_create_device(FiniteRender *render, FiniteRenderQueueFamilies fIndex, uint32_t *uniqueQueueFamilies, char **device_extentsions, uint32_t _ext);
TypeDescription
FiniteRender *renderThe render context to store the created device and queues.
FiniteRenderQueueFamilies fIndexContains indices for the graphics and presentation queues.
uint32_t *uniqueQueueFamiliesArray of unique queue family indices used to create queues.
char **device_extentsionsOptional array of Vulkan device extension names to enable.
uint32_t _extNumber of device extensions in the array.
#include <finite/log.h>
#include <finite/render.h>
uint32_t uniqueQueues[] = { graphicsQueueIndex, presentQueueIndex };
FiniteRenderQueueFamilies families = {
.graphicsFamily = graphicsQueueIndex,
.presentFamily = presentQueueIndex,
._unique = 2
};
char *extensions[] = {
VK_KHR_SWAPCHAIN_EXTENSION_NAME
};
finite_render_create_device(render, families, uniqueQueues, extensions, 1);

Call this after selecting a physical device. It will create a logical device and initialize queues needed for rendering.