MayaFlux 0.4.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 110 of file SurfaceUtils.cpp.

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

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

Referenced by MayaFlux::Kakshya::WindowContainer::get_image_format(), MayaFlux::Kakshya::WindowContainer::image_at(), MayaFlux::Kakshya::WindowContainer::image_at(), MayaFlux::Kakshya::WindowAccessProcessor::on_attach(), MayaFlux::Kakshya::WindowAccessProcessor::process(), MayaFlux::Kakshya::WindowContainer::region_to_image(), MayaFlux::Kakshya::WindowContainer::to_image(), and MayaFlux::Kakshya::WindowContainer::to_image().

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