MayaFlux 0.3.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ initialize()

bool MayaFlux::Core::VKCommandManager::initialize ( vk::Device  device,
uint32_t  graphics_queue_family,
uint32_t  compute_queue_family 
)

Initialize command manager.

Parameters
deviceLogical device
graphics_queue_familyGraphics queue family index
compute_queue_familyCompute queue family index (optional, for compute operations)
Returns
True if initialization succeeded

Definition at line 12 of file VKCommandManager.cpp.

13{
14 m_device = device;
15 m_graphics_queue_family = graphics_queue_family;
16 m_compute_queue_family = compute_queue_family;
17
18 vk::CommandPoolCreateInfo pool_info {};
19 pool_info.queueFamilyIndex = graphics_queue_family;
20 pool_info.flags = vk::CommandPoolCreateFlagBits::eResetCommandBuffer;
21
22 try {
23 m_command_pool = device.createCommandPool(pool_info);
24 } catch (const vk::SystemError& e) {
26 "Failed to create command pool: {}", e.what());
27 return false;
28 }
29
30 pool_info.queueFamilyIndex = compute_queue_family;
31 try {
32 m_compute_command_pool = device.createCommandPool(pool_info);
33 } catch (const vk::SystemError& e) {
35 "Failed to create compute command pool: {}", e.what());
36 return false;
37 }
38
40 "Command manager initialized");
41
42 return true;
43}
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
@ GraphicsBackend
Graphics/visual rendering backend (Vulkan, OpenGL)
@ Core
Core engine, backend, subsystems.

References MayaFlux::Journal::Core, MayaFlux::Journal::GraphicsBackend, m_command_pool, m_compute_command_pool, m_compute_queue_family, m_device, m_graphics_queue_family, MF_ERROR, and MF_INFO.