Query DataVariant-dispatch traits for a surface format.
For the byte count, call vk_format_bytes_per_pixel(to_vk_format(fmt)).
201{
203 switch (fmt) {
204 case SF::B8G8R8A8_SRGB:
205 case SF::R8G8B8A8_SRGB:
206 case SF::B8G8R8A8_UNORM:
207 case SF::R8G8B8A8_UNORM:
208 return {
209 .channel_count = 4U,
210 .bits_per_channel = 8U,
211 .is_float = false,
212 .is_packed = false
213 };
214
215 case SF::R16G16B16A16_SFLOAT:
216 return {
217 .channel_count = 4U,
218 .bits_per_channel = 16U,
219 .is_float = true,
220 .is_packed = false
221 };
222
223 case SF::A2B10G10R10_UNORM:
224 return {
225 .channel_count = 4U,
226 .bits_per_channel = 10U,
227 .is_float = false,
228 .is_packed = true
229 };
230
231 case SF::R32G32B32A32_SFLOAT:
232 return {
233 .channel_count = 4U,
234 .bits_per_channel = 32U,
235 .is_float = true,
236 .is_packed = false
237 };
238
239 default:
240 return {
241 .channel_count = 4U,
242 .bits_per_channel = 8U,
243 .is_float = false,
244 .is_packed = false
245 };
246 }
247}
SurfaceFormat
Default pixel format for window surfaces (Vulkan-compatible)