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

◆ update_presentation_queue()

bool MayaFlux::Core::VKDevice::update_presentation_queue ( vk::SurfaceKHR  surface)

Update presentation queue family for a specific surface.

Parameters
surfaceSurface to check presentation support for
Returns
true if presentation support found

Definition at line 146 of file VKDevice.cpp.

147{
148 if (!surface) {
150 "No surface provided for presentation support check");
151 return false;
152 }
153
154 auto queue_families = m_physical_device.getQueueFamilyProperties();
155
156 for (uint32_t i = 0; i < queue_families.size(); i++) {
157 if (queue_families[i].queueCount > 0) {
158 vk::Bool32 presentSupport = m_physical_device.getSurfaceSupportKHR(i, surface);
159 if (presentSupport) {
160 if (i == m_queue_families.graphics_family.value()) {
164 "Graphics queue family {} supports presentation", i);
165 return true;
166 }
167 }
168 }
169 }
170
171 for (uint32_t i = 0; i < queue_families.size(); i++) {
172 if (queue_families[i].queueCount > 0) {
173 vk::Bool32 presentSupport = m_physical_device.getSurfaceSupportKHR(i, surface);
174 if (presentSupport) {
178 "Found presentation support in queue family {}", i);
179 return true;
180 }
181 }
182 }
183
185 "No queue family with presentation support found!");
186 return false;
187}
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
vk::PhysicalDevice m_physical_device
Selected physical device (GPU)
Definition VKDevice.hpp:109
QueueFamilyIndices m_queue_families
Indices of required queue families.
Definition VKDevice.hpp:116
@ GraphicsBackend
Graphics/visual rendering backend (Vulkan, OpenGL)
@ Core
Core engine, backend, subsystems.
std::optional< uint32_t > graphics_family
Definition VKDevice.hpp:14
std::optional< uint32_t > present_family
Definition VKDevice.hpp:17

References MayaFlux::Journal::Core, MayaFlux::Core::QueueFamilyIndices::graphics_family, MayaFlux::Journal::GraphicsBackend, m_physical_device, m_presentation_initialized, m_queue_families, MF_ERROR, MF_INFO, MF_WARN, and MayaFlux::Core::QueueFamilyIndices::present_family.

Referenced by MayaFlux::Core::VKContext::update_present_family().

+ Here is the caller graph for this function: