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

◆ from_vk_format()

GraphicsSurfaceInfo::SurfaceFormat MayaFlux::Core::from_vk_format ( vk::Format  fmt)
inline

Reverse-map a vk::Format to the nearest GraphicsSurfaceInfo::SurfaceFormat.

Returns B8G8R8A8_SRGB as a safe fallback for unmapped formats.

Parameters
fmtVulkan format obtained from the live swapchain.
Returns
Closest MayaFlux surface format enum value.

Definition at line 170 of file VKEnumUtils.hpp.

171{
173 switch (fmt) {
174 case vk::Format::eB8G8R8A8Srgb:
175 return SF::B8G8R8A8_SRGB;
176 case vk::Format::eR8G8B8A8Srgb:
177 return SF::R8G8B8A8_SRGB;
178 case vk::Format::eB8G8R8A8Unorm:
179 return SF::B8G8R8A8_UNORM;
180 case vk::Format::eR8G8B8A8Unorm:
181 return SF::R8G8B8A8_UNORM;
182 case vk::Format::eR16G16B16A16Sfloat:
183 return SF::R16G16B16A16_SFLOAT;
184 case vk::Format::eA2B10G10R10UnormPack32:
185 return SF::A2B10G10R10_UNORM;
186 case vk::Format::eR32G32B32A32Sfloat:
187 return SF::R32G32B32A32_SFLOAT;
188 default:
189 return SF::B8G8R8A8_SRGB;
190 }
191}
SurfaceFormat
Default pixel format for window surfaces (Vulkan-compatible)

Referenced by MayaFlux::Kakshya::query_surface_format(), and MayaFlux::Kakshya::readback_region().

+ Here is the caller graph for this function: