use crate::{
device::{physical::PhysicalDevice, Device},
image::{ImageAspects, ImageTiling},
macros::vulkan_bitflags,
shader::spirv::ImageFormat,
DeviceSize, Requires, RequiresAllOf, RequiresOneOf, ValidationError,
};
include!(concat!(env!("OUT_DIR"), "/formats.rs"));
impl Format {
#[deprecated(
since = "0.28.0",
note = "use PhysicalDevice::format_properties instead"
)]
#[inline]
pub fn properties(self, physical_device: PhysicalDevice) -> FormatProperties {
physical_device.format_properties(self).unwrap()
}
#[inline]
pub fn shader_storage_image_without_format(self) -> bool {
matches!(
self,
Format::R8G8B8A8_UNORM
| Format::R8G8B8A8_SNORM
| Format::R8G8B8A8_UINT
| Format::R8G8B8A8_SINT
| Format::R32_UINT
| Format::R32_SINT
| Format::R32_SFLOAT
| Format::R32G32_UINT
| Format::R32G32_SINT
| Format::R32G32_SFLOAT
| Format::R32G32B32A32_UINT
| Format::R32G32B32A32_SINT
| Format::R32G32B32A32_SFLOAT
| Format::R16G16B16A16_UINT
| Format::R16G16B16A16_SINT
| Format::R16G16B16A16_SFLOAT
| Format::R16G16_SFLOAT
| Format::B10G11R11_UFLOAT_PACK32
| Format::R16_SFLOAT
| Format::R16G16B16A16_UNORM
| Format::A2B10G10R10_UNORM_PACK32
| Format::R16G16_UNORM
| Format::R8G8_UNORM
| Format::R16_UNORM
| Format::R8_UNORM
| Format::R16G16B16A16_SNORM
| Format::R16G16_SNORM
| Format::R8G8_SNORM
| Format::R16_SNORM
| Format::R8_SNORM
| Format::R16G16_SINT
| Format::R8G8_SINT
| Format::R16_SINT
| Format::R8_SINT
| Format::A2B10G10R10_UINT_PACK32
| Format::R16G16_UINT
| Format::R8G8_UINT
| Format::R16_UINT
| Format::R8_UINT
)
}
}
impl From<Format> for ash::vk::Format {
#[inline]
fn from(val: Format) -> Self {
ash::vk::Format::from_raw(val as i32)
}
}
impl From<ImageFormat> for Option<Format> {
#[inline]
fn from(val: ImageFormat) -> Self {
match val {
ImageFormat::Unknown => None,
ImageFormat::Rgba32f => Some(Format::R32G32B32A32_SFLOAT),
ImageFormat::Rgba16f => Some(Format::R16G16B16A16_SFLOAT),
ImageFormat::R32f => Some(Format::R32_SFLOAT),
ImageFormat::Rgba8 => Some(Format::R8G8B8A8_UNORM),
ImageFormat::Rgba8Snorm => Some(Format::R8G8B8A8_SNORM),
ImageFormat::Rg32f => Some(Format::R32G32_SFLOAT),
ImageFormat::Rg16f => Some(Format::R16G16_SFLOAT),
ImageFormat::R11fG11fB10f => Some(Format::B10G11R11_UFLOAT_PACK32),
ImageFormat::R16f => Some(Format::R16_SFLOAT),
ImageFormat::Rgba16 => Some(Format::R16G16B16A16_UNORM),
ImageFormat::Rgb10A2 => Some(Format::A2B10G10R10_UNORM_PACK32),
ImageFormat::Rg16 => Some(Format::R16G16_UNORM),
ImageFormat::Rg8 => Some(Format::R8G8_UNORM),
ImageFormat::R16 => Some(Format::R16_UNORM),
ImageFormat::R8 => Some(Format::R8_UNORM),
ImageFormat::Rgba16Snorm => Some(Format::R16G16B16A16_SNORM),
ImageFormat::Rg16Snorm => Some(Format::R16G16_SNORM),
ImageFormat::Rg8Snorm => Some(Format::R8G8_SNORM),
ImageFormat::R16Snorm => Some(Format::R16_SNORM),
ImageFormat::R8Snorm => Some(Format::R8_SNORM),
ImageFormat::Rgba32i => Some(Format::R32G32B32A32_SINT),
ImageFormat::Rgba16i => Some(Format::R16G16B16A16_SINT),
ImageFormat::Rgba8i => Some(Format::R8G8B8A8_SINT),
ImageFormat::R32i => Some(Format::R32_SINT),
ImageFormat::Rg32i => Some(Format::R32G32_SINT),
ImageFormat::Rg16i => Some(Format::R16G16_SINT),
ImageFormat::Rg8i => Some(Format::R8G8_SINT),
ImageFormat::R16i => Some(Format::R16_SINT),
ImageFormat::R8i => Some(Format::R8_SINT),
ImageFormat::Rgba32ui => Some(Format::R32G32B32A32_UINT),
ImageFormat::Rgba16ui => Some(Format::R16G16B16A16_UINT),
ImageFormat::Rgba8ui => Some(Format::R8G8B8A8_UINT),
ImageFormat::R32ui => Some(Format::R32_UINT),
ImageFormat::Rgb10a2ui => Some(Format::A2B10G10R10_UINT_PACK32),
ImageFormat::Rg32ui => Some(Format::R32G32_UINT),
ImageFormat::Rg16ui => Some(Format::R16G16_UINT),
ImageFormat::Rg8ui => Some(Format::R8G8_UINT),
ImageFormat::R16ui => Some(Format::R16_UINT),
ImageFormat::R8ui => Some(Format::R8_UINT),
ImageFormat::R64ui => Some(Format::R64_UINT),
ImageFormat::R64i => Some(Format::R64_SINT),
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[allow(non_camel_case_types)]
pub enum CompressionType {
ASTC_LDR,
ASTC_HDR,
BC,
ETC2,
EAC,
PVRTC,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum ChromaSampling {
Mode444,
Mode422,
Mode420,
}
impl ChromaSampling {
#[inline]
pub fn subsampled_extent(self, mut extent: [u32; 3]) -> [u32; 3] {
match self {
ChromaSampling::Mode444 => (),
ChromaSampling::Mode422 => {
debug_assert!(extent[0] % 2 == 0);
extent[0] /= 2;
}
ChromaSampling::Mode420 => {
debug_assert!(extent[0] % 2 == 0 && extent[1] % 2 == 0);
extent[0] /= 2;
extent[1] /= 2;
}
}
extent
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum NumericFormat {
SFLOAT,
UFLOAT,
SINT,
UINT,
SNORM,
UNORM,
SSCALED,
USCALED,
SRGB,
}
impl NumericFormat {
pub const fn numeric_type(self) -> NumericType {
match self {
NumericFormat::SFLOAT
| NumericFormat::UFLOAT
| NumericFormat::SNORM
| NumericFormat::UNORM
| NumericFormat::SSCALED
| NumericFormat::USCALED
| NumericFormat::SRGB => NumericType::Float,
NumericFormat::SINT => NumericType::Int,
NumericFormat::UINT => NumericType::Uint,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum NumericType {
Float,
Int,
Uint,
}
impl From<NumericFormat> for NumericType {
#[inline]
fn from(val: NumericFormat) -> Self {
val.numeric_type()
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[repr(transparent)]
pub struct FormatCompatibility(pub(crate) &'static FormatCompatibilityInner);
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[allow(non_camel_case_types)]
pub(crate) enum FormatCompatibilityInner {
Undefined,
Class_8bit,
Class_16bit,
Class_24bit,
Class_32bit,
Class_48bit,
Class_64bit,
Class_96bit,
Class_128bit,
Class_192bit,
Class_256bit,
Class_D16,
Class_D24,
Class_D32,
Class_S8,
Class_D16S8,
Class_D24S8,
Class_D32S8,
Class_64bit_R10G10B10A10,
Class_64bit_R12G12B12A12,
Class_BC1_RGB,
Class_BC1_RGBA,
Class_BC2,
Class_BC3,
Class_BC4,
Class_BC5,
Class_BC6H,
Class_BC7,
Class_ETC2_RGB,
Class_ETC2_RGBA,
Class_ETC2_EAC_RGBA,
Class_EAC_R,
Class_EAC_RG,
Class_ASTC_4x4,
Class_ASTC_5x4,
Class_ASTC_5x5,
Class_ASTC_6x5,
Class_ASTC_6x6,
Class_ASTC_8x5,
Class_ASTC_8x6,
Class_ASTC_8x8,
Class_ASTC_10x5,
Class_ASTC_10x6,
Class_ASTC_10x8,
Class_ASTC_10x10,
Class_ASTC_12x10,
Class_ASTC_12x12,
Class_PVRTC1_2BPP,
Class_PVRTC1_4BPP,
Class_PVRTC2_2BPP,
Class_PVRTC2_4BPP,
Class_32bit_G8B8G8R8,
Class_32bit_B8G8R8G8,
Class_64bit_G10B10G10R10,
Class_64bit_B10G10R10G10,
Class_64bit_G12B12G12R12,
Class_64bit_B12G12R12G12,
Class_64bit_G16B16G16R16,
Class_64bit_B16G16R16G16,
Class_8bit_3plane_420,
Class_8bit_2plane_420,
Class_10bit_3plane_420,
Class_10bit_2plane_420,
Class_12bit_3plane_420,
Class_12bit_2plane_420,
Class_16bit_3plane_420,
Class_16bit_2plane_420,
Class_8bit_3plane_422,
Class_8bit_2plane_422,
Class_10bit_3plane_422,
Class_10bit_2plane_422,
Class_12bit_3plane_422,
Class_12bit_2plane_422,
Class_16bit_3plane_422,
Class_16bit_2plane_422,
Class_8bit_3plane_444,
Class_10bit_3plane_444,
Class_12bit_3plane_444,
Class_16bit_3plane_444,
Class_8bit_2plane_444,
Class_10bit_2plane_444,
Class_12bit_2plane_444,
Class_16bit_2plane_444,
}
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ClearValue {
Float([f32; 4]),
Int([i32; 4]),
Uint([u32; 4]),
Depth(f32),
Stencil(u32),
DepthStencil((f32, u32)),
}
impl ClearValue {
pub(crate) fn validate(&self, device: &Device) -> Result<(), Box<ValidationError>> {
if let ClearValue::Depth(depth) | ClearValue::DepthStencil((depth, _)) = self {
if !(0.0..=1.0).contains(depth)
&& !device.enabled_extensions().ext_depth_range_unrestricted
{
return Err(Box::new(ValidationError {
problem: "is `ClearValue::Depth` or `ClearValue::DepthStencil`, and \
the depth value is not between 0.0 and 1.0 inclusive"
.into(),
requires_one_of: RequiresOneOf(&[RequiresAllOf(&[Requires::DeviceExtension(
"ext_depth_range_unrestricted",
)])]),
vuids: &["VUID-VkClearDepthStencilValue-depth-00022"],
..Default::default()
}));
}
}
Ok(())
}
pub(crate) fn clear_value_type(&self) -> ClearValueType {
match self {
ClearValue::Float(_) => ClearValueType::Float,
ClearValue::Int(_) => ClearValueType::Int,
ClearValue::Uint(_) => ClearValueType::Uint,
ClearValue::Depth(_) => ClearValueType::Depth,
ClearValue::Stencil(_) => ClearValueType::Stencil,
ClearValue::DepthStencil(_) => ClearValueType::DepthStencil,
}
}
}
impl From<ClearValue> for ash::vk::ClearValue {
#[inline]
fn from(val: ClearValue) -> Self {
match val {
ClearValue::Float(val) => Self {
color: ash::vk::ClearColorValue { float32: val },
},
ClearValue::Int(val) => Self {
color: ash::vk::ClearColorValue { int32: val },
},
ClearValue::Uint(val) => Self {
color: ash::vk::ClearColorValue { uint32: val },
},
ClearValue::Depth(depth) => Self {
depth_stencil: ash::vk::ClearDepthStencilValue { depth, stencil: 0 },
},
ClearValue::Stencil(stencil) => Self {
depth_stencil: ash::vk::ClearDepthStencilValue {
depth: 0.0,
stencil,
},
},
ClearValue::DepthStencil((depth, stencil)) => Self {
depth_stencil: ash::vk::ClearDepthStencilValue { depth, stencil },
},
}
}
}
impl From<ClearColorValue> for ClearValue {
#[inline]
fn from(val: ClearColorValue) -> Self {
match val {
ClearColorValue::Float(val) => Self::Float(val),
ClearColorValue::Int(val) => Self::Int(val),
ClearColorValue::Uint(val) => Self::Uint(val),
}
}
}
impl From<[f32; 1]> for ClearValue {
#[inline]
fn from(val: [f32; 1]) -> Self {
Self::Float([val[0], 0.0, 0.0, 1.0])
}
}
impl From<[f32; 2]> for ClearValue {
#[inline]
fn from(val: [f32; 2]) -> Self {
Self::Float([val[0], val[1], 0.0, 1.0])
}
}
impl From<[f32; 3]> for ClearValue {
#[inline]
fn from(val: [f32; 3]) -> Self {
Self::Float([val[0], val[1], val[2], 1.0])
}
}
impl From<[f32; 4]> for ClearValue {
#[inline]
fn from(val: [f32; 4]) -> Self {
Self::Float(val)
}
}
impl From<[u32; 1]> for ClearValue {
#[inline]
fn from(val: [u32; 1]) -> Self {
Self::Uint([val[0], 0, 0, 0]) }
}
impl From<[u32; 2]> for ClearValue {
#[inline]
fn from(val: [u32; 2]) -> Self {
Self::Uint([val[0], val[1], 0, 0]) }
}
impl From<[u32; 3]> for ClearValue {
#[inline]
fn from(val: [u32; 3]) -> Self {
Self::Uint([val[0], val[1], val[2], 0]) }
}
impl From<[u32; 4]> for ClearValue {
#[inline]
fn from(val: [u32; 4]) -> Self {
Self::Uint(val)
}
}
impl From<[i32; 1]> for ClearValue {
#[inline]
fn from(val: [i32; 1]) -> Self {
Self::Int([val[0], 0, 0, 0]) }
}
impl From<[i32; 2]> for ClearValue {
#[inline]
fn from(val: [i32; 2]) -> Self {
Self::Int([val[0], val[1], 0, 0]) }
}
impl From<[i32; 3]> for ClearValue {
#[inline]
fn from(val: [i32; 3]) -> Self {
Self::Int([val[0], val[1], val[2], 0]) }
}
impl From<[i32; 4]> for ClearValue {
#[inline]
fn from(val: [i32; 4]) -> Self {
Self::Int(val)
}
}
impl From<f32> for ClearValue {
#[inline]
fn from(val: f32) -> Self {
Self::Depth(val)
}
}
impl From<u32> for ClearValue {
#[inline]
fn from(val: u32) -> Self {
Self::Stencil(val)
}
}
impl From<(f32, u32)> for ClearValue {
#[inline]
fn from(val: (f32, u32)) -> Self {
Self::DepthStencil(val)
}
}
#[derive(Debug, PartialEq, Eq)]
pub(crate) enum ClearValueType {
Float,
Int,
Uint,
Depth,
Stencil,
DepthStencil,
}
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ClearColorValue {
Float([f32; 4]),
Int([i32; 4]),
Uint([u32; 4]),
}
impl ClearColorValue {
pub fn numeric_type(&self) -> NumericType {
match self {
ClearColorValue::Float(_) => NumericType::Float,
ClearColorValue::Int(_) => NumericType::Int,
ClearColorValue::Uint(_) => NumericType::Uint,
}
}
}
impl From<ClearColorValue> for ash::vk::ClearColorValue {
#[inline]
fn from(val: ClearColorValue) -> Self {
match val {
ClearColorValue::Float(float32) => Self { float32 },
ClearColorValue::Int(int32) => Self { int32 },
ClearColorValue::Uint(uint32) => Self { uint32 },
}
}
}
impl From<[f32; 1]> for ClearColorValue {
#[inline]
fn from(val: [f32; 1]) -> Self {
Self::Float([val[0], 0.0, 0.0, 1.0])
}
}
impl From<[f32; 2]> for ClearColorValue {
#[inline]
fn from(val: [f32; 2]) -> Self {
Self::Float([val[0], val[1], 0.0, 1.0])
}
}
impl From<[f32; 3]> for ClearColorValue {
#[inline]
fn from(val: [f32; 3]) -> Self {
Self::Float([val[0], val[1], val[2], 1.0])
}
}
impl From<[f32; 4]> for ClearColorValue {
#[inline]
fn from(val: [f32; 4]) -> Self {
Self::Float(val)
}
}
impl From<[i32; 1]> for ClearColorValue {
#[inline]
fn from(val: [i32; 1]) -> Self {
Self::Int([val[0], 0, 0, 1])
}
}
impl From<[i32; 2]> for ClearColorValue {
#[inline]
fn from(val: [i32; 2]) -> Self {
Self::Int([val[0], val[1], 0, 1])
}
}
impl From<[i32; 3]> for ClearColorValue {
#[inline]
fn from(val: [i32; 3]) -> Self {
Self::Int([val[0], val[1], val[2], 1])
}
}
impl From<[i32; 4]> for ClearColorValue {
#[inline]
fn from(val: [i32; 4]) -> Self {
Self::Int(val)
}
}
impl From<[u32; 1]> for ClearColorValue {
#[inline]
fn from(val: [u32; 1]) -> Self {
Self::Uint([val[0], 0, 0, 1])
}
}
impl From<[u32; 2]> for ClearColorValue {
#[inline]
fn from(val: [u32; 2]) -> Self {
Self::Uint([val[0], val[1], 0, 1])
}
}
impl From<[u32; 3]> for ClearColorValue {
#[inline]
fn from(val: [u32; 3]) -> Self {
Self::Uint([val[0], val[1], val[2], 1])
}
}
impl From<[u32; 4]> for ClearColorValue {
#[inline]
fn from(val: [u32; 4]) -> Self {
Self::Uint(val)
}
}
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct ClearDepthStencilValue {
pub depth: f32,
pub stencil: u32,
}
impl From<ClearDepthStencilValue> for ash::vk::ClearDepthStencilValue {
#[inline]
fn from(val: ClearDepthStencilValue) -> Self {
Self {
depth: val.depth,
stencil: val.stencil,
}
}
}
impl From<f32> for ClearDepthStencilValue {
#[inline]
fn from(depth: f32) -> Self {
Self { depth, stencil: 0 }
}
}
impl From<u32> for ClearDepthStencilValue {
#[inline]
fn from(stencil: u32) -> Self {
Self {
depth: 0.0,
stencil,
}
}
}
impl From<(f32, u32)> for ClearDepthStencilValue {
#[inline]
fn from((depth, stencil): (f32, u32)) -> Self {
Self { depth, stencil }
}
}
#[derive(Clone, Debug)]
pub struct FormatProperties {
pub linear_tiling_features: FormatFeatures,
pub optimal_tiling_features: FormatFeatures,
pub buffer_features: FormatFeatures,
pub drm_format_modifier_properties: Vec<DrmFormatModifierProperties>,
pub _ne: crate::NonExhaustive,
}
impl Default for FormatProperties {
#[inline]
fn default() -> Self {
Self {
linear_tiling_features: Default::default(),
optimal_tiling_features: Default::default(),
buffer_features: Default::default(),
drm_format_modifier_properties: Default::default(),
_ne: crate::NonExhaustive(()),
}
}
}
impl FormatProperties {
pub fn format_features(
&self,
tiling: ImageTiling,
drm_format_modifiers: &[u64],
) -> FormatFeatures {
match tiling {
ImageTiling::Linear => self.linear_tiling_features,
ImageTiling::Optimal => self.optimal_tiling_features,
ImageTiling::DrmFormatModifier => self
.drm_format_modifier_properties
.iter()
.filter(|properties| drm_format_modifiers.contains(&properties.drm_format_modifier))
.fold(FormatFeatures::empty(), |total, properties| {
total | properties.drm_format_modifier_tiling_features
}),
}
}
#[inline]
pub fn potential_format_features(&self) -> FormatFeatures {
self.linear_tiling_features | self.optimal_tiling_features
}
}
#[derive(Clone, Debug)]
pub struct DrmFormatModifierProperties {
pub drm_format_modifier: u64,
pub drm_format_modifier_plane_count: u32,
pub drm_format_modifier_tiling_features: FormatFeatures,
}
vulkan_bitflags! {
#[non_exhaustive]
FormatFeatures = FormatFeatureFlags2(u64);
SAMPLED_IMAGE = SAMPLED_IMAGE,
STORAGE_IMAGE = STORAGE_IMAGE,
STORAGE_IMAGE_ATOMIC = STORAGE_IMAGE_ATOMIC,
STORAGE_READ_WITHOUT_FORMAT = STORAGE_READ_WITHOUT_FORMAT
RequiresOneOf([
RequiresAllOf([APIVersion(V1_3)]),
RequiresAllOf([DeviceExtension(khr_format_feature_flags2)]),
]),
STORAGE_WRITE_WITHOUT_FORMAT = STORAGE_WRITE_WITHOUT_FORMAT
RequiresOneOf([
RequiresAllOf([APIVersion(V1_3)]),
RequiresAllOf([DeviceExtension(khr_format_feature_flags2)]),
]),
COLOR_ATTACHMENT = COLOR_ATTACHMENT,
COLOR_ATTACHMENT_BLEND = COLOR_ATTACHMENT_BLEND,
DEPTH_STENCIL_ATTACHMENT = DEPTH_STENCIL_ATTACHMENT,
FRAGMENT_DENSITY_MAP = FRAGMENT_DENSITY_MAP_EXT
RequiresOneOf([
RequiresAllOf([DeviceExtension(ext_fragment_density_map)]),
]),
FRAGMENT_SHADING_RATE_ATTACHMENT = FRAGMENT_SHADING_RATE_ATTACHMENT_KHR
RequiresOneOf([
RequiresAllOf([DeviceExtension(khr_fragment_shading_rate)]),
]),
TRANSFER_SRC = TRANSFER_SRC
RequiresOneOf([
RequiresAllOf([APIVersion(V1_1)]),
RequiresAllOf([DeviceExtension(khr_maintenance1)]),
]),
TRANSFER_DST = TRANSFER_DST
RequiresOneOf([
RequiresAllOf([APIVersion(V1_1)]),
RequiresAllOf([DeviceExtension(khr_maintenance1)]),
]),
BLIT_SRC = BLIT_SRC,
BLIT_DST = BLIT_DST,
SAMPLED_IMAGE_FILTER_LINEAR = SAMPLED_IMAGE_FILTER_LINEAR,
SAMPLED_IMAGE_FILTER_CUBIC = SAMPLED_IMAGE_FILTER_CUBIC_EXT
RequiresOneOf([
RequiresAllOf([DeviceExtension(ext_filter_cubic)]),
RequiresAllOf([DeviceExtension(img_filter_cubic)]),
]),
SAMPLED_IMAGE_FILTER_MINMAX = SAMPLED_IMAGE_FILTER_MINMAX
RequiresOneOf([
RequiresAllOf([APIVersion(V1_2)]),
RequiresAllOf([DeviceExtension(ext_sampler_filter_minmax)]),
]),
MIDPOINT_CHROMA_SAMPLES = MIDPOINT_CHROMA_SAMPLES
RequiresOneOf([
RequiresAllOf([APIVersion(V1_1)]),
RequiresAllOf([DeviceExtension(khr_sampler_ycbcr_conversion)]),
]),
COSITED_CHROMA_SAMPLES = COSITED_CHROMA_SAMPLES
RequiresOneOf([
RequiresAllOf([APIVersion(V1_1)]),
RequiresAllOf([DeviceExtension(khr_sampler_ycbcr_conversion)]),
]),
SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER = SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER
RequiresOneOf([
RequiresAllOf([APIVersion(V1_1)]),
RequiresAllOf([DeviceExtension(khr_sampler_ycbcr_conversion)]),
]),
SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER = SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER
RequiresOneOf([
RequiresAllOf([APIVersion(V1_1)]),
RequiresAllOf([DeviceExtension(khr_sampler_ycbcr_conversion)]),
]),
SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT = SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT
RequiresOneOf([
RequiresAllOf([APIVersion(V1_1)]),
RequiresAllOf([DeviceExtension(khr_sampler_ycbcr_conversion)]),
]),
SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE = SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE
RequiresOneOf([
RequiresAllOf([APIVersion(V1_1)]),
RequiresAllOf([DeviceExtension(khr_sampler_ycbcr_conversion)]),
]),
SAMPLED_IMAGE_DEPTH_COMPARISON = SAMPLED_IMAGE_DEPTH_COMPARISON
RequiresOneOf([
RequiresAllOf([APIVersion(V1_3)]),
RequiresAllOf([DeviceExtension(khr_format_feature_flags2)]),
]),
VIDEO_DECODE_OUTPUT = VIDEO_DECODE_OUTPUT_KHR
RequiresOneOf([
RequiresAllOf([DeviceExtension(khr_video_decode_queue)]),
]),
VIDEO_DECODE_DPB = VIDEO_DECODE_DPB_KHR
RequiresOneOf([
RequiresAllOf([DeviceExtension(khr_video_decode_queue)]),
]),
VIDEO_ENCODE_INPUT = VIDEO_ENCODE_INPUT_KHR
RequiresOneOf([
RequiresAllOf([DeviceExtension(khr_video_encode_queue)]),
]),
VIDEO_ENCODE_DPB = VIDEO_ENCODE_DPB_KHR
RequiresOneOf([
RequiresAllOf([DeviceExtension(khr_video_encode_queue)]),
]),
DISJOINT = DISJOINT
RequiresOneOf([
RequiresAllOf([APIVersion(V1_1)]),
RequiresAllOf([DeviceExtension(khr_sampler_ycbcr_conversion)]),
]),
LINEAR_COLOR_ATTACHMENT = LINEAR_COLOR_ATTACHMENT_NV
RequiresOneOf([
RequiresAllOf([
APIVersion(V1_3),
DeviceExtension(nv_linear_color_attachment),
]),
RequiresAllOf([
DeviceExtension(khr_format_feature_flags2),
DeviceExtension(nv_linear_color_attachment),
]),
]),
WEIGHT_IMAGE = WEIGHT_IMAGE_QCOM
RequiresOneOf([
RequiresAllOf([
APIVersion(V1_3),
DeviceExtension(qcom_image_processing),
]),
RequiresAllOf([
DeviceExtension(khr_format_feature_flags2),
DeviceExtension(qcom_image_processing),
]),
]),
WEIGHT_SAMPLED_IMAGE = WEIGHT_SAMPLED_IMAGE_QCOM
RequiresOneOf([
RequiresAllOf([
APIVersion(V1_3),
DeviceExtension(qcom_image_processing),
]),
RequiresAllOf([
DeviceExtension(khr_format_feature_flags2),
DeviceExtension(qcom_image_processing),
]),
]),
BLOCK_MATCHING = BLOCK_MATCHING_QCOM
RequiresOneOf([
RequiresAllOf([
APIVersion(V1_3),
DeviceExtension(qcom_image_processing),
]),
RequiresAllOf([
DeviceExtension(khr_format_feature_flags2),
DeviceExtension(qcom_image_processing),
]),
]),
BOX_FILTER_SAMPLED = BOX_FILTER_SAMPLED_QCOM
RequiresOneOf([
RequiresAllOf([
APIVersion(V1_3),
DeviceExtension(qcom_image_processing),
]),
RequiresAllOf([
DeviceExtension(khr_format_feature_flags2),
DeviceExtension(qcom_image_processing),
]),
]),
OPTICAL_FLOW_IMAGE = OPTICAL_FLOW_IMAGE_NV
RequiresOneOf([
RequiresAllOf([
APIVersion(V1_3),
DeviceExtension(nv_optical_flow),
]),
RequiresAllOf([
DeviceExtension(khr_format_feature_flags2),
DeviceExtension(nv_optical_flow),
]),
]),
OPTICAL_FLOW_VECTOR = OPTICAL_FLOW_VECTOR_NV
RequiresOneOf([
RequiresAllOf([
APIVersion(V1_3),
DeviceExtension(nv_optical_flow),
]),
RequiresAllOf([
DeviceExtension(khr_format_feature_flags2),
DeviceExtension(nv_optical_flow),
]),
]),
OPTICAL_FLOW_COST = OPTICAL_FLOW_COST_NV
RequiresOneOf([
RequiresAllOf([
APIVersion(V1_3),
DeviceExtension(nv_optical_flow),
]),
RequiresAllOf([
DeviceExtension(khr_format_feature_flags2),
DeviceExtension(nv_optical_flow),
]),
]),
UNIFORM_TEXEL_BUFFER = UNIFORM_TEXEL_BUFFER,
STORAGE_TEXEL_BUFFER = STORAGE_TEXEL_BUFFER,
STORAGE_TEXEL_BUFFER_ATOMIC = STORAGE_TEXEL_BUFFER_ATOMIC,
VERTEX_BUFFER = VERTEX_BUFFER,
ACCELERATION_STRUCTURE_VERTEX_BUFFER = ACCELERATION_STRUCTURE_VERTEX_BUFFER_KHR
RequiresOneOf([
RequiresAllOf([DeviceExtension(khr_acceleration_structure)]),
]),
}
impl From<ash::vk::FormatFeatureFlags> for FormatFeatures {
#[inline]
fn from(val: ash::vk::FormatFeatureFlags) -> Self {
Self::from(ash::vk::FormatFeatureFlags2::from_raw(val.as_raw() as u64))
}
}