MayaFlux 0.3.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 186 of file VKDevice.cpp.

187{
188 if (!surface) {
190 "No surface provided for presentation support check");
191 return false;
192 }
193
194 auto queue_families = m_physical_device.getQueueFamilyProperties();
195
196 for (uint32_t i = 0; i < queue_families.size(); i++) {
197 if (queue_families[i].queueCount > 0) {
198 vk::Bool32 presentSupport = m_physical_device.getSurfaceSupportKHR(i, surface);
199 if (presentSupport) {
200 if (i == m_queue_families.graphics_family.value()) {
204 "Graphics queue family {} supports presentation", i);
205 return true;
206 }
207 }
208 }
209 }
210
211 for (uint32_t i = 0; i < queue_families.size(); i++) {
212 if (queue_families[i].queueCount > 0) {
213 vk::Bool32 presentSupport = m_physical_device.getSurfaceSupportKHR(i, surface);
214 if (presentSupport) {
218 "Found presentation support in queue family {}", i);
219 return true;
220 }
221 }
222 }
223
225 "No queue family with presentation support found!");
226 return false;
227}
#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:115
bool m_presentation_initialized
Whether presentation support has been initialized.
Definition VKDevice.hpp:149
QueueFamilyIndices m_queue_families
Indices of required queue families.
Definition VKDevice.hpp:122
@ 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: