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

◆ query_surface_format()

MAYAFLUX_API Core::GraphicsSurfaceInfo::SurfaceFormat MayaFlux::Kakshya::query_surface_format ( const std::shared_ptr< Core::Window > &  window)

Query the actual vk::Format in use by the window's live swapchain, translated back to the MayaFlux surface format enum.

This is the ground truth for readback allocation — it reflects what the driver actually negotiated, which may differ from the value requested in GlobalGraphicsConfig when the preferred format was unavailable.

Parameters
windowTarget window.
Returns
Actual surface format. Returns B8G8R8A8_SRGB if the window has no registered swapchain.

Definition at line 111 of file SurfaceUtils.cpp.

113{
114 auto* svc = get_display_service();
115 if (!svc)
116 return Core::GraphicsSurfaceInfo::SurfaceFormat::B8G8R8A8_SRGB;
117
118 const int raw = svc->get_swapchain_format(std::static_pointer_cast<void>(window));
119 return Core::from_vk_format(static_cast<vk::Format>(raw));
120}

References MayaFlux::Core::GraphicsSurfaceInfo::B8G8R8A8_SRGB, and MayaFlux::Core::from_vk_format().

Referenced by MayaFlux::Kakshya::WindowAccessProcessor::on_attach(), and MayaFlux::Kakshya::WindowAccessProcessor::process().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: