Skip to content

Commit

Permalink
Vulkan 1.2.175: Provisional Video Extensions (#417)
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
MarijnS95 authored Jun 6, 2021
1 parent b81b19a commit 06b4f8e
Show file tree
Hide file tree
Showing 15 changed files with 13,286 additions and 201 deletions.
2 changes: 1 addition & 1 deletion ash-window/examples/winit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion ash/src/entry_libloading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion ash/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions ash/src/vk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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."]
Expand Down
163 changes: 163 additions & 0 deletions ash/src/vk/bitflags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Loading

0 comments on commit 06b4f8e

Please sign in to comment.