Vulkan 1.2.175: Provisional Video Extensions (#417)
* generator: Add edegecases for broken Video extension enum variants
* Replace deprecated `make_version()` with `make_api_version()`
* generator: Use the same predicate for push_next and its traits
Some structs turn out to be root structs when their name is not in the
`root_structs` set, even when they themselves extend another struct.
This was already taken care of for `push_next` which is emitted in this
situation, but the trait referenced by `push_next`'s `T` bound is still
relying on the `extends` field to not exist in `vk.xml` at all, leading
to it not being generated despite `push_next` needing it.
Fixes: 215511f
("Implement ExtendXXX for multiple root create infos if
there are more than 1")
* Update Vulkan-Headers to 12.175
* generator: Generate low-level structs with bindgen (for vk_video)
This commit is contained in:
parent
b81b19a735
commit
06b4f8ef35
15 changed files with 13294 additions and 209 deletions
|
@ -21,7 +21,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||
.iter()
|
||||
.map(|ext| ext.as_ptr())
|
||||
.collect::<Vec<_>>();
|
||||
let app_desc = vk::ApplicationInfo::builder().api_version(vk::make_version(1, 0, 0));
|
||||
let app_desc = vk::ApplicationInfo::builder().api_version(vk::make_api_version(0, 1, 0, 0));
|
||||
let instance_desc = vk::InstanceCreateInfo::builder()
|
||||
.application_info(&app_desc)
|
||||
.enabled_extension_names(&instance_extensions);
|
||||
|
|
|
@ -67,7 +67,7 @@ impl EntryCustom<Arc<Library>> {
|
|||
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
/// let entry = unsafe { Entry::new() }?;
|
||||
/// let app_info = vk::ApplicationInfo {
|
||||
/// api_version: vk::make_version(1, 0, 0),
|
||||
/// api_version: vk::make_api_version(0, 1, 0, 0),
|
||||
/// ..Default::default()
|
||||
/// };
|
||||
/// let create_info = vk::InstanceCreateInfo {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
//! let entry = unsafe { Entry::new() }?;
|
||||
//! let app_info = vk::ApplicationInfo {
|
||||
//! api_version: vk::make_version(1, 0, 0),
|
||||
//! api_version: vk::make_api_version(0, 1, 0, 0),
|
||||
//! ..Default::default()
|
||||
//! };
|
||||
//! let create_info = vk::InstanceCreateInfo {
|
||||
|
|
|
@ -24,6 +24,9 @@ mod feature_extensions;
|
|||
pub use feature_extensions::*;
|
||||
mod features;
|
||||
pub use features::*;
|
||||
#[doc = r" Native bindings from Vulkan headers, generated by bindgen"]
|
||||
#[allow(nonstandard_style)]
|
||||
pub mod native;
|
||||
mod platform_types;
|
||||
pub use platform_types::*;
|
||||
#[doc = r" Iterates through the pointer chain. Includes the item that is passed into the function."]
|
||||
|
|
|
@ -1046,3 +1046,166 @@ impl SubmitFlagsKHR {
|
|||
pub struct EventCreateFlags(pub(crate) Flags);
|
||||
vk_bitflags_wrapped!(EventCreateFlags, 0b0, Flags);
|
||||
impl EventCreateFlags {}
|
||||
#[repr(transparent)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoCodecOperationFlagBitsKHR.html>"]
|
||||
pub struct VideoCodecOperationFlagsKHR(pub(crate) Flags);
|
||||
vk_bitflags_wrapped!(VideoCodecOperationFlagsKHR, 0b0, Flags);
|
||||
impl VideoCodecOperationFlagsKHR {
|
||||
pub const INVALID: Self = Self(0);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoChromaSubsamplingFlagBitsKHR.html>"]
|
||||
pub struct VideoChromaSubsamplingFlagsKHR(pub(crate) Flags);
|
||||
vk_bitflags_wrapped!(VideoChromaSubsamplingFlagsKHR, 0b1111, Flags);
|
||||
impl VideoChromaSubsamplingFlagsKHR {
|
||||
pub const INVALID: Self = Self(0);
|
||||
pub const MONOCHROME: Self = Self(0b1);
|
||||
pub const TYPE_420: Self = Self(0b10);
|
||||
pub const TYPE_422: Self = Self(0b100);
|
||||
pub const TYPE_444: Self = Self(0b1000);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoComponentBitDepthFlagBitsKHR.html>"]
|
||||
pub struct VideoComponentBitDepthFlagsKHR(pub(crate) Flags);
|
||||
vk_bitflags_wrapped!(VideoComponentBitDepthFlagsKHR, 0b1_0101, Flags);
|
||||
impl VideoComponentBitDepthFlagsKHR {
|
||||
pub const INVALID: Self = Self(0);
|
||||
pub const TYPE_8: Self = Self(0b1);
|
||||
pub const TYPE_10: Self = Self(0b100);
|
||||
pub const TYPE_12: Self = Self(0b1_0000);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoCapabilitiesFlagBitsKHR.html>"]
|
||||
pub struct VideoCapabilitiesFlagsKHR(pub(crate) Flags);
|
||||
vk_bitflags_wrapped!(VideoCapabilitiesFlagsKHR, 0b11, Flags);
|
||||
impl VideoCapabilitiesFlagsKHR {
|
||||
pub const PROTECTED_CONTENT: Self = Self(0b1);
|
||||
pub const SEPARATE_REFERENCE_IMAGES: Self = Self(0b10);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoSessionCreateFlagBitsKHR.html>"]
|
||||
pub struct VideoSessionCreateFlagsKHR(pub(crate) Flags);
|
||||
vk_bitflags_wrapped!(VideoSessionCreateFlagsKHR, 0b1, Flags);
|
||||
impl VideoSessionCreateFlagsKHR {
|
||||
pub const DEFAULT: Self = Self(0);
|
||||
pub const PROTECTED_CONTENT: Self = Self(0b1);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoCodingQualityPresetFlagBitsKHR.html>"]
|
||||
pub struct VideoCodingQualityPresetFlagsKHR(pub(crate) Flags);
|
||||
vk_bitflags_wrapped!(VideoCodingQualityPresetFlagsKHR, 0b111, Flags);
|
||||
impl VideoCodingQualityPresetFlagsKHR {
|
||||
pub const DEFAULT: Self = Self(0);
|
||||
pub const NORMAL: Self = Self(0b1);
|
||||
pub const POWER: Self = Self(0b10);
|
||||
pub const QUALITY: Self = Self(0b100);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoDecodeH264FieldLayoutFlagBitsEXT.html>"]
|
||||
pub struct VideoDecodeH264FieldLayoutFlagsEXT(pub(crate) Flags);
|
||||
vk_bitflags_wrapped!(VideoDecodeH264FieldLayoutFlagsEXT, 0b11, Flags);
|
||||
impl VideoDecodeH264FieldLayoutFlagsEXT {
|
||||
pub const PROGRESSIVE_PICTURES_ONLY: Self = Self(0);
|
||||
pub const LINE_INTERLACED_PLANE: Self = Self(0b1);
|
||||
pub const SEPARATE_INTERLACED_PLANE: Self = Self(0b10);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoCodingControlFlagBitsKHR.html>"]
|
||||
pub struct VideoCodingControlFlagsKHR(pub(crate) Flags);
|
||||
vk_bitflags_wrapped!(VideoCodingControlFlagsKHR, 0b1, Flags);
|
||||
impl VideoCodingControlFlagsKHR {
|
||||
pub const DEFAULT: Self = Self(0);
|
||||
pub const RESET: Self = Self(0b1);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoDecodeFlagBitsKHR.html>"]
|
||||
pub struct VideoDecodeFlagsKHR(pub(crate) Flags);
|
||||
vk_bitflags_wrapped!(VideoDecodeFlagsKHR, 0b1, Flags);
|
||||
impl VideoDecodeFlagsKHR {
|
||||
pub const DEFAULT: Self = Self(0);
|
||||
pub const RESERVED_0: Self = Self(0b1);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoEncodeFlagBitsKHR.html>"]
|
||||
pub struct VideoEncodeFlagsKHR(pub(crate) Flags);
|
||||
vk_bitflags_wrapped!(VideoEncodeFlagsKHR, 0b1, Flags);
|
||||
impl VideoEncodeFlagsKHR {
|
||||
pub const DEFAULT: Self = Self(0);
|
||||
pub const RESERVED_0: Self = Self(0b1);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoEncodeRateControlFlagBitsKHR.html>"]
|
||||
pub struct VideoEncodeRateControlFlagsKHR(pub(crate) Flags);
|
||||
vk_bitflags_wrapped!(VideoEncodeRateControlFlagsKHR, 0b1, Flags);
|
||||
impl VideoEncodeRateControlFlagsKHR {
|
||||
pub const DEFAULT: Self = Self(0);
|
||||
pub const RESET: Self = Self(0b1);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoEncodeRateControlModeFlagBitsKHR.html>"]
|
||||
pub struct VideoEncodeRateControlModeFlagsKHR(pub(crate) Flags);
|
||||
vk_bitflags_wrapped!(VideoEncodeRateControlModeFlagsKHR, 0b11, Flags);
|
||||
impl VideoEncodeRateControlModeFlagsKHR {
|
||||
pub const NONE: Self = Self(0);
|
||||
pub const CBR: Self = Self(1);
|
||||
pub const VBR: Self = Self(2);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoEncodeH264CapabilitiesFlagBitsEXT.html>"]
|
||||
pub struct VideoEncodeH264CapabilitiesFlagsEXT(pub(crate) Flags);
|
||||
vk_bitflags_wrapped!(VideoEncodeH264CapabilitiesFlagsEXT, 0b111_1111_1111, Flags);
|
||||
impl VideoEncodeH264CapabilitiesFlagsEXT {
|
||||
pub const CABAC: Self = Self(0b1);
|
||||
pub const CAVLC: Self = Self(0b10);
|
||||
pub const WEIGHTED_BI_PRED_IMPLICIT: Self = Self(0b100);
|
||||
pub const TRANSFORM_8X8: Self = Self(0b1000);
|
||||
pub const CHROMA_QP_OFFSET: Self = Self(0b1_0000);
|
||||
pub const SECOND_CHROMA_QP_OFFSET: Self = Self(0b10_0000);
|
||||
pub const DEBLOCKING_FILTER_DISABLED: Self = Self(0b100_0000);
|
||||
pub const DEBLOCKING_FILTER_ENABLED: Self = Self(0b1000_0000);
|
||||
pub const DEBLOCKING_FILTER_PARTIAL: Self = Self(0b1_0000_0000);
|
||||
pub const MULTIPLE_SLICE_PER_FRAME: Self = Self(0b10_0000_0000);
|
||||
pub const EVENLY_DISTRIBUTED_SLICE_SIZE: Self = Self(0b100_0000_0000);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoEncodeH264InputModeFlagBitsEXT.html>"]
|
||||
pub struct VideoEncodeH264InputModeFlagsEXT(pub(crate) Flags);
|
||||
vk_bitflags_wrapped!(VideoEncodeH264InputModeFlagsEXT, 0b111, Flags);
|
||||
impl VideoEncodeH264InputModeFlagsEXT {
|
||||
pub const FRAME: Self = Self(0b1);
|
||||
pub const SLICE: Self = Self(0b10);
|
||||
pub const NON_VCL: Self = Self(0b100);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoEncodeH264OutputModeFlagBitsEXT.html>"]
|
||||
pub struct VideoEncodeH264OutputModeFlagsEXT(pub(crate) Flags);
|
||||
vk_bitflags_wrapped!(VideoEncodeH264OutputModeFlagsEXT, 0b111, Flags);
|
||||
impl VideoEncodeH264OutputModeFlagsEXT {
|
||||
pub const FRAME: Self = Self(0b1);
|
||||
pub const SLICE: Self = Self(0b10);
|
||||
pub const NON_VCL: Self = Self(0b100);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoEncodeH264CreateFlagBitsEXT.html>"]
|
||||
pub struct VideoEncodeH264CreateFlagsEXT(pub(crate) Flags);
|
||||
vk_bitflags_wrapped!(VideoEncodeH264CreateFlagsEXT, 0b1, Flags);
|
||||
impl VideoEncodeH264CreateFlagsEXT {
|
||||
pub const DEFAULT: Self = Self(0);
|
||||
pub const RESERVED_0: Self = Self(0b1);
|
||||
}
|
||||
|
|
|
@ -246,10 +246,10 @@ impl fmt::Debug for AccessFlags2KHR {
|
|||
AccessFlags2KHR::SHADER_STORAGE_WRITE.0,
|
||||
"SHADER_STORAGE_WRITE",
|
||||
),
|
||||
(AccessFlags2KHR::RESERVED_READ_35.0, "RESERVED_READ_35"),
|
||||
(AccessFlags2KHR::RESERVED_WRITE_36.0, "RESERVED_WRITE_36"),
|
||||
(AccessFlags2KHR::RESERVED_READ_37.0, "RESERVED_READ_37"),
|
||||
(AccessFlags2KHR::RESERVED_WRITE_38.0, "RESERVED_WRITE_38"),
|
||||
(AccessFlags2KHR::VIDEO_DECODE_READ.0, "VIDEO_DECODE_READ"),
|
||||
(AccessFlags2KHR::VIDEO_DECODE_WRITE.0, "VIDEO_DECODE_WRITE"),
|
||||
(AccessFlags2KHR::VIDEO_ENCODE_READ.0, "VIDEO_ENCODE_READ"),
|
||||
(AccessFlags2KHR::VIDEO_ENCODE_WRITE.0, "VIDEO_ENCODE_WRITE"),
|
||||
(
|
||||
AccessFlags2KHR::TRANSFORM_FEEDBACK_WRITE_EXT.0,
|
||||
"TRANSFORM_FEEDBACK_WRITE_EXT",
|
||||
|
@ -509,10 +509,22 @@ impl fmt::Debug for BufferUsageFlags {
|
|||
(BufferUsageFlags::INDEX_BUFFER.0, "INDEX_BUFFER"),
|
||||
(BufferUsageFlags::VERTEX_BUFFER.0, "VERTEX_BUFFER"),
|
||||
(BufferUsageFlags::INDIRECT_BUFFER.0, "INDIRECT_BUFFER"),
|
||||
(BufferUsageFlags::RESERVED_15_KHR.0, "RESERVED_15_KHR"),
|
||||
(BufferUsageFlags::RESERVED_16_KHR.0, "RESERVED_16_KHR"),
|
||||
(BufferUsageFlags::RESERVED_13_KHR.0, "RESERVED_13_KHR"),
|
||||
(BufferUsageFlags::RESERVED_14_KHR.0, "RESERVED_14_KHR"),
|
||||
(
|
||||
BufferUsageFlags::VIDEO_DECODE_SRC_KHR.0,
|
||||
"VIDEO_DECODE_SRC_KHR",
|
||||
),
|
||||
(
|
||||
BufferUsageFlags::VIDEO_DECODE_DST_KHR.0,
|
||||
"VIDEO_DECODE_DST_KHR",
|
||||
),
|
||||
(
|
||||
BufferUsageFlags::VIDEO_ENCODE_DST_KHR.0,
|
||||
"VIDEO_ENCODE_DST_KHR",
|
||||
),
|
||||
(
|
||||
BufferUsageFlags::VIDEO_ENCODE_SRC_KHR.0,
|
||||
"VIDEO_ENCODE_SRC_KHR",
|
||||
),
|
||||
(
|
||||
BufferUsageFlags::TRANSFORM_FEEDBACK_BUFFER_EXT.0,
|
||||
"TRANSFORM_FEEDBACK_BUFFER_EXT",
|
||||
|
@ -1277,6 +1289,7 @@ impl fmt::Debug for DriverId {
|
|||
Self::BROADCOM_PROPRIETARY => Some("BROADCOM_PROPRIETARY"),
|
||||
Self::MESA_LLVMPIPE => Some("MESA_LLVMPIPE"),
|
||||
Self::MOLTENVK => Some("MOLTENVK"),
|
||||
Self::COREAVI_PROPRIETARY => Some("COREAVI_PROPRIETARY"),
|
||||
_ => None,
|
||||
};
|
||||
if let Some(x) = name {
|
||||
|
@ -1321,6 +1334,8 @@ impl fmt::Debug for DynamicState {
|
|||
Self::DEPTH_BOUNDS_TEST_ENABLE_EXT => Some("DEPTH_BOUNDS_TEST_ENABLE_EXT"),
|
||||
Self::STENCIL_TEST_ENABLE_EXT => Some("STENCIL_TEST_ENABLE_EXT"),
|
||||
Self::STENCIL_OP_EXT => Some("STENCIL_OP_EXT"),
|
||||
Self::VERTEX_INPUT_EXT => Some("VERTEX_INPUT_EXT"),
|
||||
Self::COLOR_WRITE_ENABLE_EXT => Some("COLOR_WRITE_ENABLE_EXT"),
|
||||
_ => None,
|
||||
};
|
||||
if let Some(x) = name {
|
||||
|
@ -1771,6 +1786,14 @@ impl fmt::Debug for Format {
|
|||
Self::ASTC_6X6X6_UNORM_BLOCK_EXT => Some("ASTC_6X6X6_UNORM_BLOCK_EXT"),
|
||||
Self::ASTC_6X6X6_SRGB_BLOCK_EXT => Some("ASTC_6X6X6_SRGB_BLOCK_EXT"),
|
||||
Self::ASTC_6X6X6_SFLOAT_BLOCK_EXT => Some("ASTC_6X6X6_SFLOAT_BLOCK_EXT"),
|
||||
Self::G8_B8R8_2PLANE_444_UNORM_EXT => Some("G8_B8R8_2PLANE_444_UNORM_EXT"),
|
||||
Self::G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT => {
|
||||
Some("G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT")
|
||||
}
|
||||
Self::G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT => {
|
||||
Some("G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT")
|
||||
}
|
||||
Self::G16_B16R16_2PLANE_444_UNORM_EXT => Some("G16_B16R16_2PLANE_444_UNORM_EXT"),
|
||||
Self::A4R4G4B4_UNORM_PACK16_EXT => Some("A4R4G4B4_UNORM_PACK16_EXT"),
|
||||
Self::A4B4G4R4_UNORM_PACK16_EXT => Some("A4B4G4R4_UNORM_PACK16_EXT"),
|
||||
Self::G8B8G8R8_422_UNORM => Some("G8B8G8R8_422_UNORM"),
|
||||
|
@ -1846,7 +1869,7 @@ impl fmt::Debug for Format {
|
|||
}
|
||||
impl fmt::Debug for FormatFeatureFlags {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
const KNOWN : & [(Flags , & str)] = & [(FormatFeatureFlags :: SAMPLED_IMAGE . 0 , "SAMPLED_IMAGE") , (FormatFeatureFlags :: STORAGE_IMAGE . 0 , "STORAGE_IMAGE") , (FormatFeatureFlags :: STORAGE_IMAGE_ATOMIC . 0 , "STORAGE_IMAGE_ATOMIC") , (FormatFeatureFlags :: UNIFORM_TEXEL_BUFFER . 0 , "UNIFORM_TEXEL_BUFFER") , (FormatFeatureFlags :: STORAGE_TEXEL_BUFFER . 0 , "STORAGE_TEXEL_BUFFER") , (FormatFeatureFlags :: STORAGE_TEXEL_BUFFER_ATOMIC . 0 , "STORAGE_TEXEL_BUFFER_ATOMIC") , (FormatFeatureFlags :: VERTEX_BUFFER . 0 , "VERTEX_BUFFER") , (FormatFeatureFlags :: COLOR_ATTACHMENT . 0 , "COLOR_ATTACHMENT") , (FormatFeatureFlags :: COLOR_ATTACHMENT_BLEND . 0 , "COLOR_ATTACHMENT_BLEND") , (FormatFeatureFlags :: DEPTH_STENCIL_ATTACHMENT . 0 , "DEPTH_STENCIL_ATTACHMENT") , (FormatFeatureFlags :: BLIT_SRC . 0 , "BLIT_SRC") , (FormatFeatureFlags :: BLIT_DST . 0 , "BLIT_DST") , (FormatFeatureFlags :: SAMPLED_IMAGE_FILTER_LINEAR . 0 , "SAMPLED_IMAGE_FILTER_LINEAR") , (FormatFeatureFlags :: SAMPLED_IMAGE_FILTER_CUBIC_IMG . 0 , "SAMPLED_IMAGE_FILTER_CUBIC_IMG") , (FormatFeatureFlags :: RESERVED_27_KHR . 0 , "RESERVED_27_KHR") , (FormatFeatureFlags :: RESERVED_28_KHR . 0 , "RESERVED_28_KHR") , (FormatFeatureFlags :: RESERVED_25_KHR . 0 , "RESERVED_25_KHR") , (FormatFeatureFlags :: RESERVED_26_KHR . 0 , "RESERVED_26_KHR") , (FormatFeatureFlags :: ACCELERATION_STRUCTURE_VERTEX_BUFFER_KHR . 0 , "ACCELERATION_STRUCTURE_VERTEX_BUFFER_KHR") , (FormatFeatureFlags :: FRAGMENT_DENSITY_MAP_EXT . 0 , "FRAGMENT_DENSITY_MAP_EXT") , (FormatFeatureFlags :: FRAGMENT_SHADING_RATE_ATTACHMENT_KHR . 0 , "FRAGMENT_SHADING_RATE_ATTACHMENT_KHR") , (FormatFeatureFlags :: TRANSFER_SRC . 0 , "TRANSFER_SRC") , (FormatFeatureFlags :: TRANSFER_DST . 0 , "TRANSFER_DST") , (FormatFeatureFlags :: MIDPOINT_CHROMA_SAMPLES . 0 , "MIDPOINT_CHROMA_SAMPLES") , (FormatFeatureFlags :: SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER . 0 , "SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER") , (FormatFeatureFlags :: SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER . 0 , "SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER") , (FormatFeatureFlags :: SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT . 0 , "SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT") , (FormatFeatureFlags :: SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE . 0 , "SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE") , (FormatFeatureFlags :: DISJOINT . 0 , "DISJOINT") , (FormatFeatureFlags :: COSITED_CHROMA_SAMPLES . 0 , "COSITED_CHROMA_SAMPLES") , (FormatFeatureFlags :: SAMPLED_IMAGE_FILTER_MINMAX . 0 , "SAMPLED_IMAGE_FILTER_MINMAX")] ;
|
||||
const KNOWN : & [(Flags , & str)] = & [(FormatFeatureFlags :: SAMPLED_IMAGE . 0 , "SAMPLED_IMAGE") , (FormatFeatureFlags :: STORAGE_IMAGE . 0 , "STORAGE_IMAGE") , (FormatFeatureFlags :: STORAGE_IMAGE_ATOMIC . 0 , "STORAGE_IMAGE_ATOMIC") , (FormatFeatureFlags :: UNIFORM_TEXEL_BUFFER . 0 , "UNIFORM_TEXEL_BUFFER") , (FormatFeatureFlags :: STORAGE_TEXEL_BUFFER . 0 , "STORAGE_TEXEL_BUFFER") , (FormatFeatureFlags :: STORAGE_TEXEL_BUFFER_ATOMIC . 0 , "STORAGE_TEXEL_BUFFER_ATOMIC") , (FormatFeatureFlags :: VERTEX_BUFFER . 0 , "VERTEX_BUFFER") , (FormatFeatureFlags :: COLOR_ATTACHMENT . 0 , "COLOR_ATTACHMENT") , (FormatFeatureFlags :: COLOR_ATTACHMENT_BLEND . 0 , "COLOR_ATTACHMENT_BLEND") , (FormatFeatureFlags :: DEPTH_STENCIL_ATTACHMENT . 0 , "DEPTH_STENCIL_ATTACHMENT") , (FormatFeatureFlags :: BLIT_SRC . 0 , "BLIT_SRC") , (FormatFeatureFlags :: BLIT_DST . 0 , "BLIT_DST") , (FormatFeatureFlags :: SAMPLED_IMAGE_FILTER_LINEAR . 0 , "SAMPLED_IMAGE_FILTER_LINEAR") , (FormatFeatureFlags :: SAMPLED_IMAGE_FILTER_CUBIC_IMG . 0 , "SAMPLED_IMAGE_FILTER_CUBIC_IMG") , (FormatFeatureFlags :: VIDEO_DECODE_OUTPUT_KHR . 0 , "VIDEO_DECODE_OUTPUT_KHR") , (FormatFeatureFlags :: VIDEO_DECODE_DPB_KHR . 0 , "VIDEO_DECODE_DPB_KHR") , (FormatFeatureFlags :: VIDEO_ENCODE_INPUT_KHR . 0 , "VIDEO_ENCODE_INPUT_KHR") , (FormatFeatureFlags :: VIDEO_ENCODE_DPB_KHR . 0 , "VIDEO_ENCODE_DPB_KHR") , (FormatFeatureFlags :: ACCELERATION_STRUCTURE_VERTEX_BUFFER_KHR . 0 , "ACCELERATION_STRUCTURE_VERTEX_BUFFER_KHR") , (FormatFeatureFlags :: FRAGMENT_DENSITY_MAP_EXT . 0 , "FRAGMENT_DENSITY_MAP_EXT") , (FormatFeatureFlags :: FRAGMENT_SHADING_RATE_ATTACHMENT_KHR . 0 , "FRAGMENT_SHADING_RATE_ATTACHMENT_KHR") , (FormatFeatureFlags :: TRANSFER_SRC . 0 , "TRANSFER_SRC") , (FormatFeatureFlags :: TRANSFER_DST . 0 , "TRANSFER_DST") , (FormatFeatureFlags :: MIDPOINT_CHROMA_SAMPLES . 0 , "MIDPOINT_CHROMA_SAMPLES") , (FormatFeatureFlags :: SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER . 0 , "SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER") , (FormatFeatureFlags :: SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER . 0 , "SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER") , (FormatFeatureFlags :: SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT . 0 , "SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT") , (FormatFeatureFlags :: SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE . 0 , "SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE") , (FormatFeatureFlags :: DISJOINT . 0 , "DISJOINT") , (FormatFeatureFlags :: COSITED_CHROMA_SAMPLES . 0 , "COSITED_CHROMA_SAMPLES") , (FormatFeatureFlags :: SAMPLED_IMAGE_FILTER_MINMAX . 0 , "SAMPLED_IMAGE_FILTER_MINMAX")] ;
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
|
@ -2066,6 +2089,12 @@ impl fmt::Debug for ImageLayout {
|
|||
Self::TRANSFER_DST_OPTIMAL => Some("TRANSFER_DST_OPTIMAL"),
|
||||
Self::PREINITIALIZED => Some("PREINITIALIZED"),
|
||||
Self::PRESENT_SRC_KHR => Some("PRESENT_SRC_KHR"),
|
||||
Self::VIDEO_DECODE_DST_KHR => Some("VIDEO_DECODE_DST_KHR"),
|
||||
Self::VIDEO_DECODE_SRC_KHR => Some("VIDEO_DECODE_SRC_KHR"),
|
||||
Self::VIDEO_DECODE_DPB_KHR => Some("VIDEO_DECODE_DPB_KHR"),
|
||||
Self::VIDEO_ENCODE_DST_KHR => Some("VIDEO_ENCODE_DST_KHR"),
|
||||
Self::VIDEO_ENCODE_SRC_KHR => Some("VIDEO_ENCODE_SRC_KHR"),
|
||||
Self::VIDEO_ENCODE_DPB_KHR => Some("VIDEO_ENCODE_DPB_KHR"),
|
||||
Self::SHARED_PRESENT_KHR => Some("SHARED_PRESENT_KHR"),
|
||||
Self::SHADING_RATE_OPTIMAL_NV => Some("SHADING_RATE_OPTIMAL_NV"),
|
||||
Self::FRAGMENT_DENSITY_MAP_OPTIMAL_EXT => Some("FRAGMENT_DENSITY_MAP_OPTIMAL_EXT"),
|
||||
|
@ -2143,12 +2172,30 @@ impl fmt::Debug for ImageUsageFlags {
|
|||
"TRANSIENT_ATTACHMENT",
|
||||
),
|
||||
(ImageUsageFlags::INPUT_ATTACHMENT.0, "INPUT_ATTACHMENT"),
|
||||
(ImageUsageFlags::RESERVED_13_KHR.0, "RESERVED_13_KHR"),
|
||||
(ImageUsageFlags::RESERVED_14_KHR.0, "RESERVED_14_KHR"),
|
||||
(ImageUsageFlags::RESERVED_15_KHR.0, "RESERVED_15_KHR"),
|
||||
(ImageUsageFlags::RESERVED_10_KHR.0, "RESERVED_10_KHR"),
|
||||
(ImageUsageFlags::RESERVED_11_KHR.0, "RESERVED_11_KHR"),
|
||||
(ImageUsageFlags::RESERVED_12_KHR.0, "RESERVED_12_KHR"),
|
||||
(
|
||||
ImageUsageFlags::VIDEO_DECODE_DST_KHR.0,
|
||||
"VIDEO_DECODE_DST_KHR",
|
||||
),
|
||||
(
|
||||
ImageUsageFlags::VIDEO_DECODE_SRC_KHR.0,
|
||||
"VIDEO_DECODE_SRC_KHR",
|
||||
),
|
||||
(
|
||||
ImageUsageFlags::VIDEO_DECODE_DPB_KHR.0,
|
||||
"VIDEO_DECODE_DPB_KHR",
|
||||
),
|
||||
(
|
||||
ImageUsageFlags::VIDEO_ENCODE_DST_KHR.0,
|
||||
"VIDEO_ENCODE_DST_KHR",
|
||||
),
|
||||
(
|
||||
ImageUsageFlags::VIDEO_ENCODE_SRC_KHR.0,
|
||||
"VIDEO_ENCODE_SRC_KHR",
|
||||
),
|
||||
(
|
||||
ImageUsageFlags::VIDEO_ENCODE_DPB_KHR.0,
|
||||
"VIDEO_ENCODE_DPB_KHR",
|
||||
),
|
||||
(
|
||||
ImageUsageFlags::SHADING_RATE_IMAGE_NV.0,
|
||||
"SHADING_RATE_IMAGE_NV",
|
||||
|
@ -2433,6 +2480,8 @@ impl fmt::Debug for ObjectType {
|
|||
Self::DISPLAY_KHR => Some("DISPLAY_KHR"),
|
||||
Self::DISPLAY_MODE_KHR => Some("DISPLAY_MODE_KHR"),
|
||||
Self::DEBUG_REPORT_CALLBACK_EXT => Some("DEBUG_REPORT_CALLBACK_EXT"),
|
||||
Self::VIDEO_SESSION_KHR => Some("VIDEO_SESSION_KHR"),
|
||||
Self::VIDEO_SESSION_PARAMETERS_KHR => Some("VIDEO_SESSION_PARAMETERS_KHR"),
|
||||
Self::DEBUG_UTILS_MESSENGER_EXT => Some("DEBUG_UTILS_MESSENGER_EXT"),
|
||||
Self::ACCELERATION_STRUCTURE_KHR => Some("ACCELERATION_STRUCTURE_KHR"),
|
||||
Self::VALIDATION_CACHE_EXT => Some("VALIDATION_CACHE_EXT"),
|
||||
|
@ -2988,8 +3037,8 @@ impl fmt::Debug for PipelineStageFlags2KHR {
|
|||
PipelineStageFlags2KHR::PRE_RASTERIZATION_SHADERS.0,
|
||||
"PRE_RASTERIZATION_SHADERS",
|
||||
),
|
||||
(PipelineStageFlags2KHR::RESERVED_26.0, "RESERVED_26"),
|
||||
(PipelineStageFlags2KHR::RESERVED_27.0, "RESERVED_27"),
|
||||
(PipelineStageFlags2KHR::VIDEO_DECODE.0, "VIDEO_DECODE"),
|
||||
(PipelineStageFlags2KHR::VIDEO_ENCODE.0, "VIDEO_ENCODE"),
|
||||
(
|
||||
PipelineStageFlags2KHR::TRANSFORM_FEEDBACK_EXT.0,
|
||||
"TRANSFORM_FEEDBACK_EXT",
|
||||
|
@ -3208,18 +3257,36 @@ impl fmt::Debug for QueryResultFlags {
|
|||
(QueryResultFlags::WAIT.0, "WAIT"),
|
||||
(QueryResultFlags::WITH_AVAILABILITY.0, "WITH_AVAILABILITY"),
|
||||
(QueryResultFlags::PARTIAL.0, "PARTIAL"),
|
||||
(QueryResultFlags::WITH_STATUS_KHR.0, "WITH_STATUS_KHR"),
|
||||
];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for QueryResultStatusKHR {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
let name = match *self {
|
||||
Self::ERROR => Some("ERROR"),
|
||||
Self::NOT_READY => Some("NOT_READY"),
|
||||
Self::COMPLETE => Some("COMPLETE"),
|
||||
_ => None,
|
||||
};
|
||||
if let Some(x) = name {
|
||||
f.write_str(x)
|
||||
} else {
|
||||
self.0.fmt(f)
|
||||
}
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for QueryType {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
let name = match *self {
|
||||
Self::OCCLUSION => Some("OCCLUSION"),
|
||||
Self::PIPELINE_STATISTICS => Some("PIPELINE_STATISTICS"),
|
||||
Self::TIMESTAMP => Some("TIMESTAMP"),
|
||||
Self::RESERVED_8 => Some("RESERVED_8"),
|
||||
Self::RESERVED_4 => Some("RESERVED_4"),
|
||||
Self::RESULT_STATUS_ONLY_KHR => Some("RESULT_STATUS_ONLY_KHR"),
|
||||
Self::VIDEO_ENCODESTREAM_BUFFER_RANGE_KHR => {
|
||||
Some("VIDEO_ENCODESTREAM_BUFFER_RANGE_KHR")
|
||||
}
|
||||
Self::TRANSFORM_FEEDBACK_STREAM_EXT => Some("TRANSFORM_FEEDBACK_STREAM_EXT"),
|
||||
Self::PERFORMANCE_QUERY_KHR => Some("PERFORMANCE_QUERY_KHR"),
|
||||
Self::ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR => {
|
||||
|
@ -3248,8 +3315,8 @@ impl fmt::Debug for QueueFlags {
|
|||
(QueueFlags::COMPUTE.0, "COMPUTE"),
|
||||
(QueueFlags::TRANSFER.0, "TRANSFER"),
|
||||
(QueueFlags::SPARSE_BINDING.0, "SPARSE_BINDING"),
|
||||
(QueueFlags::RESERVED_6_KHR.0, "RESERVED_6_KHR"),
|
||||
(QueueFlags::RESERVED_5_KHR.0, "RESERVED_5_KHR"),
|
||||
(QueueFlags::VIDEO_DECODE_KHR.0, "VIDEO_DECODE_KHR"),
|
||||
(QueueFlags::VIDEO_ENCODE_KHR.0, "VIDEO_ENCODE_KHR"),
|
||||
(QueueFlags::PROTECTED.0, "PROTECTED"),
|
||||
];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
|
@ -3824,6 +3891,33 @@ impl fmt::Debug for StructureType {
|
|||
Self::DEBUG_MARKER_OBJECT_NAME_INFO_EXT => Some("DEBUG_MARKER_OBJECT_NAME_INFO_EXT"),
|
||||
Self::DEBUG_MARKER_OBJECT_TAG_INFO_EXT => Some("DEBUG_MARKER_OBJECT_TAG_INFO_EXT"),
|
||||
Self::DEBUG_MARKER_MARKER_INFO_EXT => Some("DEBUG_MARKER_MARKER_INFO_EXT"),
|
||||
Self::VIDEO_PROFILE_KHR => Some("VIDEO_PROFILE_KHR"),
|
||||
Self::VIDEO_CAPABILITIES_KHR => Some("VIDEO_CAPABILITIES_KHR"),
|
||||
Self::VIDEO_PICTURE_RESOURCE_KHR => Some("VIDEO_PICTURE_RESOURCE_KHR"),
|
||||
Self::VIDEO_GET_MEMORY_PROPERTIES_KHR => Some("VIDEO_GET_MEMORY_PROPERTIES_KHR"),
|
||||
Self::VIDEO_BIND_MEMORY_KHR => Some("VIDEO_BIND_MEMORY_KHR"),
|
||||
Self::VIDEO_SESSION_CREATE_INFO_KHR => Some("VIDEO_SESSION_CREATE_INFO_KHR"),
|
||||
Self::VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR => {
|
||||
Some("VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR")
|
||||
}
|
||||
Self::VIDEO_SESSION_PARAMETERS_UPDATE_INFO_KHR => {
|
||||
Some("VIDEO_SESSION_PARAMETERS_UPDATE_INFO_KHR")
|
||||
}
|
||||
Self::VIDEO_BEGIN_CODING_INFO_KHR => Some("VIDEO_BEGIN_CODING_INFO_KHR"),
|
||||
Self::VIDEO_END_CODING_INFO_KHR => Some("VIDEO_END_CODING_INFO_KHR"),
|
||||
Self::VIDEO_CODING_CONTROL_INFO_KHR => Some("VIDEO_CODING_CONTROL_INFO_KHR"),
|
||||
Self::VIDEO_REFERENCE_SLOT_KHR => Some("VIDEO_REFERENCE_SLOT_KHR"),
|
||||
Self::VIDEO_QUEUE_FAMILY_PROPERTIES_2_KHR => {
|
||||
Some("VIDEO_QUEUE_FAMILY_PROPERTIES_2_KHR")
|
||||
}
|
||||
Self::VIDEO_PROFILES_KHR => Some("VIDEO_PROFILES_KHR"),
|
||||
Self::PHYSICAL_DEVICE_VIDEO_FORMAT_INFO_KHR => {
|
||||
Some("PHYSICAL_DEVICE_VIDEO_FORMAT_INFO_KHR")
|
||||
}
|
||||
Self::VIDEO_FORMAT_PROPERTIES_KHR => Some("VIDEO_FORMAT_PROPERTIES_KHR"),
|
||||
Self::VIDEO_DECODE_INFO_KHR => Some("VIDEO_DECODE_INFO_KHR"),
|
||||
Self::VIDEO_ENCODE_INFO_KHR => Some("VIDEO_ENCODE_INFO_KHR"),
|
||||
Self::VIDEO_ENCODE_RATE_CONTROL_INFO_KHR => Some("VIDEO_ENCODE_RATE_CONTROL_INFO_KHR"),
|
||||
Self::DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV => {
|
||||
Some("DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV")
|
||||
}
|
||||
|
@ -3844,6 +3938,43 @@ impl fmt::Debug for StructureType {
|
|||
}
|
||||
Self::IMAGE_VIEW_HANDLE_INFO_NVX => Some("IMAGE_VIEW_HANDLE_INFO_NVX"),
|
||||
Self::IMAGE_VIEW_ADDRESS_PROPERTIES_NVX => Some("IMAGE_VIEW_ADDRESS_PROPERTIES_NVX"),
|
||||
Self::VIDEO_ENCODE_H264_CAPABILITIES_EXT => Some("VIDEO_ENCODE_H264_CAPABILITIES_EXT"),
|
||||
Self::VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT => {
|
||||
Some("VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT")
|
||||
}
|
||||
Self::VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT => {
|
||||
Some("VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT")
|
||||
}
|
||||
Self::VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT => {
|
||||
Some("VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT")
|
||||
}
|
||||
Self::VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT => {
|
||||
Some("VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT")
|
||||
}
|
||||
Self::VIDEO_ENCODE_H264_DPB_SLOT_INFO_EXT => {
|
||||
Some("VIDEO_ENCODE_H264_DPB_SLOT_INFO_EXT")
|
||||
}
|
||||
Self::VIDEO_ENCODE_H264_NALU_SLICE_EXT => Some("VIDEO_ENCODE_H264_NALU_SLICE_EXT"),
|
||||
Self::VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_EXT => {
|
||||
Some("VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_EXT")
|
||||
}
|
||||
Self::VIDEO_ENCODE_H264_PROFILE_EXT => Some("VIDEO_ENCODE_H264_PROFILE_EXT"),
|
||||
Self::VIDEO_DECODE_H264_CAPABILITIES_EXT => Some("VIDEO_DECODE_H264_CAPABILITIES_EXT"),
|
||||
Self::VIDEO_DECODE_H264_SESSION_CREATE_INFO_EXT => {
|
||||
Some("VIDEO_DECODE_H264_SESSION_CREATE_INFO_EXT")
|
||||
}
|
||||
Self::VIDEO_DECODE_H264_PICTURE_INFO_EXT => Some("VIDEO_DECODE_H264_PICTURE_INFO_EXT"),
|
||||
Self::VIDEO_DECODE_H264_MVC_EXT => Some("VIDEO_DECODE_H264_MVC_EXT"),
|
||||
Self::VIDEO_DECODE_H264_PROFILE_EXT => Some("VIDEO_DECODE_H264_PROFILE_EXT"),
|
||||
Self::VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT => {
|
||||
Some("VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT")
|
||||
}
|
||||
Self::VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT => {
|
||||
Some("VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT")
|
||||
}
|
||||
Self::VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT => {
|
||||
Some("VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT")
|
||||
}
|
||||
Self::TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD => {
|
||||
Some("TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD")
|
||||
}
|
||||
|
@ -4203,6 +4334,21 @@ impl fmt::Debug for StructureType {
|
|||
Self::PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD => {
|
||||
Some("PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD")
|
||||
}
|
||||
Self::VIDEO_DECODE_H265_CAPABILITIES_EXT => Some("VIDEO_DECODE_H265_CAPABILITIES_EXT"),
|
||||
Self::VIDEO_DECODE_H265_SESSION_CREATE_INFO_EXT => {
|
||||
Some("VIDEO_DECODE_H265_SESSION_CREATE_INFO_EXT")
|
||||
}
|
||||
Self::VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT => {
|
||||
Some("VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT")
|
||||
}
|
||||
Self::VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT => {
|
||||
Some("VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT")
|
||||
}
|
||||
Self::VIDEO_DECODE_H265_PROFILE_EXT => Some("VIDEO_DECODE_H265_PROFILE_EXT"),
|
||||
Self::VIDEO_DECODE_H265_PICTURE_INFO_EXT => Some("VIDEO_DECODE_H265_PICTURE_INFO_EXT"),
|
||||
Self::VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT => {
|
||||
Some("VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT")
|
||||
}
|
||||
Self::DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD => {
|
||||
Some("DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD")
|
||||
}
|
||||
|
@ -4423,6 +4569,12 @@ impl fmt::Debug for StructureType {
|
|||
Self::PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV => {
|
||||
Some("PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV")
|
||||
}
|
||||
Self::PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV => {
|
||||
Some("PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV")
|
||||
}
|
||||
Self::COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV => {
|
||||
Some("COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV")
|
||||
}
|
||||
Self::PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT => {
|
||||
Some("PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT")
|
||||
}
|
||||
|
@ -4503,6 +4655,9 @@ impl fmt::Debug for StructureType {
|
|||
Self::PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV => {
|
||||
Some("PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV")
|
||||
}
|
||||
Self::PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT => {
|
||||
Some("PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT")
|
||||
}
|
||||
Self::PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT => {
|
||||
Some("PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT")
|
||||
}
|
||||
|
@ -4537,6 +4692,15 @@ impl fmt::Debug for StructureType {
|
|||
Self::MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE => {
|
||||
Some("MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE")
|
||||
}
|
||||
Self::PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT => {
|
||||
Some("PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT")
|
||||
}
|
||||
Self::VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT => {
|
||||
Some("VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT")
|
||||
}
|
||||
Self::VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT => {
|
||||
Some("VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT")
|
||||
}
|
||||
Self::IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA => {
|
||||
Some("IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA")
|
||||
}
|
||||
|
@ -4553,6 +4717,12 @@ impl fmt::Debug for StructureType {
|
|||
Some("SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA")
|
||||
}
|
||||
Self::SCREEN_SURFACE_CREATE_INFO_QNX => Some("SCREEN_SURFACE_CREATE_INFO_QNX"),
|
||||
Self::PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT => {
|
||||
Some("PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT")
|
||||
}
|
||||
Self::PIPELINE_COLOR_WRITE_CREATE_INFO_EXT => {
|
||||
Some("PIPELINE_COLOR_WRITE_CREATE_INFO_EXT")
|
||||
}
|
||||
Self::PHYSICAL_DEVICE_SUBGROUP_PROPERTIES => {
|
||||
Some("PHYSICAL_DEVICE_SUBGROUP_PROPERTIES")
|
||||
}
|
||||
|
@ -5083,6 +5253,250 @@ impl fmt::Debug for ViSurfaceCreateFlagsNN {
|
|||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for VideoBeginCodingFlagsKHR {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
const KNOWN: &[(Flags, &str)] = &[];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for VideoCapabilitiesFlagsKHR {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
const KNOWN: &[(Flags, &str)] = &[
|
||||
(
|
||||
VideoCapabilitiesFlagsKHR::PROTECTED_CONTENT.0,
|
||||
"PROTECTED_CONTENT",
|
||||
),
|
||||
(
|
||||
VideoCapabilitiesFlagsKHR::SEPARATE_REFERENCE_IMAGES.0,
|
||||
"SEPARATE_REFERENCE_IMAGES",
|
||||
),
|
||||
];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for VideoChromaSubsamplingFlagsKHR {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
const KNOWN: &[(Flags, &str)] = &[
|
||||
(VideoChromaSubsamplingFlagsKHR::INVALID.0, "INVALID"),
|
||||
(VideoChromaSubsamplingFlagsKHR::MONOCHROME.0, "MONOCHROME"),
|
||||
(VideoChromaSubsamplingFlagsKHR::TYPE_420.0, "TYPE_420"),
|
||||
(VideoChromaSubsamplingFlagsKHR::TYPE_422.0, "TYPE_422"),
|
||||
(VideoChromaSubsamplingFlagsKHR::TYPE_444.0, "TYPE_444"),
|
||||
];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for VideoCodecOperationFlagsKHR {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
const KNOWN: &[(Flags, &str)] = &[
|
||||
(VideoCodecOperationFlagsKHR::INVALID.0, "INVALID"),
|
||||
(
|
||||
VideoCodecOperationFlagsKHR::ENCODE_H264_EXT.0,
|
||||
"ENCODE_H264_EXT",
|
||||
),
|
||||
(
|
||||
VideoCodecOperationFlagsKHR::DECODE_H264_EXT.0,
|
||||
"DECODE_H264_EXT",
|
||||
),
|
||||
(
|
||||
VideoCodecOperationFlagsKHR::DECODE_H265_EXT.0,
|
||||
"DECODE_H265_EXT",
|
||||
),
|
||||
];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for VideoCodingControlFlagsKHR {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
const KNOWN: &[(Flags, &str)] = &[
|
||||
(VideoCodingControlFlagsKHR::DEFAULT.0, "DEFAULT"),
|
||||
(VideoCodingControlFlagsKHR::RESET.0, "RESET"),
|
||||
];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for VideoCodingQualityPresetFlagsKHR {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
const KNOWN: &[(Flags, &str)] = &[
|
||||
(VideoCodingQualityPresetFlagsKHR::DEFAULT.0, "DEFAULT"),
|
||||
(VideoCodingQualityPresetFlagsKHR::NORMAL.0, "NORMAL"),
|
||||
(VideoCodingQualityPresetFlagsKHR::POWER.0, "POWER"),
|
||||
(VideoCodingQualityPresetFlagsKHR::QUALITY.0, "QUALITY"),
|
||||
];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for VideoComponentBitDepthFlagsKHR {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
const KNOWN: &[(Flags, &str)] = &[
|
||||
(VideoComponentBitDepthFlagsKHR::INVALID.0, "INVALID"),
|
||||
(VideoComponentBitDepthFlagsKHR::TYPE_8.0, "TYPE_8"),
|
||||
(VideoComponentBitDepthFlagsKHR::TYPE_10.0, "TYPE_10"),
|
||||
(VideoComponentBitDepthFlagsKHR::TYPE_12.0, "TYPE_12"),
|
||||
];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for VideoDecodeFlagsKHR {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
const KNOWN: &[(Flags, &str)] = &[
|
||||
(VideoDecodeFlagsKHR::DEFAULT.0, "DEFAULT"),
|
||||
(VideoDecodeFlagsKHR::RESERVED_0.0, "RESERVED_0"),
|
||||
];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for VideoDecodeH264CreateFlagsEXT {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
const KNOWN: &[(Flags, &str)] = &[];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for VideoDecodeH264FieldLayoutFlagsEXT {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
const KNOWN: &[(Flags, &str)] = &[
|
||||
(
|
||||
VideoDecodeH264FieldLayoutFlagsEXT::PROGRESSIVE_PICTURES_ONLY.0,
|
||||
"PROGRESSIVE_PICTURES_ONLY",
|
||||
),
|
||||
(
|
||||
VideoDecodeH264FieldLayoutFlagsEXT::LINE_INTERLACED_PLANE.0,
|
||||
"LINE_INTERLACED_PLANE",
|
||||
),
|
||||
(
|
||||
VideoDecodeH264FieldLayoutFlagsEXT::SEPARATE_INTERLACED_PLANE.0,
|
||||
"SEPARATE_INTERLACED_PLANE",
|
||||
),
|
||||
];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for VideoDecodeH265CreateFlagsEXT {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
const KNOWN: &[(Flags, &str)] = &[];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for VideoEncodeFlagsKHR {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
const KNOWN: &[(Flags, &str)] = &[
|
||||
(VideoEncodeFlagsKHR::DEFAULT.0, "DEFAULT"),
|
||||
(VideoEncodeFlagsKHR::RESERVED_0.0, "RESERVED_0"),
|
||||
];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for VideoEncodeH264CapabilitiesFlagsEXT {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
const KNOWN: &[(Flags, &str)] = &[
|
||||
(VideoEncodeH264CapabilitiesFlagsEXT::CABAC.0, "CABAC"),
|
||||
(VideoEncodeH264CapabilitiesFlagsEXT::CAVLC.0, "CAVLC"),
|
||||
(
|
||||
VideoEncodeH264CapabilitiesFlagsEXT::WEIGHTED_BI_PRED_IMPLICIT.0,
|
||||
"WEIGHTED_BI_PRED_IMPLICIT",
|
||||
),
|
||||
(
|
||||
VideoEncodeH264CapabilitiesFlagsEXT::TRANSFORM_8X8.0,
|
||||
"TRANSFORM_8X8",
|
||||
),
|
||||
(
|
||||
VideoEncodeH264CapabilitiesFlagsEXT::CHROMA_QP_OFFSET.0,
|
||||
"CHROMA_QP_OFFSET",
|
||||
),
|
||||
(
|
||||
VideoEncodeH264CapabilitiesFlagsEXT::SECOND_CHROMA_QP_OFFSET.0,
|
||||
"SECOND_CHROMA_QP_OFFSET",
|
||||
),
|
||||
(
|
||||
VideoEncodeH264CapabilitiesFlagsEXT::DEBLOCKING_FILTER_DISABLED.0,
|
||||
"DEBLOCKING_FILTER_DISABLED",
|
||||
),
|
||||
(
|
||||
VideoEncodeH264CapabilitiesFlagsEXT::DEBLOCKING_FILTER_ENABLED.0,
|
||||
"DEBLOCKING_FILTER_ENABLED",
|
||||
),
|
||||
(
|
||||
VideoEncodeH264CapabilitiesFlagsEXT::DEBLOCKING_FILTER_PARTIAL.0,
|
||||
"DEBLOCKING_FILTER_PARTIAL",
|
||||
),
|
||||
(
|
||||
VideoEncodeH264CapabilitiesFlagsEXT::MULTIPLE_SLICE_PER_FRAME.0,
|
||||
"MULTIPLE_SLICE_PER_FRAME",
|
||||
),
|
||||
(
|
||||
VideoEncodeH264CapabilitiesFlagsEXT::EVENLY_DISTRIBUTED_SLICE_SIZE.0,
|
||||
"EVENLY_DISTRIBUTED_SLICE_SIZE",
|
||||
),
|
||||
];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for VideoEncodeH264CreateFlagsEXT {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
const KNOWN: &[(Flags, &str)] = &[
|
||||
(VideoEncodeH264CreateFlagsEXT::DEFAULT.0, "DEFAULT"),
|
||||
(VideoEncodeH264CreateFlagsEXT::RESERVED_0.0, "RESERVED_0"),
|
||||
];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for VideoEncodeH264InputModeFlagsEXT {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
const KNOWN: &[(Flags, &str)] = &[
|
||||
(VideoEncodeH264InputModeFlagsEXT::FRAME.0, "FRAME"),
|
||||
(VideoEncodeH264InputModeFlagsEXT::SLICE.0, "SLICE"),
|
||||
(VideoEncodeH264InputModeFlagsEXT::NON_VCL.0, "NON_VCL"),
|
||||
];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for VideoEncodeH264OutputModeFlagsEXT {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
const KNOWN: &[(Flags, &str)] = &[
|
||||
(VideoEncodeH264OutputModeFlagsEXT::FRAME.0, "FRAME"),
|
||||
(VideoEncodeH264OutputModeFlagsEXT::SLICE.0, "SLICE"),
|
||||
(VideoEncodeH264OutputModeFlagsEXT::NON_VCL.0, "NON_VCL"),
|
||||
];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for VideoEncodeRateControlFlagsKHR {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
const KNOWN: &[(Flags, &str)] = &[
|
||||
(VideoEncodeRateControlFlagsKHR::DEFAULT.0, "DEFAULT"),
|
||||
(VideoEncodeRateControlFlagsKHR::RESET.0, "RESET"),
|
||||
];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for VideoEncodeRateControlModeFlagsKHR {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
const KNOWN: &[(Flags, &str)] = &[
|
||||
(VideoEncodeRateControlModeFlagsKHR::NONE.0, "NONE"),
|
||||
(VideoEncodeRateControlModeFlagsKHR::CBR.0, "CBR"),
|
||||
(VideoEncodeRateControlModeFlagsKHR::VBR.0, "VBR"),
|
||||
];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for VideoEndCodingFlagsKHR {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
const KNOWN: &[(Flags, &str)] = &[];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for VideoSessionCreateFlagsKHR {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
const KNOWN: &[(Flags, &str)] = &[
|
||||
(VideoSessionCreateFlagsKHR::DEFAULT.0, "DEFAULT"),
|
||||
(
|
||||
VideoSessionCreateFlagsKHR::PROTECTED_CONTENT.0,
|
||||
"PROTECTED_CONTENT",
|
||||
),
|
||||
];
|
||||
debug_flags(f, KNOWN, self.0)
|
||||
}
|
||||
}
|
||||
impl fmt::Debug for ViewportCoordinateSwizzleNV {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
let name = match *self {
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1650,6 +1650,8 @@ impl DriverId {
|
|||
pub const MESA_LLVMPIPE: Self = Self(13);
|
||||
#[doc = "MoltenVK"]
|
||||
pub const MOLTENVK: Self = Self(14);
|
||||
#[doc = "Core Avionics & Industrial Inc."]
|
||||
pub const COREAVI_PROPRIETARY: Self = Self(15);
|
||||
}
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
|
||||
#[repr(transparent)]
|
||||
|
@ -2186,3 +2188,20 @@ impl FragmentShadingRateTypeNV {
|
|||
pub const FRAGMENT_SIZE: Self = Self(0);
|
||||
pub const ENUMS: Self = Self(1);
|
||||
}
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
|
||||
#[repr(transparent)]
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkQueryResultStatusKHR.html>"]
|
||||
pub struct QueryResultStatusKHR(pub(crate) i32);
|
||||
impl QueryResultStatusKHR {
|
||||
pub const fn from_raw(x: i32) -> Self {
|
||||
QueryResultStatusKHR(x)
|
||||
}
|
||||
pub const fn as_raw(self) -> i32 {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
impl QueryResultStatusKHR {
|
||||
pub const ERROR: Self = Self(-1);
|
||||
pub const NOT_READY: Self = Self(0);
|
||||
pub const COMPLETE: Self = Self(1);
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
7439
ash/src/vk/native.rs
Normal file
7439
ash/src/vk/native.rs
Normal file
File diff suppressed because it is too large
Load diff
|
@ -225,7 +225,7 @@ impl ExampleBase {
|
|||
.application_version(0)
|
||||
.engine_name(&app_name)
|
||||
.engine_version(0)
|
||||
.api_version(vk::make_version(1, 0, 0));
|
||||
.api_version(vk::make_api_version(0, 1, 0, 0));
|
||||
|
||||
let create_info = vk::InstanceCreateInfo::builder()
|
||||
.application_info(&appinfo)
|
||||
|
|
|
@ -5,6 +5,7 @@ authors = ["Maik Klein <maikklein@googlemail.com>"]
|
|||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
bindgen = "0.58"
|
||||
heck = "0.3"
|
||||
itertools = "0.10"
|
||||
nom = "6.0"
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit e1d8c4931d8e4b6c4a8e633c163ed3aa82d6ac1c
|
||||
Subproject commit f5ac258209dc535973aa527bf3c11ba7063ba1b0
|
|
@ -4,11 +4,8 @@ use std::path::Path;
|
|||
fn main() {
|
||||
let cwd = std::env::current_dir().unwrap();
|
||||
if cwd.ends_with("generator") {
|
||||
write_source_code(Path::new("Vulkan-Headers/registry/vk.xml"), "../ash/src");
|
||||
write_source_code(Path::new("Vulkan-Headers"), "../ash/src");
|
||||
} else {
|
||||
write_source_code(
|
||||
Path::new("generator/Vulkan-Headers/registry/vk.xml"),
|
||||
"ash/src",
|
||||
);
|
||||
write_source_code(Path::new("generator/Vulkan-Headers"), "ash/src");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,9 +3,10 @@
|
|||
use heck::{CamelCase, ShoutySnakeCase, SnakeCase};
|
||||
use itertools::Itertools;
|
||||
use nom::{
|
||||
alt,
|
||||
character::complete::{digit1, hex_digit1},
|
||||
complete, delimited, do_parse, map, named, one_of, opt, pair, preceded, tag, terminated, value,
|
||||
alt, char,
|
||||
character::complete::{digit1, hex_digit1, multispace1},
|
||||
complete, delimited, do_parse, many1, map, named, none_of, one_of, opt, pair, preceded, tag,
|
||||
terminated, value,
|
||||
};
|
||||
use once_cell::sync::Lazy;
|
||||
use proc_macro2::{Delimiter, Group, Literal, Span, TokenStream, TokenTree};
|
||||
|
@ -106,6 +107,23 @@ named!(cfloat<&str, f32>,
|
|||
terminated!(nom::number::complete::float, one_of!("fF"))
|
||||
);
|
||||
|
||||
// Like a C string, but does not support quote escaping and expects at least one character.
|
||||
// If needed, use https://github.com/Geal/nom/blob/8e09f0c3029d32421b5b69fb798cef6855d0c8df/tests/json.rs#L61-L81
|
||||
named!(c_include_string<&str, String>,
|
||||
delimited!(
|
||||
char!('"'),
|
||||
map!(
|
||||
many1!(none_of!("\"")),
|
||||
|chars| chars.iter().map(char::to_string).join("")
|
||||
),
|
||||
char!('"')
|
||||
)
|
||||
);
|
||||
|
||||
named!(c_include<&str, String>,
|
||||
preceded!(tag!("#include"), preceded!(multispace1, c_include_string))
|
||||
);
|
||||
|
||||
fn khronos_link<S: Display + ?Sized>(name: &S) -> Literal {
|
||||
Literal::string(&format!(
|
||||
"<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/{name}.html>",
|
||||
|
@ -1376,6 +1394,14 @@ pub fn variant_ident(enum_name: &str, variant_name: &str) -> Ident {
|
|||
.unwrap_or_else(|| {
|
||||
if enum_name == "VkResult" || is_enum_variant_with_typo(variant_name) {
|
||||
variant_name.strip_prefix("VK").unwrap()
|
||||
} else if variant_name == "VK_VIDEO_DECODE_H264_PROGRESSIVE_PICTURES_ONLY" {
|
||||
// https://github.com/KhronosGroup/Vulkan-Docs/issues/1531
|
||||
"_PROGRESSIVE_PICTURES_ONLY"
|
||||
} else if struct_name == "VK_VIDEO_ENCODE_H264_CAPABILITIES" {
|
||||
// https://github.com/KhronosGroup/Vulkan-Docs/issues/1531
|
||||
variant_name
|
||||
.strip_prefix("VK_VIDEO_ENCODE_H264_CAPABILITY")
|
||||
.unwrap()
|
||||
} else {
|
||||
panic!(
|
||||
"Failed to strip {} prefix from enum variant {}",
|
||||
|
@ -1951,7 +1977,7 @@ pub fn derive_setters(
|
|||
})
|
||||
});
|
||||
|
||||
let extends_name = name_to_tokens(&format!("Extends{}", name));
|
||||
let extends_name = format_ident!("Extends{}", name);
|
||||
|
||||
let root_structs: Vec<Ident> = _struct
|
||||
.extends
|
||||
|
@ -1960,13 +1986,15 @@ pub fn derive_setters(
|
|||
extends
|
||||
.split(',')
|
||||
.filter(|extend| root_struct_names.contains(*extend))
|
||||
.map(|extends| name_to_tokens(&format!("Extends{}", name_to_tokens(&extends))))
|
||||
.map(|extends| format_ident!("Extends{}", name_to_tokens(extends)))
|
||||
.collect()
|
||||
})
|
||||
.unwrap_or_else(Vec::new);
|
||||
|
||||
let is_root_struct = has_next && root_structs.is_empty();
|
||||
|
||||
// We only implement a next methods for root structs with a `pnext` field.
|
||||
let next_function = if has_next && root_structs.is_empty() {
|
||||
let next_function = if is_root_struct {
|
||||
quote! {
|
||||
/// Prepends the given extension struct between the root and the first pointer. This
|
||||
/// method only exists on structs that can be passed to a function directly. Only
|
||||
|
@ -1993,27 +2021,22 @@ pub fn derive_setters(
|
|||
}
|
||||
}
|
||||
} else {
|
||||
quote! {}
|
||||
quote!()
|
||||
};
|
||||
|
||||
// Root structs come with their own trait that structs that extends this struct will
|
||||
// implement
|
||||
let next_trait = if has_next && _struct.extends.is_none() {
|
||||
quote! {
|
||||
pub unsafe trait #extends_name {
|
||||
}
|
||||
}
|
||||
// Root structs come with their own trait that structs that extend
|
||||
// this struct will implement
|
||||
let next_trait = if is_root_struct {
|
||||
quote!(pub unsafe trait #extends_name {})
|
||||
} else {
|
||||
quote! {}
|
||||
quote!()
|
||||
};
|
||||
|
||||
// If the struct extends something we need to implement the trait.
|
||||
let impl_extend_trait = root_structs.iter().map(|extends| {
|
||||
quote! {
|
||||
unsafe impl #extends for #name_builder<'_> {
|
||||
}
|
||||
unsafe impl #extends for #name {
|
||||
}
|
||||
unsafe impl #extends for #name_builder<'_> {}
|
||||
unsafe impl #extends for #name {}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -2488,6 +2511,62 @@ pub fn generate_const_debugs(const_values: &BTreeMap<Ident, ConstantTypeInfo>) -
|
|||
#(#impls)*
|
||||
}
|
||||
}
|
||||
pub fn extract_native_types(registry: &vk_parse::Registry) -> (Vec<(String, String)>, Vec<String>) {
|
||||
// Not a HashMap so that headers are processed in order of definition:
|
||||
let mut header_includes = vec![];
|
||||
let mut header_types = vec![];
|
||||
|
||||
let types = registry
|
||||
.0
|
||||
.iter()
|
||||
.filter_map(|item| match item {
|
||||
vk_parse::RegistryChild::Types(ref ty) => {
|
||||
Some(ty.children.iter().filter_map(|child| match child {
|
||||
vk_parse::TypesChild::Type(ty) => Some(ty),
|
||||
_ => None,
|
||||
}))
|
||||
}
|
||||
_ => None,
|
||||
})
|
||||
.flatten();
|
||||
|
||||
for ty in types {
|
||||
match ty.category.as_deref() {
|
||||
Some("include") => {
|
||||
// `category="include"` lacking an `#include` directive are generally "irrelevant" system headers.
|
||||
if let vk_parse::TypeSpec::Code(code) = &ty.spec {
|
||||
let name = ty
|
||||
.name
|
||||
.clone()
|
||||
.expect("Include type must provide header name");
|
||||
assert!(
|
||||
header_includes
|
||||
.iter()
|
||||
.all(|(other_name, _)| other_name != &name),
|
||||
"Header `{}` being redefined",
|
||||
name
|
||||
);
|
||||
|
||||
let (rem, path) = c_include(&code.code)
|
||||
.expect("Failed to parse `#include` from `category=\"include\"` directive");
|
||||
assert!(rem.is_empty());
|
||||
header_includes.push((name, path));
|
||||
}
|
||||
}
|
||||
Some(_) => {}
|
||||
None => {
|
||||
if let Some(header_name) = ty.requires.clone() {
|
||||
if header_includes.iter().any(|(name, _)| name == &header_name) {
|
||||
// Omit types from system and other headers
|
||||
header_types.push(ty.name.clone().expect("Type must have a name"));
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
(header_includes, header_types)
|
||||
}
|
||||
pub fn generate_aliases_of_types(
|
||||
types: &vk_parse::Types,
|
||||
ty_cache: &mut HashSet<Ident, impl BuildHasher>,
|
||||
|
@ -2514,10 +2593,11 @@ pub fn generate_aliases_of_types(
|
|||
#(#aliases)*
|
||||
}
|
||||
}
|
||||
pub fn write_source_code<P: AsRef<Path>>(vk_xml: &Path, src_dir: P) {
|
||||
pub fn write_source_code<P: AsRef<Path>>(vk_headers_dir: &Path, src_dir: P) {
|
||||
let vk_xml = vk_headers_dir.join("registry/vk.xml");
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
let (spec2, _errors) = vk_parse::parse_file(vk_xml).expect("Invalid xml file");
|
||||
let (spec2, _errors) = vk_parse::parse_file(&vk_xml).expect("Invalid xml file");
|
||||
let extensions: &Vec<vk_parse::Extension> = spec2
|
||||
.0
|
||||
.iter()
|
||||
|
@ -2539,7 +2619,7 @@ pub fn write_source_code<P: AsRef<Path>>(vk_xml: &Path, src_dir: P) {
|
|||
})
|
||||
.collect();
|
||||
|
||||
let spec = vk_parse::parse_file_as_vkxml(vk_xml).expect("Invalid xml file.");
|
||||
let spec = vk_parse::parse_file_as_vkxml(&vk_xml).expect("Invalid xml file.");
|
||||
let cmd_aliases: HashMap<String, String> = spec2
|
||||
.0
|
||||
.iter()
|
||||
|
@ -2738,11 +2818,12 @@ pub fn write_source_code<P: AsRef<Path>>(vk_xml: &Path, src_dir: P) {
|
|||
use std::fmt;
|
||||
use std::os::raw::*;
|
||||
use crate::vk::{Handle, ptr_chain_iter};
|
||||
use crate::vk::platform_types::*;
|
||||
use crate::vk::aliases::*;
|
||||
use crate::vk::bitflags::*;
|
||||
use crate::vk::constants::*;
|
||||
use crate::vk::enums::*;
|
||||
use crate::vk::native::*;
|
||||
use crate::vk::platform_types::*;
|
||||
#(#definition_code)*
|
||||
};
|
||||
|
||||
|
@ -2820,6 +2901,9 @@ pub fn write_source_code<P: AsRef<Path>>(vk_xml: &Path, src_dir: P) {
|
|||
pub use feature_extensions::*;
|
||||
mod features;
|
||||
pub use features::*;
|
||||
/// Native bindings from Vulkan headers, generated by bindgen
|
||||
#[allow(nonstandard_style)]
|
||||
pub mod native;
|
||||
mod platform_types;
|
||||
pub use platform_types::*;
|
||||
|
||||
|
@ -2852,4 +2936,41 @@ pub fn write_source_code<P: AsRef<Path>>(vk_xml: &Path, src_dir: P) {
|
|||
write!(&mut vk_aliases_file, "{}", aliases).expect("Unable to write vk/aliases.rs");
|
||||
write!(&mut vk_rs_file, "{} {}", vk_rs_clippy_lints, vk_rs_code)
|
||||
.expect("Unable to write vk.rs");
|
||||
|
||||
let vk_include = vk_headers_dir.join("include");
|
||||
|
||||
let mut bindings = bindgen::Builder::default()
|
||||
.clang_arg(format!(
|
||||
"-I{}",
|
||||
vk_include.to_str().expect("Valid UTF8 string")
|
||||
))
|
||||
.clang_arg(format!(
|
||||
"-I{}",
|
||||
vk_include
|
||||
.join("vulkan")
|
||||
.to_str()
|
||||
.expect("Valid UTF8 string")
|
||||
));
|
||||
|
||||
let (header_includes, header_types) = extract_native_types(&spec2);
|
||||
|
||||
for (_name, path) in header_includes {
|
||||
let path = if path == "vk_platform.h" {
|
||||
// Fix broken path, https://github.com/KhronosGroup/Vulkan-Docs/pull/1538
|
||||
vk_include.join("vulkan").join(path)
|
||||
} else {
|
||||
vk_include.join(path)
|
||||
};
|
||||
bindings = bindings.header(path.to_str().expect("Valid UTF8 string"));
|
||||
}
|
||||
|
||||
for typ in header_types {
|
||||
bindings = bindings.allowlist_type(typ);
|
||||
}
|
||||
|
||||
bindings
|
||||
.generate()
|
||||
.expect("Unable to generate native bindings")
|
||||
.write_to_file(vk_dir.join("native.rs"))
|
||||
.expect("Couldn't write native bindings!");
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue