use ash::vk; use crate::{ImageFormat, Size}; impl From for vk::Format { fn from(format: ImageFormat) -> Self { match format { ImageFormat::Unknown => vk::Format::UNDEFINED, ImageFormat::R8Unorm => vk::Format::R8_UNORM, ImageFormat::R8Uint => vk::Format::R8_UINT, ImageFormat::R8Sint => vk::Format::R8_SINT, ImageFormat::R8G8Unorm => vk::Format::R8G8_UNORM, ImageFormat::R8G8Uint => vk::Format::R8G8_UINT, ImageFormat::R8G8Sint => vk::Format::R8G8_SINT, ImageFormat::R8G8B8A8Unorm => vk::Format::R8G8B8A8_UNORM, ImageFormat::R8G8B8A8Uint => vk::Format::R8G8B8A8_UINT, ImageFormat::R8G8B8A8Sint => vk::Format::R8G8B8A8_SINT, ImageFormat::R8G8B8A8Srgb => vk::Format::R8G8B8A8_SRGB, ImageFormat::A2B10G10R10UnormPack32 => vk::Format::A2B10G10R10_UNORM_PACK32, ImageFormat::A2B10G10R10UintPack32 => vk::Format::A2B10G10R10_UINT_PACK32, ImageFormat::R16Uint => vk::Format::R16_UINT, ImageFormat::R16Sint => vk::Format::R16_SINT, ImageFormat::R16Sfloat => vk::Format::R16_SFLOAT, ImageFormat::R16G16Uint => vk::Format::R16G16_UINT, ImageFormat::R16G16Sint => vk::Format::R16G16_SINT, ImageFormat::R16G16Sfloat => vk::Format::R16G16_SFLOAT, ImageFormat::R16G16B16A16Uint => vk::Format::R16G16B16A16_UINT, ImageFormat::R16G16B16A16Sint => vk::Format::R16G16B16A16_SINT, ImageFormat::R16G16B16A16Sfloat => vk::Format::R16G16B16A16_SFLOAT, ImageFormat::R32Uint => vk::Format::R32_UINT, ImageFormat::R32Sint => vk::Format::R32_SINT, ImageFormat::R32Sfloat => vk::Format::R32_SFLOAT, ImageFormat::R32G32Uint => vk::Format::R32G32_UINT, ImageFormat::R32G32Sint => vk::Format::R32G32_SINT, ImageFormat::R32G32Sfloat => vk::Format::R32G32_SFLOAT, ImageFormat::R32G32B32A32Uint => vk::Format::R32G32B32A32_UINT, ImageFormat::R32G32B32A32Sint => vk::Format::R32G32B32A32_SINT, ImageFormat::R32G32B32A32Sfloat => vk::Format::R32G32B32A32_SFLOAT, } } } impl From for ImageFormat { fn from(format: vk::Format) -> Self { match format { vk::Format::UNDEFINED => ImageFormat::Unknown, vk::Format::R8_UNORM => ImageFormat::R8Unorm, vk::Format::R8_UINT => ImageFormat::R8Uint, vk::Format::R8_SINT => ImageFormat::R8Sint, vk::Format::R8G8_UNORM => ImageFormat::R8G8Unorm, vk::Format::R8G8_UINT => ImageFormat::R8G8Uint, vk::Format::R8G8_SINT => ImageFormat::R8G8Sint, vk::Format::R8G8B8A8_UNORM => ImageFormat::R8G8B8A8Unorm, vk::Format::R8G8B8A8_UINT => ImageFormat::R8G8B8A8Uint, vk::Format::R8G8B8A8_SINT => ImageFormat::R8G8B8A8Sint, vk::Format::R8G8B8A8_SRGB => ImageFormat::R8G8B8A8Srgb, vk::Format::A2B10G10R10_UNORM_PACK32 => ImageFormat::A2B10G10R10UnormPack32, vk::Format::A2B10G10R10_UINT_PACK32 => ImageFormat::A2B10G10R10UintPack32, vk::Format::R16_UINT => ImageFormat::R16Uint, vk::Format::R16_SINT => ImageFormat::R16Sint, vk::Format::R16_SFLOAT => ImageFormat::R16Sfloat, vk::Format::R16G16_UINT => ImageFormat::R16G16Uint, vk::Format::R16G16_SINT => ImageFormat::R16G16Sint, vk::Format::R16G16_SFLOAT => ImageFormat::R16G16Sfloat, vk::Format::R16G16B16A16_UINT => ImageFormat::R16G16B16A16Uint, vk::Format::R16G16B16A16_SINT => ImageFormat::R16G16B16A16Sint, vk::Format::R16G16B16A16_SFLOAT => ImageFormat::R16G16B16A16Sfloat, vk::Format::R32_UINT => ImageFormat::R32Uint, vk::Format::R32_SINT => ImageFormat::R32Sint, vk::Format::R32_SFLOAT => ImageFormat::R32Sfloat, vk::Format::R32G32_UINT => ImageFormat::R32G32Uint, vk::Format::R32G32_SINT => ImageFormat::R32G32Sint, vk::Format::R32G32_SFLOAT => ImageFormat::R32G32Sfloat, vk::Format::R32G32B32A32_UINT => ImageFormat::R32G32B32A32Uint, vk::Format::R32G32B32A32_SINT => ImageFormat::R32G32B32A32Sint, vk::Format::R32G32B32A32_SFLOAT => ImageFormat::R32G32B32A32Sfloat, _ => ImageFormat::Unknown, } } } impl From> for vk::Extent3D { fn from(value: Size) -> Self { vk::Extent3D { width: value.width, height: value.height, depth: 1, } } }