WIP: Bug 1747750 - Return null WebGPU adapter r=jimb

Differential Revision: https://phabricator.services.mozilla.com/D135645
This commit is contained in:
Dzmitry Malyshau 2022-01-12 15:34:55 +00:00
Родитель 250cea0582
Коммит 71dcb0b551
177 изменённых файлов: 65263 добавлений и 58951 удалений

Просмотреть файл

@ -82,20 +82,20 @@ git = "https://github.com/hsivonen/chardetng"
replace-with = "vendored-sources"
rev = "3484d3e3ebdc8931493aa5df4d7ee9360a90e76b"
[source."https://github.com/grovesNL/glow"]
git = "https://github.com/grovesNL/glow"
replace-with = "vendored-sources"
rev = "5851ca6"
[source."https://github.com/gfx-rs/wgpu"]
git = "https://github.com/gfx-rs/wgpu"
replace-with = "vendored-sources"
rev = "1e593a6"
rev = "6bc896f"
[source."https://github.com/gfx-rs/naga"]
git = "https://github.com/gfx-rs/naga"
replace-with = "vendored-sources"
rev = "8ffd6ba"
rev = "c0b7ac7"
[source."https://github.com/gfx-rs/metal-rs"]
git = "https://github.com/gfx-rs/metal-rs"
replace-with = "vendored-sources"
rev = "140c8f4"
[source."https://github.com/chris-zen/coremidi.git"]
git = "https://github.com/chris-zen/coremidi.git"

28
Cargo.lock сгенерированный
Просмотреть файл

@ -124,9 +124,9 @@ dependencies = [
[[package]]
name = "ash"
version = "0.33.3+1.2.191"
version = "0.35.0+1.2.203"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc4f1d82f164f838ae413296d1131aa6fa79b917d25bebaa7033d25620c09219"
checksum = "5a7638ce84f8c84d6fd6faa63aa267574d345181ba591c0eeb5550d4c30cd600"
dependencies = [
"libloading 0.7.2",
]
@ -2142,8 +2142,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
[[package]]
name = "glow"
version = "0.11.1"
source = "git+https://github.com/grovesNL/glow?rev=5851ca6#5851ca65e6b6f4f2c59683245c07de1843c85452"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919"
dependencies = [
"js-sys",
"slotmap",
@ -3054,8 +3055,7 @@ dependencies = [
[[package]]
name = "metal"
version = "0.23.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e0514f491f4cc03632ab399ee01e2c1c1b12d3e1cf2d667c1ff5f87d6dcd2084"
source = "git+https://github.com/gfx-rs/metal-rs?rev=140c8f4#140c8f4e39001ae154f153ffc767da6c0c9d7f06"
dependencies = [
"bitflags",
"block",
@ -3373,8 +3373,8 @@ checksum = "a2983372caf4480544083767bf2d27defafe32af49ab4df3a0b7fc90793a3664"
[[package]]
name = "naga"
version = "0.7.1"
source = "git+https://github.com/gfx-rs/naga?rev=8ffd6ba#8ffd6ba929b4b93c9564f08fe8bb34b23fa72a6f"
version = "0.8.0"
source = "git+https://github.com/gfx-rs/naga?rev=c0b7ac7#c0b7ac7f542cc42ccac6f2ec3fc1fb01309cf4d7"
dependencies = [
"bit-set",
"bitflags",
@ -5752,8 +5752,8 @@ dependencies = [
[[package]]
name = "wgpu-core"
version = "0.11.0"
source = "git+https://github.com/gfx-rs/wgpu?rev=1e593a6#1e593a6bd3e60796d00604d803c77bfb41ef3232"
version = "0.12.0"
source = "git+https://github.com/gfx-rs/wgpu?rev=6bc896f#6bc896fe8cc6d74e09934afc7f257c0c60aac59f"
dependencies = [
"arrayvec 0.7.2",
"bitflags",
@ -5775,8 +5775,8 @@ dependencies = [
[[package]]
name = "wgpu-hal"
version = "0.11.2"
source = "git+https://github.com/gfx-rs/wgpu?rev=1e593a6#1e593a6bd3e60796d00604d803c77bfb41ef3232"
version = "0.12.0"
source = "git+https://github.com/gfx-rs/wgpu?rev=6bc896f#6bc896fe8cc6d74e09934afc7f257c0c60aac59f"
dependencies = [
"arrayvec 0.7.2",
"ash",
@ -5812,8 +5812,8 @@ dependencies = [
[[package]]
name = "wgpu-types"
version = "0.11.0"
source = "git+https://github.com/gfx-rs/wgpu?rev=1e593a6#1e593a6bd3e60796d00604d803c77bfb41ef3232"
version = "0.12.0"
source = "git+https://github.com/gfx-rs/wgpu?rev=6bc896f#6bc896fe8cc6d74e09934afc7f257c0c60aac59f"
dependencies = [
"bitflags",
"bitflags_serde_shim",

Просмотреть файл

@ -72,8 +72,7 @@ already_AddRefed<dom::Promise> Instance::RequestAdapter(
if (aResponseReason.isSome()) {
promise->MaybeRejectWithAbortError("Internal communication error!");
} else {
promise->MaybeRejectWithInvalidStateError(
"No matching adapter found!");
promise->MaybeResolve(JS::NullHandleValue);
}
});

Просмотреть файл

@ -17,7 +17,7 @@ default = []
[dependencies.wgc]
package = "wgpu-core"
git = "https://github.com/gfx-rs/wgpu"
rev = "1e593a6"
rev = "6bc896f"
#Note: "replay" shouldn't ideally be needed,
# but it allows us to serialize everything across IPC.
features = ["replay", "trace", "serial-pass"]
@ -25,12 +25,12 @@ features = ["replay", "trace", "serial-pass"]
[dependencies.wgt]
package = "wgpu-types"
git = "https://github.com/gfx-rs/wgpu"
rev = "1e593a6"
rev = "6bc896f"
[dependencies.wgh]
package = "wgpu-hal"
git = "https://github.com/gfx-rs/wgpu"
rev = "1e593a6"
rev = "6bc896f"
[dependencies]
bincode = "1"

2
third_party/rust/ash/.cargo-checksum.json поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

20
third_party/rust/ash/Cargo.toml поставляемый
Просмотреть файл

@ -3,17 +3,16 @@
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you believe there's an error in this file please file an
# issue against the rust-lang/cargo repository. If you're
# editing this file be aware that the upstream Cargo.toml
# will likely look very different (and much more reasonable)
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.
[package]
edition = "2018"
name = "ash"
version = "0.33.3+1.2.191"
version = "0.35.0+1.2.203"
authors = ["maik klein <maikklein@googlemail.com>"]
description = "Vulkan bindings for Rust"
documentation = "https://docs.rs/ash"
@ -21,6 +20,10 @@ readme = "../README.md"
keywords = ["vulkan", "graphic"]
license = "MIT"
repository = "https://github.com/MaikKlein/ash"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[package.metadata.release]
no-dev-version = true
[dependencies.libloading]
@ -28,4 +31,7 @@ version = "0.7"
optional = true
[features]
default = ["libloading"]
debug = []
default = ["loaded", "debug"]
linked = []
loaded = ["libloading"]

24
third_party/rust/ash/build.rs поставляемый Normal file
Просмотреть файл

@ -0,0 +1,24 @@
fn main() {
#[cfg(feature = "linked")]
{
use std::env;
let target_family = env::var("CARGO_CFG_TARGET_FAMILY").unwrap();
let target_pointer_width = env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap();
println!("cargo:rerun-if-env-changed=VULKAN_SDK");
if let Ok(var) = env::var("VULKAN_SDK") {
let suffix = match (&*target_family, &*target_pointer_width) {
("windows", "32") => "Lib32",
("windows", "64") => "Lib",
_ => "lib",
};
println!("cargo:rustc-link-search={}/{}", var, suffix);
}
let lib = match &*target_family {
"windows" => "vulkan-1",
_ => "vulkan",
};
println!("cargo:rustc-link-lib={}", lib);
}
}

58
third_party/rust/ash/src/device.rs поставляемый
Просмотреть файл

@ -22,7 +22,7 @@ impl Device {
mem::transmute(instance_fn.get_device_proc_addr(device, name.as_ptr()))
};
Device {
Self {
handle: device,
device_fn_1_0: vk::DeviceFnV1_0::load(load_fn),
@ -166,14 +166,14 @@ impl Device {
) -> VkResult<()> {
self.device_fn_1_2
.wait_semaphores(self.handle(), wait_info, timeout)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkSignalSemaphore.html>"]
pub unsafe fn signal_semaphore(&self, signal_info: &vk::SemaphoreSignalInfo) -> VkResult<()> {
self.device_fn_1_2
.signal_semaphore(self.handle(), signal_info)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetBufferDeviceAddress.html>"]
@ -218,7 +218,7 @@ impl Device {
) -> VkResult<()> {
self.device_fn_1_1
.bind_buffer_memory2(self.handle(), bind_infos.len() as _, bind_infos.as_ptr())
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkBindImageMemory2.html>"]
@ -228,7 +228,7 @@ impl Device {
) -> VkResult<()> {
self.device_fn_1_1
.bind_image_memory2(self.handle(), bind_infos.len() as _, bind_infos.as_ptr())
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDeviceGroupPeerMemoryFeatures.html>"]
@ -297,6 +297,7 @@ impl Device {
.get_buffer_memory_requirements2(self.handle(), info, out);
}
/// Retrieve the number of elements to pass to [`Self::get_image_sparse_memory_requirements2()`]
pub unsafe fn get_image_sparse_memory_requirements2_len(
&self,
info: &vk::ImageSparseMemoryRequirementsInfo2,
@ -312,6 +313,9 @@ impl Device {
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetImageSparseMemoryRequirements2.html>"]
///
/// Call [`Self::get_image_sparse_memory_requirements2_len()`] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
pub unsafe fn get_image_sparse_memory_requirements2(
&self,
info: &vk::ImageSparseMemoryRequirementsInfo2,
@ -503,12 +507,14 @@ impl Device {
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkSetEvent.html>"]
pub unsafe fn set_event(&self, event: vk::Event) -> VkResult<()> {
self.device_fn_1_0.set_event(self.handle(), event).into()
self.device_fn_1_0.set_event(self.handle(), event).result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkResetEvent.html>"]
pub unsafe fn reset_event(&self, event: vk::Event) -> VkResult<()> {
self.device_fn_1_0.reset_event(self.handle(), event).into()
self.device_fn_1_0
.reset_event(self.handle(), event)
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetEvent.html>"]
pub unsafe fn cmd_set_event(
@ -766,7 +772,7 @@ impl Device {
descriptor_sets.len() as u32,
descriptor_sets.as_ptr(),
)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkUpdateDescriptorSets.html>"]
@ -986,7 +992,7 @@ impl Device {
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkDeviceWaitIdle.html>"]
pub unsafe fn device_wait_idle(&self) -> VkResult<()> {
self.device_fn_1_0.device_wait_idle(self.handle()).into()
self.device_fn_1_0.device_wait_idle(self.handle()).result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateDescriptorPool.html>"]
@ -1014,7 +1020,7 @@ impl Device {
) -> VkResult<()> {
self.device_fn_1_0
.reset_descriptor_pool(self.handle(), pool, flags)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkResetCommandPool.html>"]
@ -1025,7 +1031,7 @@ impl Device {
) -> VkResult<()> {
self.device_fn_1_0
.reset_command_pool(self.handle(), command_pool, flags)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkResetCommandBuffer.html>"]
@ -1036,14 +1042,14 @@ impl Device {
) -> VkResult<()> {
self.device_fn_1_0
.reset_command_buffer(command_buffer, flags)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkResetFences.html>"]
pub unsafe fn reset_fences(&self, fences: &[vk::Fence]) -> VkResult<()> {
self.device_fn_1_0
.reset_fences(self.handle(), fences.len() as u32, fences.as_ptr())
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdBindIndexBuffer.html>"]
@ -1469,7 +1475,7 @@ impl Device {
mem::size_of::<T>() as _,
flags,
)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdBeginQuery.html>"]
@ -1661,7 +1667,7 @@ impl Device {
src_caches.len() as u32,
src_caches.as_ptr(),
)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkMapMemory.html>"]
@ -1690,7 +1696,7 @@ impl Device {
) -> VkResult<()> {
self.device_fn_1_0
.invalidate_mapped_memory_ranges(self.handle(), ranges.len() as u32, ranges.as_ptr())
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkFlushMappedMemoryRanges.html>"]
@ -1700,7 +1706,7 @@ impl Device {
) -> VkResult<()> {
self.device_fn_1_0
.flush_mapped_memory_ranges(self.handle(), ranges.len() as u32, ranges.as_ptr())
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateFramebuffer.html>"]
@ -1782,12 +1788,14 @@ impl Device {
) -> VkResult<()> {
self.device_fn_1_0
.begin_command_buffer(command_buffer, begin_info)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEndCommandBuffer.html>"]
pub unsafe fn end_command_buffer(&self, command_buffer: vk::CommandBuffer) -> VkResult<()> {
self.device_fn_1_0.end_command_buffer(command_buffer).into()
self.device_fn_1_0
.end_command_buffer(command_buffer)
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkWaitForFences.html>"]
@ -1805,7 +1813,7 @@ impl Device {
wait_all as u32,
timeout,
)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetFenceStatus.html>"]
@ -1820,7 +1828,7 @@ impl Device {
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkQueueWaitIdle.html>"]
pub unsafe fn queue_wait_idle(&self, queue: vk::Queue) -> VkResult<()> {
self.device_fn_1_0.queue_wait_idle(queue).into()
self.device_fn_1_0.queue_wait_idle(queue).result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkQueueSubmit.html>"]
@ -1832,7 +1840,7 @@ impl Device {
) -> VkResult<()> {
self.device_fn_1_0
.queue_submit(queue, submits.len() as u32, submits.as_ptr(), fence)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkQueueBindSparse.html>"]
@ -1844,7 +1852,7 @@ impl Device {
) -> VkResult<()> {
self.device_fn_1_0
.queue_bind_sparse(queue, bind_info.len() as u32, bind_info.as_ptr(), fence)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateBufferView.html>"]
@ -2055,7 +2063,7 @@ impl Device {
) -> VkResult<()> {
self.device_fn_1_0
.bind_buffer_memory(self.handle(), buffer, device_memory, offset)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkBindImageMemory.html>"]
@ -2067,7 +2075,7 @@ impl Device {
) -> VkResult<()> {
self.device_fn_1_0
.bind_image_memory(self.handle(), image, device_memory, offset)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetRenderAreaGranularity.html>"]

231
third_party/rust/ash/src/entry.rs поставляемый
Просмотреть файл

@ -2,41 +2,146 @@ use crate::instance::Instance;
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use std::error::Error;
use std::ffi::CStr;
use std::fmt;
#[cfg(feature = "loaded")]
use std::ffi::OsStr;
use std::mem;
use std::os::raw::c_char;
use std::os::raw::c_void;
use std::ptr;
#[cfg(feature = "loaded")]
use std::sync::Arc;
/// Holds a custom type `L` to load symbols from (usually a handle to a `dlopen`ed library),
/// the [`vkGetInstanceProcAddr`][vk::StaticFn::get_instance_proc_addr()] loader function from
/// this library (in [`vk::StaticFn`]), and Vulkan's "entry point" functions (resolved with `NULL`
/// `instance`) as listed in [`vkGetInstanceProcAddr`'s description].
///
/// [`vkGetInstanceProcAddr`'s description]: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetInstanceProcAddr.html#_description
#[cfg(feature = "loaded")]
use libloading::Library;
/// Holds the Vulkan functions independent of a particular instance
#[derive(Clone)]
pub struct EntryCustom<L> {
pub struct Entry {
static_fn: vk::StaticFn,
entry_fn_1_0: vk::EntryFnV1_0,
entry_fn_1_1: vk::EntryFnV1_1,
entry_fn_1_2: vk::EntryFnV1_2,
lib: L,
#[cfg(feature = "loaded")]
_lib_guard: Option<Arc<Library>>,
}
/// Vulkan core 1.0
#[allow(non_camel_case_types)]
impl<L> EntryCustom<L> {
pub fn new_custom<Load>(
mut lib: L,
mut load: Load,
) -> std::result::Result<Self, MissingEntryPoint>
where
Load: FnMut(&mut L, &::std::ffi::CStr) -> *const c_void,
{
// Bypass the normal StaticFn::load so we can return an error
let static_fn = vk::StaticFn::load_checked(|name| load(&mut lib, name))?;
impl Entry {
/// Load default Vulkan library for the current platform
///
/// Prefer this over [`linked`](Self::linked) when your application can gracefully handle
/// environments that lack Vulkan support, and when the build environment might not have Vulkan
/// development packages installed (e.g. the Vulkan SDK, or Ubuntu's `libvulkan-dev`).
///
/// # Safety
/// `dlopen`ing native libraries is inherently unsafe. The safety guidelines
/// for [`Library::new()`] and [`Library::get()`] apply here.
///
/// ```no_run
/// use ash::{vk, Entry};
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let entry = unsafe { Entry::load()? };
/// let app_info = vk::ApplicationInfo {
/// api_version: vk::make_api_version(0, 1, 0, 0),
/// ..Default::default()
/// };
/// let create_info = vk::InstanceCreateInfo {
/// p_application_info: &app_info,
/// ..Default::default()
/// };
/// let instance = unsafe { entry.create_instance(&create_info, None)? };
/// # Ok(()) }
/// ```
#[cfg(feature = "loaded")]
#[cfg_attr(docsrs, doc(cfg(feature = "loaded")))]
pub unsafe fn load() -> Result<Self, LoadingError> {
#[cfg(windows)]
const LIB_PATH: &str = "vulkan-1.dll";
#[cfg(all(
unix,
not(any(target_os = "macos", target_os = "ios", target_os = "android"))
))]
const LIB_PATH: &str = "libvulkan.so.1";
#[cfg(target_os = "android")]
const LIB_PATH: &str = "libvulkan.so";
#[cfg(any(target_os = "macos", target_os = "ios"))]
const LIB_PATH: &str = "libvulkan.dylib";
Self::load_from(LIB_PATH)
}
/// Load entry points from a Vulkan loader linked at compile time
///
/// Compared to [`load`](Self::load), this is infallible, but requires that the build
/// environment have Vulkan development packages installed (e.g. the Vulkan SDK, or Ubuntu's
/// `libvulkan-dev`), and prevents the resulting binary from starting in environments that do not
/// support Vulkan.
///
/// Note that instance/device functions are still fetched via `vkGetInstanceProcAddr` and
/// `vkGetDeviceProcAddr` for maximum performance.
///
/// ```no_run
/// use ash::{vk, Entry};
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let entry = Entry::linked();
/// let app_info = vk::ApplicationInfo {
/// api_version: vk::make_api_version(0, 1, 0, 0),
/// ..Default::default()
/// };
/// let create_info = vk::InstanceCreateInfo {
/// p_application_info: &app_info,
/// ..Default::default()
/// };
/// let instance = unsafe { entry.create_instance(&create_info, None)? };
/// # Ok(()) }
/// ```
#[cfg(feature = "linked")]
#[cfg_attr(docsrs, doc(cfg(feature = "linked")))]
pub fn linked() -> Self {
// Sound because we're linking to Vulkan, which provides a vkGetInstanceProcAddr that has
// defined behavior in this use.
unsafe {
Self::from_static_fn(vk::StaticFn {
get_instance_proc_addr: vkGetInstanceProcAddr,
})
}
}
/// Load Vulkan library at `path`
///
/// # Safety
/// `dlopen`ing native libraries is inherently unsafe. The safety guidelines
/// for [`Library::new()`] and [`Library::get()`] apply here.
#[cfg(feature = "loaded")]
#[cfg_attr(docsrs, doc(cfg(feature = "loaded")))]
pub unsafe fn load_from(path: impl AsRef<OsStr>) -> Result<Self, LoadingError> {
let lib = Library::new(path)
.map_err(LoadingError::LibraryLoadFailure)
.map(Arc::new)?;
let static_fn = vk::StaticFn::load_checked(|name| {
lib.get(name.to_bytes_with_nul())
.map(|symbol| *symbol)
.unwrap_or(ptr::null_mut())
})?;
Ok(Self {
_lib_guard: Some(lib),
..Self::from_static_fn(static_fn)
})
}
/// Load entry points based on an already-loaded [`vk::StaticFn`]
///
/// # Safety
/// `static_fn` must contain valid function pointers that comply with the semantics specified by
/// Vulkan 1.0, which must remain valid for at least the lifetime of the returned [`Entry`].
pub unsafe fn from_static_fn(static_fn: vk::StaticFn) -> Self {
let load_fn = |name: &std::ffi::CStr| unsafe {
mem::transmute(static_fn.get_instance_proc_addr(vk::Instance::null(), name.as_ptr()))
};
@ -44,13 +149,14 @@ impl<L> EntryCustom<L> {
let entry_fn_1_1 = vk::EntryFnV1_1::load(load_fn);
let entry_fn_1_2 = vk::EntryFnV1_2::load(load_fn);
Ok(EntryCustom {
Self {
static_fn,
entry_fn_1_0,
entry_fn_1_1,
entry_fn_1_2,
lib,
})
#[cfg(feature = "loaded")]
_lib_guard: None,
}
}
pub fn fp_v1_0(&self) -> &vk::EntryFnV1_0 {
@ -65,7 +171,7 @@ impl<L> EntryCustom<L> {
/// ```no_run
/// # use ash::{Entry, vk};
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let entry = unsafe { Entry::new() }?;
/// let entry = Entry::linked();
/// match entry.try_enumerate_instance_version()? {
/// // Vulkan 1.1+
/// Some(version) => {
@ -107,7 +213,7 @@ impl<L> EntryCustom<L> {
&self,
create_info: &vk::InstanceCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> Result<Instance, InstanceError> {
) -> VkResult<Instance> {
let mut instance = mem::zeroed();
self.entry_fn_1_0
.create_instance(
@ -115,8 +221,7 @@ impl<L> EntryCustom<L> {
allocation_callbacks.as_raw_ptr(),
&mut instance,
)
.result()
.map_err(InstanceError::VkError)?;
.result()?;
Ok(Instance::load(&self.static_fn, instance))
}
@ -154,7 +259,7 @@ impl<L> EntryCustom<L> {
/// Vulkan core 1.1
#[allow(non_camel_case_types)]
impl<L> EntryCustom<L> {
impl Entry {
pub fn fp_v1_1(&self) -> &vk::EntryFnV1_1 {
&self.entry_fn_1_1
}
@ -175,29 +280,20 @@ impl<L> EntryCustom<L> {
/// Vulkan core 1.2
#[allow(non_camel_case_types)]
impl<L> EntryCustom<L> {
impl Entry {
pub fn fp_v1_2(&self) -> &vk::EntryFnV1_2 {
&self.entry_fn_1_2
}
}
#[derive(Clone, Debug)]
pub enum InstanceError {
LoadError(Vec<&'static str>),
VkError(vk::Result),
}
impl fmt::Display for InstanceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
InstanceError::LoadError(e) => write!(f, "{}", e.join("; ")),
InstanceError::VkError(e) => write!(f, "{}", e),
}
#[cfg(feature = "linked")]
#[cfg_attr(docsrs, doc(cfg(feature = "linked")))]
impl Default for Entry {
fn default() -> Self {
Self::linked()
}
}
impl Error for InstanceError {}
impl vk::StaticFn {
pub fn load_checked<F>(mut _f: F) -> Result<Self, MissingEntryPoint>
where
@ -206,7 +302,7 @@ impl vk::StaticFn {
// TODO: Make this a &'static CStr once CStr::from_bytes_with_nul_unchecked is const
static ENTRY_POINT: &[u8] = b"vkGetInstanceProcAddr\0";
Ok(vk::StaticFn {
Ok(Self {
get_instance_proc_addr: unsafe {
let cname = CStr::from_bytes_with_nul_unchecked(ENTRY_POINT);
let val = _f(cname);
@ -228,3 +324,50 @@ impl std::fmt::Display for MissingEntryPoint {
}
}
impl std::error::Error for MissingEntryPoint {}
#[cfg(feature = "linked")]
extern "system" {
fn vkGetInstanceProcAddr(instance: vk::Instance, name: *const c_char)
-> vk::PFN_vkVoidFunction;
}
#[cfg(feature = "loaded")]
mod loaded {
use std::error::Error;
use std::fmt;
use super::*;
#[derive(Debug)]
#[cfg_attr(docsrs, doc(cfg(feature = "loaded")))]
pub enum LoadingError {
LibraryLoadFailure(libloading::Error),
MissingEntryPoint(MissingEntryPoint),
}
impl fmt::Display for LoadingError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
LoadingError::LibraryLoadFailure(err) => fmt::Display::fmt(err, f),
LoadingError::MissingEntryPoint(err) => fmt::Display::fmt(err, f),
}
}
}
impl Error for LoadingError {
fn source(&self) -> Option<&(dyn Error + 'static)> {
Some(match self {
LoadingError::LibraryLoadFailure(err) => err,
LoadingError::MissingEntryPoint(err) => err,
})
}
}
impl From<MissingEntryPoint> for LoadingError {
fn from(err: MissingEntryPoint) -> Self {
Self::MissingEntryPoint(err)
}
}
}
#[cfg(feature = "loaded")]
pub use self::loaded::*;

101
third_party/rust/ash/src/entry_libloading.rs поставляемый
Просмотреть файл

@ -1,101 +0,0 @@
use crate::entry::EntryCustom;
use crate::entry::MissingEntryPoint;
use libloading::Library;
use std::error::Error;
use std::ffi::OsStr;
use std::fmt;
use std::ptr;
use std::sync::Arc;
#[cfg(windows)]
const LIB_PATH: &str = "vulkan-1.dll";
#[cfg(all(
unix,
not(any(target_os = "macos", target_os = "ios", target_os = "android"))
))]
const LIB_PATH: &str = "libvulkan.so.1";
#[cfg(target_os = "android")]
const LIB_PATH: &str = "libvulkan.so";
#[cfg(any(target_os = "macos", target_os = "ios"))]
const LIB_PATH: &str = "libvulkan.dylib";
#[derive(Debug)]
pub enum LoadingError {
LibraryLoadFailure(libloading::Error),
MissingEntryPoint(MissingEntryPoint),
}
impl fmt::Display for LoadingError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
LoadingError::LibraryLoadFailure(err) => fmt::Display::fmt(err, f),
LoadingError::MissingEntryPoint(err) => fmt::Display::fmt(err, f),
}
}
}
impl Error for LoadingError {
fn source(&self) -> Option<&(dyn Error + 'static)> {
Some(match self {
LoadingError::LibraryLoadFailure(err) => err,
LoadingError::MissingEntryPoint(err) => err,
})
}
}
impl From<MissingEntryPoint> for LoadingError {
fn from(err: MissingEntryPoint) -> Self {
LoadingError::MissingEntryPoint(err)
}
}
/// Default function loader
pub type Entry = EntryCustom<Arc<Library>>;
impl Entry {
/// Load default Vulkan library for the current platform
///
/// # Safety
/// `dlopen`ing native libraries is inherently unsafe. The safety guidelines
/// for [`Library::new`] and [`Library::get`] apply here.
///
/// ```no_run
/// use ash::{vk, Entry};
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let entry = unsafe { Entry::new() }?;
/// let app_info = vk::ApplicationInfo {
/// api_version: vk::make_api_version(0, 1, 0, 0),
/// ..Default::default()
/// };
/// let create_info = vk::InstanceCreateInfo {
/// p_application_info: &app_info,
/// ..Default::default()
/// };
/// let instance = unsafe { entry.create_instance(&create_info, None)? };
/// # Ok(()) }
/// ```
pub unsafe fn new() -> Result<Entry, LoadingError> {
Self::with_library(LIB_PATH)
}
/// Load Vulkan library at `path`
///
/// # Safety
/// `dlopen`ing native libraries is inherently unsafe. The safety guidelines
/// for [`Library::new`] and [`Library::get`] apply here.
pub unsafe fn with_library(path: impl AsRef<OsStr>) -> Result<Entry, LoadingError> {
let lib = Library::new(path)
.map_err(LoadingError::LibraryLoadFailure)
.map(Arc::new)?;
Ok(Self::new_custom(lib, |vk_lib, name| {
vk_lib
.get(name.to_bytes_with_nul())
.map(|symbol| *symbol)
.unwrap_or(ptr::null_mut())
})?)
}
}

Просмотреть файл

@ -25,7 +25,10 @@
*
**********************************************************************************************************************/
#[cfg(feature = "debug")]
use crate::prelude::debug_flags;
use crate::vk::*;
use std::fmt;
use std::os::raw::*;
@ -34,15 +37,8 @@ use std::os::raw::*;
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct GpaSqShaderStageFlags(pub(crate) Flags);
vk_bitflags_wrapped!(
GpaSqShaderStageFlags,
0b1111111111111111111111111111111,
Flags
);
// ignore clippy::use_self false positives
// changing GpaSqShaderStageFlags::PS.0 to Self::PS.0 as suggested by clippy generates:
// error[E0401]: can't use generic parameters from outer function
#[allow(clippy::use_self)]
vk_bitflags_wrapped!(GpaSqShaderStageFlags, Flags);
#[cfg(feature = "debug")]
impl fmt::Debug for GpaSqShaderStageFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[
@ -75,7 +71,8 @@ impl StructureType {
pub const GPA_DEVICE_CLOCK_MODE_INFO_AMD: Self = Self(1000133004);
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[cfg_attr(feature = "debug", derive(Debug))]
#[repr(transparent)]
pub struct GpaDeviceClockModeAmd(pub(crate) i32);
impl GpaDeviceClockModeAmd {
@ -95,7 +92,8 @@ impl GpaDeviceClockModeAmd {
pub const PEAK: Self = Self(5);
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[cfg_attr(feature = "debug", derive(Debug))]
#[repr(transparent)]
pub struct GpaPerfBlockAmd(pub(crate) i32);
impl GpaPerfBlockAmd {
@ -141,7 +139,8 @@ impl GpaPerfBlockAmd {
pub const RMI: Self = Self(31);
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[cfg_attr(feature = "debug", derive(Debug))]
#[repr(transparent)]
pub struct GpaSampleTypeAmd(pub(crate) i32);
impl GpaSampleTypeAmd {
@ -161,7 +160,8 @@ impl GpaSampleTypeAmd {
handle_nondispatchable!(GpaSessionAmd, UNKNOWN);
#[repr(C)]
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone)]
#[cfg_attr(feature = "debug", derive(Debug))]
pub struct GpaSessionCreateInfoAmd {
pub s_type: StructureType,
pub p_next: *const c_void,
@ -169,7 +169,8 @@ pub struct GpaSessionCreateInfoAmd {
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone)]
#[cfg_attr(feature = "debug", derive(Debug))]
pub struct GpaPerfBlockPropertiesAmd {
pub block_type: GpaPerfBlockAmd,
pub flags: Flags,
@ -181,7 +182,8 @@ pub struct GpaPerfBlockPropertiesAmd {
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone)]
#[cfg_attr(feature = "debug", derive(Debug))]
pub struct PhysicalDeviceGpaFeaturesAmd {
pub s_type: StructureType,
pub p_next: *const c_void,
@ -192,7 +194,8 @@ pub struct PhysicalDeviceGpaFeaturesAmd {
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone)]
#[cfg_attr(feature = "debug", derive(Debug))]
pub struct PhysicalDeviceGpaPropertiesAmd {
pub s_type: StructureType,
pub p_next: *const c_void,
@ -250,7 +253,8 @@ impl<'a> PhysicalDeviceGpaPropertiesAmdBuilder<'a> {
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone)]
#[cfg_attr(feature = "debug", derive(Debug))]
pub struct GpaPerfCounterAmd {
pub block_type: GpaPerfBlockAmd,
pub block_instance: u32,
@ -258,7 +262,8 @@ pub struct GpaPerfCounterAmd {
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone)]
#[cfg_attr(feature = "debug", derive(Debug))]
pub struct GpaSampleBeginInfoAmd {
pub s_type: StructureType,
pub p_next: *const c_void,
@ -279,7 +284,8 @@ pub struct GpaSampleBeginInfoAmd {
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone)]
#[cfg_attr(feature = "debug", derive(Debug))]
pub struct GpaDeviceClockModeInfoAmd {
pub s_type: StructureType,
pub p_next: *const c_void,
@ -638,7 +644,8 @@ impl StructureType {
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone)]
#[cfg_attr(feature = "debug", derive(Debug))]
pub struct PhysicalDeviceWaveLimitPropertiesAmd {
pub s_type: StructureType,
pub p_next: *const c_void,
@ -698,7 +705,8 @@ impl<'a> PhysicalDeviceWaveLimitPropertiesAmdBuilder<'a> {
}
#[repr(C)]
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone)]
#[cfg_attr(feature = "debug", derive(Debug))]
pub struct PipelineShaderStageCreateInfoWaveLimitAmd {
pub s_type: StructureType,
pub p_next: *const c_void,

Просмотреть файл

@ -6,18 +6,16 @@ use std::mem;
#[derive(Clone)]
pub struct BufferDeviceAddress {
handle: vk::Device,
fns: vk::ExtBufferDeviceAddressFn,
fp: vk::ExtBufferDeviceAddressFn,
}
impl BufferDeviceAddress {
pub fn new(instance: &Instance, device: &Device) -> Self {
let fns = vk::ExtBufferDeviceAddressFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
let handle = device.handle();
let fp = vk::ExtBufferDeviceAddressFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self {
handle: device.handle(),
fns,
}
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetBufferDeviceAddressEXT.html>"]
@ -25,7 +23,7 @@ impl BufferDeviceAddress {
&self,
info: &vk::BufferDeviceAddressInfoEXT,
) -> vk::DeviceAddress {
self.fns.get_buffer_device_address_ext(self.handle, info)
self.fp.get_buffer_device_address_ext(self.handle, info)
}
pub fn name() -> &'static CStr {
@ -33,7 +31,7 @@ impl BufferDeviceAddress {
}
pub fn fp(&self) -> &vk::ExtBufferDeviceAddressFn {
&self.fns
&self.fp
}
pub fn device(&self) -> vk::Device {

Просмотреть файл

@ -6,30 +6,27 @@ use std::mem;
#[derive(Clone)]
pub struct DebugMarker {
debug_marker_fn: vk::ExtDebugMarkerFn,
handle: vk::Device,
fp: vk::ExtDebugMarkerFn,
}
impl DebugMarker {
pub fn new(instance: &Instance, device: &Device) -> Self {
let debug_marker_fn = vk::ExtDebugMarkerFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
let handle = device.handle();
let fp = vk::ExtDebugMarkerFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self { debug_marker_fn }
}
pub fn name() -> &'static CStr {
vk::ExtDebugMarkerFn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkDebugMarkerSetObjectNameEXT.html>"]
pub unsafe fn debug_marker_set_object_name(
&self,
device: vk::Device,
name_info: &vk::DebugMarkerObjectNameInfoEXT,
) -> VkResult<()> {
self.debug_marker_fn
.debug_marker_set_object_name_ext(device, name_info)
.into()
self.fp
.debug_marker_set_object_name_ext(self.handle, name_info)
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdDebugMarkerBeginEXT.html>"]
@ -38,14 +35,13 @@ impl DebugMarker {
command_buffer: vk::CommandBuffer,
marker_info: &vk::DebugMarkerMarkerInfoEXT,
) {
self.debug_marker_fn
self.fp
.cmd_debug_marker_begin_ext(command_buffer, marker_info);
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdDebugMarkerEndEXT.html>"]
pub unsafe fn cmd_debug_marker_end(&self, command_buffer: vk::CommandBuffer) {
self.debug_marker_fn
.cmd_debug_marker_end_ext(command_buffer);
self.fp.cmd_debug_marker_end_ext(command_buffer);
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdDebugMarkerInsertEXT.html>"]
@ -54,11 +50,19 @@ impl DebugMarker {
command_buffer: vk::CommandBuffer,
marker_info: &vk::DebugMarkerMarkerInfoEXT,
) {
self.debug_marker_fn
self.fp
.cmd_debug_marker_insert_ext(command_buffer, marker_info);
}
pub fn name() -> &'static CStr {
vk::ExtDebugMarkerFn::name()
}
pub fn fp(&self) -> &vk::ExtDebugMarkerFn {
&self.debug_marker_fn
&self.fp
}
pub fn device(&self) -> vk::Device {
self.handle
}
}

Просмотреть файл

@ -1,29 +1,23 @@
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use crate::{EntryCustom, Instance};
use crate::{Entry, Instance};
use std::ffi::CStr;
use std::mem;
#[derive(Clone)]
pub struct DebugReport {
handle: vk::Instance,
debug_report_fn: vk::ExtDebugReportFn,
fp: vk::ExtDebugReportFn,
}
impl DebugReport {
pub fn new<L>(entry: &EntryCustom<L>, instance: &Instance) -> Self {
let debug_report_fn = vk::ExtDebugReportFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))
pub fn new(entry: &Entry, instance: &Instance) -> Self {
let handle = instance.handle();
let fp = vk::ExtDebugReportFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self {
handle: instance.handle(),
debug_report_fn,
}
}
pub fn name() -> &'static CStr {
vk::ExtDebugReportFn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkDestroyDebugReportCallbackEXT.html>"]
@ -32,7 +26,7 @@ impl DebugReport {
debug: vk::DebugReportCallbackEXT,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) {
self.debug_report_fn.destroy_debug_report_callback_ext(
self.fp.destroy_debug_report_callback_ext(
self.handle,
debug,
allocation_callbacks.as_raw_ptr(),
@ -46,7 +40,7 @@ impl DebugReport {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::DebugReportCallbackEXT> {
let mut debug_cb = mem::zeroed();
self.debug_report_fn
self.fp
.create_debug_report_callback_ext(
self.handle,
create_info,
@ -56,8 +50,12 @@ impl DebugReport {
.result_with_success(debug_cb)
}
pub fn name() -> &'static CStr {
vk::ExtDebugReportFn::name()
}
pub fn fp(&self) -> &vk::ExtDebugReportFn {
&self.debug_report_fn
&self.fp
}
pub fn instance(&self) -> vk::Instance {

Просмотреть файл

@ -1,28 +1,22 @@
use crate::prelude::*;
use crate::{vk, RawPtr};
use crate::{EntryCustom, Instance};
use crate::{Entry, Instance};
use std::ffi::CStr;
use std::mem;
#[derive(Clone)]
pub struct DebugUtils {
handle: vk::Instance,
debug_utils_fn: vk::ExtDebugUtilsFn,
fp: vk::ExtDebugUtilsFn,
}
impl DebugUtils {
pub fn new<L>(entry: &EntryCustom<L>, instance: &Instance) -> Self {
let debug_utils_fn = vk::ExtDebugUtilsFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))
pub fn new(entry: &Entry, instance: &Instance) -> Self {
let handle = instance.handle();
let fp = vk::ExtDebugUtilsFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self {
handle: instance.handle(),
debug_utils_fn,
}
}
pub fn name() -> &'static CStr {
vk::ExtDebugUtilsFn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkSetDebugUtilsObjectNameEXT.html>"]
@ -31,9 +25,9 @@ impl DebugUtils {
device: vk::Device,
name_info: &vk::DebugUtilsObjectNameInfoEXT,
) -> VkResult<()> {
self.debug_utils_fn
self.fp
.set_debug_utils_object_name_ext(device, name_info)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkSetDebugUtilsObjectTagEXT.html>"]
@ -42,9 +36,9 @@ impl DebugUtils {
device: vk::Device,
tag_info: &vk::DebugUtilsObjectTagInfoEXT,
) -> VkResult<()> {
self.debug_utils_fn
self.fp
.set_debug_utils_object_tag_ext(device, tag_info)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdBeginDebugUtilsLabelEXT.html>"]
@ -53,14 +47,13 @@ impl DebugUtils {
command_buffer: vk::CommandBuffer,
label: &vk::DebugUtilsLabelEXT,
) {
self.debug_utils_fn
self.fp
.cmd_begin_debug_utils_label_ext(command_buffer, label);
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdEndDebugUtilsLabelEXT.html>"]
pub unsafe fn cmd_end_debug_utils_label(&self, command_buffer: vk::CommandBuffer) {
self.debug_utils_fn
.cmd_end_debug_utils_label_ext(command_buffer);
self.fp.cmd_end_debug_utils_label_ext(command_buffer);
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdInsertDebugUtilsLabelEXT.html>"]
@ -69,7 +62,7 @@ impl DebugUtils {
command_buffer: vk::CommandBuffer,
label: &vk::DebugUtilsLabelEXT,
) {
self.debug_utils_fn
self.fp
.cmd_insert_debug_utils_label_ext(command_buffer, label);
}
@ -79,13 +72,12 @@ impl DebugUtils {
queue: vk::Queue,
label: &vk::DebugUtilsLabelEXT,
) {
self.debug_utils_fn
.queue_begin_debug_utils_label_ext(queue, label);
self.fp.queue_begin_debug_utils_label_ext(queue, label);
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkQueueEndDebugUtilsLabelEXT.html>"]
pub unsafe fn queue_end_debug_utils_label(&self, queue: vk::Queue) {
self.debug_utils_fn.queue_end_debug_utils_label_ext(queue);
self.fp.queue_end_debug_utils_label_ext(queue);
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkQueueInsertDebugUtilsLabelEXT.html>"]
@ -94,8 +86,7 @@ impl DebugUtils {
queue: vk::Queue,
label: &vk::DebugUtilsLabelEXT,
) {
self.debug_utils_fn
.queue_insert_debug_utils_label_ext(queue, label);
self.fp.queue_insert_debug_utils_label_ext(queue, label);
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateDebugUtilsMessengerEXT.html>"]
@ -105,7 +96,7 @@ impl DebugUtils {
allocator: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::DebugUtilsMessengerEXT> {
let mut messenger = mem::zeroed();
self.debug_utils_fn
self.fp
.create_debug_utils_messenger_ext(
self.handle,
create_info,
@ -121,31 +112,31 @@ impl DebugUtils {
messenger: vk::DebugUtilsMessengerEXT,
allocator: Option<&vk::AllocationCallbacks>,
) {
self.debug_utils_fn.destroy_debug_utils_messenger_ext(
self.handle,
messenger,
allocator.as_raw_ptr(),
);
self.fp
.destroy_debug_utils_messenger_ext(self.handle, messenger, allocator.as_raw_ptr());
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkSubmitDebugUtilsMessageEXT.html>"]
pub unsafe fn submit_debug_utils_message(
&self,
instance: vk::Instance,
message_severity: vk::DebugUtilsMessageSeverityFlagsEXT,
message_types: vk::DebugUtilsMessageTypeFlagsEXT,
callback_data: &vk::DebugUtilsMessengerCallbackDataEXT,
) {
self.debug_utils_fn.submit_debug_utils_message_ext(
instance,
self.fp.submit_debug_utils_message_ext(
self.handle,
message_severity,
message_types,
callback_data,
);
}
pub fn name() -> &'static CStr {
vk::ExtDebugUtilsFn::name()
}
pub fn fp(&self) -> &vk::ExtDebugUtilsFn {
&self.debug_utils_fn
&self.fp
}
pub fn instance(&self) -> vk::Instance {

Просмотреть файл

@ -6,23 +6,15 @@ use std::ptr;
#[derive(Clone)]
pub struct ExtendedDynamicState {
handle: vk::Instance,
extended_dynamic_state_fn: vk::ExtExtendedDynamicStateFn,
fp: vk::ExtExtendedDynamicStateFn,
}
impl ExtendedDynamicState {
pub fn new(instance: &Instance, device: &Device) -> Self {
let extended_dynamic_state_fn = vk::ExtExtendedDynamicStateFn::load(|name| unsafe {
let fp = vk::ExtExtendedDynamicStateFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
});
Self {
handle: instance.handle(),
extended_dynamic_state_fn,
}
}
pub fn name() -> &'static CStr {
vk::ExtExtendedDynamicStateFn::name()
Self { fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetCullModeEXT.html>"]
@ -31,8 +23,7 @@ impl ExtendedDynamicState {
command_buffer: vk::CommandBuffer,
cull_mode: vk::CullModeFlags,
) {
self.extended_dynamic_state_fn
.cmd_set_cull_mode_ext(command_buffer, cull_mode)
self.fp.cmd_set_cull_mode_ext(command_buffer, cull_mode)
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetFrontFaceEXT.html>"]
@ -41,8 +32,7 @@ impl ExtendedDynamicState {
command_buffer: vk::CommandBuffer,
front_face: vk::FrontFace,
) {
self.extended_dynamic_state_fn
.cmd_set_front_face_ext(command_buffer, front_face)
self.fp.cmd_set_front_face_ext(command_buffer, front_face)
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetPrimitiveTopologyEXT.html>"]
@ -51,7 +41,7 @@ impl ExtendedDynamicState {
command_buffer: vk::CommandBuffer,
primitive_topology: vk::PrimitiveTopology,
) {
self.extended_dynamic_state_fn
self.fp
.cmd_set_primitive_topology_ext(command_buffer, primitive_topology)
}
@ -61,12 +51,11 @@ impl ExtendedDynamicState {
command_buffer: vk::CommandBuffer,
viewports: &[vk::Viewport],
) {
self.extended_dynamic_state_fn
.cmd_set_viewport_with_count_ext(
command_buffer,
viewports.len() as u32,
viewports.as_ptr(),
)
self.fp.cmd_set_viewport_with_count_ext(
command_buffer,
viewports.len() as u32,
viewports.as_ptr(),
)
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetScissorWithCountEXT.html>"]
@ -75,12 +64,11 @@ impl ExtendedDynamicState {
command_buffer: vk::CommandBuffer,
scissors: &[vk::Rect2D],
) {
self.extended_dynamic_state_fn
.cmd_set_scissor_with_count_ext(
command_buffer,
scissors.len() as u32,
scissors.as_ptr(),
)
self.fp.cmd_set_scissor_with_count_ext(
command_buffer,
scissors.len() as u32,
scissors.as_ptr(),
)
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdBindVertexBuffers2EXT.html>"]
@ -106,7 +94,7 @@ impl ExtendedDynamicState {
} else {
ptr::null()
};
self.extended_dynamic_state_fn.cmd_bind_vertex_buffers2_ext(
self.fp.cmd_bind_vertex_buffers2_ext(
command_buffer,
first_binding,
buffers.len() as u32,
@ -123,7 +111,7 @@ impl ExtendedDynamicState {
command_buffer: vk::CommandBuffer,
depth_test_enable: bool,
) {
self.extended_dynamic_state_fn
self.fp
.cmd_set_depth_test_enable_ext(command_buffer, depth_test_enable.into())
}
@ -133,7 +121,7 @@ impl ExtendedDynamicState {
command_buffer: vk::CommandBuffer,
depth_write_enable: bool,
) {
self.extended_dynamic_state_fn
self.fp
.cmd_set_depth_write_enable_ext(command_buffer, depth_write_enable.into())
}
@ -143,7 +131,7 @@ impl ExtendedDynamicState {
command_buffer: vk::CommandBuffer,
depth_compare_op: vk::CompareOp,
) {
self.extended_dynamic_state_fn
self.fp
.cmd_set_depth_compare_op_ext(command_buffer, depth_compare_op)
}
@ -153,7 +141,7 @@ impl ExtendedDynamicState {
command_buffer: vk::CommandBuffer,
depth_bounds_test_enable: bool,
) {
self.extended_dynamic_state_fn
self.fp
.cmd_set_depth_bounds_test_enable_ext(command_buffer, depth_bounds_test_enable.into())
}
@ -163,7 +151,7 @@ impl ExtendedDynamicState {
command_buffer: vk::CommandBuffer,
stencil_test_enable: bool,
) {
self.extended_dynamic_state_fn
self.fp
.cmd_set_stencil_test_enable_ext(command_buffer, stencil_test_enable.into())
}
@ -177,7 +165,7 @@ impl ExtendedDynamicState {
depth_fail_op: vk::StencilOp,
compare_op: vk::CompareOp,
) {
self.extended_dynamic_state_fn.cmd_set_stencil_op_ext(
self.fp.cmd_set_stencil_op_ext(
command_buffer,
face_mask,
fail_op,
@ -187,11 +175,11 @@ impl ExtendedDynamicState {
)
}
pub fn fp(&self) -> &vk::ExtExtendedDynamicStateFn {
&self.extended_dynamic_state_fn
pub fn name() -> &'static CStr {
vk::ExtExtendedDynamicStateFn::name()
}
pub fn instance(&self) -> vk::Instance {
self.handle
pub fn fp(&self) -> &vk::ExtExtendedDynamicStateFn {
&self.fp
}
}

Просмотреть файл

@ -7,22 +7,16 @@ use std::mem;
#[derive(Clone)]
pub struct FullScreenExclusive {
handle: vk::Device,
full_screen_exclusive_fn: vk::ExtFullScreenExclusiveFn,
fp: vk::ExtFullScreenExclusiveFn,
}
impl FullScreenExclusive {
pub fn new(instance: &Instance, device: &Device) -> Self {
let full_screen_exclusive_fn = vk::ExtFullScreenExclusiveFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
let handle = device.handle();
let fp = vk::ExtFullScreenExclusiveFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self {
handle: device.handle(),
full_screen_exclusive_fn,
}
}
pub fn name() -> &'static CStr {
vk::ExtFullScreenExclusiveFn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkAcquireFullScreenExclusiveModeEXT.html>"]
@ -30,7 +24,7 @@ impl FullScreenExclusive {
&self,
swapchain: vk::SwapchainKHR,
) -> VkResult<()> {
self.full_screen_exclusive_fn
self.fp
.acquire_full_screen_exclusive_mode_ext(self.handle, swapchain)
.result()
}
@ -42,13 +36,12 @@ impl FullScreenExclusive {
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
) -> VkResult<Vec<vk::PresentModeKHR>> {
read_into_uninitialized_vector(|count, data| {
self.full_screen_exclusive_fn
.get_physical_device_surface_present_modes2_ext(
physical_device,
surface_info,
count,
data,
)
self.fp.get_physical_device_surface_present_modes2_ext(
physical_device,
surface_info,
count,
data,
)
})
}
@ -57,7 +50,7 @@ impl FullScreenExclusive {
&self,
swapchain: vk::SwapchainKHR,
) -> VkResult<()> {
self.full_screen_exclusive_fn
self.fp
.release_full_screen_exclusive_mode_ext(self.handle, swapchain)
.result()
}
@ -68,7 +61,7 @@ impl FullScreenExclusive {
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
) -> VkResult<vk::DeviceGroupPresentModeFlagsKHR> {
let mut present_modes = mem::zeroed();
self.full_screen_exclusive_fn
self.fp
.get_device_group_surface_present_modes2_ext(
self.handle,
surface_info,
@ -77,8 +70,12 @@ impl FullScreenExclusive {
.result_with_success(present_modes)
}
pub fn name() -> &'static CStr {
vk::ExtFullScreenExclusiveFn::name()
}
pub fn fp(&self) -> &vk::ExtFullScreenExclusiveFn {
&self.full_screen_exclusive_fn
&self.fp
}
pub fn device(&self) -> vk::Device {

Просмотреть файл

@ -1,29 +1,23 @@
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use crate::{EntryCustom, Instance};
use crate::{Entry, Instance};
use std::ffi::CStr;
use std::mem;
#[derive(Clone)]
pub struct MetalSurface {
handle: vk::Instance,
metal_surface_fn: vk::ExtMetalSurfaceFn,
fp: vk::ExtMetalSurfaceFn,
}
impl MetalSurface {
pub fn new<L>(entry: &EntryCustom<L>, instance: &Instance) -> Self {
let surface_fn = vk::ExtMetalSurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))
pub fn new(entry: &Entry, instance: &Instance) -> Self {
let handle = instance.handle();
let fp = vk::ExtMetalSurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self {
handle: instance.handle(),
metal_surface_fn: surface_fn,
}
}
pub fn name() -> &'static CStr {
vk::ExtMetalSurfaceFn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateMetalSurfaceEXT.html>"]
@ -33,7 +27,7 @@ impl MetalSurface {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
self.metal_surface_fn
self.fp
.create_metal_surface_ext(
self.handle,
create_info,
@ -43,8 +37,12 @@ impl MetalSurface {
.result_with_success(surface)
}
pub fn name() -> &'static CStr {
vk::ExtMetalSurfaceFn::name()
}
pub fn fp(&self) -> &vk::ExtMetalSurfaceFn {
&self.metal_surface_fn
&self.fp
}
pub fn instance(&self) -> vk::Instance {

Просмотреть файл

@ -1,28 +1,20 @@
use crate::prelude::*;
use crate::vk;
use crate::{EntryCustom, Instance};
use crate::{Entry, Instance};
use std::ffi::CStr;
use std::mem;
#[derive(Clone)]
pub struct ToolingInfo {
handle: vk::Instance,
tooling_info_fn: vk::ExtToolingInfoFn,
fp: vk::ExtToolingInfoFn,
}
impl ToolingInfo {
pub fn new<L>(entry: &EntryCustom<L>, instance: &Instance) -> Self {
let tooling_info_fn = vk::ExtToolingInfoFn::load(|name| unsafe {
pub fn new(entry: &Entry, instance: &Instance) -> Self {
let fp = vk::ExtToolingInfoFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))
});
Self {
handle: instance.handle(),
tooling_info_fn,
}
}
pub fn name() -> &'static CStr {
vk::ExtToolingInfoFn::name()
Self { fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceToolPropertiesEXT.html>"]
@ -31,16 +23,16 @@ impl ToolingInfo {
physical_device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::PhysicalDeviceToolPropertiesEXT>> {
read_into_defaulted_vector(|count, data| {
self.tooling_info_fn
self.fp
.get_physical_device_tool_properties_ext(physical_device, count, data)
})
}
pub fn fp(&self) -> &vk::ExtToolingInfoFn {
&self.tooling_info_fn
pub fn name() -> &'static CStr {
vk::ExtToolingInfoFn::name()
}
pub fn instance(&self) -> vk::Instance {
self.handle
pub fn fp(&self) -> &vk::ExtToolingInfoFn {
&self.fp
}
}

Просмотреть файл

@ -8,18 +8,16 @@ use std::mem;
#[derive(Clone)]
pub struct AccelerationStructure {
handle: vk::Device,
acceleration_structure_fn: vk::KhrAccelerationStructureFn,
fp: vk::KhrAccelerationStructureFn,
}
impl AccelerationStructure {
pub fn new(instance: &Instance, device: &Device) -> Self {
let acceleration_structure_fn = vk::KhrAccelerationStructureFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
let handle = device.handle();
let fp = vk::KhrAccelerationStructureFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self {
handle: device.handle(),
acceleration_structure_fn,
}
Self { handle, fp }
}
pub unsafe fn get_properties(
@ -41,7 +39,7 @@ impl AccelerationStructure {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::AccelerationStructureKHR> {
let mut accel_struct = mem::zeroed();
self.acceleration_structure_fn
self.fp
.create_acceleration_structure_khr(
self.handle,
create_info,
@ -57,12 +55,11 @@ impl AccelerationStructure {
accel_struct: vk::AccelerationStructureKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) {
self.acceleration_structure_fn
.destroy_acceleration_structure_khr(
self.handle,
accel_struct,
allocation_callbacks.as_raw_ptr(),
);
self.fp.destroy_acceleration_structure_khr(
self.handle,
accel_struct,
allocation_callbacks.as_raw_ptr(),
);
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdBuildAccelerationStructuresKHR.html>"]
@ -83,13 +80,12 @@ impl AccelerationStructure {
})
.collect::<Vec<_>>();
self.acceleration_structure_fn
.cmd_build_acceleration_structures_khr(
command_buffer,
infos.len() as _,
infos.as_ptr(),
build_range_infos.as_ptr(),
);
self.fp.cmd_build_acceleration_structures_khr(
command_buffer,
infos.len() as _,
infos.as_ptr(),
build_range_infos.as_ptr(),
);
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdBuildAccelerationStructuresIndirectKHR.html>"]
@ -114,15 +110,14 @@ impl AccelerationStructure {
})
.collect::<Vec<_>>();
self.acceleration_structure_fn
.cmd_build_acceleration_structures_indirect_khr(
command_buffer,
infos.len() as _,
infos.as_ptr(),
indirect_device_addresses.as_ptr(),
indirect_strides.as_ptr(),
max_primitive_counts.as_ptr(),
);
self.fp.cmd_build_acceleration_structures_indirect_khr(
command_buffer,
infos.len() as _,
infos.as_ptr(),
indirect_device_addresses.as_ptr(),
indirect_strides.as_ptr(),
max_primitive_counts.as_ptr(),
);
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkBuildAccelerationStructuresKHR.html>"]
@ -143,7 +138,7 @@ impl AccelerationStructure {
})
.collect::<Vec<_>>();
self.acceleration_structure_fn
self.fp
.build_acceleration_structures_khr(
self.handle,
deferred_operation,
@ -151,7 +146,7 @@ impl AccelerationStructure {
infos.as_ptr(),
build_range_infos.as_ptr(),
)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCopyAccelerationStructureKHR.html>"]
@ -160,9 +155,9 @@ impl AccelerationStructure {
deferred_operation: vk::DeferredOperationKHR,
info: &vk::CopyAccelerationStructureInfoKHR,
) -> VkResult<()> {
self.acceleration_structure_fn
self.fp
.copy_acceleration_structure_khr(self.handle, deferred_operation, info as *const _)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCopyAccelerationStructureToMemoryKHR.html>"]
@ -171,13 +166,13 @@ impl AccelerationStructure {
deferred_operation: vk::DeferredOperationKHR,
info: &vk::CopyAccelerationStructureToMemoryInfoKHR,
) -> VkResult<()> {
self.acceleration_structure_fn
self.fp
.copy_acceleration_structure_to_memory_khr(
self.handle,
deferred_operation,
info as *const _,
)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCopyMemoryToAccelerationStructureKHR.html>"]
@ -186,13 +181,13 @@ impl AccelerationStructure {
deferred_operation: vk::DeferredOperationKHR,
info: &vk::CopyMemoryToAccelerationStructureInfoKHR,
) -> VkResult<()> {
self.acceleration_structure_fn
self.fp
.copy_memory_to_acceleration_structure_khr(
self.handle,
deferred_operation,
info as *const _,
)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkWriteAccelerationStructuresPropertiesKHR.html>"]
@ -203,7 +198,7 @@ impl AccelerationStructure {
data: &mut [u8],
stride: usize,
) -> VkResult<()> {
self.acceleration_structure_fn
self.fp
.write_acceleration_structures_properties_khr(
self.handle,
acceleration_structures.len() as _,
@ -213,7 +208,7 @@ impl AccelerationStructure {
data.as_mut_ptr() as *mut std::ffi::c_void,
stride,
)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdCopyAccelerationStructureKHR.html>"]
@ -222,7 +217,7 @@ impl AccelerationStructure {
command_buffer: vk::CommandBuffer,
info: &vk::CopyAccelerationStructureInfoKHR,
) {
self.acceleration_structure_fn
self.fp
.cmd_copy_acceleration_structure_khr(command_buffer, info);
}
@ -232,7 +227,7 @@ impl AccelerationStructure {
command_buffer: vk::CommandBuffer,
info: &vk::CopyAccelerationStructureToMemoryInfoKHR,
) {
self.acceleration_structure_fn
self.fp
.cmd_copy_acceleration_structure_to_memory_khr(command_buffer, info as *const _);
}
@ -242,7 +237,7 @@ impl AccelerationStructure {
command_buffer: vk::CommandBuffer,
info: &vk::CopyMemoryToAccelerationStructureInfoKHR,
) {
self.acceleration_structure_fn
self.fp
.cmd_copy_memory_to_acceleration_structure_khr(command_buffer, info as *const _);
}
@ -251,7 +246,7 @@ impl AccelerationStructure {
&self,
info: &vk::AccelerationStructureDeviceAddressInfoKHR,
) -> vk::DeviceAddress {
self.acceleration_structure_fn
self.fp
.get_acceleration_structure_device_address_khr(self.handle, info as *const _)
}
@ -264,15 +259,14 @@ impl AccelerationStructure {
query_pool: vk::QueryPool,
first_query: u32,
) {
self.acceleration_structure_fn
.cmd_write_acceleration_structures_properties_khr(
command_buffer,
structures.len() as _,
structures.as_ptr(),
query_type,
query_pool,
first_query,
);
self.fp.cmd_write_acceleration_structures_properties_khr(
command_buffer,
structures.len() as _,
structures.as_ptr(),
query_type,
query_pool,
first_query,
);
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDeviceAccelerationStructureCompatibilityKHR.html>"]
@ -282,12 +276,11 @@ impl AccelerationStructure {
) -> vk::AccelerationStructureCompatibilityKHR {
let mut compatibility = vk::AccelerationStructureCompatibilityKHR::default();
self.acceleration_structure_fn
.get_device_acceleration_structure_compatibility_khr(
self.handle,
version,
&mut compatibility as *mut _,
);
self.fp.get_device_acceleration_structure_compatibility_khr(
self.handle,
version,
&mut compatibility as *mut _,
);
compatibility
}
@ -303,14 +296,13 @@ impl AccelerationStructure {
let mut size_info = vk::AccelerationStructureBuildSizesInfoKHR::default();
self.acceleration_structure_fn
.get_acceleration_structure_build_sizes_khr(
self.handle,
build_type,
build_info as *const _,
max_primitive_counts.as_ptr(),
&mut size_info as *mut _,
);
self.fp.get_acceleration_structure_build_sizes_khr(
self.handle,
build_type,
build_info as *const _,
max_primitive_counts.as_ptr(),
&mut size_info as *mut _,
);
size_info
}
@ -320,7 +312,7 @@ impl AccelerationStructure {
}
pub fn fp(&self) -> &vk::KhrAccelerationStructureFn {
&self.acceleration_structure_fn
&self.fp
}
pub fn device(&self) -> vk::Device {

Просмотреть файл

@ -1,29 +1,23 @@
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use crate::{EntryCustom, Instance};
use crate::{Entry, Instance};
use std::ffi::CStr;
use std::mem;
#[derive(Clone)]
pub struct AndroidSurface {
handle: vk::Instance,
android_surface_fn: vk::KhrAndroidSurfaceFn,
fp: vk::KhrAndroidSurfaceFn,
}
impl AndroidSurface {
pub fn new<L>(entry: &EntryCustom<L>, instance: &Instance) -> Self {
let surface_fn = vk::KhrAndroidSurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))
pub fn new(entry: &Entry, instance: &Instance) -> Self {
let handle = instance.handle();
let fp = vk::KhrAndroidSurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self {
handle: instance.handle(),
android_surface_fn: surface_fn,
}
}
pub fn name() -> &'static CStr {
vk::KhrAndroidSurfaceFn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateAndroidSurfaceKHR.html>"]
@ -33,7 +27,7 @@ impl AndroidSurface {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
self.android_surface_fn
self.fp
.create_android_surface_khr(
self.handle,
create_info,
@ -43,8 +37,12 @@ impl AndroidSurface {
.result_with_success(surface)
}
pub fn name() -> &'static CStr {
vk::KhrAndroidSurfaceFn::name()
}
pub fn fp(&self) -> &vk::KhrAndroidSurfaceFn {
&self.android_surface_fn
&self.fp
}
pub fn instance(&self) -> vk::Instance {

Просмотреть файл

@ -6,18 +6,16 @@ use std::mem;
#[derive(Clone)]
pub struct BufferDeviceAddress {
handle: vk::Device,
fns: vk::KhrBufferDeviceAddressFn,
fp: vk::KhrBufferDeviceAddressFn,
}
impl BufferDeviceAddress {
pub fn new(instance: &Instance, device: &Device) -> Self {
let fns = vk::KhrBufferDeviceAddressFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
let handle = device.handle();
let fp = vk::KhrBufferDeviceAddressFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self {
handle: device.handle(),
fns,
}
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetBufferDeviceAddressKHR.html>"]
@ -25,7 +23,7 @@ impl BufferDeviceAddress {
&self,
info: &vk::BufferDeviceAddressInfoKHR,
) -> vk::DeviceAddress {
self.fns.get_buffer_device_address_khr(self.handle, info)
self.fp.get_buffer_device_address_khr(self.handle, info)
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetBufferOpaqueCaptureAddressKHR.html>"]
@ -33,7 +31,7 @@ impl BufferDeviceAddress {
&self,
info: &vk::BufferDeviceAddressInfoKHR,
) -> u64 {
self.fns
self.fp
.get_buffer_opaque_capture_address_khr(self.handle, info)
}
@ -42,7 +40,7 @@ impl BufferDeviceAddress {
&self,
info: &vk::DeviceMemoryOpaqueCaptureAddressInfoKHR,
) -> u64 {
self.fns
self.fp
.get_device_memory_opaque_capture_address_khr(self.handle, info)
}
@ -51,7 +49,7 @@ impl BufferDeviceAddress {
}
pub fn fp(&self) -> &vk::KhrBufferDeviceAddressFn {
&self.fns
&self.fp
}
pub fn device(&self) -> vk::Device {

Просмотреть файл

@ -8,22 +8,16 @@ use std::mem;
#[derive(Clone)]
pub struct CreateRenderPass2 {
handle: vk::Device,
khr_create_renderpass2_fn: vk::KhrCreateRenderpass2Fn,
fp: vk::KhrCreateRenderpass2Fn,
}
impl CreateRenderPass2 {
pub fn new(instance: &Instance, device: &Device) -> Self {
let khr_create_renderpass2_fn = vk::KhrCreateRenderpass2Fn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
let handle = device.handle();
let fp = vk::KhrCreateRenderpass2Fn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self {
handle: device.handle(),
khr_create_renderpass2_fn,
}
}
pub fn name() -> &'static CStr {
vk::KhrCreateRenderpass2Fn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateRenderPass2.html>"]
@ -33,7 +27,7 @@ impl CreateRenderPass2 {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::RenderPass> {
let mut renderpass = mem::zeroed();
self.khr_create_renderpass2_fn
self.fp
.create_render_pass2_khr(
self.handle,
create_info,
@ -50,7 +44,7 @@ impl CreateRenderPass2 {
render_pass_begin_info: &vk::RenderPassBeginInfo,
subpass_begin_info: &vk::SubpassBeginInfo,
) {
self.khr_create_renderpass2_fn.cmd_begin_render_pass2_khr(
self.fp.cmd_begin_render_pass2_khr(
command_buffer,
render_pass_begin_info,
subpass_begin_info,
@ -64,11 +58,8 @@ impl CreateRenderPass2 {
subpass_begin_info: &vk::SubpassBeginInfo,
subpass_end_info: &vk::SubpassEndInfo,
) {
self.khr_create_renderpass2_fn.cmd_next_subpass2_khr(
command_buffer,
subpass_begin_info,
subpass_end_info,
);
self.fp
.cmd_next_subpass2_khr(command_buffer, subpass_begin_info, subpass_end_info);
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdEndRenderPass2.html>"]
@ -77,12 +68,16 @@ impl CreateRenderPass2 {
command_buffer: vk::CommandBuffer,
subpass_end_info: &vk::SubpassEndInfo,
) {
self.khr_create_renderpass2_fn
self.fp
.cmd_end_render_pass2_khr(command_buffer, subpass_end_info);
}
pub fn name() -> &'static CStr {
vk::KhrCreateRenderpass2Fn::name()
}
pub fn fp(&self) -> &vk::KhrCreateRenderpass2Fn {
&self.khr_create_renderpass2_fn
&self.fp
}
pub fn device(&self) -> vk::Device {

Просмотреть файл

@ -8,18 +8,16 @@ use std::mem;
#[derive(Clone)]
pub struct DeferredHostOperations {
handle: vk::Device,
deferred_host_operations_fn: vk::KhrDeferredHostOperationsFn,
fp: vk::KhrDeferredHostOperationsFn,
}
impl DeferredHostOperations {
pub fn new(instance: &Instance, device: &Device) -> Self {
let deferred_host_operations_fn = vk::KhrDeferredHostOperationsFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
let handle = device.handle();
let fp = vk::KhrDeferredHostOperationsFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self {
handle: device.handle(),
deferred_host_operations_fn,
}
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateDeferredOperationKHR.html>"]
@ -28,7 +26,7 @@ impl DeferredHostOperations {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::DeferredOperationKHR> {
let mut operation = mem::zeroed();
self.deferred_host_operations_fn
self.fp
.create_deferred_operation_khr(
self.handle,
allocation_callbacks.as_raw_ptr(),
@ -42,7 +40,7 @@ impl DeferredHostOperations {
&self,
operation: vk::DeferredOperationKHR,
) -> VkResult<()> {
self.deferred_host_operations_fn
self.fp
.deferred_operation_join_khr(self.handle, operation)
.result()
}
@ -53,12 +51,11 @@ impl DeferredHostOperations {
operation: vk::DeferredOperationKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) {
self.deferred_host_operations_fn
.destroy_deferred_operation_khr(
self.handle,
operation,
allocation_callbacks.as_raw_ptr(),
);
self.fp.destroy_deferred_operation_khr(
self.handle,
operation,
allocation_callbacks.as_raw_ptr(),
);
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDeferredOperationMaxConcurrencyKHR.html>"]
@ -66,7 +63,7 @@ impl DeferredHostOperations {
&self,
operation: vk::DeferredOperationKHR,
) -> u32 {
self.deferred_host_operations_fn
self.fp
.get_deferred_operation_max_concurrency_khr(self.handle, operation)
}
@ -75,7 +72,7 @@ impl DeferredHostOperations {
&self,
operation: vk::DeferredOperationKHR,
) -> VkResult<()> {
self.deferred_host_operations_fn
self.fp
.get_deferred_operation_result_khr(self.handle, operation)
.result()
}
@ -85,7 +82,7 @@ impl DeferredHostOperations {
}
pub fn fp(&self) -> &vk::KhrDeferredHostOperationsFn {
&self.deferred_host_operations_fn
&self.fp
}
pub fn device(&self) -> vk::Device {

Просмотреть файл

@ -1,29 +1,23 @@
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use crate::{EntryCustom, Instance};
use crate::{Entry, Instance};
use std::ffi::CStr;
use std::mem;
#[derive(Clone)]
pub struct Display {
handle: vk::Instance,
display_fn: vk::KhrDisplayFn,
fp: vk::KhrDisplayFn,
}
impl Display {
pub fn new<L>(entry: &EntryCustom<L>, instance: &Instance) -> Self {
let display_fn = vk::KhrDisplayFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))
pub fn new(entry: &Entry, instance: &Instance) -> Self {
let handle = instance.handle();
let fp = vk::KhrDisplayFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self {
handle: instance.handle(),
display_fn,
}
}
pub fn name() -> &'static CStr {
vk::KhrDisplayFn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceDisplayPropertiesKHR.html>"]
@ -32,7 +26,7 @@ impl Display {
physical_device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::DisplayPropertiesKHR>> {
read_into_uninitialized_vector(|count, data| {
self.display_fn
self.fp
.get_physical_device_display_properties_khr(physical_device, count, data)
})
}
@ -43,7 +37,7 @@ impl Display {
physical_device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::DisplayPlanePropertiesKHR>> {
read_into_uninitialized_vector(|count, data| {
self.display_fn
self.fp
.get_physical_device_display_plane_properties_khr(physical_device, count, data)
})
}
@ -55,7 +49,7 @@ impl Display {
plane_index: u32,
) -> VkResult<Vec<vk::DisplayKHR>> {
read_into_uninitialized_vector(|count, data| {
self.display_fn.get_display_plane_supported_displays_khr(
self.fp.get_display_plane_supported_displays_khr(
physical_device,
plane_index,
count,
@ -71,7 +65,7 @@ impl Display {
display: vk::DisplayKHR,
) -> VkResult<Vec<vk::DisplayModePropertiesKHR>> {
read_into_uninitialized_vector(|count, data| {
self.display_fn
self.fp
.get_display_mode_properties_khr(physical_device, display, count, data)
})
}
@ -85,7 +79,7 @@ impl Display {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::DisplayModeKHR> {
let mut display_mode = mem::MaybeUninit::zeroed();
self.display_fn
self.fp
.create_display_mode_khr(
physical_device,
display,
@ -104,7 +98,7 @@ impl Display {
plane_index: u32,
) -> VkResult<vk::DisplayPlaneCapabilitiesKHR> {
let mut display_plane_capabilities = mem::MaybeUninit::zeroed();
self.display_fn
self.fp
.get_display_plane_capabilities_khr(
physical_device,
mode,
@ -121,7 +115,7 @@ impl Display {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::MaybeUninit::zeroed();
self.display_fn
self.fp
.create_display_plane_surface_khr(
self.handle,
create_info,
@ -131,8 +125,12 @@ impl Display {
.result_with_success(surface.assume_init())
}
pub fn name() -> &'static CStr {
vk::KhrDisplayFn::name()
}
pub fn fp(&self) -> &vk::KhrDisplayFn {
&self.display_fn
&self.fp
}
pub fn instance(&self) -> vk::Instance {

Просмотреть файл

@ -8,22 +8,16 @@ use std::mem;
#[derive(Clone)]
pub struct DisplaySwapchain {
handle: vk::Device,
swapchain_fn: vk::KhrDisplaySwapchainFn,
fp: vk::KhrDisplaySwapchainFn,
}
impl DisplaySwapchain {
pub fn new(instance: &Instance, device: &Device) -> Self {
let swapchain_fn = vk::KhrDisplaySwapchainFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
let handle = device.handle();
let fp = vk::KhrDisplaySwapchainFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self {
handle: device.handle(),
swapchain_fn,
}
}
pub fn name() -> &'static CStr {
vk::KhrDisplaySwapchainFn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateSharedSwapchainsKHR.html>"]
@ -33,7 +27,7 @@ impl DisplaySwapchain {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<Vec<vk::SwapchainKHR>> {
let mut swapchains = Vec::with_capacity(create_infos.len());
let err_code = self.swapchain_fn.create_shared_swapchains_khr(
let err_code = self.fp.create_shared_swapchains_khr(
self.handle,
create_infos.len() as u32,
create_infos.as_ptr(),
@ -44,8 +38,12 @@ impl DisplaySwapchain {
err_code.result_with_success(swapchains)
}
pub fn name() -> &'static CStr {
vk::KhrDisplaySwapchainFn::name()
}
pub fn fp(&self) -> &vk::KhrDisplaySwapchainFn {
&self.swapchain_fn
&self.fp
}
pub fn device(&self) -> vk::Device {

Просмотреть файл

@ -5,23 +5,15 @@ use std::mem;
#[derive(Clone)]
pub struct DrawIndirectCount {
handle: vk::Device,
draw_indirect_count_fn: vk::KhrDrawIndirectCountFn,
fp: vk::KhrDrawIndirectCountFn,
}
impl DrawIndirectCount {
pub fn new(instance: &Instance, device: &Device) -> Self {
let draw_indirect_count_fn = vk::KhrDrawIndirectCountFn::load(|name| unsafe {
let fp = vk::KhrDrawIndirectCountFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
});
Self {
handle: device.handle(),
draw_indirect_count_fn,
}
}
pub fn name() -> &'static CStr {
vk::KhrDrawIndirectCountFn::name()
Self { fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdDrawIndexedIndirectCountKHR.html>"]
@ -35,16 +27,15 @@ impl DrawIndirectCount {
max_draw_count: u32,
stride: u32,
) {
self.draw_indirect_count_fn
.cmd_draw_indexed_indirect_count_khr(
command_buffer,
buffer,
offset,
count_buffer,
count_buffer_offset,
max_draw_count,
stride,
);
self.fp.cmd_draw_indexed_indirect_count_khr(
command_buffer,
buffer,
offset,
count_buffer,
count_buffer_offset,
max_draw_count,
stride,
);
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdDrawIndirectCountKHR.html>"]
@ -58,15 +49,22 @@ impl DrawIndirectCount {
max_draw_count: u32,
stride: u32,
) {
self.draw_indirect_count_fn
.cmd_draw_indexed_indirect_count_khr(
command_buffer,
buffer,
offset,
count_buffer,
count_buffer_offset,
max_draw_count,
stride,
);
self.fp.cmd_draw_indexed_indirect_count_khr(
command_buffer,
buffer,
offset,
count_buffer,
count_buffer_offset,
max_draw_count,
stride,
);
}
pub fn name() -> &'static CStr {
vk::KhrDrawIndirectCountFn::name()
}
pub fn fp(&self) -> &vk::KhrDrawIndirectCountFn {
&self.fp
}
}

41
third_party/rust/ash/src/extensions/khr/dynamic_rendering.rs поставляемый Normal file
Просмотреть файл

@ -0,0 +1,41 @@
use crate::vk;
use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;
#[derive(Clone)]
pub struct DynamicRendering {
fp: vk::KhrDynamicRenderingFn,
}
impl DynamicRendering {
pub fn new(instance: &Instance, device: &Device) -> Self {
let fp = vk::KhrDynamicRenderingFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
});
Self { fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdBeginRenderingKHR.html>"]
pub unsafe fn cmd_begin_rendering(
&self,
command_buffer: vk::CommandBuffer,
rendering_info: &vk::RenderingInfoKHR,
) {
self.fp
.cmd_begin_rendering_khr(command_buffer, rendering_info)
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdEndRenderingKHR.html>"]
pub unsafe fn cmd_end_rendering(&self, command_buffer: vk::CommandBuffer) {
self.fp.cmd_end_rendering_khr(command_buffer)
}
pub fn name() -> &'static CStr {
vk::KhrDynamicRenderingFn::name()
}
pub fn fp(&self) -> &vk::KhrDynamicRenderingFn {
&self.fp
}
}

Просмотреть файл

@ -7,27 +7,21 @@ use std::mem;
#[derive(Clone)]
pub struct ExternalFenceFd {
handle: vk::Device,
external_fence_fd_fn: vk::KhrExternalFenceFdFn,
fp: vk::KhrExternalFenceFdFn,
}
impl ExternalFenceFd {
pub fn new(instance: &Instance, device: &Device) -> Self {
let external_fence_fd_fn = vk::KhrExternalFenceFdFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
let handle = device.handle();
let fp = vk::KhrExternalFenceFdFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self {
handle: device.handle(),
external_fence_fd_fn,
}
}
pub fn name() -> &'static CStr {
vk::KhrExternalFenceFdFn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkImportFenceFdKHR.html>"]
pub unsafe fn import_fence_fd(&self, import_info: &vk::ImportFenceFdInfoKHR) -> VkResult<()> {
self.external_fence_fd_fn
self.fp
.import_fence_fd_khr(self.handle, import_info)
.result()
}
@ -35,14 +29,17 @@ impl ExternalFenceFd {
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetFenceFdKHR.html>"]
pub unsafe fn get_fence_fd(&self, get_info: &vk::FenceGetFdInfoKHR) -> VkResult<i32> {
let mut fd = -1;
self.external_fence_fd_fn
self.fp
.get_fence_fd_khr(self.handle, get_info, &mut fd)
.result_with_success(fd)
}
pub fn name() -> &'static CStr {
vk::KhrExternalFenceFdFn::name()
}
pub fn fp(&self) -> &vk::KhrExternalFenceFdFn {
&self.external_fence_fd_fn
&self.fp
}
pub fn device(&self) -> vk::Device {

Просмотреть файл

@ -7,29 +7,22 @@ use std::mem;
#[derive(Clone)]
pub struct ExternalMemoryFd {
handle: vk::Device,
external_memory_fd_fn: vk::KhrExternalMemoryFdFn,
fp: vk::KhrExternalMemoryFdFn,
}
impl ExternalMemoryFd {
pub fn new(instance: &Instance, device: &Device) -> Self {
let external_memory_fd_fn = vk::KhrExternalMemoryFdFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
let handle = device.handle();
let fp = vk::KhrExternalMemoryFdFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self {
handle: device.handle(),
external_memory_fd_fn,
}
}
pub fn name() -> &'static CStr {
vk::KhrExternalMemoryFdFn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetMemoryFdKHR.html>"]
pub unsafe fn get_memory_fd(&self, create_info: &vk::MemoryGetFdInfoKHR) -> VkResult<i32> {
let mut fd = -1;
self.external_memory_fd_fn
self.fp
.get_memory_fd_khr(self.handle, create_info, &mut fd)
.result_with_success(fd)
}
@ -41,13 +34,17 @@ impl ExternalMemoryFd {
fd: i32,
) -> VkResult<vk::MemoryFdPropertiesKHR> {
let mut memory_fd_properties = Default::default();
self.external_memory_fd_fn
self.fp
.get_memory_fd_properties_khr(self.handle, handle_type, fd, &mut memory_fd_properties)
.result_with_success(memory_fd_properties)
}
pub fn name() -> &'static CStr {
vk::KhrExternalMemoryFdFn::name()
}
pub fn fp(&self) -> &vk::KhrExternalMemoryFdFn {
&self.external_memory_fd_fn
&self.fp
}
pub fn device(&self) -> vk::Device {

Просмотреть файл

@ -7,22 +7,16 @@ use std::mem;
#[derive(Clone)]
pub struct ExternalSemaphoreFd {
handle: vk::Device,
external_semaphore_fd_fn: vk::KhrExternalSemaphoreFdFn,
fp: vk::KhrExternalSemaphoreFdFn,
}
impl ExternalSemaphoreFd {
pub fn new(instance: &Instance, device: &Device) -> Self {
let external_semaphore_fd_fn = vk::KhrExternalSemaphoreFdFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
let handle = device.handle();
let fp = vk::KhrExternalSemaphoreFdFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self {
handle: device.handle(),
external_semaphore_fd_fn,
}
}
pub fn name() -> &'static CStr {
vk::KhrExternalSemaphoreFdFn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkImportSemaphoreFdKHR.html>"]
@ -30,7 +24,7 @@ impl ExternalSemaphoreFd {
&self,
import_info: &vk::ImportSemaphoreFdInfoKHR,
) -> VkResult<()> {
self.external_semaphore_fd_fn
self.fp
.import_semaphore_fd_khr(self.handle, import_info)
.result()
}
@ -38,14 +32,17 @@ impl ExternalSemaphoreFd {
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetSemaphoreFdKHR.html>"]
pub unsafe fn get_semaphore_fd(&self, get_info: &vk::SemaphoreGetFdInfoKHR) -> VkResult<i32> {
let mut fd = -1;
self.external_semaphore_fd_fn
self.fp
.get_semaphore_fd_khr(self.handle, get_info, &mut fd)
.result_with_success(fd)
}
pub fn name() -> &'static CStr {
vk::KhrExternalSemaphoreFdFn::name()
}
pub fn fp(&self) -> &vk::KhrExternalSemaphoreFdFn {
&self.external_semaphore_fd_fn
&self.fp
}
pub fn device(&self) -> vk::Device {

Просмотреть файл

@ -7,22 +7,16 @@ use std::ptr;
#[derive(Clone)]
pub struct GetMemoryRequirements2 {
handle: vk::Device,
get_memory_requirements2_fn: vk::KhrGetMemoryRequirements2Fn,
fp: vk::KhrGetMemoryRequirements2Fn,
}
impl GetMemoryRequirements2 {
pub fn new(instance: &Instance, device: &Device) -> Self {
let get_memory_requirements2_fn = vk::KhrGetMemoryRequirements2Fn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
let handle = device.handle();
let fp = vk::KhrGetMemoryRequirements2Fn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self {
handle: device.handle(),
get_memory_requirements2_fn,
}
}
pub fn name() -> &'static CStr {
vk::KhrGetMemoryRequirements2Fn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetBufferMemoryRequirements2KHR.html>"]
@ -31,7 +25,7 @@ impl GetMemoryRequirements2 {
info: &vk::BufferMemoryRequirementsInfo2KHR,
memory_requirements: &mut vk::MemoryRequirements2KHR,
) {
self.get_memory_requirements2_fn
self.fp
.get_buffer_memory_requirements2_khr(self.handle, info, memory_requirements);
}
@ -41,43 +35,49 @@ impl GetMemoryRequirements2 {
info: &vk::ImageMemoryRequirementsInfo2KHR,
memory_requirements: &mut vk::MemoryRequirements2KHR,
) {
self.get_memory_requirements2_fn
self.fp
.get_image_memory_requirements2_khr(self.handle, info, memory_requirements);
}
/// Retrieve the number of elements to pass to [`Self::get_image_sparse_memory_requirements2()`]
pub unsafe fn get_image_sparse_memory_requirements2_len(
&self,
info: &vk::ImageSparseMemoryRequirementsInfo2KHR,
) -> usize {
let mut count = 0;
self.get_memory_requirements2_fn
.get_image_sparse_memory_requirements2_khr(
self.handle,
info,
&mut count,
ptr::null_mut(),
);
self.fp.get_image_sparse_memory_requirements2_khr(
self.handle,
info,
&mut count,
ptr::null_mut(),
);
count as usize
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetImageSparseMemoryRequirements2KHR.html>"]
///
/// Call [`Self::get_image_sparse_memory_requirements2_len()`] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
pub unsafe fn get_image_sparse_memory_requirements2(
&self,
info: &vk::ImageSparseMemoryRequirementsInfo2KHR,
sparse_memory_requirements: &mut [vk::SparseImageMemoryRequirements2KHR],
out: &mut [vk::SparseImageMemoryRequirements2KHR],
) {
let mut count = sparse_memory_requirements.len() as u32;
self.get_memory_requirements2_fn
.get_image_sparse_memory_requirements2_khr(
self.handle,
info,
&mut count,
sparse_memory_requirements.as_mut_ptr(),
);
let mut count = out.len() as u32;
self.fp.get_image_sparse_memory_requirements2_khr(
self.handle,
info,
&mut count,
out.as_mut_ptr(),
);
}
pub fn name() -> &'static CStr {
vk::KhrGetMemoryRequirements2Fn::name()
}
pub fn fp(&self) -> &vk::KhrGetMemoryRequirements2Fn {
&self.get_memory_requirements2_fn
&self.fp
}
pub fn device(&self) -> vk::Device {

Просмотреть файл

@ -1,30 +1,21 @@
use crate::prelude::*;
use crate::vk;
use crate::{EntryCustom, Instance};
use crate::{Entry, Instance};
use std::ffi::CStr;
use std::mem;
use std::ptr;
#[derive(Clone)]
pub struct GetPhysicalDeviceProperties2 {
handle: vk::Instance,
get_physical_device_properties2_fn: vk::KhrGetPhysicalDeviceProperties2Fn,
fp: vk::KhrGetPhysicalDeviceProperties2Fn,
}
impl GetPhysicalDeviceProperties2 {
pub fn new<L>(entry: &EntryCustom<L>, instance: &Instance) -> Self {
let get_physical_device_properties2_fn =
vk::KhrGetPhysicalDeviceProperties2Fn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))
});
Self {
handle: instance.handle(),
get_physical_device_properties2_fn,
}
}
pub fn name() -> &'static CStr {
vk::KhrGetPhysicalDeviceProperties2Fn::name()
pub fn new(entry: &Entry, instance: &Instance) -> Self {
let fp = vk::KhrGetPhysicalDeviceProperties2Fn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))
});
Self { fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceFeatures2KHR.html>"]
@ -33,7 +24,7 @@ impl GetPhysicalDeviceProperties2 {
physical_device: vk::PhysicalDevice,
features: &mut vk::PhysicalDeviceFeatures2KHR,
) {
self.get_physical_device_properties2_fn
self.fp
.get_physical_device_features2_khr(physical_device, features);
}
@ -44,8 +35,11 @@ impl GetPhysicalDeviceProperties2 {
format: vk::Format,
format_properties: &mut vk::FormatProperties2KHR,
) {
self.get_physical_device_properties2_fn
.get_physical_device_format_properties2_khr(physical_device, format, format_properties);
self.fp.get_physical_device_format_properties2_khr(
physical_device,
format,
format_properties,
);
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceImageFormatProperties2KHR.html>"]
@ -55,7 +49,7 @@ impl GetPhysicalDeviceProperties2 {
image_format_info: &vk::PhysicalDeviceImageFormatInfo2KHR,
image_format_properties: &mut vk::ImageFormatProperties2KHR,
) -> VkResult<()> {
self.get_physical_device_properties2_fn
self.fp
.get_physical_device_image_format_properties2_khr(
physical_device,
image_format_info,
@ -70,7 +64,7 @@ impl GetPhysicalDeviceProperties2 {
physical_device: vk::PhysicalDevice,
memory_properties: &mut vk::PhysicalDeviceMemoryProperties2KHR,
) {
self.get_physical_device_properties2_fn
self.fp
.get_physical_device_memory_properties2_khr(physical_device, memory_properties);
}
@ -80,46 +74,49 @@ impl GetPhysicalDeviceProperties2 {
physical_device: vk::PhysicalDevice,
properties: &mut vk::PhysicalDeviceProperties2KHR,
) {
self.get_physical_device_properties2_fn
self.fp
.get_physical_device_properties2_khr(physical_device, properties);
}
/// Retrieve the number of elements to pass to [`Self::get_physical_device_queue_family_properties2()`]
pub unsafe fn get_physical_device_queue_family_properties2_len(
&self,
physical_device: vk::PhysicalDevice,
) -> usize {
let mut count = 0;
self.get_physical_device_properties2_fn
.get_physical_device_queue_family_properties2_khr(
physical_device,
&mut count,
ptr::null_mut(),
);
self.fp.get_physical_device_queue_family_properties2_khr(
physical_device,
&mut count,
ptr::null_mut(),
);
count as usize
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceQueueFamilyProperties2KHR.html>"]
///
/// Call [`Self::get_physical_device_queue_family_properties2_len()`] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
pub unsafe fn get_physical_device_queue_family_properties2(
&self,
physical_device: vk::PhysicalDevice,
queue_family_properties: &mut [vk::QueueFamilyProperties2KHR],
out: &mut [vk::QueueFamilyProperties2KHR],
) {
let mut count = queue_family_properties.len() as u32;
self.get_physical_device_properties2_fn
.get_physical_device_queue_family_properties2_khr(
physical_device,
&mut count,
queue_family_properties.as_mut_ptr(),
);
let mut count = out.len() as u32;
self.fp.get_physical_device_queue_family_properties2_khr(
physical_device,
&mut count,
out.as_mut_ptr(),
);
}
/// Retrieve the number of elements to pass to [`Self::get_physical_device_sparse_image_format_properties2()`]
pub unsafe fn get_physical_device_sparse_image_format_properties2_len(
&self,
physical_device: vk::PhysicalDevice,
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2KHR,
) -> usize {
let mut count = 0;
self.get_physical_device_properties2_fn
self.fp
.get_physical_device_sparse_image_format_properties2_khr(
physical_device,
format_info,
@ -130,27 +127,30 @@ impl GetPhysicalDeviceProperties2 {
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceSparseImageFormatProperties2KHR.html>"]
///
/// Call [`Self::get_physical_device_sparse_image_format_properties2_len()`] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
pub unsafe fn get_physical_device_sparse_image_format_properties2(
&self,
physical_device: vk::PhysicalDevice,
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2KHR,
properties: &mut [vk::SparseImageFormatProperties2KHR],
out: &mut [vk::SparseImageFormatProperties2KHR],
) {
let mut count = properties.len() as u32;
self.get_physical_device_properties2_fn
let mut count = out.len() as u32;
self.fp
.get_physical_device_sparse_image_format_properties2_khr(
physical_device,
format_info,
&mut count,
properties.as_mut_ptr(),
out.as_mut_ptr(),
);
}
pub fn fp(&self) -> &vk::KhrGetPhysicalDeviceProperties2Fn {
&self.get_physical_device_properties2_fn
pub fn name() -> &'static CStr {
vk::KhrGetPhysicalDeviceProperties2Fn::name()
}
pub fn instance(&self) -> vk::Instance {
self.handle
pub fn fp(&self) -> &vk::KhrGetPhysicalDeviceProperties2Fn {
&self.fp
}
}

Просмотреть файл

@ -6,22 +6,16 @@ use std::mem;
#[derive(Clone)]
pub struct Maintenance1 {
handle: vk::Device,
fns: vk::KhrMaintenance1Fn,
fp: vk::KhrMaintenance1Fn,
}
impl Maintenance1 {
pub fn new(instance: &Instance, device: &Device) -> Self {
let fns = vk::KhrMaintenance1Fn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
let handle = device.handle();
let fp = vk::KhrMaintenance1Fn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self {
handle: device.handle(),
fns,
}
}
pub fn name() -> &'static CStr {
vk::KhrMaintenance1Fn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkTrimCommandPoolKHR.html>"]
@ -30,12 +24,16 @@ impl Maintenance1 {
command_pool: vk::CommandPool,
flags: vk::CommandPoolTrimFlagsKHR,
) {
self.fns
self.fp
.trim_command_pool_khr(self.handle, command_pool, flags);
}
pub fn name() -> &'static CStr {
vk::KhrMaintenance1Fn::name()
}
pub fn fp(&self) -> &vk::KhrMaintenance1Fn {
&self.fns
&self.fp
}
pub fn device(&self) -> vk::Device {

Просмотреть файл

@ -6,22 +6,16 @@ use std::mem;
#[derive(Clone)]
pub struct Maintenance3 {
handle: vk::Device,
fns: vk::KhrMaintenance3Fn,
fp: vk::KhrMaintenance3Fn,
}
impl Maintenance3 {
pub fn new(instance: &Instance, device: &Device) -> Self {
let fns = vk::KhrMaintenance3Fn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
let handle = device.handle();
let fp = vk::KhrMaintenance3Fn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self {
handle: device.handle(),
fns,
}
}
pub fn name() -> &'static CStr {
vk::KhrMaintenance3Fn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDescriptorSetLayoutSupportKHR.html>"]
@ -30,12 +24,16 @@ impl Maintenance3 {
create_info: &vk::DescriptorSetLayoutCreateInfo,
out: &mut vk::DescriptorSetLayoutSupportKHR,
) {
self.fns
self.fp
.get_descriptor_set_layout_support_khr(self.handle, create_info, out);
}
pub fn name() -> &'static CStr {
vk::KhrMaintenance3Fn::name()
}
pub fn fp(&self) -> &vk::KhrMaintenance3Fn {
&self.fns
&self.fp
}
pub fn device(&self) -> vk::Device {

86
third_party/rust/ash/src/extensions/khr/maintenance4.rs поставляемый Normal file
Просмотреть файл

@ -0,0 +1,86 @@
use crate::vk;
use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;
#[derive(Clone)]
pub struct Maintenance4 {
handle: vk::Device,
fp: vk::KhrMaintenance4Fn,
}
impl Maintenance4 {
pub fn new(instance: &Instance, device: &Device) -> Self {
let handle = device.handle();
let fp = vk::KhrMaintenance4Fn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDeviceBufferMemoryRequirementsKHR.html>"]
pub unsafe fn get_device_buffer_memory_requirements(
&self,
create_info: &vk::DeviceBufferMemoryRequirementsKHR,
out: &mut vk::MemoryRequirements2,
) {
self.fp
.get_device_buffer_memory_requirements_khr(self.handle, create_info, out)
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDeviceImageMemoryRequirementsKHR.html>"]
pub unsafe fn get_device_image_memory_requirements(
&self,
create_info: &vk::DeviceImageMemoryRequirementsKHR,
out: &mut vk::MemoryRequirements2,
) {
self.fp
.get_device_image_memory_requirements_khr(self.handle, create_info, out)
}
/// Retrieve the number of elements to pass to [`Self::get_device_image_sparse_memory_requirements()`]
pub unsafe fn get_device_image_sparse_memory_requirements_len(
&self,
create_info: &vk::DeviceImageMemoryRequirementsKHR,
) -> usize {
let mut count = 0;
self.fp.get_device_image_sparse_memory_requirements_khr(
self.handle,
create_info,
&mut count,
std::ptr::null_mut(),
);
count as usize
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDeviceImageSparseMemoryRequirementsKHR.html>"]
///
/// Call [`Self::get_device_image_sparse_memory_requirements_len()`] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
pub unsafe fn get_device_image_sparse_memory_requirements(
&self,
create_info: &vk::DeviceImageMemoryRequirementsKHR,
out: &mut [vk::SparseImageMemoryRequirements2],
) {
let mut count = out.len() as u32;
self.fp.get_device_image_sparse_memory_requirements_khr(
self.handle,
create_info,
&mut count,
out.as_mut_ptr(),
);
assert_eq!(count, out.len() as u32);
}
pub fn name() -> &'static CStr {
vk::KhrMaintenance4Fn::name()
}
pub fn fp(&self) -> &vk::KhrMaintenance4Fn {
&self.fp
}
pub fn device(&self) -> vk::Device {
self.handle
}
}

Просмотреть файл

@ -6,6 +6,7 @@ pub use self::deferred_host_operations::DeferredHostOperations;
pub use self::display::Display;
pub use self::display_swapchain::DisplaySwapchain;
pub use self::draw_indirect_count::DrawIndirectCount;
pub use self::dynamic_rendering::DynamicRendering;
pub use self::external_fence_fd::ExternalFenceFd;
pub use self::external_memory_fd::ExternalMemoryFd;
pub use self::external_semaphore_fd::ExternalSemaphoreFd;
@ -13,7 +14,9 @@ pub use self::get_memory_requirements2::GetMemoryRequirements2;
pub use self::get_physical_device_properties2::GetPhysicalDeviceProperties2;
pub use self::maintenance1::Maintenance1;
pub use self::maintenance3::Maintenance3;
pub use self::maintenance4::Maintenance4;
pub use self::pipeline_executable_properties::PipelineExecutableProperties;
pub use self::present_wait::PresentWait;
pub use self::push_descriptor::PushDescriptor;
pub use self::ray_tracing_pipeline::RayTracingPipeline;
pub use self::surface::Surface;
@ -33,6 +36,7 @@ mod deferred_host_operations;
mod display;
mod display_swapchain;
mod draw_indirect_count;
mod dynamic_rendering;
mod external_fence_fd;
mod external_memory_fd;
mod external_semaphore_fd;
@ -40,7 +44,9 @@ mod get_memory_requirements2;
mod get_physical_device_properties2;
mod maintenance1;
mod maintenance3;
mod maintenance4;
mod pipeline_executable_properties;
mod present_wait;
mod push_descriptor;
mod ray_tracing_pipeline;
mod surface;

Просмотреть файл

@ -1,41 +1,33 @@
use crate::prelude::*;
use crate::vk;
use crate::{EntryCustom, Instance};
use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;
#[derive(Clone)]
pub struct PipelineExecutableProperties {
handle: vk::Instance,
pipeline_executable_properties_fn: vk::KhrPipelineExecutablePropertiesFn,
handle: vk::Device,
fp: vk::KhrPipelineExecutablePropertiesFn,
}
impl PipelineExecutableProperties {
pub fn new<L>(entry: &EntryCustom<L>, instance: &Instance) -> Self {
let pipeline_executable_properties_fn =
vk::KhrPipelineExecutablePropertiesFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))
});
Self {
handle: instance.handle(),
pipeline_executable_properties_fn,
}
}
pub fn name() -> &'static CStr {
vk::KhrPipelineExecutablePropertiesFn::name()
pub fn new(instance: &Instance, device: &Device) -> Self {
let handle = device.handle();
let fp = vk::KhrPipelineExecutablePropertiesFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPipelineExecutableInternalRepresentationsKHR.html>"]
pub unsafe fn get_pipeline_executable_internal_representations(
&self,
device: vk::Device,
executable_info: &vk::PipelineExecutableInfoKHR,
) -> VkResult<Vec<vk::PipelineExecutableInternalRepresentationKHR>> {
read_into_defaulted_vector(|count, data| {
self.pipeline_executable_properties_fn
self.fp
.get_pipeline_executable_internal_representations_khr(
device,
self.handle,
executable_info,
count,
data,
@ -46,32 +38,38 @@ impl PipelineExecutableProperties {
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPipelineExecutablePropertiesKHR.html>"]
pub unsafe fn get_pipeline_executable_properties(
&self,
device: vk::Device,
pipeline_info: &vk::PipelineInfoKHR,
) -> VkResult<Vec<vk::PipelineExecutablePropertiesKHR>> {
read_into_defaulted_vector(|count, data| {
self.pipeline_executable_properties_fn
.get_pipeline_executable_properties_khr(device, pipeline_info, count, data)
self.fp
.get_pipeline_executable_properties_khr(self.handle, pipeline_info, count, data)
})
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPipelineExecutableStatisticsKHR.html>"]
pub unsafe fn get_pipeline_executable_statistics(
&self,
device: vk::Device,
executable_info: &vk::PipelineExecutableInfoKHR,
) -> VkResult<Vec<vk::PipelineExecutableStatisticKHR>> {
read_into_defaulted_vector(|count, data| {
self.pipeline_executable_properties_fn
.get_pipeline_executable_statistics_khr(device, executable_info, count, data)
self.fp.get_pipeline_executable_statistics_khr(
self.handle,
executable_info,
count,
data,
)
})
}
pub fn fp(&self) -> &vk::KhrPipelineExecutablePropertiesFn {
&self.pipeline_executable_properties_fn
pub fn name() -> &'static CStr {
vk::KhrPipelineExecutablePropertiesFn::name()
}
pub fn instance(&self) -> vk::Instance {
pub fn fp(&self) -> &vk::KhrPipelineExecutablePropertiesFn {
&self.fp
}
pub fn device(&self) -> vk::Device {
self.handle
}
}

45
third_party/rust/ash/src/extensions/khr/present_wait.rs поставляемый Normal file
Просмотреть файл

@ -0,0 +1,45 @@
use crate::prelude::*;
use crate::vk;
use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;
#[derive(Clone)]
pub struct PresentWait {
handle: vk::Device,
fp: vk::KhrPresentWaitFn,
}
impl PresentWait {
pub fn new(instance: &Instance, device: &Device) -> Self {
let handle = device.handle();
let fp = vk::KhrPresentWaitFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkWaitForPresentKHR.html>"]
pub unsafe fn wait_for_present(
&self,
swapchain: vk::SwapchainKHR,
present_id: u64,
timeout: u64,
) -> VkResult<()> {
self.fp
.wait_for_present_khr(self.handle, swapchain, present_id, timeout)
.result()
}
pub fn name() -> &'static CStr {
vk::KhrPresentWaitFn::name()
}
pub fn fp(&self) -> &vk::KhrPresentWaitFn {
&self.fp
}
pub fn device(&self) -> vk::Device {
self.handle
}
}

Просмотреть файл

@ -6,23 +6,15 @@ use std::mem;
#[derive(Clone)]
pub struct PushDescriptor {
handle: vk::Instance,
push_descriptors_fn: vk::KhrPushDescriptorFn,
fp: vk::KhrPushDescriptorFn,
}
impl PushDescriptor {
pub fn new(instance: &Instance, device: &Device) -> Self {
let push_descriptors_fn = vk::KhrPushDescriptorFn::load(|name| unsafe {
let fp = vk::KhrPushDescriptorFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
});
Self {
handle: instance.handle(),
push_descriptors_fn,
}
}
pub fn name() -> &'static CStr {
vk::KhrPushDescriptorFn::name()
Self { fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdPushDescriptorSetKHR.html>"]
@ -34,7 +26,7 @@ impl PushDescriptor {
set: u32,
descriptor_writes: &[vk::WriteDescriptorSet],
) {
self.push_descriptors_fn.cmd_push_descriptor_set_khr(
self.fp.cmd_push_descriptor_set_khr(
command_buffer,
pipeline_bind_point,
layout,
@ -53,21 +45,20 @@ impl PushDescriptor {
set: u32,
p_data: *const c_void,
) {
self.push_descriptors_fn
.cmd_push_descriptor_set_with_template_khr(
command_buffer,
descriptor_update_template,
layout,
set,
p_data,
);
self.fp.cmd_push_descriptor_set_with_template_khr(
command_buffer,
descriptor_update_template,
layout,
set,
p_data,
);
}
pub fn name() -> &'static CStr {
vk::KhrPushDescriptorFn::name()
}
pub fn fp(&self) -> &vk::KhrPushDescriptorFn {
&self.push_descriptors_fn
}
pub fn instance(&self) -> vk::Instance {
self.handle
&self.fp
}
}

Просмотреть файл

@ -8,18 +8,16 @@ use std::mem;
#[derive(Clone)]
pub struct RayTracingPipeline {
handle: vk::Device,
ray_tracing_fn: vk::KhrRayTracingPipelineFn,
fp: vk::KhrRayTracingPipelineFn,
}
impl RayTracingPipeline {
pub fn new(instance: &Instance, device: &Device) -> Self {
let ray_tracing_fn = vk::KhrRayTracingPipelineFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
let handle = device.handle();
let fp = vk::KhrRayTracingPipelineFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self {
handle: device.handle(),
ray_tracing_fn,
}
Self { handle, fp }
}
pub unsafe fn get_properties(
@ -46,7 +44,7 @@ impl RayTracingPipeline {
height: u32,
depth: u32,
) {
self.ray_tracing_fn.cmd_trace_rays_khr(
self.fp.cmd_trace_rays_khr(
command_buffer,
raygen_shader_binding_tables as *const _,
miss_shader_binding_tables as *const _,
@ -67,7 +65,7 @@ impl RayTracingPipeline {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<Vec<vk::Pipeline>> {
let mut pipelines = vec![mem::zeroed(); create_info.len()];
self.ray_tracing_fn
self.fp
.create_ray_tracing_pipelines_khr(
self.handle,
deferred_operation,
@ -89,16 +87,14 @@ impl RayTracingPipeline {
data_size: usize,
) -> VkResult<Vec<u8>> {
let mut data = Vec::<u8>::with_capacity(data_size);
let err_code = self
.ray_tracing_fn
.get_ray_tracing_shader_group_handles_khr(
self.handle,
pipeline,
first_group,
group_count,
data_size,
data.as_mut_ptr() as *mut std::ffi::c_void,
);
let err_code = self.fp.get_ray_tracing_shader_group_handles_khr(
self.handle,
pipeline,
first_group,
group_count,
data_size,
data.as_mut_ptr() as *mut std::ffi::c_void,
);
data.set_len(data_size);
err_code.result_with_success(data)
}
@ -113,7 +109,7 @@ impl RayTracingPipeline {
) -> VkResult<Vec<u8>> {
let mut data: Vec<u8> = Vec::with_capacity(data_size);
self.ray_tracing_fn
self.fp
.get_ray_tracing_capture_replay_shader_group_handles_khr(
self.handle,
pipeline,
@ -135,7 +131,7 @@ impl RayTracingPipeline {
callable_shader_binding_table: &[vk::StridedDeviceAddressRegionKHR],
indirect_device_address: vk::DeviceAddress,
) {
self.ray_tracing_fn.cmd_trace_rays_indirect_khr(
self.fp.cmd_trace_rays_indirect_khr(
command_buffer,
raygen_shader_binding_table.as_ptr(),
miss_shader_binding_table.as_ptr(),
@ -152,8 +148,12 @@ impl RayTracingPipeline {
group: u32,
group_shader: vk::ShaderGroupShaderKHR,
) -> vk::DeviceSize {
self.ray_tracing_fn
.get_ray_tracing_shader_group_stack_size_khr(self.handle, pipeline, group, group_shader)
self.fp.get_ray_tracing_shader_group_stack_size_khr(
self.handle,
pipeline,
group,
group_shader,
)
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetRayTracingPipelineStackSizeKHR.html>"]
@ -162,7 +162,7 @@ impl RayTracingPipeline {
command_buffer: vk::CommandBuffer,
pipeline_stack_size: u32,
) {
self.ray_tracing_fn
self.fp
.cmd_set_ray_tracing_pipeline_stack_size_khr(command_buffer, pipeline_stack_size);
}
@ -171,7 +171,7 @@ impl RayTracingPipeline {
}
pub fn fp(&self) -> &vk::KhrRayTracingPipelineFn {
&self.ray_tracing_fn
&self.fp
}
pub fn device(&self) -> vk::Device {

Просмотреть файл

@ -1,29 +1,23 @@
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use crate::{EntryCustom, Instance};
use crate::{Entry, Instance};
use std::ffi::CStr;
use std::mem;
#[derive(Clone)]
pub struct Surface {
handle: vk::Instance,
surface_fn: vk::KhrSurfaceFn,
fp: vk::KhrSurfaceFn,
}
impl Surface {
pub fn new<L>(entry: &EntryCustom<L>, instance: &Instance) -> Self {
let surface_fn = vk::KhrSurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))
pub fn new(entry: &Entry, instance: &Instance) -> Self {
let handle = instance.handle();
let fp = vk::KhrSurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self {
handle: instance.handle(),
surface_fn,
}
}
pub fn name() -> &'static CStr {
vk::KhrSurfaceFn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceSurfaceSupportKHR.html>"]
@ -34,7 +28,7 @@ impl Surface {
surface: vk::SurfaceKHR,
) -> VkResult<bool> {
let mut b = 0;
self.surface_fn
self.fp
.get_physical_device_surface_support_khr(
physical_device,
queue_family_index,
@ -51,13 +45,12 @@ impl Surface {
surface: vk::SurfaceKHR,
) -> VkResult<Vec<vk::PresentModeKHR>> {
read_into_uninitialized_vector(|count, data| {
self.surface_fn
.get_physical_device_surface_present_modes_khr(
physical_device,
surface,
count,
data,
)
self.fp.get_physical_device_surface_present_modes_khr(
physical_device,
surface,
count,
data,
)
})
}
@ -68,7 +61,7 @@ impl Surface {
surface: vk::SurfaceKHR,
) -> VkResult<vk::SurfaceCapabilitiesKHR> {
let mut surface_capabilities = mem::zeroed();
self.surface_fn
self.fp
.get_physical_device_surface_capabilities_khr(
physical_device,
surface,
@ -84,12 +77,8 @@ impl Surface {
surface: vk::SurfaceKHR,
) -> VkResult<Vec<vk::SurfaceFormatKHR>> {
read_into_uninitialized_vector(|count, data| {
self.surface_fn.get_physical_device_surface_formats_khr(
physical_device,
surface,
count,
data,
)
self.fp
.get_physical_device_surface_formats_khr(physical_device, surface, count, data)
})
}
@ -99,15 +88,16 @@ impl Surface {
surface: vk::SurfaceKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) {
self.surface_fn.destroy_surface_khr(
self.handle,
surface,
allocation_callbacks.as_raw_ptr(),
);
self.fp
.destroy_surface_khr(self.handle, surface, allocation_callbacks.as_raw_ptr());
}
pub fn name() -> &'static CStr {
vk::KhrSurfaceFn::name()
}
pub fn fp(&self) -> &vk::KhrSurfaceFn {
&self.surface_fn
&self.fp
}
pub fn instance(&self) -> vk::Instance {

Просмотреть файл

@ -8,22 +8,16 @@ use std::mem;
#[derive(Clone)]
pub struct Swapchain {
handle: vk::Device,
swapchain_fn: vk::KhrSwapchainFn,
fp: vk::KhrSwapchainFn,
}
impl Swapchain {
pub fn new(instance: &Instance, device: &Device) -> Self {
let swapchain_fn = vk::KhrSwapchainFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
let handle = device.handle();
let fp = vk::KhrSwapchainFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self {
handle: device.handle(),
swapchain_fn,
}
}
pub fn name() -> &'static CStr {
vk::KhrSwapchainFn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkDestroySwapchainKHR.html>"]
@ -32,11 +26,8 @@ impl Swapchain {
swapchain: vk::SwapchainKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) {
self.swapchain_fn.destroy_swapchain_khr(
self.handle,
swapchain,
allocation_callbacks.as_raw_ptr(),
);
self.fp
.destroy_swapchain_khr(self.handle, swapchain, allocation_callbacks.as_raw_ptr());
}
/// On success, returns the next image's index and whether the swapchain is suboptimal for the surface.
@ -49,7 +40,7 @@ impl Swapchain {
fence: vk::Fence,
) -> VkResult<(u32, bool)> {
let mut index = 0;
let err_code = self.swapchain_fn.acquire_next_image_khr(
let err_code = self.fp.acquire_next_image_khr(
self.handle,
swapchain,
timeout,
@ -71,7 +62,7 @@ impl Swapchain {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SwapchainKHR> {
let mut swapchain = mem::zeroed();
self.swapchain_fn
self.fp
.create_swapchain_khr(
self.handle,
create_info,
@ -86,9 +77,9 @@ impl Swapchain {
pub unsafe fn queue_present(
&self,
queue: vk::Queue,
create_info: &vk::PresentInfoKHR,
present_info: &vk::PresentInfoKHR,
) -> VkResult<bool> {
let err_code = self.swapchain_fn.queue_present_khr(queue, create_info);
let err_code = self.fp.queue_present_khr(queue, present_info);
match err_code {
vk::Result::SUCCESS => Ok(false),
vk::Result::SUBOPTIMAL_KHR => Ok(true),
@ -102,13 +93,17 @@ impl Swapchain {
swapchain: vk::SwapchainKHR,
) -> VkResult<Vec<vk::Image>> {
read_into_uninitialized_vector(|count, data| {
self.swapchain_fn
self.fp
.get_swapchain_images_khr(self.handle, swapchain, count, data)
})
}
pub fn name() -> &'static CStr {
vk::KhrSwapchainFn::name()
}
pub fn fp(&self) -> &vk::KhrSwapchainFn {
&self.swapchain_fn
&self.fp
}
pub fn device(&self) -> vk::Device {

Просмотреть файл

@ -6,31 +6,15 @@ use std::mem;
#[derive(Clone)]
pub struct Synchronization2 {
handle: vk::Device,
synchronization2_fn: vk::KhrSynchronization2Fn,
fp: vk::KhrSynchronization2Fn,
}
impl Synchronization2 {
pub fn new(instance: &Instance, device: &Device) -> Self {
let synchronization2_fn = vk::KhrSynchronization2Fn::load(|name| unsafe {
let fp = vk::KhrSynchronization2Fn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
});
Self {
handle: device.handle(),
synchronization2_fn,
}
}
pub fn name() -> &'static CStr {
vk::KhrSynchronization2Fn::name()
}
pub fn fp(&self) -> &vk::KhrSynchronization2Fn {
&self.synchronization2_fn
}
pub fn device(&self) -> vk::Device {
self.handle
Self { fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdPipelineBarrier2KHR.html>"]
@ -39,7 +23,7 @@ impl Synchronization2 {
command_buffer: vk::CommandBuffer,
dependency_info: &vk::DependencyInfoKHR,
) {
self.synchronization2_fn
self.fp
.cmd_pipeline_barrier2_khr(command_buffer, dependency_info)
}
@ -50,7 +34,7 @@ impl Synchronization2 {
event: vk::Event,
stage_mask: vk::PipelineStageFlags2KHR,
) {
self.synchronization2_fn
self.fp
.cmd_reset_event2_khr(command_buffer, event, stage_mask)
}
@ -61,7 +45,7 @@ impl Synchronization2 {
event: vk::Event,
dependency_info: &vk::DependencyInfoKHR,
) {
self.synchronization2_fn
self.fp
.cmd_set_event2_khr(command_buffer, event, dependency_info)
}
@ -73,7 +57,7 @@ impl Synchronization2 {
dependency_infos: &[vk::DependencyInfoKHR],
) {
assert_eq!(events.len(), dependency_infos.len());
self.synchronization2_fn.cmd_wait_events2_khr(
self.fp.cmd_wait_events2_khr(
command_buffer,
events.len() as u32,
events.as_ptr(),
@ -89,7 +73,7 @@ impl Synchronization2 {
query_pool: vk::QueryPool,
query: u32,
) {
self.synchronization2_fn
self.fp
.cmd_write_timestamp2_khr(command_buffer, stage, query_pool, query)
}
@ -100,8 +84,16 @@ impl Synchronization2 {
submits: &[vk::SubmitInfo2KHR],
fence: vk::Fence,
) -> VkResult<()> {
self.synchronization2_fn
self.fp
.queue_submit2_khr(queue, submits.len() as u32, submits.as_ptr(), fence)
.result()
}
pub fn name() -> &'static CStr {
vk::KhrSynchronization2Fn::name()
}
pub fn fp(&self) -> &vk::KhrSynchronization2Fn {
&self.fp
}
}

Просмотреть файл

@ -1,70 +1,59 @@
use crate::prelude::*;
use crate::vk;
use crate::{EntryCustom, Instance};
use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;
#[derive(Clone)]
pub struct TimelineSemaphore {
handle: vk::Instance,
timeline_semaphore_fn: vk::KhrTimelineSemaphoreFn,
handle: vk::Device,
fp: vk::KhrTimelineSemaphoreFn,
}
impl TimelineSemaphore {
pub fn new<L>(entry: &EntryCustom<L>, instance: &Instance) -> Self {
let timeline_semaphore_fn = vk::KhrTimelineSemaphoreFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))
pub fn new(instance: &Instance, device: &Device) -> Self {
let handle = device.handle();
let fp = vk::KhrTimelineSemaphoreFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self {
handle: instance.handle(),
timeline_semaphore_fn,
}
}
pub fn name() -> &'static CStr {
vk::KhrTimelineSemaphoreFn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetSemaphoreCounterValue.html>"]
pub unsafe fn get_semaphore_counter_value(
&self,
device: vk::Device,
semaphore: vk::Semaphore,
) -> VkResult<u64> {
pub unsafe fn get_semaphore_counter_value(&self, semaphore: vk::Semaphore) -> VkResult<u64> {
let mut value = 0;
self.timeline_semaphore_fn
.get_semaphore_counter_value_khr(device, semaphore, &mut value)
self.fp
.get_semaphore_counter_value_khr(self.handle, semaphore, &mut value)
.result_with_success(value)
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkWaitSemaphores.html>"]
pub unsafe fn wait_semaphores(
&self,
device: vk::Device,
wait_info: &vk::SemaphoreWaitInfo,
timeout: u64,
) -> VkResult<()> {
self.timeline_semaphore_fn
.wait_semaphores_khr(device, wait_info, timeout)
.into()
self.fp
.wait_semaphores_khr(self.handle, wait_info, timeout)
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkSignalSemaphore.html>"]
pub unsafe fn signal_semaphore(
&self,
device: vk::Device,
signal_info: &vk::SemaphoreSignalInfo,
) -> VkResult<()> {
self.timeline_semaphore_fn
.signal_semaphore_khr(device, signal_info)
.into()
pub unsafe fn signal_semaphore(&self, signal_info: &vk::SemaphoreSignalInfo) -> VkResult<()> {
self.fp
.signal_semaphore_khr(self.handle, signal_info)
.result()
}
pub fn name() -> &'static CStr {
vk::KhrTimelineSemaphoreFn::name()
}
pub fn fp(&self) -> &vk::KhrTimelineSemaphoreFn {
&self.timeline_semaphore_fn
&self.fp
}
pub fn instance(&self) -> vk::Instance {
pub fn device(&self) -> vk::Device {
self.handle
}
}

Просмотреть файл

@ -1,29 +1,23 @@
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use crate::{EntryCustom, Instance};
use crate::{Entry, Instance};
use std::ffi::CStr;
use std::mem;
#[derive(Clone)]
pub struct WaylandSurface {
handle: vk::Instance,
wayland_surface_fn: vk::KhrWaylandSurfaceFn,
fp: vk::KhrWaylandSurfaceFn,
}
impl WaylandSurface {
pub fn new<L>(entry: &EntryCustom<L>, instance: &Instance) -> Self {
let surface_fn = vk::KhrWaylandSurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))
pub fn new(entry: &Entry, instance: &Instance) -> Self {
let handle = instance.handle();
let fp = vk::KhrWaylandSurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self {
handle: instance.handle(),
wayland_surface_fn: surface_fn,
}
}
pub fn name() -> &'static CStr {
vk::KhrWaylandSurfaceFn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateWaylandSurfaceKHR.html>"]
@ -33,7 +27,7 @@ impl WaylandSurface {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
self.wayland_surface_fn
self.fp
.create_wayland_surface_khr(
self.handle,
create_info,
@ -51,7 +45,7 @@ impl WaylandSurface {
wl_display: &mut vk::wl_display,
) -> bool {
let b = self
.wayland_surface_fn
.fp
.get_physical_device_wayland_presentation_support_khr(
physical_device,
queue_family_index,
@ -61,8 +55,12 @@ impl WaylandSurface {
b > 0
}
pub fn name() -> &'static CStr {
vk::KhrWaylandSurfaceFn::name()
}
pub fn fp(&self) -> &vk::KhrWaylandSurfaceFn {
&self.wayland_surface_fn
&self.fp
}
pub fn instance(&self) -> vk::Instance {

Просмотреть файл

@ -1,29 +1,23 @@
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use crate::{EntryCustom, Instance};
use crate::{Entry, Instance};
use std::ffi::CStr;
use std::mem;
#[derive(Clone)]
pub struct Win32Surface {
handle: vk::Instance,
win32_surface_fn: vk::KhrWin32SurfaceFn,
fp: vk::KhrWin32SurfaceFn,
}
impl Win32Surface {
pub fn new<L>(entry: &EntryCustom<L>, instance: &Instance) -> Self {
let surface_fn = vk::KhrWin32SurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))
pub fn new(entry: &Entry, instance: &Instance) -> Self {
let handle = instance.handle();
let fp = vk::KhrWin32SurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self {
handle: instance.handle(),
win32_surface_fn: surface_fn,
}
}
pub fn name() -> &'static CStr {
vk::KhrWin32SurfaceFn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateWin32SurfaceKHR.html>"]
@ -33,7 +27,7 @@ impl Win32Surface {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
self.win32_surface_fn
self.fp
.create_win32_surface_khr(
self.handle,
create_info,
@ -49,18 +43,20 @@ impl Win32Surface {
physical_device: vk::PhysicalDevice,
queue_family_index: u32,
) -> bool {
let b = self
.win32_surface_fn
.get_physical_device_win32_presentation_support_khr(
physical_device,
queue_family_index,
);
let b = self.fp.get_physical_device_win32_presentation_support_khr(
physical_device,
queue_family_index,
);
b > 0
}
pub fn name() -> &'static CStr {
vk::KhrWin32SurfaceFn::name()
}
pub fn fp(&self) -> &vk::KhrWin32SurfaceFn {
&self.win32_surface_fn
&self.fp
}
pub fn instance(&self) -> vk::Instance {

Просмотреть файл

@ -1,29 +1,23 @@
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use crate::{EntryCustom, Instance};
use crate::{Entry, Instance};
use std::ffi::CStr;
use std::mem;
#[derive(Clone)]
pub struct XcbSurface {
handle: vk::Instance,
xcb_surface_fn: vk::KhrXcbSurfaceFn,
fp: vk::KhrXcbSurfaceFn,
}
impl XcbSurface {
pub fn new<L>(entry: &EntryCustom<L>, instance: &Instance) -> Self {
let surface_fn = vk::KhrXcbSurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))
pub fn new(entry: &Entry, instance: &Instance) -> Self {
let handle = instance.handle();
let fp = vk::KhrXcbSurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self {
handle: instance.handle(),
xcb_surface_fn: surface_fn,
}
}
pub fn name() -> &'static CStr {
vk::KhrXcbSurfaceFn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateXcbSurfaceKHR.html>"]
@ -33,7 +27,7 @@ impl XcbSurface {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
self.xcb_surface_fn
self.fp
.create_xcb_surface_khr(
self.handle,
create_info,
@ -51,20 +45,22 @@ impl XcbSurface {
connection: &mut vk::xcb_connection_t,
visual_id: vk::xcb_visualid_t,
) -> bool {
let b = self
.xcb_surface_fn
.get_physical_device_xcb_presentation_support_khr(
physical_device,
queue_family_index,
connection,
visual_id,
);
let b = self.fp.get_physical_device_xcb_presentation_support_khr(
physical_device,
queue_family_index,
connection,
visual_id,
);
b > 0
}
pub fn name() -> &'static CStr {
vk::KhrXcbSurfaceFn::name()
}
pub fn fp(&self) -> &vk::KhrXcbSurfaceFn {
&self.xcb_surface_fn
&self.fp
}
pub fn instance(&self) -> vk::Instance {

Просмотреть файл

@ -1,29 +1,23 @@
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use crate::{EntryCustom, Instance};
use crate::{Entry, Instance};
use std::ffi::CStr;
use std::mem;
#[derive(Clone)]
pub struct XlibSurface {
handle: vk::Instance,
xlib_surface_fn: vk::KhrXlibSurfaceFn,
fp: vk::KhrXlibSurfaceFn,
}
impl XlibSurface {
pub fn new<L>(entry: &EntryCustom<L>, instance: &Instance) -> Self {
let surface_fn = vk::KhrXlibSurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))
pub fn new(entry: &Entry, instance: &Instance) -> Self {
let handle = instance.handle();
let fp = vk::KhrXlibSurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self {
handle: instance.handle(),
xlib_surface_fn: surface_fn,
}
}
pub fn name() -> &'static CStr {
vk::KhrXlibSurfaceFn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateXlibSurfaceKHR.html>"]
@ -33,7 +27,7 @@ impl XlibSurface {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
self.xlib_surface_fn
self.fp
.create_xlib_surface_khr(
self.handle,
create_info,
@ -51,20 +45,22 @@ impl XlibSurface {
display: &mut vk::Display,
visual_id: vk::VisualID,
) -> bool {
let b = self
.xlib_surface_fn
.get_physical_device_xlib_presentation_support_khr(
physical_device,
queue_family_index,
display,
visual_id,
);
let b = self.fp.get_physical_device_xlib_presentation_support_khr(
physical_device,
queue_family_index,
display,
visual_id,
);
b > 0
}
pub fn name() -> &'static CStr {
vk::KhrXlibSurfaceFn::name()
}
pub fn fp(&self) -> &vk::KhrXlibSurfaceFn {
&self.xlib_surface_fn
&self.fp
}
pub fn instance(&self) -> vk::Instance {

1
third_party/rust/ash/src/extensions/mod.rs поставляемый
Просмотреть файл

@ -1,4 +1,3 @@
#![deny(clippy::use_self)]
pub mod experimental;
pub mod ext;
pub mod khr;

Просмотреть файл

@ -1,29 +1,23 @@
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use crate::{EntryCustom, Instance};
use crate::{Entry, Instance};
use std::ffi::CStr;
use std::mem;
#[derive(Clone)]
pub struct IOSSurface {
handle: vk::Instance,
ios_surface_fn: vk::MvkIosSurfaceFn,
fp: vk::MvkIosSurfaceFn,
}
impl IOSSurface {
pub fn new<L>(entry: &EntryCustom<L>, instance: &Instance) -> Self {
let surface_fn = vk::MvkIosSurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))
pub fn new(entry: &Entry, instance: &Instance) -> Self {
let handle = instance.handle();
let fp = vk::MvkIosSurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self {
handle: instance.handle(),
ios_surface_fn: surface_fn,
}
}
pub fn name() -> &'static CStr {
vk::MvkIosSurfaceFn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateIOSSurfaceMVK.html>"]
@ -33,7 +27,7 @@ impl IOSSurface {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
self.ios_surface_fn
self.fp
.create_ios_surface_mvk(
self.handle,
create_info,
@ -43,8 +37,12 @@ impl IOSSurface {
.result_with_success(surface)
}
pub fn name() -> &'static CStr {
vk::MvkIosSurfaceFn::name()
}
pub fn fp(&self) -> &vk::MvkIosSurfaceFn {
&self.ios_surface_fn
&self.fp
}
pub fn instance(&self) -> vk::Instance {

Просмотреть файл

@ -1,29 +1,23 @@
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use crate::{EntryCustom, Instance};
use crate::{Entry, Instance};
use std::ffi::CStr;
use std::mem;
#[derive(Clone)]
pub struct MacOSSurface {
handle: vk::Instance,
macos_surface_fn: vk::MvkMacosSurfaceFn,
fp: vk::MvkMacosSurfaceFn,
}
impl MacOSSurface {
pub fn new<L>(entry: &EntryCustom<L>, instance: &Instance) -> Self {
let surface_fn = vk::MvkMacosSurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))
pub fn new(entry: &Entry, instance: &Instance) -> Self {
let handle = instance.handle();
let fp = vk::MvkMacosSurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self {
handle: instance.handle(),
macos_surface_fn: surface_fn,
}
}
pub fn name() -> &'static CStr {
vk::MvkMacosSurfaceFn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateMacOSSurfaceMVK.html>"]
@ -33,7 +27,7 @@ impl MacOSSurface {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
self.macos_surface_fn
self.fp
.create_mac_os_surface_mvk(
self.handle,
create_info,
@ -43,8 +37,12 @@ impl MacOSSurface {
.result_with_success(surface)
}
pub fn name() -> &'static CStr {
vk::MvkMacosSurfaceFn::name()
}
pub fn fp(&self) -> &vk::MvkMacosSurfaceFn {
&self.macos_surface_fn
&self.fp
}
pub fn instance(&self) -> vk::Instance {

Просмотреть файл

@ -1,29 +1,23 @@
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use crate::{EntryCustom, Instance};
use crate::{Entry, Instance};
use std::ffi::CStr;
use std::mem;
#[derive(Clone)]
pub struct ViSurface {
handle: vk::Instance,
vi_surface_fn: vk::NnViSurfaceFn,
fp: vk::NnViSurfaceFn,
}
impl ViSurface {
pub fn new<L>(entry: &EntryCustom<L>, instance: &Instance) -> Self {
let surface_fn = vk::NnViSurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))
pub fn new(entry: &Entry, instance: &Instance) -> Self {
let handle = instance.handle();
let fp = vk::NnViSurfaceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self {
handle: instance.handle(),
vi_surface_fn: surface_fn,
}
}
pub fn name() -> &'static CStr {
vk::NnViSurfaceFn::name()
Self { handle, fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCreateViSurfaceNN.html>"]
@ -33,7 +27,7 @@ impl ViSurface {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
self.vi_surface_fn
self.fp
.create_vi_surface_nn(
self.handle,
create_info,
@ -43,8 +37,12 @@ impl ViSurface {
.result_with_success(surface)
}
pub fn name() -> &'static CStr {
vk::NnViSurfaceFn::name()
}
pub fn fp(&self) -> &vk::NnViSurfaceFn {
&self.vi_surface_fn
&self.fp
}
pub fn instance(&self) -> vk::Instance {

Просмотреть файл

@ -6,18 +6,15 @@ use std::os::raw::c_void;
#[derive(Clone)]
pub struct DeviceDiagnosticCheckpoints {
device_diagnostic_checkpoints_fn: vk::NvDeviceDiagnosticCheckpointsFn,
fp: vk::NvDeviceDiagnosticCheckpointsFn,
}
impl DeviceDiagnosticCheckpoints {
pub fn new(instance: &Instance, device: &Device) -> Self {
let device_diagnostic_checkpoints_fn =
vk::NvDeviceDiagnosticCheckpointsFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
});
Self {
device_diagnostic_checkpoints_fn,
}
let fp = vk::NvDeviceDiagnosticCheckpointsFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
});
Self { fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetCheckpointNV.html>"]
@ -26,23 +23,25 @@ impl DeviceDiagnosticCheckpoints {
command_buffer: vk::CommandBuffer,
p_checkpoint_marker: *const c_void,
) {
self.device_diagnostic_checkpoints_fn
self.fp
.cmd_set_checkpoint_nv(command_buffer, p_checkpoint_marker);
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetQueueCheckpointDataNV.html>"]
pub unsafe fn get_queue_checkpoint_data(&self, queue: vk::Queue) -> Vec<vk::CheckpointDataNV> {
let mut checkpoint_data_count: u32 = 0;
self.device_diagnostic_checkpoints_fn
.get_queue_checkpoint_data_nv(queue, &mut checkpoint_data_count, std::ptr::null_mut());
self.fp.get_queue_checkpoint_data_nv(
queue,
&mut checkpoint_data_count,
std::ptr::null_mut(),
);
let mut checkpoint_data: Vec<vk::CheckpointDataNV> =
vec![vk::CheckpointDataNV::default(); checkpoint_data_count as _];
self.device_diagnostic_checkpoints_fn
.get_queue_checkpoint_data_nv(
queue,
&mut checkpoint_data_count,
checkpoint_data.as_mut_ptr(),
);
self.fp.get_queue_checkpoint_data_nv(
queue,
&mut checkpoint_data_count,
checkpoint_data.as_mut_ptr(),
);
checkpoint_data
}
@ -51,6 +50,6 @@ impl DeviceDiagnosticCheckpoints {
}
pub fn fp(&self) -> &vk::NvDeviceDiagnosticCheckpointsFn {
&self.device_diagnostic_checkpoints_fn
&self.fp
}
}

Просмотреть файл

@ -5,15 +5,15 @@ use std::mem;
#[derive(Clone)]
pub struct MeshShader {
mesh_shader_fn: vk::NvMeshShaderFn,
fp: vk::NvMeshShaderFn,
}
impl MeshShader {
pub fn new(instance: &Instance, device: &Device) -> Self {
let mesh_shader_fn = vk::NvMeshShaderFn::load(|name| unsafe {
let fp = vk::NvMeshShaderFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
});
Self { mesh_shader_fn }
Self { fp }
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdDrawMeshTasksNV.html>"]
@ -23,7 +23,7 @@ impl MeshShader {
task_count: u32,
first_task: u32,
) {
self.mesh_shader_fn
self.fp
.cmd_draw_mesh_tasks_nv(command_buffer, task_count, first_task);
}
@ -36,13 +36,8 @@ impl MeshShader {
draw_count: u32,
stride: u32,
) {
self.mesh_shader_fn.cmd_draw_mesh_tasks_indirect_nv(
command_buffer,
buffer,
offset,
draw_count,
stride,
);
self.fp
.cmd_draw_mesh_tasks_indirect_nv(command_buffer, buffer, offset, draw_count, stride);
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdDrawMeshTasksIndirectCountNV.html>"]
@ -56,7 +51,7 @@ impl MeshShader {
max_draw_count: u32,
stride: u32,
) {
self.mesh_shader_fn.cmd_draw_mesh_tasks_indirect_count_nv(
self.fp.cmd_draw_mesh_tasks_indirect_count_nv(
command_buffer,
buffer,
offset,
@ -72,6 +67,6 @@ impl MeshShader {
}
pub fn fp(&self) -> &vk::NvMeshShaderFn {
&self.mesh_shader_fn
&self.fp
}
}

Просмотреть файл

@ -8,18 +8,16 @@ use std::mem;
#[derive(Clone)]
pub struct RayTracing {
handle: vk::Device,
ray_tracing_fn: vk::NvRayTracingFn,
fp: vk::NvRayTracingFn,
}
impl RayTracing {
pub fn new(instance: &Instance, device: &Device) -> Self {
let ray_tracing_fn = vk::NvRayTracingFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
let handle = device.handle();
let fp = vk::NvRayTracingFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self {
handle: device.handle(),
ray_tracing_fn,
}
Self { handle, fp }
}
pub unsafe fn get_properties(
@ -41,7 +39,7 @@ impl RayTracing {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::AccelerationStructureNV> {
let mut accel_struct = mem::zeroed();
self.ray_tracing_fn
self.fp
.create_acceleration_structure_nv(
self.handle,
create_info,
@ -57,7 +55,7 @@ impl RayTracing {
accel_struct: vk::AccelerationStructureNV,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) {
self.ray_tracing_fn.destroy_acceleration_structure_nv(
self.fp.destroy_acceleration_structure_nv(
self.handle,
accel_struct,
allocation_callbacks.as_raw_ptr(),
@ -70,12 +68,11 @@ impl RayTracing {
info: &vk::AccelerationStructureMemoryRequirementsInfoNV,
) -> vk::MemoryRequirements2KHR {
let mut requirements = mem::zeroed();
self.ray_tracing_fn
.get_acceleration_structure_memory_requirements_nv(
self.handle,
info,
&mut requirements,
);
self.fp.get_acceleration_structure_memory_requirements_nv(
self.handle,
info,
&mut requirements,
);
requirements
}
@ -84,13 +81,13 @@ impl RayTracing {
&self,
bind_info: &[vk::BindAccelerationStructureMemoryInfoNV],
) -> VkResult<()> {
self.ray_tracing_fn
self.fp
.bind_acceleration_structure_memory_nv(
self.handle,
bind_info.len() as u32,
bind_info.as_ptr(),
)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdBuildAccelerationStructureNV.html>"]
@ -106,7 +103,7 @@ impl RayTracing {
scratch: vk::Buffer,
scratch_offset: vk::DeviceSize,
) {
self.ray_tracing_fn.cmd_build_acceleration_structure_nv(
self.fp.cmd_build_acceleration_structure_nv(
command_buffer,
info,
instance_data,
@ -127,7 +124,7 @@ impl RayTracing {
src: vk::AccelerationStructureNV,
mode: vk::CopyAccelerationStructureModeNV,
) {
self.ray_tracing_fn
self.fp
.cmd_copy_acceleration_structure_nv(command_buffer, dst, src, mode);
}
@ -150,7 +147,7 @@ impl RayTracing {
height: u32,
depth: u32,
) {
self.ray_tracing_fn.cmd_trace_rays_nv(
self.fp.cmd_trace_rays_nv(
command_buffer,
raygen_shader_binding_table_buffer,
raygen_shader_binding_offset,
@ -177,7 +174,7 @@ impl RayTracing {
allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<Vec<vk::Pipeline>> {
let mut pipelines = vec![mem::zeroed(); create_info.len()];
self.ray_tracing_fn
self.fp
.create_ray_tracing_pipelines_nv(
self.handle,
pipeline_cache,
@ -197,7 +194,7 @@ impl RayTracing {
group_count: u32,
data: &mut [u8],
) -> VkResult<()> {
self.ray_tracing_fn
self.fp
.get_ray_tracing_shader_group_handles_nv(
self.handle,
pipeline,
@ -206,7 +203,7 @@ impl RayTracing {
data.len(),
data.as_mut_ptr() as *mut std::ffi::c_void,
)
.into()
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetAccelerationStructureHandleNV.html>"]
@ -216,7 +213,7 @@ impl RayTracing {
) -> VkResult<u64> {
let mut handle: u64 = 0;
let handle_ptr: *mut u64 = &mut handle;
self.ray_tracing_fn
self.fp
.get_acceleration_structure_handle_nv(
self.handle,
accel_struct,
@ -235,22 +232,21 @@ impl RayTracing {
query_pool: vk::QueryPool,
first_query: u32,
) {
self.ray_tracing_fn
.cmd_write_acceleration_structures_properties_nv(
command_buffer,
structures.len() as u32,
structures.as_ptr(),
query_type,
query_pool,
first_query,
);
self.fp.cmd_write_acceleration_structures_properties_nv(
command_buffer,
structures.len() as u32,
structures.as_ptr(),
query_type,
query_pool,
first_query,
);
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCompileDeferredNV.html>"]
pub unsafe fn compile_deferred(&self, pipeline: vk::Pipeline, shader: u32) -> VkResult<()> {
self.ray_tracing_fn
self.fp
.compile_deferred_nv(self.handle, pipeline, shader)
.into()
.result()
}
pub fn name() -> &'static CStr {
@ -258,7 +254,7 @@ impl RayTracing {
}
pub fn fp(&self) -> &vk::NvRayTracingFn {
&self.ray_tracing_fn
&self.fp
}
pub fn device(&self) -> vk::Device {

34
third_party/rust/ash/src/instance.rs поставляемый
Просмотреть файл

@ -22,7 +22,7 @@ impl Instance {
mem::transmute(static_fn.get_instance_proc_addr(instance, name.as_ptr()))
};
Instance {
Self {
handle: instance,
instance_fn_1_0: vk::InstanceFnV1_0::load(load_fn),
@ -51,6 +51,7 @@ impl Instance {
&self.instance_fn_1_1
}
/// Retrieve the number of elements to pass to [`Self::enumerate_physical_device_groups()`]
pub unsafe fn enumerate_physical_device_groups_len(&self) -> VkResult<usize> {
let mut group_count = 0;
self.instance_fn_1_1
@ -59,16 +60,17 @@ impl Instance {
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumeratePhysicalDeviceGroups.html>"]
pub fn enumerate_physical_device_groups(
///
/// Call [`Self::enumerate_physical_device_groups_len()`] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
pub unsafe fn enumerate_physical_device_groups(
&self,
out: &mut [vk::PhysicalDeviceGroupProperties],
) -> VkResult<()> {
unsafe {
let mut group_count = out.len() as u32;
self.instance_fn_1_1
.enumerate_physical_device_groups(self.handle(), &mut group_count, out.as_mut_ptr())
.into()
}
let mut group_count = out.len() as u32;
self.instance_fn_1_1
.enumerate_physical_device_groups(self.handle(), &mut group_count, out.as_mut_ptr())
.result()
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceFeatures2.html>"]
@ -115,9 +117,10 @@ impl Instance {
format_info,
image_format_prop,
)
.into()
.result()
}
/// Retrieve the number of elements to pass to [`Self::get_physical_device_queue_family_properties2()`]
pub unsafe fn get_physical_device_queue_family_properties2_len(
&self,
physical_device: vk::PhysicalDevice,
@ -133,17 +136,20 @@ impl Instance {
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceQueueFamilyProperties2.html>"]
///
/// Call [`Self::get_physical_device_queue_family_properties2_len()`] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
pub unsafe fn get_physical_device_queue_family_properties2(
&self,
physical_device: vk::PhysicalDevice,
queue_family_props: &mut [vk::QueueFamilyProperties2],
out: &mut [vk::QueueFamilyProperties2],
) {
let mut queue_count = queue_family_props.len() as u32;
let mut queue_count = out.len() as u32;
self.instance_fn_1_1
.get_physical_device_queue_family_properties2(
physical_device,
&mut queue_count,
queue_family_props.as_mut_ptr(),
out.as_mut_ptr(),
);
}
@ -157,6 +163,7 @@ impl Instance {
.get_physical_device_memory_properties2(physical_device, out);
}
/// Retrieve the number of elements to pass to [`Self::get_physical_device_sparse_image_format_properties2()`]
pub unsafe fn get_physical_device_sparse_image_format_properties2_len(
&self,
physical_device: vk::PhysicalDevice,
@ -174,6 +181,9 @@ impl Instance {
}
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceSparseImageFormatProperties2.html>"]
///
/// Call [`Self::get_physical_device_sparse_image_format_properties2_len()`] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
pub unsafe fn get_physical_device_sparse_image_format_properties2(
&self,
physical_device: vk::PhysicalDevice,

21
third_party/rust/ash/src/lib.rs поставляемый
Просмотреть файл

@ -1,8 +1,10 @@
#![deny(clippy::use_self)]
#![allow(
clippy::too_many_arguments,
clippy::missing_safety_doc,
clippy::upper_case_acronyms
)]
#![cfg_attr(docsrs, feature(doc_cfg))]
//! # Vulkan API
//!
//! <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/index.html>
@ -12,7 +14,7 @@
//! ```no_run
//! use ash::{vk, Entry};
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let entry = unsafe { Entry::new() }?;
//! let entry = Entry::linked();
//! let app_info = vk::ApplicationInfo {
//! api_version: vk::make_api_version(0, 1, 0, 0),
//! ..Default::default()
@ -26,22 +28,19 @@
//! ```
//!
//! ## Getting started
//! Load the Vulkan library at the default location using [`Entry::new()`][EntryCustom<_>::new()],
//! or at a custom location using [`Entry::with_library("path/to/vulkan")`][EntryCustom<_>::with_library()].
//! These loaders use [`libloading`]. If you wish to perform function loading yourself
//! call [`EntryCustom::new_custom()`] with a closure turning function names
//! into function pointers.
//!
//! Load the Vulkan library linked at compile time using [`Entry::linked()`], or load it at runtime
//! using [`Entry::load()`], which uses `libloading`. If you want to perform entry point loading
//! yourself, call [`Entry::from_static_fn()`].
pub use crate::device::Device;
pub use crate::entry::{EntryCustom, InstanceError};
#[cfg(feature = "libloading")]
pub use crate::entry_libloading::{Entry, LoadingError};
pub use crate::entry::Entry;
#[cfg(feature = "loaded")]
pub use crate::entry::LoadingError;
pub use crate::instance::Instance;
mod device;
mod entry;
#[cfg(feature = "libloading")]
mod entry_libloading;
mod instance;
pub mod prelude;
pub mod util;

38
third_party/rust/ash/src/prelude.rs поставляемый
Просмотреть файл

@ -1,14 +1,10 @@
use std::convert::TryInto;
#[cfg(feature = "debug")]
use std::fmt;
use crate::vk;
pub type VkResult<T> = Result<T, vk::Result>;
impl From<vk::Result> for VkResult<()> {
fn from(err_code: vk::Result) -> Self {
err_code.result()
}
}
impl vk::Result {
pub fn result(self) -> VkResult<()> {
self.result_with_success(())
@ -16,7 +12,7 @@ impl vk::Result {
pub fn result_with_success<T>(self, v: T) -> VkResult<T> {
match self {
vk::Result::SUCCESS => Ok(v),
Self::SUCCESS => Ok(v),
_ => Err(self),
}
}
@ -87,3 +83,31 @@ where
}
}
}
#[cfg(feature = "debug")]
pub(crate) fn debug_flags<Value: Into<u64> + Copy>(
f: &mut fmt::Formatter,
known: &[(Value, &'static str)],
value: Value,
) -> fmt::Result {
let mut first = true;
let mut accum = value.into();
for &(bit, name) in known {
let bit = bit.into();
if bit != 0 && accum & bit == bit {
if !first {
f.write_str(" | ")?;
}
f.write_str(name)?;
first = false;
accum &= !bit;
}
}
if accum != 0 {
if !first {
f.write_str(" | ")?;
}
write!(f, "{:b}", accum)?;
}
Ok(())
}

2
third_party/rust/ash/src/util.rs поставляемый
Просмотреть файл

@ -51,7 +51,7 @@ impl<T> Align<T> {
let padding = calc_padding(size_of::<T>() as vk::DeviceSize, alignment);
let elem_size = size_of::<T>() as vk::DeviceSize + padding;
assert!(calc_padding(size, alignment) == 0, "size must be aligned");
Align {
Self {
ptr,
elem_size,
size,

10
third_party/rust/ash/src/vk.rs поставляемый
Просмотреть файл

@ -10,8 +10,8 @@ mod aliases;
pub use aliases::*;
mod bitflags;
pub use bitflags::*;
#[cfg(feature = "debug")]
mod const_debugs;
pub(crate) use const_debugs::*;
mod constants;
pub use constants::*;
mod definitions;
@ -24,14 +24,16 @@ mod feature_extensions;
pub use feature_extensions::*;
mod features;
pub use features::*;
#[doc = r" Native bindings from Vulkan headers, generated by bindgen"]
mod prelude;
pub use prelude::*;
/// Native bindings from Vulkan headers, generated by bindgen
#[allow(nonstandard_style)]
#[allow(deref_nullptr)]
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."]
#[doc = r" Stops at the last `BaseOutStructure` that has a null `p_next` field."]
/// Iterates through the pointer chain. Includes the item that is passed into the function.
/// Stops at the last [`BaseOutStructure`] that has a null [`BaseOutStructure::p_next`] field.
pub(crate) unsafe fn ptr_chain_iter<T>(ptr: &mut T) -> impl Iterator<Item = *mut BaseOutStructure> {
let ptr: *mut BaseOutStructure = ptr as *mut T as _;
(0..).scan(ptr, |p_ptr, _| {

1
third_party/rust/ash/src/vk/aliases.rs поставляемый
Просмотреть файл

@ -164,3 +164,4 @@ pub type DeviceMemoryOpaqueCaptureAddressInfoKHR = DeviceMemoryOpaqueCaptureAddr
pub type AabbPositionsNV = AabbPositionsKHR;
pub type TransformMatrixNV = TransformMatrixKHR;
pub type AccelerationStructureInstanceNV = AccelerationStructureInstanceKHR;
pub type AttachmentSampleCountInfoNV = AttachmentSampleCountInfoAMD;

352
third_party/rust/ash/src/vk/bitflags.rs поставляемый
Просмотреть файл

@ -3,13 +3,13 @@ use crate::vk::definitions::*;
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineCacheCreateFlagBits.html>"]
pub struct PipelineCacheCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(PipelineCacheCreateFlags, 0b0, Flags);
vk_bitflags_wrapped!(PipelineCacheCreateFlags, Flags);
impl PipelineCacheCreateFlags {}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkQueueFlagBits.html>"]
pub struct QueueFlags(pub(crate) Flags);
vk_bitflags_wrapped!(QueueFlags, 0b1111, Flags);
vk_bitflags_wrapped!(QueueFlags, Flags);
impl QueueFlags {
#[doc = "Queue supports graphics operations"]
pub const GRAPHICS: Self = Self(0b1);
@ -24,7 +24,7 @@ impl QueueFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkCullModeFlagBits.html>"]
pub struct CullModeFlags(pub(crate) Flags);
vk_bitflags_wrapped!(CullModeFlags, 0b11, Flags);
vk_bitflags_wrapped!(CullModeFlags, Flags);
impl CullModeFlags {
pub const NONE: Self = Self(0);
pub const FRONT: Self = Self(0b1);
@ -35,19 +35,19 @@ impl CullModeFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkRenderPassCreateFlagBits.html>"]
pub struct RenderPassCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(RenderPassCreateFlags, 0b0, Flags);
vk_bitflags_wrapped!(RenderPassCreateFlags, Flags);
impl RenderPassCreateFlags {}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDeviceQueueCreateFlagBits.html>"]
pub struct DeviceQueueCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(DeviceQueueCreateFlags, 0b0, Flags);
vk_bitflags_wrapped!(DeviceQueueCreateFlags, Flags);
impl DeviceQueueCreateFlags {}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkMemoryPropertyFlagBits.html>"]
pub struct MemoryPropertyFlags(pub(crate) Flags);
vk_bitflags_wrapped!(MemoryPropertyFlags, 0b1_1111, Flags);
vk_bitflags_wrapped!(MemoryPropertyFlags, Flags);
impl MemoryPropertyFlags {
#[doc = "If otherwise stated, then allocate memory on device"]
pub const DEVICE_LOCAL: Self = Self(0b1);
@ -64,7 +64,7 @@ impl MemoryPropertyFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkMemoryHeapFlagBits.html>"]
pub struct MemoryHeapFlags(pub(crate) Flags);
vk_bitflags_wrapped!(MemoryHeapFlags, 0b1, Flags);
vk_bitflags_wrapped!(MemoryHeapFlags, Flags);
impl MemoryHeapFlags {
#[doc = "If set, heap represents device memory"]
pub const DEVICE_LOCAL: Self = Self(0b1);
@ -73,7 +73,7 @@ impl MemoryHeapFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAccessFlagBits.html>"]
pub struct AccessFlags(pub(crate) Flags);
vk_bitflags_wrapped!(AccessFlags, 0b1_1111_1111_1111_1111, Flags);
vk_bitflags_wrapped!(AccessFlags, Flags);
impl AccessFlags {
#[doc = "Controls coherency of indirect command reads"]
pub const INDIRECT_COMMAND_READ: Self = Self(0b1);
@ -114,7 +114,7 @@ impl AccessFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBufferUsageFlagBits.html>"]
pub struct BufferUsageFlags(pub(crate) Flags);
vk_bitflags_wrapped!(BufferUsageFlags, 0b1_1111_1111, Flags);
vk_bitflags_wrapped!(BufferUsageFlags, Flags);
impl BufferUsageFlags {
#[doc = "Can be used as a source of transfer operations"]
pub const TRANSFER_SRC: Self = Self(0b1);
@ -139,7 +139,7 @@ impl BufferUsageFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBufferCreateFlagBits.html>"]
pub struct BufferCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(BufferCreateFlags, 0b111, Flags);
vk_bitflags_wrapped!(BufferCreateFlags, Flags);
impl BufferCreateFlags {
#[doc = "Buffer should support sparse backing"]
pub const SPARSE_BINDING: Self = Self(0b1);
@ -152,11 +152,7 @@ impl BufferCreateFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkShaderStageFlagBits.html>"]
pub struct ShaderStageFlags(pub(crate) Flags);
vk_bitflags_wrapped!(
ShaderStageFlags,
0b111_1111_1111_1111_1111_1111_1111_1111,
Flags
);
vk_bitflags_wrapped!(ShaderStageFlags, Flags);
impl ShaderStageFlags {
pub const VERTEX: Self = Self(0b1);
pub const TESSELLATION_CONTROL: Self = Self(0b10);
@ -171,7 +167,7 @@ impl ShaderStageFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImageUsageFlagBits.html>"]
pub struct ImageUsageFlags(pub(crate) Flags);
vk_bitflags_wrapped!(ImageUsageFlags, 0b1111_1111, Flags);
vk_bitflags_wrapped!(ImageUsageFlags, Flags);
impl ImageUsageFlags {
#[doc = "Can be used as a source of transfer operations"]
pub const TRANSFER_SRC: Self = Self(0b1);
@ -194,7 +190,7 @@ impl ImageUsageFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImageCreateFlagBits.html>"]
pub struct ImageCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(ImageCreateFlags, 0b1_1111, Flags);
vk_bitflags_wrapped!(ImageCreateFlags, Flags);
impl ImageCreateFlags {
#[doc = "Image should support sparse backing"]
pub const SPARSE_BINDING: Self = Self(0b1);
@ -211,19 +207,19 @@ impl ImageCreateFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImageViewCreateFlagBits.html>"]
pub struct ImageViewCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(ImageViewCreateFlags, 0b0, Flags);
vk_bitflags_wrapped!(ImageViewCreateFlags, Flags);
impl ImageViewCreateFlags {}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSamplerCreateFlagBits.html>"]
pub struct SamplerCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(SamplerCreateFlags, 0b0, Flags);
vk_bitflags_wrapped!(SamplerCreateFlags, Flags);
impl SamplerCreateFlags {}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineCreateFlagBits.html>"]
pub struct PipelineCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(PipelineCreateFlags, 0b111, Flags);
vk_bitflags_wrapped!(PipelineCreateFlags, Flags);
impl PipelineCreateFlags {
pub const DISABLE_OPTIMIZATION: Self = Self(0b1);
pub const ALLOW_DERIVATIVES: Self = Self(0b10);
@ -233,13 +229,13 @@ impl PipelineCreateFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineShaderStageCreateFlagBits.html>"]
pub struct PipelineShaderStageCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(PipelineShaderStageCreateFlags, 0b0, Flags);
vk_bitflags_wrapped!(PipelineShaderStageCreateFlags, Flags);
impl PipelineShaderStageCreateFlags {}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkColorComponentFlagBits.html>"]
pub struct ColorComponentFlags(pub(crate) Flags);
vk_bitflags_wrapped!(ColorComponentFlags, 0b1111, Flags);
vk_bitflags_wrapped!(ColorComponentFlags, Flags);
impl ColorComponentFlags {
pub const R: Self = Self(0b1);
pub const G: Self = Self(0b10);
@ -250,7 +246,7 @@ impl ColorComponentFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkFenceCreateFlagBits.html>"]
pub struct FenceCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(FenceCreateFlags, 0b1, Flags);
vk_bitflags_wrapped!(FenceCreateFlags, Flags);
impl FenceCreateFlags {
pub const SIGNALED: Self = Self(0b1);
}
@ -258,13 +254,13 @@ impl FenceCreateFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSemaphoreCreateFlagBits.html>"]
pub struct SemaphoreCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(SemaphoreCreateFlags, 0b0, Flags);
vk_bitflags_wrapped!(SemaphoreCreateFlags, Flags);
impl SemaphoreCreateFlags {}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkFormatFeatureFlagBits.html>"]
pub struct FormatFeatureFlags(pub(crate) Flags);
vk_bitflags_wrapped!(FormatFeatureFlags, 0b1_1111_1111_1111, Flags);
vk_bitflags_wrapped!(FormatFeatureFlags, Flags);
impl FormatFeatureFlags {
#[doc = "Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)"]
pub const SAMPLED_IMAGE: Self = Self(0b1);
@ -297,7 +293,7 @@ impl FormatFeatureFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkQueryControlFlagBits.html>"]
pub struct QueryControlFlags(pub(crate) Flags);
vk_bitflags_wrapped!(QueryControlFlags, 0b1, Flags);
vk_bitflags_wrapped!(QueryControlFlags, Flags);
impl QueryControlFlags {
#[doc = "Require precise results to be collected by the query"]
pub const PRECISE: Self = Self(0b1);
@ -306,7 +302,7 @@ impl QueryControlFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkQueryResultFlagBits.html>"]
pub struct QueryResultFlags(pub(crate) Flags);
vk_bitflags_wrapped!(QueryResultFlags, 0b1111, Flags);
vk_bitflags_wrapped!(QueryResultFlags, Flags);
impl QueryResultFlags {
#[doc = "Results of the queries are written to the destination buffer as 64-bit values"]
pub const TYPE_64: Self = Self(0b1);
@ -321,7 +317,7 @@ impl QueryResultFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkCommandBufferUsageFlagBits.html>"]
pub struct CommandBufferUsageFlags(pub(crate) Flags);
vk_bitflags_wrapped!(CommandBufferUsageFlags, 0b111, Flags);
vk_bitflags_wrapped!(CommandBufferUsageFlags, Flags);
impl CommandBufferUsageFlags {
pub const ONE_TIME_SUBMIT: Self = Self(0b1);
pub const RENDER_PASS_CONTINUE: Self = Self(0b10);
@ -332,7 +328,7 @@ impl CommandBufferUsageFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkQueryPipelineStatisticFlagBits.html>"]
pub struct QueryPipelineStatisticFlags(pub(crate) Flags);
vk_bitflags_wrapped!(QueryPipelineStatisticFlags, 0b111_1111_1111, Flags);
vk_bitflags_wrapped!(QueryPipelineStatisticFlags, Flags);
impl QueryPipelineStatisticFlags {
#[doc = "Optional"]
pub const INPUT_ASSEMBLY_VERTICES: Self = Self(0b1);
@ -361,7 +357,7 @@ impl QueryPipelineStatisticFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImageAspectFlagBits.html>"]
pub struct ImageAspectFlags(pub(crate) Flags);
vk_bitflags_wrapped!(ImageAspectFlags, 0b1111, Flags);
vk_bitflags_wrapped!(ImageAspectFlags, Flags);
impl ImageAspectFlags {
pub const COLOR: Self = Self(0b1);
pub const DEPTH: Self = Self(0b10);
@ -372,7 +368,7 @@ impl ImageAspectFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSparseImageFormatFlagBits.html>"]
pub struct SparseImageFormatFlags(pub(crate) Flags);
vk_bitflags_wrapped!(SparseImageFormatFlags, 0b111, Flags);
vk_bitflags_wrapped!(SparseImageFormatFlags, Flags);
impl SparseImageFormatFlags {
#[doc = "Image uses a single mip tail region for all array layers"]
pub const SINGLE_MIPTAIL: Self = Self(0b1);
@ -385,7 +381,7 @@ impl SparseImageFormatFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSparseMemoryBindFlagBits.html>"]
pub struct SparseMemoryBindFlags(pub(crate) Flags);
vk_bitflags_wrapped!(SparseMemoryBindFlags, 0b1, Flags);
vk_bitflags_wrapped!(SparseMemoryBindFlags, Flags);
impl SparseMemoryBindFlags {
#[doc = "Operation binds resource metadata to memory"]
pub const METADATA: Self = Self(0b1);
@ -394,7 +390,7 @@ impl SparseMemoryBindFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineStageFlagBits.html>"]
pub struct PipelineStageFlags(pub(crate) Flags);
vk_bitflags_wrapped!(PipelineStageFlags, 0b1_1111_1111_1111_1111, Flags);
vk_bitflags_wrapped!(PipelineStageFlags, Flags);
impl PipelineStageFlags {
#[doc = "Before subsequent commands are processed"]
pub const TOP_OF_PIPE: Self = Self(0b1);
@ -435,7 +431,7 @@ impl PipelineStageFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkCommandPoolCreateFlagBits.html>"]
pub struct CommandPoolCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(CommandPoolCreateFlags, 0b11, Flags);
vk_bitflags_wrapped!(CommandPoolCreateFlags, Flags);
impl CommandPoolCreateFlags {
#[doc = "Command buffers have a short lifetime"]
pub const TRANSIENT: Self = Self(0b1);
@ -446,7 +442,7 @@ impl CommandPoolCreateFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkCommandPoolResetFlagBits.html>"]
pub struct CommandPoolResetFlags(pub(crate) Flags);
vk_bitflags_wrapped!(CommandPoolResetFlags, 0b1, Flags);
vk_bitflags_wrapped!(CommandPoolResetFlags, Flags);
impl CommandPoolResetFlags {
#[doc = "Release resources owned by the pool"]
pub const RELEASE_RESOURCES: Self = Self(0b1);
@ -455,7 +451,7 @@ impl CommandPoolResetFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkCommandBufferResetFlagBits.html>"]
pub struct CommandBufferResetFlags(pub(crate) Flags);
vk_bitflags_wrapped!(CommandBufferResetFlags, 0b1, Flags);
vk_bitflags_wrapped!(CommandBufferResetFlags, Flags);
impl CommandBufferResetFlags {
#[doc = "Release resources owned by the buffer"]
pub const RELEASE_RESOURCES: Self = Self(0b1);
@ -464,7 +460,7 @@ impl CommandBufferResetFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSampleCountFlagBits.html>"]
pub struct SampleCountFlags(pub(crate) Flags);
vk_bitflags_wrapped!(SampleCountFlags, 0b111_1111, Flags);
vk_bitflags_wrapped!(SampleCountFlags, Flags);
impl SampleCountFlags {
#[doc = "Sample count 1 supported"]
pub const TYPE_1: Self = Self(0b1);
@ -485,7 +481,7 @@ impl SampleCountFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAttachmentDescriptionFlagBits.html>"]
pub struct AttachmentDescriptionFlags(pub(crate) Flags);
vk_bitflags_wrapped!(AttachmentDescriptionFlags, 0b1, Flags);
vk_bitflags_wrapped!(AttachmentDescriptionFlags, Flags);
impl AttachmentDescriptionFlags {
#[doc = "The attachment may alias physical memory of another attachment in the same render pass"]
pub const MAY_ALIAS: Self = Self(0b1);
@ -494,7 +490,7 @@ impl AttachmentDescriptionFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkStencilFaceFlagBits.html>"]
pub struct StencilFaceFlags(pub(crate) Flags);
vk_bitflags_wrapped!(StencilFaceFlags, 0b11, Flags);
vk_bitflags_wrapped!(StencilFaceFlags, Flags);
impl StencilFaceFlags {
#[doc = "Front face"]
pub const FRONT: Self = Self(0b1);
@ -502,14 +498,12 @@ impl StencilFaceFlags {
pub const BACK: Self = Self(0b10);
#[doc = "Front and back faces"]
pub const FRONT_AND_BACK: Self = Self(0x0000_0003);
#[deprecated = "Alias for backwards compatibility"]
pub const STENCIL_FRONT_AND_BACK: Self = Self::FRONT_AND_BACK;
}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorPoolCreateFlagBits.html>"]
pub struct DescriptorPoolCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(DescriptorPoolCreateFlags, 0b1, Flags);
vk_bitflags_wrapped!(DescriptorPoolCreateFlags, Flags);
impl DescriptorPoolCreateFlags {
#[doc = "Descriptor sets may be freed individually"]
pub const FREE_DESCRIPTOR_SET: Self = Self(0b1);
@ -518,7 +512,7 @@ impl DescriptorPoolCreateFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDependencyFlagBits.html>"]
pub struct DependencyFlags(pub(crate) Flags);
vk_bitflags_wrapped!(DependencyFlags, 0b1, Flags);
vk_bitflags_wrapped!(DependencyFlags, Flags);
impl DependencyFlags {
#[doc = "Dependency is per pixel region "]
pub const BY_REGION: Self = Self(0b1);
@ -527,7 +521,7 @@ impl DependencyFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSemaphoreWaitFlagBits.html>"]
pub struct SemaphoreWaitFlags(pub(crate) Flags);
vk_bitflags_wrapped!(SemaphoreWaitFlags, 0b1, Flags);
vk_bitflags_wrapped!(SemaphoreWaitFlags, Flags);
impl SemaphoreWaitFlags {
pub const ANY: Self = Self(0b1);
}
@ -535,7 +529,7 @@ impl SemaphoreWaitFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDisplayPlaneAlphaFlagBitsKHR.html>"]
pub struct DisplayPlaneAlphaFlagsKHR(pub(crate) Flags);
vk_bitflags_wrapped!(DisplayPlaneAlphaFlagsKHR, 0b1111, Flags);
vk_bitflags_wrapped!(DisplayPlaneAlphaFlagsKHR, Flags);
impl DisplayPlaneAlphaFlagsKHR {
pub const OPAQUE: Self = Self(0b1);
pub const GLOBAL: Self = Self(0b10);
@ -546,7 +540,7 @@ impl DisplayPlaneAlphaFlagsKHR {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkCompositeAlphaFlagBitsKHR.html>"]
pub struct CompositeAlphaFlagsKHR(pub(crate) Flags);
vk_bitflags_wrapped!(CompositeAlphaFlagsKHR, 0b1111, Flags);
vk_bitflags_wrapped!(CompositeAlphaFlagsKHR, Flags);
impl CompositeAlphaFlagsKHR {
pub const OPAQUE: Self = Self(0b1);
pub const PRE_MULTIPLIED: Self = Self(0b10);
@ -557,7 +551,7 @@ impl CompositeAlphaFlagsKHR {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSurfaceTransformFlagBitsKHR.html>"]
pub struct SurfaceTransformFlagsKHR(pub(crate) Flags);
vk_bitflags_wrapped!(SurfaceTransformFlagsKHR, 0b1_1111_1111, Flags);
vk_bitflags_wrapped!(SurfaceTransformFlagsKHR, Flags);
impl SurfaceTransformFlagsKHR {
pub const IDENTITY: Self = Self(0b1);
pub const ROTATE_90: Self = Self(0b10);
@ -573,7 +567,7 @@ impl SurfaceTransformFlagsKHR {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSwapchainImageUsageFlagBitsANDROID.html>"]
pub struct SwapchainImageUsageFlagsANDROID(pub(crate) Flags);
vk_bitflags_wrapped!(SwapchainImageUsageFlagsANDROID, 0b1, Flags);
vk_bitflags_wrapped!(SwapchainImageUsageFlagsANDROID, Flags);
impl SwapchainImageUsageFlagsANDROID {
pub const SHARED: Self = Self(0b1);
}
@ -581,7 +575,7 @@ impl SwapchainImageUsageFlagsANDROID {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDebugReportFlagBitsEXT.html>"]
pub struct DebugReportFlagsEXT(pub(crate) Flags);
vk_bitflags_wrapped!(DebugReportFlagsEXT, 0b1_1111, Flags);
vk_bitflags_wrapped!(DebugReportFlagsEXT, Flags);
impl DebugReportFlagsEXT {
pub const INFORMATION: Self = Self(0b1);
pub const WARNING: Self = Self(0b10);
@ -593,7 +587,7 @@ impl DebugReportFlagsEXT {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkExternalMemoryHandleTypeFlagBitsNV.html>"]
pub struct ExternalMemoryHandleTypeFlagsNV(pub(crate) Flags);
vk_bitflags_wrapped!(ExternalMemoryHandleTypeFlagsNV, 0b1111, Flags);
vk_bitflags_wrapped!(ExternalMemoryHandleTypeFlagsNV, Flags);
impl ExternalMemoryHandleTypeFlagsNV {
pub const OPAQUE_WIN32: Self = Self(0b1);
pub const OPAQUE_WIN32_KMT: Self = Self(0b10);
@ -604,7 +598,7 @@ impl ExternalMemoryHandleTypeFlagsNV {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkExternalMemoryFeatureFlagBitsNV.html>"]
pub struct ExternalMemoryFeatureFlagsNV(pub(crate) Flags);
vk_bitflags_wrapped!(ExternalMemoryFeatureFlagsNV, 0b111, Flags);
vk_bitflags_wrapped!(ExternalMemoryFeatureFlagsNV, Flags);
impl ExternalMemoryFeatureFlagsNV {
pub const DEDICATED_ONLY: Self = Self(0b1);
pub const EXPORTABLE: Self = Self(0b10);
@ -614,7 +608,7 @@ impl ExternalMemoryFeatureFlagsNV {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSubgroupFeatureFlagBits.html>"]
pub struct SubgroupFeatureFlags(pub(crate) Flags);
vk_bitflags_wrapped!(SubgroupFeatureFlags, 0b1111_1111, Flags);
vk_bitflags_wrapped!(SubgroupFeatureFlags, Flags);
impl SubgroupFeatureFlags {
#[doc = "Basic subgroup operations"]
pub const BASIC: Self = Self(0b1);
@ -637,7 +631,7 @@ impl SubgroupFeatureFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkIndirectCommandsLayoutUsageFlagBitsNV.html>"]
pub struct IndirectCommandsLayoutUsageFlagsNV(pub(crate) Flags);
vk_bitflags_wrapped!(IndirectCommandsLayoutUsageFlagsNV, 0b111, Flags);
vk_bitflags_wrapped!(IndirectCommandsLayoutUsageFlagsNV, Flags);
impl IndirectCommandsLayoutUsageFlagsNV {
pub const EXPLICIT_PREPROCESS: Self = Self(0b1);
pub const INDEXED_SEQUENCES: Self = Self(0b10);
@ -647,7 +641,7 @@ impl IndirectCommandsLayoutUsageFlagsNV {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkIndirectStateFlagBitsNV.html>"]
pub struct IndirectStateFlagsNV(pub(crate) Flags);
vk_bitflags_wrapped!(IndirectStateFlagsNV, 0b1, Flags);
vk_bitflags_wrapped!(IndirectStateFlagsNV, Flags);
impl IndirectStateFlagsNV {
pub const FLAG_FRONTFACE: Self = Self(0b1);
}
@ -655,19 +649,19 @@ impl IndirectStateFlagsNV {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPrivateDataSlotCreateFlagBitsEXT.html>"]
pub struct PrivateDataSlotCreateFlagsEXT(pub(crate) Flags);
vk_bitflags_wrapped!(PrivateDataSlotCreateFlagsEXT, 0b0, Flags);
vk_bitflags_wrapped!(PrivateDataSlotCreateFlagsEXT, Flags);
impl PrivateDataSlotCreateFlagsEXT {}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorSetLayoutCreateFlagBits.html>"]
pub struct DescriptorSetLayoutCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(DescriptorSetLayoutCreateFlags, 0b0, Flags);
vk_bitflags_wrapped!(DescriptorSetLayoutCreateFlags, Flags);
impl DescriptorSetLayoutCreateFlags {}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkExternalMemoryHandleTypeFlagBits.html>"]
pub struct ExternalMemoryHandleTypeFlags(pub(crate) Flags);
vk_bitflags_wrapped!(ExternalMemoryHandleTypeFlags, 0b111_1111, Flags);
vk_bitflags_wrapped!(ExternalMemoryHandleTypeFlags, Flags);
impl ExternalMemoryHandleTypeFlags {
pub const OPAQUE_FD: Self = Self(0b1);
pub const OPAQUE_WIN32: Self = Self(0b10);
@ -681,7 +675,7 @@ impl ExternalMemoryHandleTypeFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkExternalMemoryFeatureFlagBits.html>"]
pub struct ExternalMemoryFeatureFlags(pub(crate) Flags);
vk_bitflags_wrapped!(ExternalMemoryFeatureFlags, 0b111, Flags);
vk_bitflags_wrapped!(ExternalMemoryFeatureFlags, Flags);
impl ExternalMemoryFeatureFlags {
pub const DEDICATED_ONLY: Self = Self(0b1);
pub const EXPORTABLE: Self = Self(0b10);
@ -691,7 +685,7 @@ impl ExternalMemoryFeatureFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkExternalSemaphoreHandleTypeFlagBits.html>"]
pub struct ExternalSemaphoreHandleTypeFlags(pub(crate) Flags);
vk_bitflags_wrapped!(ExternalSemaphoreHandleTypeFlags, 0b1_1111, Flags);
vk_bitflags_wrapped!(ExternalSemaphoreHandleTypeFlags, Flags);
impl ExternalSemaphoreHandleTypeFlags {
pub const OPAQUE_FD: Self = Self(0b1);
pub const OPAQUE_WIN32: Self = Self(0b10);
@ -704,7 +698,7 @@ impl ExternalSemaphoreHandleTypeFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkExternalSemaphoreFeatureFlagBits.html>"]
pub struct ExternalSemaphoreFeatureFlags(pub(crate) Flags);
vk_bitflags_wrapped!(ExternalSemaphoreFeatureFlags, 0b11, Flags);
vk_bitflags_wrapped!(ExternalSemaphoreFeatureFlags, Flags);
impl ExternalSemaphoreFeatureFlags {
pub const EXPORTABLE: Self = Self(0b1);
pub const IMPORTABLE: Self = Self(0b10);
@ -713,7 +707,7 @@ impl ExternalSemaphoreFeatureFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSemaphoreImportFlagBits.html>"]
pub struct SemaphoreImportFlags(pub(crate) Flags);
vk_bitflags_wrapped!(SemaphoreImportFlags, 0b1, Flags);
vk_bitflags_wrapped!(SemaphoreImportFlags, Flags);
impl SemaphoreImportFlags {
pub const TEMPORARY: Self = Self(0b1);
}
@ -721,7 +715,7 @@ impl SemaphoreImportFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkExternalFenceHandleTypeFlagBits.html>"]
pub struct ExternalFenceHandleTypeFlags(pub(crate) Flags);
vk_bitflags_wrapped!(ExternalFenceHandleTypeFlags, 0b1111, Flags);
vk_bitflags_wrapped!(ExternalFenceHandleTypeFlags, Flags);
impl ExternalFenceHandleTypeFlags {
pub const OPAQUE_FD: Self = Self(0b1);
pub const OPAQUE_WIN32: Self = Self(0b10);
@ -732,7 +726,7 @@ impl ExternalFenceHandleTypeFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkExternalFenceFeatureFlagBits.html>"]
pub struct ExternalFenceFeatureFlags(pub(crate) Flags);
vk_bitflags_wrapped!(ExternalFenceFeatureFlags, 0b11, Flags);
vk_bitflags_wrapped!(ExternalFenceFeatureFlags, Flags);
impl ExternalFenceFeatureFlags {
pub const EXPORTABLE: Self = Self(0b1);
pub const IMPORTABLE: Self = Self(0b10);
@ -741,7 +735,7 @@ impl ExternalFenceFeatureFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkFenceImportFlagBits.html>"]
pub struct FenceImportFlags(pub(crate) Flags);
vk_bitflags_wrapped!(FenceImportFlags, 0b1, Flags);
vk_bitflags_wrapped!(FenceImportFlags, Flags);
impl FenceImportFlags {
pub const TEMPORARY: Self = Self(0b1);
}
@ -749,7 +743,7 @@ impl FenceImportFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSurfaceCounterFlagBitsEXT.html>"]
pub struct SurfaceCounterFlagsEXT(pub(crate) Flags);
vk_bitflags_wrapped!(SurfaceCounterFlagsEXT, 0b1, Flags);
vk_bitflags_wrapped!(SurfaceCounterFlagsEXT, Flags);
impl SurfaceCounterFlagsEXT {
pub const VBLANK: Self = Self(0b1);
}
@ -757,7 +751,7 @@ impl SurfaceCounterFlagsEXT {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPeerMemoryFeatureFlagBits.html>"]
pub struct PeerMemoryFeatureFlags(pub(crate) Flags);
vk_bitflags_wrapped!(PeerMemoryFeatureFlags, 0b1111, Flags);
vk_bitflags_wrapped!(PeerMemoryFeatureFlags, Flags);
impl PeerMemoryFeatureFlags {
#[doc = "Can read with vkCmdCopy commands"]
pub const COPY_SRC: Self = Self(0b1);
@ -772,7 +766,7 @@ impl PeerMemoryFeatureFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkMemoryAllocateFlagBits.html>"]
pub struct MemoryAllocateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(MemoryAllocateFlags, 0b1, Flags);
vk_bitflags_wrapped!(MemoryAllocateFlags, Flags);
impl MemoryAllocateFlags {
#[doc = "Force allocation on specific devices"]
pub const DEVICE_MASK: Self = Self(0b1);
@ -781,7 +775,7 @@ impl MemoryAllocateFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDeviceGroupPresentModeFlagBitsKHR.html>"]
pub struct DeviceGroupPresentModeFlagsKHR(pub(crate) Flags);
vk_bitflags_wrapped!(DeviceGroupPresentModeFlagsKHR, 0b1111, Flags);
vk_bitflags_wrapped!(DeviceGroupPresentModeFlagsKHR, Flags);
impl DeviceGroupPresentModeFlagsKHR {
#[doc = "Present from local memory"]
pub const LOCAL: Self = Self(0b1);
@ -796,19 +790,19 @@ impl DeviceGroupPresentModeFlagsKHR {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSwapchainCreateFlagBitsKHR.html>"]
pub struct SwapchainCreateFlagsKHR(pub(crate) Flags);
vk_bitflags_wrapped!(SwapchainCreateFlagsKHR, 0b0, Flags);
vk_bitflags_wrapped!(SwapchainCreateFlagsKHR, Flags);
impl SwapchainCreateFlagsKHR {}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSubpassDescriptionFlagBits.html>"]
pub struct SubpassDescriptionFlags(pub(crate) Flags);
vk_bitflags_wrapped!(SubpassDescriptionFlags, 0b0, Flags);
vk_bitflags_wrapped!(SubpassDescriptionFlags, Flags);
impl SubpassDescriptionFlags {}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDebugUtilsMessageSeverityFlagBitsEXT.html>"]
pub struct DebugUtilsMessageSeverityFlagsEXT(pub(crate) Flags);
vk_bitflags_wrapped!(DebugUtilsMessageSeverityFlagsEXT, 0b1_0001_0001_0001, Flags);
vk_bitflags_wrapped!(DebugUtilsMessageSeverityFlagsEXT, Flags);
impl DebugUtilsMessageSeverityFlagsEXT {
pub const VERBOSE: Self = Self(0b1);
pub const INFO: Self = Self(0b1_0000);
@ -819,7 +813,7 @@ impl DebugUtilsMessageSeverityFlagsEXT {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDebugUtilsMessageTypeFlagBitsEXT.html>"]
pub struct DebugUtilsMessageTypeFlagsEXT(pub(crate) Flags);
vk_bitflags_wrapped!(DebugUtilsMessageTypeFlagsEXT, 0b111, Flags);
vk_bitflags_wrapped!(DebugUtilsMessageTypeFlagsEXT, Flags);
impl DebugUtilsMessageTypeFlagsEXT {
pub const GENERAL: Self = Self(0b1);
pub const VALIDATION: Self = Self(0b10);
@ -829,7 +823,7 @@ impl DebugUtilsMessageTypeFlagsEXT {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDescriptorBindingFlagBits.html>"]
pub struct DescriptorBindingFlags(pub(crate) Flags);
vk_bitflags_wrapped!(DescriptorBindingFlags, 0b1111, Flags);
vk_bitflags_wrapped!(DescriptorBindingFlags, Flags);
impl DescriptorBindingFlags {
pub const UPDATE_AFTER_BIND: Self = Self(0b1);
pub const UPDATE_UNUSED_WHILE_PENDING: Self = Self(0b10);
@ -840,7 +834,7 @@ impl DescriptorBindingFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkConditionalRenderingFlagBitsEXT.html>"]
pub struct ConditionalRenderingFlagsEXT(pub(crate) Flags);
vk_bitflags_wrapped!(ConditionalRenderingFlagsEXT, 0b1, Flags);
vk_bitflags_wrapped!(ConditionalRenderingFlagsEXT, Flags);
impl ConditionalRenderingFlagsEXT {
pub const INVERTED: Self = Self(0b1);
}
@ -848,7 +842,7 @@ impl ConditionalRenderingFlagsEXT {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkResolveModeFlagBits.html>"]
pub struct ResolveModeFlags(pub(crate) Flags);
vk_bitflags_wrapped!(ResolveModeFlags, 0b1111, Flags);
vk_bitflags_wrapped!(ResolveModeFlags, Flags);
impl ResolveModeFlags {
pub const NONE: Self = Self(0);
pub const SAMPLE_ZERO: Self = Self(0b1);
@ -860,7 +854,7 @@ impl ResolveModeFlags {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkGeometryInstanceFlagBitsKHR.html>"]
pub struct GeometryInstanceFlagsKHR(pub(crate) Flags);
vk_bitflags_wrapped!(GeometryInstanceFlagsKHR, 0b1111, Flags);
vk_bitflags_wrapped!(GeometryInstanceFlagsKHR, Flags);
impl GeometryInstanceFlagsKHR {
pub const TRIANGLE_FACING_CULL_DISABLE: Self = Self(0b1);
pub const TRIANGLE_FLIP_FACING: Self = Self(0b10);
@ -872,7 +866,7 @@ impl GeometryInstanceFlagsKHR {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkGeometryFlagBitsKHR.html>"]
pub struct GeometryFlagsKHR(pub(crate) Flags);
vk_bitflags_wrapped!(GeometryFlagsKHR, 0b11, Flags);
vk_bitflags_wrapped!(GeometryFlagsKHR, Flags);
impl GeometryFlagsKHR {
pub const OPAQUE: Self = Self(0b1);
pub const NO_DUPLICATE_ANY_HIT_INVOCATION: Self = Self(0b10);
@ -881,7 +875,7 @@ impl GeometryFlagsKHR {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBuildAccelerationStructureFlagBitsKHR.html>"]
pub struct BuildAccelerationStructureFlagsKHR(pub(crate) Flags);
vk_bitflags_wrapped!(BuildAccelerationStructureFlagsKHR, 0b1_1111, Flags);
vk_bitflags_wrapped!(BuildAccelerationStructureFlagsKHR, Flags);
impl BuildAccelerationStructureFlagsKHR {
pub const ALLOW_UPDATE: Self = Self(0b1);
pub const ALLOW_COMPACTION: Self = Self(0b10);
@ -893,7 +887,7 @@ impl BuildAccelerationStructureFlagsKHR {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAccelerationStructureCreateFlagBitsKHR.html>"]
pub struct AccelerationStructureCreateFlagsKHR(pub(crate) Flags);
vk_bitflags_wrapped!(AccelerationStructureCreateFlagsKHR, 0b1, Flags);
vk_bitflags_wrapped!(AccelerationStructureCreateFlagsKHR, Flags);
impl AccelerationStructureCreateFlagsKHR {
pub const DEVICE_ADDRESS_CAPTURE_REPLAY: Self = Self(0b1);
}
@ -901,13 +895,13 @@ impl AccelerationStructureCreateFlagsKHR {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkFramebufferCreateFlagBits.html>"]
pub struct FramebufferCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(FramebufferCreateFlags, 0b0, Flags);
vk_bitflags_wrapped!(FramebufferCreateFlags, Flags);
impl FramebufferCreateFlags {}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDeviceDiagnosticsConfigFlagBitsNV.html>"]
pub struct DeviceDiagnosticsConfigFlagsNV(pub(crate) Flags);
vk_bitflags_wrapped!(DeviceDiagnosticsConfigFlagsNV, 0b111, Flags);
vk_bitflags_wrapped!(DeviceDiagnosticsConfigFlagsNV, Flags);
impl DeviceDiagnosticsConfigFlagsNV {
pub const ENABLE_SHADER_DEBUG_INFO: Self = Self(0b1);
pub const ENABLE_RESOURCE_TRACKING: Self = Self(0b10);
@ -917,7 +911,7 @@ impl DeviceDiagnosticsConfigFlagsNV {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineCreationFeedbackFlagBitsEXT.html>"]
pub struct PipelineCreationFeedbackFlagsEXT(pub(crate) Flags);
vk_bitflags_wrapped!(PipelineCreationFeedbackFlagsEXT, 0b111, Flags);
vk_bitflags_wrapped!(PipelineCreationFeedbackFlagsEXT, Flags);
impl PipelineCreationFeedbackFlagsEXT {
pub const VALID: Self = Self(0b1);
pub const APPLICATION_PIPELINE_CACHE_HIT: Self = Self(0b10);
@ -927,7 +921,7 @@ impl PipelineCreationFeedbackFlagsEXT {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPerformanceCounterDescriptionFlagBitsKHR.html>"]
pub struct PerformanceCounterDescriptionFlagsKHR(pub(crate) Flags);
vk_bitflags_wrapped!(PerformanceCounterDescriptionFlagsKHR, 0b11, Flags);
vk_bitflags_wrapped!(PerformanceCounterDescriptionFlagsKHR, Flags);
impl PerformanceCounterDescriptionFlagsKHR {
pub const PERFORMANCE_IMPACTING: Self = Self(0b1);
pub const CONCURRENTLY_IMPACTED: Self = Self(0b10);
@ -936,31 +930,31 @@ impl PerformanceCounterDescriptionFlagsKHR {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAcquireProfilingLockFlagBitsKHR.html>"]
pub struct AcquireProfilingLockFlagsKHR(pub(crate) Flags);
vk_bitflags_wrapped!(AcquireProfilingLockFlagsKHR, 0b0, Flags);
vk_bitflags_wrapped!(AcquireProfilingLockFlagsKHR, Flags);
impl AcquireProfilingLockFlagsKHR {}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkShaderCorePropertiesFlagBitsAMD.html>"]
pub struct ShaderCorePropertiesFlagsAMD(pub(crate) Flags);
vk_bitflags_wrapped!(ShaderCorePropertiesFlagsAMD, 0b0, Flags);
vk_bitflags_wrapped!(ShaderCorePropertiesFlagsAMD, Flags);
impl ShaderCorePropertiesFlagsAMD {}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkShaderModuleCreateFlagBits.html>"]
pub struct ShaderModuleCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(ShaderModuleCreateFlags, 0b0, Flags);
vk_bitflags_wrapped!(ShaderModuleCreateFlags, Flags);
impl ShaderModuleCreateFlags {}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineCompilerControlFlagBitsAMD.html>"]
pub struct PipelineCompilerControlFlagsAMD(pub(crate) Flags);
vk_bitflags_wrapped!(PipelineCompilerControlFlagsAMD, 0b0, Flags);
vk_bitflags_wrapped!(PipelineCompilerControlFlagsAMD, Flags);
impl PipelineCompilerControlFlagsAMD {}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkToolPurposeFlagBitsEXT.html>"]
pub struct ToolPurposeFlagsEXT(pub(crate) Flags);
vk_bitflags_wrapped!(ToolPurposeFlagsEXT, 0b1_1111, Flags);
vk_bitflags_wrapped!(ToolPurposeFlagsEXT, Flags);
impl ToolPurposeFlagsEXT {
pub const VALIDATION: Self = Self(0b1);
pub const PROFILING: Self = Self(0b10);
@ -972,11 +966,7 @@ impl ToolPurposeFlagsEXT {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAccessFlagBits2KHR.html>"]
pub struct AccessFlags2KHR(pub(crate) Flags64);
vk_bitflags_wrapped!(
AccessFlags2KHR,
0b111_0000_0000_0000_0001_1111_1111_1111_1111,
Flags64
);
vk_bitflags_wrapped!(AccessFlags2KHR, Flags64);
impl AccessFlags2KHR {
pub const NONE: Self = Self(0);
pub const INDIRECT_COMMAND_READ: Self = Self(0b1);
@ -1004,11 +994,7 @@ impl AccessFlags2KHR {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineStageFlagBits2KHR.html>"]
pub struct PipelineStageFlags2KHR(pub(crate) Flags64);
vk_bitflags_wrapped!(
PipelineStageFlags2KHR,
0b111_1111_0000_0000_0000_0001_1111_1111_1111_1111,
Flags64
);
vk_bitflags_wrapped!(PipelineStageFlags2KHR, Flags64);
impl PipelineStageFlags2KHR {
pub const NONE: Self = Self(0);
pub const TOP_OF_PIPE: Self = Self(0b1);
@ -1043,7 +1029,7 @@ impl PipelineStageFlags2KHR {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkSubmitFlagBitsKHR.html>"]
pub struct SubmitFlagsKHR(pub(crate) Flags);
vk_bitflags_wrapped!(SubmitFlagsKHR, 0b1, Flags);
vk_bitflags_wrapped!(SubmitFlagsKHR, Flags);
impl SubmitFlagsKHR {
pub const PROTECTED: Self = Self(0b1);
}
@ -1051,19 +1037,31 @@ impl SubmitFlagsKHR {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkEventCreateFlagBits.html>"]
pub struct EventCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(EventCreateFlags, 0b0, Flags);
vk_bitflags_wrapped!(EventCreateFlags, 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/VkPipelineLayoutCreateFlagBits.html>"]
pub struct PipelineLayoutCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(PipelineLayoutCreateFlags, 0b0, Flags);
vk_bitflags_wrapped!(PipelineLayoutCreateFlags, Flags);
impl PipelineLayoutCreateFlags {}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineColorBlendStateCreateFlagBits.html>"]
pub struct PipelineColorBlendStateCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(PipelineColorBlendStateCreateFlags, Flags);
impl PipelineColorBlendStateCreateFlags {}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineDepthStencilStateCreateFlagBits.html>"]
pub struct PipelineDepthStencilStateCreateFlags(pub(crate) Flags);
vk_bitflags_wrapped!(PipelineDepthStencilStateCreateFlags, Flags);
impl PipelineDepthStencilStateCreateFlags {}
#[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);
vk_bitflags_wrapped!(VideoCodecOperationFlagsKHR, Flags);
impl VideoCodecOperationFlagsKHR {
pub const INVALID: Self = Self(0);
}
@ -1071,7 +1069,7 @@ impl VideoCodecOperationFlagsKHR {
#[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);
vk_bitflags_wrapped!(VideoChromaSubsamplingFlagsKHR, Flags);
impl VideoChromaSubsamplingFlagsKHR {
pub const INVALID: Self = Self(0);
pub const MONOCHROME: Self = Self(0b1);
@ -1083,7 +1081,7 @@ impl VideoChromaSubsamplingFlagsKHR {
#[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);
vk_bitflags_wrapped!(VideoComponentBitDepthFlagsKHR, Flags);
impl VideoComponentBitDepthFlagsKHR {
pub const INVALID: Self = Self(0);
pub const TYPE_8: Self = Self(0b1);
@ -1094,7 +1092,7 @@ impl VideoComponentBitDepthFlagsKHR {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoCapabilityFlagBitsKHR.html>"]
pub struct VideoCapabilityFlagsKHR(pub(crate) Flags);
vk_bitflags_wrapped!(VideoCapabilityFlagsKHR, 0b11, Flags);
vk_bitflags_wrapped!(VideoCapabilityFlagsKHR, Flags);
impl VideoCapabilityFlagsKHR {
pub const PROTECTED_CONTENT: Self = Self(0b1);
pub const SEPARATE_REFERENCE_IMAGES: Self = Self(0b10);
@ -1103,7 +1101,7 @@ impl VideoCapabilityFlagsKHR {
#[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);
vk_bitflags_wrapped!(VideoSessionCreateFlagsKHR, Flags);
impl VideoSessionCreateFlagsKHR {
pub const DEFAULT: Self = Self(0);
pub const PROTECTED_CONTENT: Self = Self(0b1);
@ -1112,7 +1110,7 @@ impl VideoSessionCreateFlagsKHR {
#[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);
vk_bitflags_wrapped!(VideoCodingQualityPresetFlagsKHR, Flags);
impl VideoCodingQualityPresetFlagsKHR {
pub const NORMAL: Self = Self(0b1);
pub const POWER: Self = Self(0b10);
@ -1122,7 +1120,7 @@ impl VideoCodingQualityPresetFlagsKHR {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoDecodeH264PictureLayoutFlagBitsEXT.html>"]
pub struct VideoDecodeH264PictureLayoutFlagsEXT(pub(crate) Flags);
vk_bitflags_wrapped!(VideoDecodeH264PictureLayoutFlagsEXT, 0b11, Flags);
vk_bitflags_wrapped!(VideoDecodeH264PictureLayoutFlagsEXT, Flags);
impl VideoDecodeH264PictureLayoutFlagsEXT {
pub const PROGRESSIVE: Self = Self(0);
pub const INTERLACED_INTERLEAVED_LINES: Self = Self(0b1);
@ -1132,7 +1130,7 @@ impl VideoDecodeH264PictureLayoutFlagsEXT {
#[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);
vk_bitflags_wrapped!(VideoCodingControlFlagsKHR, Flags);
impl VideoCodingControlFlagsKHR {
pub const DEFAULT: Self = Self(0);
pub const RESET: Self = Self(0b1);
@ -1141,7 +1139,7 @@ impl VideoCodingControlFlagsKHR {
#[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);
vk_bitflags_wrapped!(VideoDecodeFlagsKHR, Flags);
impl VideoDecodeFlagsKHR {
pub const DEFAULT: Self = Self(0);
pub const RESERVED_0: Self = Self(0b1);
@ -1150,7 +1148,7 @@ impl VideoDecodeFlagsKHR {
#[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);
vk_bitflags_wrapped!(VideoEncodeFlagsKHR, Flags);
impl VideoEncodeFlagsKHR {
pub const DEFAULT: Self = Self(0);
pub const RESERVED_0: Self = Self(0b1);
@ -1159,16 +1157,16 @@ impl VideoEncodeFlagsKHR {
#[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);
vk_bitflags_wrapped!(VideoEncodeRateControlFlagsKHR, Flags);
impl VideoEncodeRateControlFlagsKHR {
pub const DEFAULT: Self = Self(0);
pub const RESET: Self = Self(0b1);
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/VkVideoEncodeRateControlModeFlagBitsKHR.html>"]
pub struct VideoEncodeRateControlModeFlagsKHR(pub(crate) Flags);
vk_bitflags_wrapped!(VideoEncodeRateControlModeFlagsKHR, 0b11, Flags);
vk_bitflags_wrapped!(VideoEncodeRateControlModeFlagsKHR, Flags);
impl VideoEncodeRateControlModeFlagsKHR {
pub const NONE: Self = Self(0);
pub const CBR: Self = Self(1);
@ -1178,7 +1176,7 @@ impl VideoEncodeRateControlModeFlagsKHR {
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkVideoEncodeH264CapabilityFlagBitsEXT.html>"]
pub struct VideoEncodeH264CapabilityFlagsEXT(pub(crate) Flags);
vk_bitflags_wrapped!(VideoEncodeH264CapabilityFlagsEXT, 0b111_1111_1111, Flags);
vk_bitflags_wrapped!(VideoEncodeH264CapabilityFlagsEXT, Flags);
impl VideoEncodeH264CapabilityFlagsEXT {
pub const CABAC: Self = Self(0b1);
pub const CAVLC: Self = Self(0b10);
@ -1196,7 +1194,7 @@ impl VideoEncodeH264CapabilityFlagsEXT {
#[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);
vk_bitflags_wrapped!(VideoEncodeH264InputModeFlagsEXT, Flags);
impl VideoEncodeH264InputModeFlagsEXT {
pub const FRAME: Self = Self(0b1);
pub const SLICE: Self = Self(0b10);
@ -1206,7 +1204,7 @@ impl VideoEncodeH264InputModeFlagsEXT {
#[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);
vk_bitflags_wrapped!(VideoEncodeH264OutputModeFlagsEXT, Flags);
impl VideoEncodeH264OutputModeFlagsEXT {
pub const FRAME: Self = Self(0b1);
pub const SLICE: Self = Self(0b10);
@ -1216,8 +1214,126 @@ impl VideoEncodeH264OutputModeFlagsEXT {
#[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);
vk_bitflags_wrapped!(VideoEncodeH264CreateFlagsEXT, Flags);
impl VideoEncodeH264CreateFlagsEXT {
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/VkVideoEncodeH264RateControlStructureFlagBitsEXT.html>"]
pub struct VideoEncodeH264RateControlStructureFlagsEXT(pub(crate) Flags);
vk_bitflags_wrapped!(VideoEncodeH264RateControlStructureFlagsEXT, Flags);
impl VideoEncodeH264RateControlStructureFlagsEXT {
pub const UNKNOWN: Self = Self(0);
pub const FLAT: Self = Self(0b1);
pub const DYADIC: 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/VkImageFormatConstraintsFlagBitsFUCHSIA.html>"]
pub struct ImageFormatConstraintsFlagsFUCHSIA(pub(crate) Flags);
vk_bitflags_wrapped!(ImageFormatConstraintsFlagsFUCHSIA, Flags);
impl ImageFormatConstraintsFlagsFUCHSIA {}
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkImageConstraintsInfoFlagBitsFUCHSIA.html>"]
pub struct ImageConstraintsInfoFlagsFUCHSIA(pub(crate) Flags);
vk_bitflags_wrapped!(ImageConstraintsInfoFlagsFUCHSIA, Flags);
impl ImageConstraintsInfoFlagsFUCHSIA {
pub const CPU_READ_RARELY: Self = Self(0b1);
pub const CPU_READ_OFTEN: Self = Self(0b10);
pub const CPU_WRITE_RARELY: Self = Self(0b100);
pub const CPU_WRITE_OFTEN: Self = Self(0b1000);
pub const PROTECTED_OPTIONAL: 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/VkFormatFeatureFlagBits2KHR.html>"]
pub struct FormatFeatureFlags2KHR(pub(crate) Flags64);
vk_bitflags_wrapped!(FormatFeatureFlags2KHR, Flags64);
impl FormatFeatureFlags2KHR {
pub const SAMPLED_IMAGE: Self = Self(0b1);
pub const STORAGE_IMAGE: Self = Self(0b10);
pub const STORAGE_IMAGE_ATOMIC: Self = Self(0b100);
pub const UNIFORM_TEXEL_BUFFER: Self = Self(0b1000);
pub const STORAGE_TEXEL_BUFFER: Self = Self(0b1_0000);
pub const STORAGE_TEXEL_BUFFER_ATOMIC: Self = Self(0b10_0000);
pub const VERTEX_BUFFER: Self = Self(0b100_0000);
pub const COLOR_ATTACHMENT: Self = Self(0b1000_0000);
pub const COLOR_ATTACHMENT_BLEND: Self = Self(0b1_0000_0000);
pub const DEPTH_STENCIL_ATTACHMENT: Self = Self(0b10_0000_0000);
pub const BLIT_SRC: Self = Self(0b100_0000_0000);
pub const BLIT_DST: Self = Self(0b1000_0000_0000);
pub const SAMPLED_IMAGE_FILTER_LINEAR: Self = Self(0b1_0000_0000_0000);
pub const SAMPLED_IMAGE_FILTER_CUBIC_EXT: Self = Self(0b10_0000_0000_0000);
pub const TRANSFER_SRC: Self = Self(0b100_0000_0000_0000);
pub const TRANSFER_DST: Self = Self(0b1000_0000_0000_0000);
pub const SAMPLED_IMAGE_FILTER_MINMAX: Self = Self(0b1_0000_0000_0000_0000);
pub const MIDPOINT_CHROMA_SAMPLES: Self = Self(0b10_0000_0000_0000_0000);
pub const SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER: Self = Self(0b100_0000_0000_0000_0000);
pub const SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER: Self =
Self(0b1000_0000_0000_0000_0000);
pub const SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT: Self =
Self(0b1_0000_0000_0000_0000_0000);
pub const SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE: Self =
Self(0b10_0000_0000_0000_0000_0000);
pub const DISJOINT: Self = Self(0b100_0000_0000_0000_0000_0000);
pub const COSITED_CHROMA_SAMPLES: Self = Self(0b1000_0000_0000_0000_0000_0000);
pub const STORAGE_READ_WITHOUT_FORMAT: Self = Self(0b1000_0000_0000_0000_0000_0000_0000_0000);
pub const STORAGE_WRITE_WITHOUT_FORMAT: Self =
Self(0b1_0000_0000_0000_0000_0000_0000_0000_0000);
pub const SAMPLED_IMAGE_DEPTH_COMPARISON: Self =
Self(0b10_0000_0000_0000_0000_0000_0000_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/VkVideoEncodeH265InputModeFlagBitsEXT.html>"]
pub struct VideoEncodeH265InputModeFlagsEXT(pub(crate) Flags);
vk_bitflags_wrapped!(VideoEncodeH265InputModeFlagsEXT, Flags);
impl VideoEncodeH265InputModeFlagsEXT {
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/VkVideoEncodeH265OutputModeFlagBitsEXT.html>"]
pub struct VideoEncodeH265OutputModeFlagsEXT(pub(crate) Flags);
vk_bitflags_wrapped!(VideoEncodeH265OutputModeFlagsEXT, Flags);
impl VideoEncodeH265OutputModeFlagsEXT {
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/VkVideoEncodeH265CtbSizeFlagBitsEXT.html>"]
pub struct VideoEncodeH265CtbSizeFlagsEXT(pub(crate) Flags);
vk_bitflags_wrapped!(VideoEncodeH265CtbSizeFlagsEXT, Flags);
impl VideoEncodeH265CtbSizeFlagsEXT {
pub const TYPE_8: Self = Self(0b1);
pub const TYPE_16: Self = Self(0b10);
pub const TYPE_32: Self = Self(0b100);
pub const TYPE_64: 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/VkRenderingFlagBitsKHR.html>"]
pub struct RenderingFlagsKHR(pub(crate) Flags);
vk_bitflags_wrapped!(RenderingFlagsKHR, Flags);
impl RenderingFlagsKHR {
pub const CONTENTS_SECONDARY_COMMAND_BUFFERS: Self = Self(0b1);
pub const SUSPENDING: Self = Self(0b10);
pub const RESUMING: 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/VkVideoEncodeH265RateControlStructureFlagBitsEXT.html>"]
pub struct VideoEncodeH265RateControlStructureFlagsEXT(pub(crate) Flags);
vk_bitflags_wrapped!(VideoEncodeH265RateControlStructureFlagsEXT, Flags);
impl VideoEncodeH265RateControlStructureFlagsEXT {
pub const UNKNOWN: Self = Self(0);
pub const FLAT: Self = Self(0b1);
pub const DYADIC: Self = Self(0b10);
}

505
third_party/rust/ash/src/vk/const_debugs.rs поставляемый
Просмотреть файл

@ -1,33 +1,8 @@
use crate::prelude::debug_flags;
use crate::vk::bitflags::*;
use crate::vk::definitions::*;
use crate::vk::enums::*;
use std::fmt;
pub(crate) fn debug_flags<Value: Into<u64> + Copy>(
f: &mut fmt::Formatter,
known: &[(Value, &'static str)],
value: Value,
) -> fmt::Result {
let mut first = true;
let mut accum = value.into();
for &(bit, name) in known {
let bit = bit.into();
if bit != 0 && accum & bit == bit {
if !first {
f.write_str(" | ")?;
}
f.write_str(name)?;
first = false;
accum &= !bit;
}
}
if accum != 0 {
if !first {
f.write_str(" | ")?;
}
write!(f, "{:b}", accum)?;
}
Ok(())
}
impl fmt::Debug for AccelerationStructureBuildTypeKHR {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let name = match *self {
@ -321,10 +296,12 @@ impl fmt::Debug for AccessFlags2KHR {
AccessFlags2KHR::COLOR_ATTACHMENT_READ_NONCOHERENT_EXT.0,
"COLOR_ATTACHMENT_READ_NONCOHERENT_EXT",
),
(AccessFlags2KHR::RESERVED_41_AMD.0, "RESERVED_41_AMD"),
(
AccessFlags2KHR::INVOCATION_MASK_READ_HUAWEI.0,
"INVOCATION_MASK_READ_HUAWEI",
),
(AccessFlags2KHR::RESERVED_387.0, "RESERVED_387"),
];
debug_flags(f, KNOWN, self.0)
}
@ -368,7 +345,7 @@ impl fmt::Debug for AttachmentStoreOp {
let name = match *self {
Self::STORE => Some("STORE"),
Self::DONT_CARE => Some("DONT_CARE"),
Self::NONE_EXT => Some("NONE_EXT"),
Self::NONE_KHR => Some("NONE_KHR"),
_ => None,
};
if let Some(x) = name {
@ -513,6 +490,7 @@ impl fmt::Debug for BufferCreateFlags {
(BufferCreateFlags::SPARSE_BINDING.0, "SPARSE_BINDING"),
(BufferCreateFlags::SPARSE_RESIDENCY.0, "SPARSE_RESIDENCY"),
(BufferCreateFlags::SPARSE_ALIASED.0, "SPARSE_ALIASED"),
(BufferCreateFlags::RESERVED_5_AMD.0, "RESERVED_5_AMD"),
(BufferCreateFlags::PROTECTED.0, "PROTECTED"),
(
BufferCreateFlags::DEVICE_ADDRESS_CAPTURE_REPLAY.0,
@ -581,6 +559,8 @@ impl fmt::Debug for BufferUsageFlags {
BufferUsageFlags::VIDEO_ENCODE_SRC_KHR.0,
"VIDEO_ENCODE_SRC_KHR",
),
(BufferUsageFlags::RESERVED_21_AMD.0, "RESERVED_21_AMD"),
(BufferUsageFlags::RESERVED_22_AMD.0, "RESERVED_22_AMD"),
(
BufferUsageFlags::SHADER_DEVICE_ADDRESS.0,
"SHADER_DEVICE_ADDRESS",
@ -763,10 +743,16 @@ impl fmt::Debug for CommandPoolCreateFlags {
}
impl fmt::Debug for CommandPoolResetFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[(
CommandPoolResetFlags::RELEASE_RESOURCES.0,
"RELEASE_RESOURCES",
)];
const KNOWN: &[(Flags, &str)] = &[
(
CommandPoolResetFlags::RELEASE_RESOURCES.0,
"RELEASE_RESOURCES",
),
(
CommandPoolResetFlags::RESERVED_1_COREAVI.0,
"RESERVED_1_COREAVI",
),
];
debug_flags(f, KNOWN, self.0)
}
}
@ -983,6 +969,7 @@ impl fmt::Debug for DebugReportObjectTypeEXT {
Self::CU_FUNCTION_NVX => Some("CU_FUNCTION_NVX"),
Self::ACCELERATION_STRUCTURE_KHR => Some("ACCELERATION_STRUCTURE_KHR"),
Self::ACCELERATION_STRUCTURE_NV => Some("ACCELERATION_STRUCTURE_NV"),
Self::BUFFER_COLLECTION_FUCHSIA => Some("BUFFER_COLLECTION_FUCHSIA"),
_ => None,
};
if let Some(x) = name {
@ -1088,6 +1075,10 @@ impl fmt::Debug for DescriptorSetLayoutCreateFlags {
DescriptorSetLayoutCreateFlags::PUSH_DESCRIPTOR_KHR.0,
"PUSH_DESCRIPTOR_KHR",
),
(
DescriptorSetLayoutCreateFlags::RESERVED_4_AMD.0,
"RESERVED_4_AMD",
),
(
DescriptorSetLayoutCreateFlags::RESERVED_3_AMD.0,
"RESERVED_3_AMD",
@ -1228,7 +1219,10 @@ impl fmt::Debug for DeviceMemoryReportFlagsEXT {
}
impl fmt::Debug for DeviceQueueCreateFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[(DeviceQueueCreateFlags::PROTECTED.0, "PROTECTED")];
const KNOWN: &[(Flags, &str)] = &[
(DeviceQueueCreateFlags::RESERVED_1_QCOM.0, "RESERVED_1_QCOM"),
(DeviceQueueCreateFlags::PROTECTED.0, "PROTECTED"),
];
debug_flags(f, KNOWN, self.0)
}
}
@ -1326,6 +1320,10 @@ impl fmt::Debug for DriverId {
Self::COREAVI_PROPRIETARY => Some("COREAVI_PROPRIETARY"),
Self::JUICE_PROPRIETARY => Some("JUICE_PROPRIETARY"),
Self::VERISILICON_PROPRIETARY => Some("VERISILICON_PROPRIETARY"),
Self::MESA_TURNIP => Some("MESA_TURNIP"),
Self::MESA_V3DV => Some("MESA_V3DV"),
Self::MESA_PANVK => Some("MESA_PANVK"),
Self::SAMSUNG_PROPRIETARY => Some("SAMSUNG_PROPRIETARY"),
_ => None,
};
if let Some(x) = name {
@ -1922,6 +1920,12 @@ impl fmt::Debug for FormatFeatureFlags {
debug_flags(f, KNOWN, self.0)
}
}
impl fmt::Debug for FormatFeatureFlags2KHR {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN : & [(Flags64 , & str)] = & [(FormatFeatureFlags2KHR :: SAMPLED_IMAGE . 0 , "SAMPLED_IMAGE") , (FormatFeatureFlags2KHR :: STORAGE_IMAGE . 0 , "STORAGE_IMAGE") , (FormatFeatureFlags2KHR :: STORAGE_IMAGE_ATOMIC . 0 , "STORAGE_IMAGE_ATOMIC") , (FormatFeatureFlags2KHR :: UNIFORM_TEXEL_BUFFER . 0 , "UNIFORM_TEXEL_BUFFER") , (FormatFeatureFlags2KHR :: STORAGE_TEXEL_BUFFER . 0 , "STORAGE_TEXEL_BUFFER") , (FormatFeatureFlags2KHR :: STORAGE_TEXEL_BUFFER_ATOMIC . 0 , "STORAGE_TEXEL_BUFFER_ATOMIC") , (FormatFeatureFlags2KHR :: VERTEX_BUFFER . 0 , "VERTEX_BUFFER") , (FormatFeatureFlags2KHR :: COLOR_ATTACHMENT . 0 , "COLOR_ATTACHMENT") , (FormatFeatureFlags2KHR :: COLOR_ATTACHMENT_BLEND . 0 , "COLOR_ATTACHMENT_BLEND") , (FormatFeatureFlags2KHR :: DEPTH_STENCIL_ATTACHMENT . 0 , "DEPTH_STENCIL_ATTACHMENT") , (FormatFeatureFlags2KHR :: BLIT_SRC . 0 , "BLIT_SRC") , (FormatFeatureFlags2KHR :: BLIT_DST . 0 , "BLIT_DST") , (FormatFeatureFlags2KHR :: SAMPLED_IMAGE_FILTER_LINEAR . 0 , "SAMPLED_IMAGE_FILTER_LINEAR") , (FormatFeatureFlags2KHR :: SAMPLED_IMAGE_FILTER_CUBIC_EXT . 0 , "SAMPLED_IMAGE_FILTER_CUBIC_EXT") , (FormatFeatureFlags2KHR :: TRANSFER_SRC . 0 , "TRANSFER_SRC") , (FormatFeatureFlags2KHR :: TRANSFER_DST . 0 , "TRANSFER_DST") , (FormatFeatureFlags2KHR :: SAMPLED_IMAGE_FILTER_MINMAX . 0 , "SAMPLED_IMAGE_FILTER_MINMAX") , (FormatFeatureFlags2KHR :: MIDPOINT_CHROMA_SAMPLES . 0 , "MIDPOINT_CHROMA_SAMPLES") , (FormatFeatureFlags2KHR :: SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER . 0 , "SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER") , (FormatFeatureFlags2KHR :: SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER . 0 , "SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER") , (FormatFeatureFlags2KHR :: SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT . 0 , "SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT") , (FormatFeatureFlags2KHR :: SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE . 0 , "SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE") , (FormatFeatureFlags2KHR :: DISJOINT . 0 , "DISJOINT") , (FormatFeatureFlags2KHR :: COSITED_CHROMA_SAMPLES . 0 , "COSITED_CHROMA_SAMPLES") , (FormatFeatureFlags2KHR :: STORAGE_READ_WITHOUT_FORMAT . 0 , "STORAGE_READ_WITHOUT_FORMAT") , (FormatFeatureFlags2KHR :: STORAGE_WRITE_WITHOUT_FORMAT . 0 , "STORAGE_WRITE_WITHOUT_FORMAT") , (FormatFeatureFlags2KHR :: SAMPLED_IMAGE_DEPTH_COMPARISON . 0 , "SAMPLED_IMAGE_DEPTH_COMPARISON") , (FormatFeatureFlags2KHR :: VIDEO_DECODE_OUTPUT . 0 , "VIDEO_DECODE_OUTPUT") , (FormatFeatureFlags2KHR :: VIDEO_DECODE_DPB . 0 , "VIDEO_DECODE_DPB") , (FormatFeatureFlags2KHR :: ACCELERATION_STRUCTURE_VERTEX_BUFFER . 0 , "ACCELERATION_STRUCTURE_VERTEX_BUFFER") , (FormatFeatureFlags2KHR :: FRAGMENT_DENSITY_MAP_EXT . 0 , "FRAGMENT_DENSITY_MAP_EXT") , (FormatFeatureFlags2KHR :: FRAGMENT_SHADING_RATE_ATTACHMENT . 0 , "FRAGMENT_SHADING_RATE_ATTACHMENT") , (FormatFeatureFlags2KHR :: VIDEO_ENCODE_INPUT . 0 , "VIDEO_ENCODE_INPUT") , (FormatFeatureFlags2KHR :: VIDEO_ENCODE_DPB . 0 , "VIDEO_ENCODE_DPB") , (FormatFeatureFlags2KHR :: LINEAR_COLOR_ATTACHMENT_NV . 0 , "LINEAR_COLOR_ATTACHMENT_NV") , (FormatFeatureFlags2KHR :: RESERVED_34_QCOM . 0 , "RESERVED_34_QCOM") , (FormatFeatureFlags2KHR :: RESERVED_35_QCOM . 0 , "RESERVED_35_QCOM") , (FormatFeatureFlags2KHR :: RESERVED_36_QCOM . 0 , "RESERVED_36_QCOM") , (FormatFeatureFlags2KHR :: RESERVED_37_QCOM . 0 , "RESERVED_37_QCOM")] ;
debug_flags(f, KNOWN, self.0)
}
}
impl fmt::Debug for FragmentShadingRateCombinerOpKHR {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let name = match *self {
@ -2083,6 +2087,7 @@ impl fmt::Debug for ImageAspectFlags {
(ImageAspectFlags::MEMORY_PLANE_1_EXT.0, "MEMORY_PLANE_1_EXT"),
(ImageAspectFlags::MEMORY_PLANE_2_EXT.0, "MEMORY_PLANE_2_EXT"),
(ImageAspectFlags::MEMORY_PLANE_3_EXT.0, "MEMORY_PLANE_3_EXT"),
(ImageAspectFlags::NONE_KHR.0, "NONE_KHR"),
(ImageAspectFlags::PLANE_0.0, "PLANE_0"),
(ImageAspectFlags::PLANE_1.0, "PLANE_1"),
(ImageAspectFlags::PLANE_2.0, "PLANE_2"),
@ -2090,6 +2095,33 @@ impl fmt::Debug for ImageAspectFlags {
debug_flags(f, KNOWN, self.0)
}
}
impl fmt::Debug for ImageConstraintsInfoFlagsFUCHSIA {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[
(
ImageConstraintsInfoFlagsFUCHSIA::CPU_READ_RARELY.0,
"CPU_READ_RARELY",
),
(
ImageConstraintsInfoFlagsFUCHSIA::CPU_READ_OFTEN.0,
"CPU_READ_OFTEN",
),
(
ImageConstraintsInfoFlagsFUCHSIA::CPU_WRITE_RARELY.0,
"CPU_WRITE_RARELY",
),
(
ImageConstraintsInfoFlagsFUCHSIA::CPU_WRITE_OFTEN.0,
"CPU_WRITE_OFTEN",
),
(
ImageConstraintsInfoFlagsFUCHSIA::PROTECTED_OPTIONAL.0,
"PROTECTED_OPTIONAL",
),
];
debug_flags(f, KNOWN, self.0)
}
}
impl fmt::Debug for ImageCreateFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[
@ -2104,6 +2136,12 @@ impl fmt::Debug for ImageCreateFlags {
"SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_EXT",
),
(ImageCreateFlags::SUBSAMPLED_EXT.0, "SUBSAMPLED_EXT"),
(ImageCreateFlags::RESERVED_16_AMD.0, "RESERVED_16_AMD"),
(ImageCreateFlags::RESERVED_394_EXT.0, "RESERVED_394_EXT"),
(
ImageCreateFlags::FRAGMENT_DENSITY_MAP_OFFSET_QCOM.0,
"FRAGMENT_DENSITY_MAP_OFFSET_QCOM",
),
(ImageCreateFlags::ALIAS.0, "ALIAS"),
(
ImageCreateFlags::SPLIT_INSTANCE_BIND_REGIONS.0,
@ -2124,6 +2162,12 @@ impl fmt::Debug for ImageCreateFlags {
debug_flags(f, KNOWN, self.0)
}
}
impl fmt::Debug for ImageFormatConstraintsFlagsFUCHSIA {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[];
debug_flags(f, KNOWN, self.0)
}
}
impl fmt::Debug for ImageLayout {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let name = match *self {
@ -2261,6 +2305,8 @@ impl fmt::Debug for ImageUsageFlags {
ImageUsageFlags::INVOCATION_MASK_HUAWEI.0,
"INVOCATION_MASK_HUAWEI",
),
(ImageUsageFlags::RESERVED_20_QCOM.0, "RESERVED_20_QCOM"),
(ImageUsageFlags::RESERVED_21_QCOM.0, "RESERVED_21_QCOM"),
];
debug_flags(f, KNOWN, self.0)
}
@ -2502,63 +2548,6 @@ impl fmt::Debug for MetalSurfaceCreateFlagsEXT {
debug_flags(f, KNOWN, self.0)
}
}
impl fmt::Debug for ObjectType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let name = match *self {
Self::UNKNOWN => Some("UNKNOWN"),
Self::INSTANCE => Some("INSTANCE"),
Self::PHYSICAL_DEVICE => Some("PHYSICAL_DEVICE"),
Self::DEVICE => Some("DEVICE"),
Self::QUEUE => Some("QUEUE"),
Self::SEMAPHORE => Some("SEMAPHORE"),
Self::COMMAND_BUFFER => Some("COMMAND_BUFFER"),
Self::FENCE => Some("FENCE"),
Self::DEVICE_MEMORY => Some("DEVICE_MEMORY"),
Self::BUFFER => Some("BUFFER"),
Self::IMAGE => Some("IMAGE"),
Self::EVENT => Some("EVENT"),
Self::QUERY_POOL => Some("QUERY_POOL"),
Self::BUFFER_VIEW => Some("BUFFER_VIEW"),
Self::IMAGE_VIEW => Some("IMAGE_VIEW"),
Self::SHADER_MODULE => Some("SHADER_MODULE"),
Self::PIPELINE_CACHE => Some("PIPELINE_CACHE"),
Self::PIPELINE_LAYOUT => Some("PIPELINE_LAYOUT"),
Self::RENDER_PASS => Some("RENDER_PASS"),
Self::PIPELINE => Some("PIPELINE"),
Self::DESCRIPTOR_SET_LAYOUT => Some("DESCRIPTOR_SET_LAYOUT"),
Self::SAMPLER => Some("SAMPLER"),
Self::DESCRIPTOR_POOL => Some("DESCRIPTOR_POOL"),
Self::DESCRIPTOR_SET => Some("DESCRIPTOR_SET"),
Self::FRAMEBUFFER => Some("FRAMEBUFFER"),
Self::COMMAND_POOL => Some("COMMAND_POOL"),
Self::SURFACE_KHR => Some("SURFACE_KHR"),
Self::SWAPCHAIN_KHR => Some("SWAPCHAIN_KHR"),
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::CU_MODULE_NVX => Some("CU_MODULE_NVX"),
Self::CU_FUNCTION_NVX => Some("CU_FUNCTION_NVX"),
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"),
Self::ACCELERATION_STRUCTURE_NV => Some("ACCELERATION_STRUCTURE_NV"),
Self::PERFORMANCE_CONFIGURATION_INTEL => Some("PERFORMANCE_CONFIGURATION_INTEL"),
Self::DEFERRED_OPERATION_KHR => Some("DEFERRED_OPERATION_KHR"),
Self::INDIRECT_COMMANDS_LAYOUT_NV => Some("INDIRECT_COMMANDS_LAYOUT_NV"),
Self::PRIVATE_DATA_SLOT_EXT => Some("PRIVATE_DATA_SLOT_EXT"),
Self::SAMPLER_YCBCR_CONVERSION => Some("SAMPLER_YCBCR_CONVERSION"),
Self::DESCRIPTOR_UPDATE_TEMPLATE => Some("DESCRIPTOR_UPDATE_TEMPLATE"),
_ => None,
};
if let Some(x) = name {
f.write_str(x)
} else {
self.0.fmt(f)
}
}
}
impl fmt::Debug for PeerMemoryFeatureFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[
@ -2762,7 +2751,10 @@ impl fmt::Debug for PipelineCacheHeaderVersion {
}
impl fmt::Debug for PipelineColorBlendStateCreateFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[];
const KNOWN: &[(Flags, &str)] = &[(
PipelineColorBlendStateCreateFlags::RASTERIZATION_ORDER_ATTACHMENT_ACCESS_ARM.0,
"RASTERIZATION_ORDER_ATTACHMENT_ACCESS_ARM",
)];
debug_flags(f, KNOWN, self.0)
}
}
@ -2802,8 +2794,14 @@ impl fmt::Debug for PipelineCreateFlags {
"ALLOW_DERIVATIVES",
),
(PipelineCreateFlags::DERIVATIVE.0, "DERIVATIVE"),
(PipelineCreateFlags::RESERVED_21_AMD.0, "RESERVED_21_AMD"),
(PipelineCreateFlags::RESERVED_22_AMD.0, "RESERVED_22_AMD"),
(
PipelineCreateFlags::RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_KHR.0,
"RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_KHR",
),
(
PipelineCreateFlags::RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_EXT.0,
"RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_EXT",
),
(
PipelineCreateFlags::RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_KHR.0,
"RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_KHR",
@ -2887,7 +2885,7 @@ impl fmt::Debug for PipelineCreationFeedbackFlagsEXT {
}
impl fmt::Debug for PipelineDepthStencilStateCreateFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[];
const KNOWN : & [(Flags , & str)] = & [(PipelineDepthStencilStateCreateFlags :: RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_ARM . 0 , "RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_ARM") , (PipelineDepthStencilStateCreateFlags :: RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_ARM . 0 , "RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_ARM")] ;
debug_flags(f, KNOWN, self.0)
}
}
@ -2927,10 +2925,16 @@ impl fmt::Debug for PipelineInputAssemblyStateCreateFlags {
}
impl fmt::Debug for PipelineLayoutCreateFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[(
PipelineLayoutCreateFlags::RESERVED_0_AMD.0,
"RESERVED_0_AMD",
)];
const KNOWN: &[(Flags, &str)] = &[
(
PipelineLayoutCreateFlags::RESERVED_0_AMD.0,
"RESERVED_0_AMD",
),
(
PipelineLayoutCreateFlags::RESERVED_1_AMD.0,
"RESERVED_1_AMD",
),
];
debug_flags(f, KNOWN, self.0)
}
}
@ -3146,6 +3150,7 @@ impl fmt::Debug for PipelineStageFlags2KHR {
PipelineStageFlags2KHR::INVOCATION_MASK_HUAWEI.0,
"INVOCATION_MASK_HUAWEI",
),
(PipelineStageFlags2KHR::RESERVED_387.0, "RESERVED_387"),
];
debug_flags(f, KNOWN, self.0)
}
@ -3408,6 +3413,7 @@ impl fmt::Debug for QueueFlags {
(QueueFlags::SPARSE_BINDING.0, "SPARSE_BINDING"),
(QueueFlags::VIDEO_DECODE_KHR.0, "VIDEO_DECODE_KHR"),
(QueueFlags::VIDEO_ENCODE_KHR.0, "VIDEO_ENCODE_KHR"),
(QueueFlags::RESERVED_7_QCOM.0, "RESERVED_7_QCOM"),
(QueueFlags::PROTECTED.0, "PROTECTED"),
];
debug_flags(f, KNOWN, self.0)
@ -3467,6 +3473,19 @@ impl fmt::Debug for RenderPassCreateFlags {
debug_flags(f, KNOWN, self.0)
}
}
impl fmt::Debug for RenderingFlagsKHR {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[
(
RenderingFlagsKHR::CONTENTS_SECONDARY_COMMAND_BUFFERS.0,
"CONTENTS_SECONDARY_COMMAND_BUFFERS",
),
(RenderingFlagsKHR::SUSPENDING.0, "SUSPENDING"),
(RenderingFlagsKHR::RESUMING.0, "RESUMING"),
];
debug_flags(f, KNOWN, self.0)
}
}
impl fmt::Debug for ResolveModeFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[
@ -3479,62 +3498,6 @@ impl fmt::Debug for ResolveModeFlags {
debug_flags(f, KNOWN, self.0)
}
}
impl fmt::Debug for Result {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let name = match *self {
Self::SUCCESS => Some("SUCCESS"),
Self::NOT_READY => Some("NOT_READY"),
Self::TIMEOUT => Some("TIMEOUT"),
Self::EVENT_SET => Some("EVENT_SET"),
Self::EVENT_RESET => Some("EVENT_RESET"),
Self::INCOMPLETE => Some("INCOMPLETE"),
Self::ERROR_OUT_OF_HOST_MEMORY => Some("ERROR_OUT_OF_HOST_MEMORY"),
Self::ERROR_OUT_OF_DEVICE_MEMORY => Some("ERROR_OUT_OF_DEVICE_MEMORY"),
Self::ERROR_INITIALIZATION_FAILED => Some("ERROR_INITIALIZATION_FAILED"),
Self::ERROR_DEVICE_LOST => Some("ERROR_DEVICE_LOST"),
Self::ERROR_MEMORY_MAP_FAILED => Some("ERROR_MEMORY_MAP_FAILED"),
Self::ERROR_LAYER_NOT_PRESENT => Some("ERROR_LAYER_NOT_PRESENT"),
Self::ERROR_EXTENSION_NOT_PRESENT => Some("ERROR_EXTENSION_NOT_PRESENT"),
Self::ERROR_FEATURE_NOT_PRESENT => Some("ERROR_FEATURE_NOT_PRESENT"),
Self::ERROR_INCOMPATIBLE_DRIVER => Some("ERROR_INCOMPATIBLE_DRIVER"),
Self::ERROR_TOO_MANY_OBJECTS => Some("ERROR_TOO_MANY_OBJECTS"),
Self::ERROR_FORMAT_NOT_SUPPORTED => Some("ERROR_FORMAT_NOT_SUPPORTED"),
Self::ERROR_FRAGMENTED_POOL => Some("ERROR_FRAGMENTED_POOL"),
Self::ERROR_UNKNOWN => Some("ERROR_UNKNOWN"),
Self::ERROR_SURFACE_LOST_KHR => Some("ERROR_SURFACE_LOST_KHR"),
Self::ERROR_NATIVE_WINDOW_IN_USE_KHR => Some("ERROR_NATIVE_WINDOW_IN_USE_KHR"),
Self::SUBOPTIMAL_KHR => Some("SUBOPTIMAL_KHR"),
Self::ERROR_OUT_OF_DATE_KHR => Some("ERROR_OUT_OF_DATE_KHR"),
Self::ERROR_INCOMPATIBLE_DISPLAY_KHR => Some("ERROR_INCOMPATIBLE_DISPLAY_KHR"),
Self::ERROR_VALIDATION_FAILED_EXT => Some("ERROR_VALIDATION_FAILED_EXT"),
Self::ERROR_INVALID_SHADER_NV => Some("ERROR_INVALID_SHADER_NV"),
Self::ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT => {
Some("ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT")
}
Self::ERROR_NOT_PERMITTED_EXT => Some("ERROR_NOT_PERMITTED_EXT"),
Self::ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT => {
Some("ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT")
}
Self::THREAD_IDLE_KHR => Some("THREAD_IDLE_KHR"),
Self::THREAD_DONE_KHR => Some("THREAD_DONE_KHR"),
Self::OPERATION_DEFERRED_KHR => Some("OPERATION_DEFERRED_KHR"),
Self::OPERATION_NOT_DEFERRED_KHR => Some("OPERATION_NOT_DEFERRED_KHR"),
Self::PIPELINE_COMPILE_REQUIRED_EXT => Some("PIPELINE_COMPILE_REQUIRED_EXT"),
Self::ERROR_OUT_OF_POOL_MEMORY => Some("ERROR_OUT_OF_POOL_MEMORY"),
Self::ERROR_INVALID_EXTERNAL_HANDLE => Some("ERROR_INVALID_EXTERNAL_HANDLE"),
Self::ERROR_FRAGMENTATION => Some("ERROR_FRAGMENTATION"),
Self::ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS => {
Some("ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS")
}
_ => None,
};
if let Some(x) = name {
f.write_str(x)
} else {
self.0.fmt(f)
}
}
}
impl fmt::Debug for SampleCountFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[
@ -3574,7 +3537,12 @@ impl fmt::Debug for SamplerCreateFlags {
SamplerCreateFlags::SUBSAMPLED_COARSE_RECONSTRUCTION_EXT.0,
"SUBSAMPLED_COARSE_RECONSTRUCTION_EXT",
),
(SamplerCreateFlags::RESERVED_3_AMD.0, "RESERVED_3_AMD"),
(SamplerCreateFlags::RESERVED_2_EXT.0, "RESERVED_2_EXT"),
(
SamplerCreateFlags::IMAGE_PROCESSING_QCOM.0,
"IMAGE_PROCESSING_QCOM",
),
];
debug_flags(f, KNOWN, self.0)
}
@ -4011,6 +3979,9 @@ impl fmt::Debug for StructureType {
Some("PHYSICAL_DEVICE_VIDEO_FORMAT_INFO_KHR")
}
Self::VIDEO_FORMAT_PROPERTIES_KHR => Some("VIDEO_FORMAT_PROPERTIES_KHR"),
Self::QUEUE_FAMILY_QUERY_RESULT_STATUS_PROPERTIES_2_KHR => {
Some("QUEUE_FAMILY_QUERY_RESULT_STATUS_PROPERTIES_2_KHR")
}
Self::VIDEO_DECODE_INFO_KHR => Some("VIDEO_DECODE_INFO_KHR"),
Self::DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV => {
Some("DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV")
@ -4056,6 +4027,42 @@ impl fmt::Debug for StructureType {
Some("VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_EXT")
}
Self::VIDEO_ENCODE_H264_PROFILE_EXT => Some("VIDEO_ENCODE_H264_PROFILE_EXT"),
Self::VIDEO_ENCODE_H264_RATE_CONTROL_INFO_EXT => {
Some("VIDEO_ENCODE_H264_RATE_CONTROL_INFO_EXT")
}
Self::VIDEO_ENCODE_H264_RATE_CONTROL_LAYER_INFO_EXT => {
Some("VIDEO_ENCODE_H264_RATE_CONTROL_LAYER_INFO_EXT")
}
Self::VIDEO_ENCODE_H265_CAPABILITIES_EXT => Some("VIDEO_ENCODE_H265_CAPABILITIES_EXT"),
Self::VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT => {
Some("VIDEO_ENCODE_H265_SESSION_CREATE_INFO_EXT")
}
Self::VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT => {
Some("VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT")
}
Self::VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT => {
Some("VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT")
}
Self::VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT => {
Some("VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT")
}
Self::VIDEO_ENCODE_H265_DPB_SLOT_INFO_EXT => {
Some("VIDEO_ENCODE_H265_DPB_SLOT_INFO_EXT")
}
Self::VIDEO_ENCODE_H265_NALU_SLICE_EXT => Some("VIDEO_ENCODE_H265_NALU_SLICE_EXT"),
Self::VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_EXT => {
Some("VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_EXT")
}
Self::VIDEO_ENCODE_H265_PROFILE_EXT => Some("VIDEO_ENCODE_H265_PROFILE_EXT"),
Self::VIDEO_ENCODE_H265_REFERENCE_LISTS_EXT => {
Some("VIDEO_ENCODE_H265_REFERENCE_LISTS_EXT")
}
Self::VIDEO_ENCODE_H265_RATE_CONTROL_INFO_EXT => {
Some("VIDEO_ENCODE_H265_RATE_CONTROL_INFO_EXT")
}
Self::VIDEO_ENCODE_H265_RATE_CONTROL_LAYER_INFO_EXT => {
Some("VIDEO_ENCODE_H265_RATE_CONTROL_LAYER_INFO_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")
@ -4075,6 +4082,25 @@ impl fmt::Debug for StructureType {
Self::TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD => {
Some("TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD")
}
Self::RENDERING_INFO_KHR => Some("RENDERING_INFO_KHR"),
Self::RENDERING_ATTACHMENT_INFO_KHR => Some("RENDERING_ATTACHMENT_INFO_KHR"),
Self::PIPELINE_RENDERING_CREATE_INFO_KHR => Some("PIPELINE_RENDERING_CREATE_INFO_KHR"),
Self::PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR => {
Some("PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR")
}
Self::COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR => {
Some("COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR")
}
Self::RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR => {
Some("RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR")
}
Self::RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT => {
Some("RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT")
}
Self::ATTACHMENT_SAMPLE_COUNT_INFO_AMD => Some("ATTACHMENT_SAMPLE_COUNT_INFO_AMD"),
Self::MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX => {
Some("MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX")
}
Self::STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP => {
Some("STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP")
}
@ -4230,6 +4256,9 @@ impl fmt::Debug for StructureType {
Some("MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID")
}
Self::EXTERNAL_FORMAT_ANDROID => Some("EXTERNAL_FORMAT_ANDROID"),
Self::ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID => {
Some("ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID")
}
Self::PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT => {
Some("PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT")
}
@ -4352,6 +4381,9 @@ impl fmt::Debug for StructureType {
Self::IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT => {
Some("IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT")
}
Self::DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT => {
Some("DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT")
}
Self::VALIDATION_CACHE_CREATE_INFO_EXT => Some("VALIDATION_CACHE_CREATE_INFO_EXT"),
Self::SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT => {
Some("SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT")
@ -4746,6 +4778,9 @@ impl fmt::Debug for StructureType {
}
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::VIDEO_ENCODE_RATE_CONTROL_LAYER_INFO_KHR => {
Some("VIDEO_ENCODE_RATE_CONTROL_LAYER_INFO_KHR")
}
Self::PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV => {
Some("PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV")
}
@ -4821,6 +4856,12 @@ impl fmt::Debug for StructureType {
Self::PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT => {
Some("PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT")
}
Self::PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_ARM => {
Some("PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_ARM")
}
Self::PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT => {
Some("PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT")
}
Self::DIRECTFB_SURFACE_CREATE_INFO_EXT => Some("DIRECTFB_SURFACE_CREATE_INFO_EXT"),
Self::PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE => {
Some("PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE")
@ -4838,9 +4879,16 @@ impl fmt::Debug for StructureType {
Some("VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT")
}
Self::PHYSICAL_DEVICE_DRM_PROPERTIES_EXT => Some("PHYSICAL_DEVICE_DRM_PROPERTIES_EXT"),
Self::PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT => {
Some("PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT")
}
Self::PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT => {
Some("PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT")
}
Self::PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT => {
Some("PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT")
}
Self::FORMAT_PROPERTIES_3_KHR => Some("FORMAT_PROPERTIES_3_KHR"),
Self::IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA => {
Some("IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA")
}
@ -4856,6 +4904,30 @@ impl fmt::Debug for StructureType {
Self::SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA => {
Some("SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA")
}
Self::BUFFER_COLLECTION_CREATE_INFO_FUCHSIA => {
Some("BUFFER_COLLECTION_CREATE_INFO_FUCHSIA")
}
Self::IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA => {
Some("IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA")
}
Self::BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA => {
Some("BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA")
}
Self::BUFFER_COLLECTION_PROPERTIES_FUCHSIA => {
Some("BUFFER_COLLECTION_PROPERTIES_FUCHSIA")
}
Self::BUFFER_CONSTRAINTS_INFO_FUCHSIA => Some("BUFFER_CONSTRAINTS_INFO_FUCHSIA"),
Self::BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA => {
Some("BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA")
}
Self::IMAGE_CONSTRAINTS_INFO_FUCHSIA => Some("IMAGE_CONSTRAINTS_INFO_FUCHSIA"),
Self::IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA => {
Some("IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA")
}
Self::SYSMEM_COLOR_SPACE_FUCHSIA => Some("SYSMEM_COLOR_SPACE_FUCHSIA"),
Self::BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA => {
Some("BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA")
}
Self::SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI => {
Some("SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI")
}
@ -4888,15 +4960,49 @@ impl fmt::Debug for StructureType {
Self::QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT => {
Some("QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT")
}
Self::PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT => {
Some("PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT")
}
Self::IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT => Some("IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT"),
Self::PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT => {
Some("PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT")
}
Self::PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT => {
Some("PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT")
}
Self::PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT => {
Some("PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT")
}
Self::SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT => {
Some("SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT")
}
Self::PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT => {
Some("PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT")
}
Self::PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR => {
Some("PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR")
}
Self::PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR => {
Some("PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR")
}
Self::DEVICE_BUFFER_MEMORY_REQUIREMENTS_KHR => {
Some("DEVICE_BUFFER_MEMORY_REQUIREMENTS_KHR")
}
Self::DEVICE_IMAGE_MEMORY_REQUIREMENTS_KHR => {
Some("DEVICE_IMAGE_MEMORY_REQUIREMENTS_KHR")
}
Self::PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM => {
Some("PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM")
}
Self::PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM => {
Some("PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM")
}
Self::SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM => {
Some("SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM")
}
Self::PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV => {
Some("PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV")
}
Self::PHYSICAL_DEVICE_SUBGROUP_PROPERTIES => {
Some("PHYSICAL_DEVICE_SUBGROUP_PROPERTIES")
}
@ -5196,6 +5302,18 @@ impl fmt::Debug for SubpassDescriptionFlags {
SubpassDescriptionFlags::SHADER_RESOLVE_QCOM.0,
"SHADER_RESOLVE_QCOM",
),
(
SubpassDescriptionFlags::RASTERIZATION_ORDER_ATTACHMENT_COLOR_ACCESS_ARM.0,
"RASTERIZATION_ORDER_ATTACHMENT_COLOR_ACCESS_ARM",
),
(
SubpassDescriptionFlags::RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_ARM.0,
"RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_ARM",
),
(
SubpassDescriptionFlags::RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_ARM.0,
"RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_ARM",
),
];
debug_flags(f, KNOWN, self.0)
}
@ -5469,6 +5587,10 @@ impl fmt::Debug for VideoCodecOperationFlagsKHR {
VideoCodecOperationFlagsKHR::ENCODE_H264_EXT.0,
"ENCODE_H264_EXT",
),
(
VideoCodecOperationFlagsKHR::ENCODE_H265_EXT.0,
"ENCODE_H265_EXT",
),
(
VideoCodecOperationFlagsKHR::DECODE_H264_EXT.0,
"DECODE_H264_EXT",
@ -5634,11 +5756,86 @@ impl fmt::Debug for VideoEncodeH264OutputModeFlagsEXT {
debug_flags(f, KNOWN, self.0)
}
}
impl fmt::Debug for VideoEncodeH264RateControlStructureFlagsEXT {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[
(
VideoEncodeH264RateControlStructureFlagsEXT::UNKNOWN.0,
"UNKNOWN",
),
(VideoEncodeH264RateControlStructureFlagsEXT::FLAT.0, "FLAT"),
(
VideoEncodeH264RateControlStructureFlagsEXT::DYADIC.0,
"DYADIC",
),
];
debug_flags(f, KNOWN, self.0)
}
}
impl fmt::Debug for VideoEncodeH265CapabilityFlagsEXT {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[];
debug_flags(f, KNOWN, self.0)
}
}
impl fmt::Debug for VideoEncodeH265CreateFlagsEXT {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[];
debug_flags(f, KNOWN, self.0)
}
}
impl fmt::Debug for VideoEncodeH265CtbSizeFlagsEXT {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[
(VideoEncodeH265CtbSizeFlagsEXT::TYPE_8.0, "TYPE_8"),
(VideoEncodeH265CtbSizeFlagsEXT::TYPE_16.0, "TYPE_16"),
(VideoEncodeH265CtbSizeFlagsEXT::TYPE_32.0, "TYPE_32"),
(VideoEncodeH265CtbSizeFlagsEXT::TYPE_64.0, "TYPE_64"),
];
debug_flags(f, KNOWN, self.0)
}
}
impl fmt::Debug for VideoEncodeH265InputModeFlagsEXT {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[
(VideoEncodeH265InputModeFlagsEXT::FRAME.0, "FRAME"),
(VideoEncodeH265InputModeFlagsEXT::SLICE.0, "SLICE"),
(VideoEncodeH265InputModeFlagsEXT::NON_VCL.0, "NON_VCL"),
];
debug_flags(f, KNOWN, self.0)
}
}
impl fmt::Debug for VideoEncodeH265OutputModeFlagsEXT {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[
(VideoEncodeH265OutputModeFlagsEXT::FRAME.0, "FRAME"),
(VideoEncodeH265OutputModeFlagsEXT::SLICE.0, "SLICE"),
(VideoEncodeH265OutputModeFlagsEXT::NON_VCL.0, "NON_VCL"),
];
debug_flags(f, KNOWN, self.0)
}
}
impl fmt::Debug for VideoEncodeH265RateControlStructureFlagsEXT {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
const KNOWN: &[(Flags, &str)] = &[
(
VideoEncodeH265RateControlStructureFlagsEXT::UNKNOWN.0,
"UNKNOWN",
),
(VideoEncodeH265RateControlStructureFlagsEXT::FLAT.0, "FLAT"),
(
VideoEncodeH265RateControlStructureFlagsEXT::DYADIC.0,
"DYADIC",
),
];
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"),
(VideoEncodeRateControlFlagsKHR::RESERVED_0.0, "RESERVED_0"),
];
debug_flags(f, KNOWN, self.0)
}

1
third_party/rust/ash/src/vk/constants.rs поставляемый
Просмотреть файл

@ -5,6 +5,7 @@ pub const LUID_SIZE: usize = 8;
pub const MAX_EXTENSION_NAME_SIZE: usize = 256;
pub const MAX_DESCRIPTION_SIZE: usize = 256;
pub const MAX_MEMORY_TYPES: usize = 32;
#[doc = "The maximum number of unique memory heaps, each of which supporting 1 or more memory types"]
pub const MAX_MEMORY_HEAPS: usize = 16;
pub const LOD_CLAMP_NONE: f32 = 1000.00;
pub const REMAINING_MIP_LEVELS: u32 = !0;

10367
third_party/rust/ash/src/vk/definitions.rs поставляемый

Разница между файлами не показана из-за своего большого размера Загрузить разницу

369
third_party/rust/ash/src/vk/enums.rs поставляемый

Разница между файлами не показана из-за своего большого размера Загрузить разницу

7354
third_party/rust/ash/src/vk/extensions.rs поставляемый

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,641 +1,218 @@
use crate::vk::bitflags::*;
use crate::vk::enums::*;
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: Self = Self(1_000_094_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const BIND_BUFFER_MEMORY_INFO: Self = Self(1_000_157_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const BIND_IMAGE_MEMORY_INFO: Self = Self(1_000_157_001);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl ImageCreateFlags {
pub const ALIAS: Self = Self(0b100_0000_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: Self = Self(1_000_083_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const MEMORY_DEDICATED_REQUIREMENTS: Self = Self(1_000_127_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const MEMORY_DEDICATED_ALLOCATE_INFO: Self = Self(1_000_127_001);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const MEMORY_ALLOCATE_FLAGS_INFO: Self = Self(1_000_060_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const DEVICE_GROUP_RENDER_PASS_BEGIN_INFO: Self = Self(1_000_060_003);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO: Self = Self(1_000_060_004);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const DEVICE_GROUP_SUBMIT_INFO: Self = Self(1_000_060_005);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const DEVICE_GROUP_BIND_SPARSE_INFO: Self = Self(1_000_060_006);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl PipelineCreateFlags {
pub const VIEW_INDEX_FROM_DEVICE_INDEX: Self = Self(0b1000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl PipelineCreateFlags {
pub const DISPATCH_BASE: Self = Self(0b1_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl DependencyFlags {
pub const DEVICE_GROUP: Self = Self(0b100);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO: Self = Self(1_000_060_013);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: Self = Self(1_000_060_014);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl ImageCreateFlags {
pub const SPLIT_INSTANCE_BIND_REGIONS: Self = Self(0b100_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_GROUP_PROPERTIES: Self = Self(1_000_070_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const DEVICE_GROUP_DEVICE_CREATE_INFO: Self = Self(1_000_070_001);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl MemoryHeapFlags {
pub const MULTI_INSTANCE: Self = Self(0b10);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const BUFFER_MEMORY_REQUIREMENTS_INFO_2: Self = Self(1_000_146_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const IMAGE_MEMORY_REQUIREMENTS_INFO_2: Self = Self(1_000_146_001);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2: Self = Self(1_000_146_002);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const MEMORY_REQUIREMENTS_2: Self = Self(1_000_146_003);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const SPARSE_IMAGE_MEMORY_REQUIREMENTS_2: Self = Self(1_000_146_004);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_FEATURES_2: Self = Self(1_000_059_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_PROPERTIES_2: Self = Self(1_000_059_001);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const FORMAT_PROPERTIES_2: Self = Self(1_000_059_002);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const IMAGE_FORMAT_PROPERTIES_2: Self = Self(1_000_059_003);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2: Self = Self(1_000_059_004);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const QUEUE_FAMILY_PROPERTIES_2: Self = Self(1_000_059_005);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_MEMORY_PROPERTIES_2: Self = Self(1_000_059_006);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const SPARSE_IMAGE_FORMAT_PROPERTIES_2: Self = Self(1_000_059_007);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2: Self = Self(1_000_059_008);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Result {
pub const ERROR_OUT_OF_POOL_MEMORY: Self = Self(-1000069000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl FormatFeatureFlags {
pub const TRANSFER_SRC: Self = Self(0b100_0000_0000_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl FormatFeatureFlags {
pub const TRANSFER_DST: Self = Self(0b1000_0000_0000_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl ImageCreateFlags {
pub const TYPE_2D_ARRAY_COMPATIBLE: Self = Self(0b10_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl ImageCreateFlags {
pub const BLOCK_TEXEL_VIEW_COMPATIBLE: Self = Self(0b1000_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl ImageCreateFlags {
pub const EXTENDED_USAGE: Self = Self(0b1_0000_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: Self = Self(1_000_117_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO: Self = Self(1_000_117_001);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const IMAGE_VIEW_USAGE_CREATE_INFO: Self = Self(1_000_117_002);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO: Self = Self(1_000_117_003);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl ImageLayout {
pub const DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL: Self = Self(1_000_117_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl ImageLayout {
pub const DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL: Self = Self(1_000_117_001);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const RENDER_PASS_MULTIVIEW_CREATE_INFO: Self = Self(1_000_053_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_MULTIVIEW_FEATURES: Self = Self(1_000_053_001);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: Self = Self(1_000_053_002);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl DependencyFlags {
pub const VIEW_LOCAL: Self = Self(0b10);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: Self = Self(1_000_120_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES: Self =
Self::PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES;
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PROTECTED_SUBMIT_INFO: Self = Self(1_000_145_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: Self = Self(1_000_145_001);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: Self = Self(1_000_145_002);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const DEVICE_QUEUE_INFO_2: Self = Self(1_000_145_003);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl QueueFlags {
pub const PROTECTED: Self = Self(0b1_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl DeviceQueueCreateFlags {
pub const PROTECTED: Self = Self(0b1);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl MemoryPropertyFlags {
pub const PROTECTED: Self = Self(0b10_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl BufferCreateFlags {
#[doc = "Buffer requires protected memory"]
pub const PROTECTED: Self = Self(0b1000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl ImageCreateFlags {
pub const PROTECTED: Self = Self(0b1000_0000_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl CommandPoolCreateFlags {
#[doc = "Command buffers allocated from pool are protected command buffers"]
pub const PROTECTED: Self = Self(0b100);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const SAMPLER_YCBCR_CONVERSION_CREATE_INFO: Self = Self(1_000_156_000);
impl DependencyFlags {
#[doc = "Dependency is across devices"]
pub const DEVICE_GROUP: Self = Self(0b100);
pub const VIEW_LOCAL: Self = Self(0b10);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const SAMPLER_YCBCR_CONVERSION_INFO: Self = Self(1_000_156_001);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const BIND_IMAGE_PLANE_MEMORY_INFO: Self = Self(1_000_156_002);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: Self = Self(1_000_156_003);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: Self = Self(1_000_156_004);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: Self = Self(1_000_156_005);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl ObjectType {
pub const SAMPLER_YCBCR_CONVERSION: Self = Self(1_000_156_000);
impl DeviceQueueCreateFlags {
#[doc = "Queue is a protected-capable device queue"]
pub const PROTECTED: Self = Self(0b1);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G8B8G8R8_422_UNORM: Self = Self(1_000_156_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const B8G8R8G8_422_UNORM: Self = Self(1_000_156_001);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G8_B8_R8_3PLANE_420_UNORM: Self = Self(1_000_156_002);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G8_B8R8_2PLANE_420_UNORM: Self = Self(1_000_156_003);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G8_B8_R8_3PLANE_422_UNORM: Self = Self(1_000_156_004);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G8_B8R8_2PLANE_422_UNORM: Self = Self(1_000_156_005);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G8_B8_R8_3PLANE_444_UNORM: Self = Self(1_000_156_006);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const R10X6_UNORM_PACK16: Self = Self(1_000_156_007);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const R10X6G10X6_UNORM_2PACK16: Self = Self(1_000_156_008);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const R10X6G10X6B10X6A10X6_UNORM_4PACK16: Self = Self(1_000_156_009);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G10X6B10X6G10X6R10X6_422_UNORM_4PACK16: Self = Self(1_000_156_010);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const B10X6G10X6R10X6G10X6_422_UNORM_4PACK16: Self = Self(1_000_156_011);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16: Self = Self(1_000_156_012);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16: Self = Self(1_000_156_013);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16: Self = Self(1_000_156_014);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16: Self = Self(1_000_156_015);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16: Self = Self(1_000_156_016);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const R12X4_UNORM_PACK16: Self = Self(1_000_156_017);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const R12X4G12X4_UNORM_2PACK16: Self = Self(1_000_156_018);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const R12X4G12X4B12X4A12X4_UNORM_4PACK16: Self = Self(1_000_156_019);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G12X4B12X4G12X4R12X4_422_UNORM_4PACK16: Self = Self(1_000_156_020);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const B12X4G12X4R12X4G12X4_422_UNORM_4PACK16: Self = Self(1_000_156_021);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16: Self = Self(1_000_156_022);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16: Self = Self(1_000_156_023);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16: Self = Self(1_000_156_024);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16: Self = Self(1_000_156_025);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16: Self = Self(1_000_156_026);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G16B16G16R16_422_UNORM: Self = Self(1_000_156_027);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const B16G16R16G16_422_UNORM: Self = Self(1_000_156_028);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G16_B16_R16_3PLANE_420_UNORM: Self = Self(1_000_156_029);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G16_B16R16_2PLANE_420_UNORM: Self = Self(1_000_156_030);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G16_B16_R16_3PLANE_422_UNORM: Self = Self(1_000_156_031);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G16_B16R16_2PLANE_422_UNORM: Self = Self(1_000_156_032);
pub const G16_B16_R16_3PLANE_444_UNORM: Self = Self(1_000_156_033);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Format {
pub const G16_B16_R16_3PLANE_444_UNORM: Self = Self(1_000_156_033);
impl FormatFeatureFlags {
#[doc = "Format can be used as the source image of image transfer commands"]
pub const TRANSFER_SRC: Self = Self(0b100_0000_0000_0000);
#[doc = "Format can be used as the destination image of image transfer commands"]
pub const TRANSFER_DST: Self = Self(0b1000_0000_0000_0000);
#[doc = "Format can have midpoint rather than cosited chroma samples"]
pub const MIDPOINT_CHROMA_SAMPLES: Self = Self(0b10_0000_0000_0000_0000);
#[doc = "Format can be used with linear filtering whilst color conversion is enabled"]
pub const SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER: Self = Self(0b100_0000_0000_0000_0000);
#[doc = "Format can have different chroma, min and mag filters"]
pub const SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER: Self =
Self(0b1000_0000_0000_0000_0000);
pub const SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT: Self =
Self(0b1_0000_0000_0000_0000_0000);
pub const SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE: Self =
Self(0b10_0000_0000_0000_0000_0000);
#[doc = "Format supports disjoint planes"]
pub const DISJOINT: Self = Self(0b100_0000_0000_0000_0000_0000);
#[doc = "Format can have cosited rather than midpoint chroma samples"]
pub const COSITED_CHROMA_SAMPLES: Self = Self(0b1000_0000_0000_0000_0000_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl ImageAspectFlags {
pub const PLANE_0: Self = Self(0b1_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl ImageAspectFlags {
pub const PLANE_1: Self = Self(0b10_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl ImageAspectFlags {
pub const PLANE_2: Self = Self(0b100_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl ImageCreateFlags {
pub const ALIAS: Self = Self(0b100_0000_0000);
#[doc = "Allows using VkBindImageMemoryDeviceGroupInfo::pSplitInstanceBindRegions when binding memory to the image"]
pub const SPLIT_INSTANCE_BIND_REGIONS: Self = Self(0b100_0000);
#[doc = "The 3D image can be viewed as a 2D or 2D array image"]
pub const TYPE_2D_ARRAY_COMPATIBLE: Self = Self(0b10_0000);
pub const BLOCK_TEXEL_VIEW_COMPATIBLE: Self = Self(0b1000_0000);
pub const EXTENDED_USAGE: Self = Self(0b1_0000_0000);
#[doc = "Image requires protected memory"]
pub const PROTECTED: Self = Self(0b1000_0000_0000);
pub const DISJOINT: Self = Self(0b10_0000_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl FormatFeatureFlags {
pub const MIDPOINT_CHROMA_SAMPLES: Self = Self(0b10_0000_0000_0000_0000);
impl ImageLayout {
pub const DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL: Self = Self(1_000_117_000);
pub const DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL: Self = Self(1_000_117_001);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl FormatFeatureFlags {
pub const SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER: Self = Self(0b100_0000_0000_0000_0000);
impl MemoryHeapFlags {
#[doc = "If set, heap allocations allocate multiple instances by default"]
pub const MULTI_INSTANCE: Self = Self(0b10);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl FormatFeatureFlags {
pub const SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER: Self =
Self(0b1000_0000_0000_0000_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl FormatFeatureFlags {
pub const SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT: Self =
Self(0b1_0000_0000_0000_0000_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl FormatFeatureFlags {
pub const SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE: Self =
Self(0b10_0000_0000_0000_0000_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl FormatFeatureFlags {
pub const DISJOINT: Self = Self(0b100_0000_0000_0000_0000_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl FormatFeatureFlags {
pub const COSITED_CHROMA_SAMPLES: Self = Self(0b1000_0000_0000_0000_0000_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO: Self = Self(1_000_085_000);
impl MemoryPropertyFlags {
#[doc = "Memory is protected"]
pub const PROTECTED: Self = Self(0b10_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl ObjectType {
pub const SAMPLER_YCBCR_CONVERSION: Self = Self(1_000_156_000);
pub const DESCRIPTOR_UPDATE_TEMPLATE: Self = Self(1_000_085_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: Self = Self(1_000_071_000);
impl PipelineCreateFlags {
pub const VIEW_INDEX_FROM_DEVICE_INDEX: Self = Self(0b1000);
pub const DISPATCH_BASE: Self = Self(0b1_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const EXTERNAL_IMAGE_FORMAT_PROPERTIES: Self = Self(1_000_071_001);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO: Self = Self(1_000_071_002);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const EXTERNAL_BUFFER_PROPERTIES: Self = Self(1_000_071_003);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_ID_PROPERTIES: Self = Self(1_000_071_004);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const EXTERNAL_MEMORY_BUFFER_CREATE_INFO: Self = Self(1_000_072_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const EXTERNAL_MEMORY_IMAGE_CREATE_INFO: Self = Self(1_000_072_001);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const EXPORT_MEMORY_ALLOCATE_INFO: Self = Self(1_000_072_002);
impl QueueFlags {
#[doc = "Queues may support protected operations"]
pub const PROTECTED: Self = Self(0b1_0000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl Result {
pub const ERROR_INVALID_EXTERNAL_HANDLE: Self = Self(-1000072003);
pub const ERROR_OUT_OF_POOL_MEMORY: Self = Self(-1_000_069_000);
pub const ERROR_INVALID_EXTERNAL_HANDLE: Self = Self(-1_000_072_003);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: Self = Self(1_000_094_000);
pub const BIND_BUFFER_MEMORY_INFO: Self = Self(1_000_157_000);
pub const BIND_IMAGE_MEMORY_INFO: Self = Self(1_000_157_001);
pub const PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: Self = Self(1_000_083_000);
pub const MEMORY_DEDICATED_REQUIREMENTS: Self = Self(1_000_127_000);
pub const MEMORY_DEDICATED_ALLOCATE_INFO: Self = Self(1_000_127_001);
pub const MEMORY_ALLOCATE_FLAGS_INFO: Self = Self(1_000_060_000);
pub const DEVICE_GROUP_RENDER_PASS_BEGIN_INFO: Self = Self(1_000_060_003);
pub const DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO: Self = Self(1_000_060_004);
pub const DEVICE_GROUP_SUBMIT_INFO: Self = Self(1_000_060_005);
pub const DEVICE_GROUP_BIND_SPARSE_INFO: Self = Self(1_000_060_006);
pub const BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO: Self = Self(1_000_060_013);
pub const BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: Self = Self(1_000_060_014);
pub const PHYSICAL_DEVICE_GROUP_PROPERTIES: Self = Self(1_000_070_000);
pub const DEVICE_GROUP_DEVICE_CREATE_INFO: Self = Self(1_000_070_001);
pub const BUFFER_MEMORY_REQUIREMENTS_INFO_2: Self = Self(1_000_146_000);
pub const IMAGE_MEMORY_REQUIREMENTS_INFO_2: Self = Self(1_000_146_001);
pub const IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2: Self = Self(1_000_146_002);
pub const MEMORY_REQUIREMENTS_2: Self = Self(1_000_146_003);
pub const SPARSE_IMAGE_MEMORY_REQUIREMENTS_2: Self = Self(1_000_146_004);
pub const PHYSICAL_DEVICE_FEATURES_2: Self = Self(1_000_059_000);
pub const PHYSICAL_DEVICE_PROPERTIES_2: Self = Self(1_000_059_001);
pub const FORMAT_PROPERTIES_2: Self = Self(1_000_059_002);
pub const IMAGE_FORMAT_PROPERTIES_2: Self = Self(1_000_059_003);
pub const PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2: Self = Self(1_000_059_004);
pub const QUEUE_FAMILY_PROPERTIES_2: Self = Self(1_000_059_005);
pub const PHYSICAL_DEVICE_MEMORY_PROPERTIES_2: Self = Self(1_000_059_006);
pub const SPARSE_IMAGE_FORMAT_PROPERTIES_2: Self = Self(1_000_059_007);
pub const PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2: Self = Self(1_000_059_008);
pub const PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: Self = Self(1_000_117_000);
pub const RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO: Self = Self(1_000_117_001);
pub const IMAGE_VIEW_USAGE_CREATE_INFO: Self = Self(1_000_117_002);
pub const PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO: Self = Self(1_000_117_003);
pub const RENDER_PASS_MULTIVIEW_CREATE_INFO: Self = Self(1_000_053_000);
pub const PHYSICAL_DEVICE_MULTIVIEW_FEATURES: Self = Self(1_000_053_001);
pub const PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: Self = Self(1_000_053_002);
pub const PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: Self = Self(1_000_120_000);
pub const PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES: Self =
Self::PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES;
pub const PROTECTED_SUBMIT_INFO: Self = Self(1_000_145_000);
pub const PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: Self = Self(1_000_145_001);
pub const PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: Self = Self(1_000_145_002);
pub const DEVICE_QUEUE_INFO_2: Self = Self(1_000_145_003);
pub const SAMPLER_YCBCR_CONVERSION_CREATE_INFO: Self = Self(1_000_156_000);
pub const SAMPLER_YCBCR_CONVERSION_INFO: Self = Self(1_000_156_001);
pub const BIND_IMAGE_PLANE_MEMORY_INFO: Self = Self(1_000_156_002);
pub const IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: Self = Self(1_000_156_003);
pub const PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: Self = Self(1_000_156_004);
pub const SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: Self = Self(1_000_156_005);
pub const DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO: Self = Self(1_000_085_000);
pub const PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: Self = Self(1_000_071_000);
pub const EXTERNAL_IMAGE_FORMAT_PROPERTIES: Self = Self(1_000_071_001);
pub const PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO: Self = Self(1_000_071_002);
pub const EXTERNAL_BUFFER_PROPERTIES: Self = Self(1_000_071_003);
pub const PHYSICAL_DEVICE_ID_PROPERTIES: Self = Self(1_000_071_004);
pub const EXTERNAL_MEMORY_BUFFER_CREATE_INFO: Self = Self(1_000_072_000);
pub const EXTERNAL_MEMORY_IMAGE_CREATE_INFO: Self = Self(1_000_072_001);
pub const EXPORT_MEMORY_ALLOCATE_INFO: Self = Self(1_000_072_002);
pub const PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO: Self = Self(1_000_112_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const EXTERNAL_FENCE_PROPERTIES: Self = Self(1_000_112_001);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const EXPORT_FENCE_CREATE_INFO: Self = Self(1_000_113_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const EXPORT_SEMAPHORE_CREATE_INFO: Self = Self(1_000_077_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO: Self = Self(1_000_076_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const EXTERNAL_SEMAPHORE_PROPERTIES: Self = Self(1_000_076_001);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: Self = Self(1_000_168_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const DESCRIPTOR_SET_LAYOUT_SUPPORT: Self = Self(1_000_168_001);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: Self = Self(1_000_063_000);
}
#[doc = "Generated from 'VK_VERSION_1_1'"]
impl StructureType {
pub const PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES: Self =
Self::PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES;
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: Self = Self(49);
impl BufferCreateFlags {
pub const DEVICE_ADDRESS_CAPTURE_REPLAY: Self = Self(0b1_0000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: Self = Self(50);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: Self = Self(51);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES: Self = Self(52);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const IMAGE_FORMAT_LIST_CREATE_INFO: Self = Self(1_000_147_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const ATTACHMENT_DESCRIPTION_2: Self = Self(1_000_109_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const ATTACHMENT_REFERENCE_2: Self = Self(1_000_109_001);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const SUBPASS_DESCRIPTION_2: Self = Self(1_000_109_002);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const SUBPASS_DEPENDENCY_2: Self = Self(1_000_109_003);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const RENDER_PASS_CREATE_INFO_2: Self = Self(1_000_109_004);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const SUBPASS_BEGIN_INFO: Self = Self(1_000_109_005);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const SUBPASS_END_INFO: Self = Self(1_000_109_006);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: Self = Self(1_000_177_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_DRIVER_PROPERTIES: Self = Self(1_000_196_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: Self = Self(1_000_180_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: Self = Self(1_000_082_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES: Self = Self(1_000_197_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO: Self = Self(1_000_161_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: Self = Self(1_000_161_001);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES: Self = Self(1_000_161_002);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO: Self = Self(1_000_161_003);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT: Self = Self(1_000_161_004);
impl BufferUsageFlags {
pub const SHADER_DEVICE_ADDRESS: Self = Self(0b10_0000_0000_0000_0000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl DescriptorPoolCreateFlags {
@ -646,162 +223,81 @@ impl DescriptorSetLayoutCreateFlags {
pub const UPDATE_AFTER_BIND_POOL: Self = Self(0b10);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl Result {
pub const ERROR_FRAGMENTATION: Self = Self(-1000161000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: Self = Self(1_000_199_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE: Self = Self(1_000_199_001);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: Self = Self(1_000_221_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const IMAGE_STENCIL_USAGE_CREATE_INFO: Self = Self(1_000_246_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES: Self = Self(1_000_130_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const SAMPLER_REDUCTION_MODE_CREATE_INFO: Self = Self(1_000_130_001);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl FormatFeatureFlags {
#[doc = "Format can be used with min/max reduction filtering"]
pub const SAMPLED_IMAGE_FILTER_MINMAX: Self = Self(0b1_0000_0000_0000_0000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: Self = Self(1_000_211_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: Self = Self(1_000_108_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const FRAMEBUFFER_ATTACHMENTS_CREATE_INFO: Self = Self(1_000_108_001);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const FRAMEBUFFER_ATTACHMENT_IMAGE_INFO: Self = Self(1_000_108_002);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const RENDER_PASS_ATTACHMENT_BEGIN_INFO: Self = Self(1_000_108_003);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl FramebufferCreateFlags {
pub const IMAGELESS: Self = Self(0b1);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: Self = Self(1_000_253_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: Self = Self(1_000_175_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: Self = Self(1_000_241_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const ATTACHMENT_REFERENCE_STENCIL_LAYOUT: Self = Self(1_000_241_001);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT: Self = Self(1_000_241_002);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl ImageLayout {
pub const DEPTH_ATTACHMENT_OPTIMAL: Self = Self(1_000_241_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl ImageLayout {
pub const DEPTH_READ_ONLY_OPTIMAL: Self = Self(1_000_241_001);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl ImageLayout {
pub const STENCIL_ATTACHMENT_OPTIMAL: Self = Self(1_000_241_002);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl ImageLayout {
pub const STENCIL_READ_ONLY_OPTIMAL: Self = Self(1_000_241_003);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: Self = Self(1_000_261_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: Self = Self(1_000_207_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES: Self = Self(1_000_207_001);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const SEMAPHORE_TYPE_CREATE_INFO: Self = Self(1_000_207_002);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const TIMELINE_SEMAPHORE_SUBMIT_INFO: Self = Self(1_000_207_003);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const SEMAPHORE_WAIT_INFO: Self = Self(1_000_207_004);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const SEMAPHORE_SIGNAL_INFO: Self = Self(1_000_207_005);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: Self = Self(1_000_257_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const BUFFER_DEVICE_ADDRESS_INFO: Self = Self(1_000_244_001);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO: Self = Self(1_000_257_002);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO: Self = Self(1_000_257_003);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO: Self = Self(1_000_257_004);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl BufferUsageFlags {
pub const SHADER_DEVICE_ADDRESS: Self = Self(0b10_0000_0000_0000_0000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl BufferCreateFlags {
pub const DEVICE_ADDRESS_CAPTURE_REPLAY: Self = Self(0b1_0000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl MemoryAllocateFlags {
pub const DEVICE_ADDRESS: Self = Self(0b10);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl MemoryAllocateFlags {
pub const DEVICE_ADDRESS_CAPTURE_REPLAY: Self = Self(0b100);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl Result {
pub const ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS: Self = Self(-1000257000);
pub const ERROR_FRAGMENTATION: Self = Self(-1_000_161_000);
pub const ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS: Self = Self(-1_000_257_000);
}
#[doc = "Generated from 'VK_VERSION_1_2'"]
impl StructureType {
pub const PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: Self = Self(49);
pub const PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: Self = Self(50);
pub const PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: Self = Self(51);
pub const PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES: Self = Self(52);
pub const IMAGE_FORMAT_LIST_CREATE_INFO: Self = Self(1_000_147_000);
pub const ATTACHMENT_DESCRIPTION_2: Self = Self(1_000_109_000);
pub const ATTACHMENT_REFERENCE_2: Self = Self(1_000_109_001);
pub const SUBPASS_DESCRIPTION_2: Self = Self(1_000_109_002);
pub const SUBPASS_DEPENDENCY_2: Self = Self(1_000_109_003);
pub const RENDER_PASS_CREATE_INFO_2: Self = Self(1_000_109_004);
pub const SUBPASS_BEGIN_INFO: Self = Self(1_000_109_005);
pub const SUBPASS_END_INFO: Self = Self(1_000_109_006);
pub const PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: Self = Self(1_000_177_000);
pub const PHYSICAL_DEVICE_DRIVER_PROPERTIES: Self = Self(1_000_196_000);
pub const PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: Self = Self(1_000_180_000);
pub const PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: Self = Self(1_000_082_000);
pub const PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES: Self = Self(1_000_197_000);
pub const DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO: Self = Self(1_000_161_000);
pub const PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: Self = Self(1_000_161_001);
pub const PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES: Self = Self(1_000_161_002);
pub const DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO: Self = Self(1_000_161_003);
pub const DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT: Self = Self(1_000_161_004);
pub const PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: Self = Self(1_000_199_000);
pub const SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE: Self = Self(1_000_199_001);
pub const PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: Self = Self(1_000_221_000);
pub const IMAGE_STENCIL_USAGE_CREATE_INFO: Self = Self(1_000_246_000);
pub const PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES: Self = Self(1_000_130_000);
pub const SAMPLER_REDUCTION_MODE_CREATE_INFO: Self = Self(1_000_130_001);
pub const PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: Self = Self(1_000_211_000);
pub const PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: Self = Self(1_000_108_000);
pub const FRAMEBUFFER_ATTACHMENTS_CREATE_INFO: Self = Self(1_000_108_001);
pub const FRAMEBUFFER_ATTACHMENT_IMAGE_INFO: Self = Self(1_000_108_002);
pub const RENDER_PASS_ATTACHMENT_BEGIN_INFO: Self = Self(1_000_108_003);
pub const PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: Self = Self(1_000_253_000);
pub const PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: Self = Self(1_000_175_000);
pub const PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: Self = Self(1_000_241_000);
pub const ATTACHMENT_REFERENCE_STENCIL_LAYOUT: Self = Self(1_000_241_001);
pub const ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT: Self = Self(1_000_241_002);
pub const PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: Self = Self(1_000_261_000);
pub const PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: Self = Self(1_000_207_000);
pub const PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES: Self = Self(1_000_207_001);
pub const SEMAPHORE_TYPE_CREATE_INFO: Self = Self(1_000_207_002);
pub const TIMELINE_SEMAPHORE_SUBMIT_INFO: Self = Self(1_000_207_003);
pub const SEMAPHORE_WAIT_INFO: Self = Self(1_000_207_004);
pub const SEMAPHORE_SIGNAL_INFO: Self = Self(1_000_207_005);
pub const PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: Self = Self(1_000_257_000);
pub const BUFFER_DEVICE_ADDRESS_INFO: Self = Self(1_000_244_001);
pub const BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO: Self = Self(1_000_257_002);
pub const MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO: Self = Self(1_000_257_003);
pub const DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO: Self = Self(1_000_257_004);
}

20
third_party/rust/ash/src/vk/features.rs поставляемый
Просмотреть файл

@ -16,7 +16,7 @@ impl StaticFn {
where
F: FnMut(&::std::ffi::CStr) -> *const c_void,
{
StaticFn {
Self {
get_instance_proc_addr: unsafe {
unsafe extern "system" fn get_instance_proc_addr(
_instance: Instance,
@ -77,7 +77,7 @@ impl EntryFnV1_0 {
where
F: FnMut(&::std::ffi::CStr) -> *const c_void,
{
EntryFnV1_0 {
Self {
create_instance: unsafe {
unsafe extern "system" fn create_instance(
_p_create_info: *const InstanceCreateInfo,
@ -268,7 +268,7 @@ impl InstanceFnV1_0 {
where
F: FnMut(&::std::ffi::CStr) -> *const c_void,
{
InstanceFnV1_0 {
Self {
destroy_instance: unsafe {
unsafe extern "system" fn destroy_instance(
_instance: Instance,
@ -1605,7 +1605,7 @@ impl DeviceFnV1_0 {
where
F: FnMut(&::std::ffi::CStr) -> *const c_void,
{
DeviceFnV1_0 {
Self {
destroy_device: unsafe {
unsafe extern "system" fn destroy_device(
_device: Device,
@ -5163,7 +5163,7 @@ impl EntryFnV1_1 {
where
F: FnMut(&::std::ffi::CStr) -> *const c_void,
{
EntryFnV1_1 {
Self {
enumerate_instance_version: unsafe {
unsafe extern "system" fn enumerate_instance_version(
_p_api_version: *mut u32,
@ -5217,7 +5217,7 @@ impl InstanceFnV1_1 {
where
F: FnMut(&::std::ffi::CStr) -> *const c_void,
{
InstanceFnV1_1 {
Self {
enumerate_physical_device_groups: unsafe {
unsafe extern "system" fn enumerate_physical_device_groups(
_instance: Instance,
@ -5608,7 +5608,7 @@ impl DeviceFnV1_1 {
where
F: FnMut(&::std::ffi::CStr) -> *const c_void,
{
DeviceFnV1_1 {
Self {
bind_buffer_memory2: unsafe {
unsafe extern "system" fn bind_buffer_memory2(
_device: Device,
@ -6122,7 +6122,7 @@ impl EntryFnV1_2 {
where
F: FnMut(&::std::ffi::CStr) -> *const c_void,
{
EntryFnV1_2 {}
Self {}
}
}
#[derive(Clone)]
@ -6134,7 +6134,7 @@ impl InstanceFnV1_2 {
where
F: FnMut(&::std::ffi::CStr) -> *const c_void,
{
InstanceFnV1_2 {}
Self {}
}
}
#[derive(Clone)]
@ -6161,7 +6161,7 @@ impl DeviceFnV1_2 {
where
F: FnMut(&::std::ffi::CStr) -> *const c_void,
{
DeviceFnV1_2 {
Self {
cmd_draw_indirect_count: unsafe {
unsafe extern "system" fn cmd_draw_indirect_count(
_command_buffer: CommandBuffer,

85
third_party/rust/ash/src/vk/macros.rs поставляемый
Просмотреть файл

@ -1,23 +1,19 @@
#[macro_export]
macro_rules! vk_bitflags_wrapped {
($ name : ident , $ all : expr , $ flag_type : ty) => {
($ name : ident , $ flag_type : ty) => {
impl Default for $name {
fn default() -> $name {
$name(0)
fn default() -> Self {
Self(0)
}
}
impl $name {
#[inline]
pub const fn empty() -> $name {
$name(0)
}
#[inline]
pub const fn all() -> $name {
$name($all)
pub const fn empty() -> Self {
Self(0)
}
#[inline]
pub const fn from_raw(x: $flag_type) -> Self {
$name(x)
Self(x)
}
#[inline]
pub const fn as_raw(self) -> $flag_type {
@ -25,79 +21,62 @@ macro_rules! vk_bitflags_wrapped {
}
#[inline]
pub fn is_empty(self) -> bool {
self == $name::empty()
self == Self::empty()
}
#[inline]
pub fn is_all(self) -> bool {
self & $name::all() == $name::all()
}
#[inline]
pub fn intersects(self, other: $name) -> bool {
self & other != $name::empty()
pub fn intersects(self, other: Self) -> bool {
self & other != Self::empty()
}
#[doc = r" Returns whether `other` is a subset of `self`"]
#[inline]
pub fn contains(self, other: $name) -> bool {
pub fn contains(self, other: Self) -> bool {
self & other == other
}
}
impl ::std::ops::BitOr for $name {
type Output = $name;
type Output = Self;
#[inline]
fn bitor(self, rhs: $name) -> $name {
$name(self.0 | rhs.0)
fn bitor(self, rhs: Self) -> Self {
Self(self.0 | rhs.0)
}
}
impl ::std::ops::BitOrAssign for $name {
#[inline]
fn bitor_assign(&mut self, rhs: $name) {
fn bitor_assign(&mut self, rhs: Self) {
*self = *self | rhs
}
}
impl ::std::ops::BitAnd for $name {
type Output = $name;
type Output = Self;
#[inline]
fn bitand(self, rhs: $name) -> $name {
$name(self.0 & rhs.0)
fn bitand(self, rhs: Self) -> Self {
Self(self.0 & rhs.0)
}
}
impl ::std::ops::BitAndAssign for $name {
#[inline]
fn bitand_assign(&mut self, rhs: $name) {
fn bitand_assign(&mut self, rhs: Self) {
*self = *self & rhs
}
}
impl ::std::ops::BitXor for $name {
type Output = $name;
type Output = Self;
#[inline]
fn bitxor(self, rhs: $name) -> $name {
$name(self.0 ^ rhs.0)
fn bitxor(self, rhs: Self) -> Self {
Self(self.0 ^ rhs.0)
}
}
impl ::std::ops::BitXorAssign for $name {
#[inline]
fn bitxor_assign(&mut self, rhs: $name) {
fn bitxor_assign(&mut self, rhs: Self) {
*self = *self ^ rhs
}
}
impl ::std::ops::Sub for $name {
type Output = $name;
#[inline]
fn sub(self, rhs: $name) -> $name {
self & !rhs
}
}
impl ::std::ops::SubAssign for $name {
#[inline]
fn sub_assign(&mut self, rhs: $name) {
*self = *self - rhs
}
}
impl ::std::ops::Not for $name {
type Output = $name;
type Output = Self;
#[inline]
fn not(self) -> $name {
self ^ $name::all()
fn not(self) -> Self {
Self(!self.0)
}
}
};
@ -118,12 +97,12 @@ macro_rules! handle_nondispatchable {
self.0 as u64
}
fn from_raw(x: u64) -> Self {
$name(x as _)
Self(x as _)
}
}
impl $name {
pub const fn null() -> $name {
$name(0)
pub const fn null() -> Self {
Self(0)
}
}
impl fmt::Pointer for $name {
@ -149,8 +128,8 @@ macro_rules! define_handle {
#[$doc_link]
pub struct $name(*mut u8);
impl Default for $name {
fn default() -> $name {
$name::null()
fn default() -> Self {
Self::null()
}
}
impl Handle for $name {
@ -159,14 +138,14 @@ macro_rules! define_handle {
self.0 as u64
}
fn from_raw(x: u64) -> Self {
$name(x as _)
Self(x as _)
}
}
unsafe impl Send for $name {}
unsafe impl Sync for $name {}
impl $name {
pub const fn null() -> Self {
$name(::std::ptr::null_mut())
Self(::std::ptr::null_mut())
}
}
impl fmt::Pointer for $name {

1754
third_party/rust/ash/src/vk/native.rs поставляемый

Разница между файлами не показана из-за своего большого размера Загрузить разницу

28
third_party/rust/ash/src/vk/prelude.rs поставляемый Normal file
Просмотреть файл

@ -0,0 +1,28 @@
/// Holds 24 bits in the least significant bits of memory,
/// and 8 bytes in the most significant bits of that memory,
/// occupying a single [`u32`] in total. This is commonly used in
/// [acceleration structure instances] such as
/// [`vk::AccelerationStructureInstanceKHR`][super::AccelerationStructureInstanceKHR],
/// [`vk::AccelerationStructureSRTMotionInstanceNV`][super::AccelerationStructureSRTMotionInstanceNV] and
/// [`vk::AccelerationStructureMatrixMotionInstanceNV`][super::AccelerationStructureMatrixMotionInstanceNV].
///
/// [acceleration structure instances]: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAccelerationStructureInstanceKHR.html#_description
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug)]
#[repr(transparent)]
pub struct Packed24_8(u32);
impl Packed24_8 {
pub fn new(low_24: u32, high_8: u8) -> Self {
Self((low_24 & 0x00ff_ffff) | (u32::from(high_8) << 24))
}
/// Extracts the least-significant 24 bits (3 bytes) of this integer
pub fn low_24(&self) -> u32 {
self.0 & 0xffffff
}
/// Extracts the most significant 8 bits (single byte) of this integer
pub fn high_8(&self) -> u8 {
(self.0 >> 24) as u8
}
}

2
third_party/rust/glow/.cargo-checksum.json поставляемый
Просмотреть файл

@ -1 +1 @@
{"files":{".github/FUNDING.yml":"c4bfbf64e3a1139bab67f2f6d04b3cd33bf587d7102ad52896cbbac4cb9a960f",".github/workflows/ci.yml":"fe1cfbdc70be5d6df7029894e49c66ce2f4700560b9dab11d159f613f8797b38","Cargo.toml":"8a98d52a54c933b84a7aeb50fc379fb2b8845a6ae484bfeaece1dee65820c1d9","LICENSE-APACHE":"769f80b5bcb42ed0af4e4d2fd74e1ac9bf843cb80c5a29219d1ef3544428a6bb","LICENSE-MIT":"30fefc3a7d6a0041541858293bcbea2dde4caa4c0a5802f996a7f7e8c0085652","README.md":"964d3a8155cb7b60102f5a5b34cf0376a81cca0a0aa8592a430e18e389553722","bors.toml":"06209f3018713efa5d526970d51676ab8cd618e05d01e56474539b6778406565","clippy.toml":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","rustfmt.toml":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","src/gl46.rs":"2c9fa79c1c0686ee5268af950f294b56acc57fd86857d6dff5e870f48ee59f43","src/lib.rs":"d4391649f2cb788238f2d91bb71d7d5a2f45fda6b2e8ef9f4f43f5d16053d3f0","src/native.rs":"64c45e9d3ecbac0ec75ce300ae844fe659e44e7a06683543d22a67e4fc053b73","src/version.rs":"4adcda91205727be9b984f40e1c5e7b23c7502e7c49b2606c373d3fa4f7679e7","src/web_sys.rs":"294e8646e4a83e14226b6bdbeda3aff2d84fee8e180ea12cfd5f0ad145eab254"},"package":null}
{"files":{"Cargo.toml":"2ff6da0f7927418e38b605f804303d65b2fe9e47826a4ea812db7a8b166dcd96","LICENSE-APACHE":"b8601fc79bdf8d8088f0938bea861ffc63ed0eebbedf25f44ab2cf2e85bd7edc","LICENSE-MIT":"cdbd06e25b8c9c5d6019949d2de8123f56d29cee4166396423d2ba8c81700845","README.md":"2ac1eb0ed3d808c5e55e1dd47c893c32ed6975b3285c016c518b117979d9f282","bors.toml":"1a13121a179fff004a1b8b9b507eee1834c7a0c6ffdd99d94e9fc74defd8fa02","clippy.toml":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","rustfmt.toml":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","src/gl46.rs":"3fda7232f6dbea4e63361eb5ed12220c3c2fb6cda3fa77f19e9320cb77e85802","src/lib.rs":"3a2e3f258a78ec5e6c4f3a175425f7c77d35036a0d7d71b15d6a9fcb0d340702","src/native.rs":"c8d63076655ab6cde4f2ae63f064b0c2c0482163d1f5c488bb13f91a7c74016c","src/version.rs":"0c2694e3897170b8f22d8e615ca862e169cd8b28c8f15cc1180f0da29c92905a","src/web_sys.rs":"75bc06897931a4b1fcee136658e31e87610c9af164a6ac64fc0654a231fbefd7"},"package":"d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919"}

1
third_party/rust/glow/.github/FUNDING.yml поставляемый
Просмотреть файл

@ -1 +0,0 @@
github: [grovesNL]

Просмотреть файл

@ -1,68 +0,0 @@
name: CI
on:
push:
branches-ignore: [staging.tmp]
pull_request:
branches-ignore: [staging.tmp]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [pinned, stable, beta, nightly, macos, windows]
include:
- build: pinned
os: ubuntu-18.04
rust: 1.49.0
sdl: true
- build: stable
os: ubuntu-18.04
rust: stable
sdl: true
- build: beta
os: ubuntu-18.04
rust: beta
sdl: true
- build: nightly
os: ubuntu-18.04
rust: nightly
sdl: true
- build: macos
os: macos-10.15
rust: stable
sdl: false
- build: windows
os: windows-2019
rust: stable
sdl: false
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
profile: minimal
target: wasm32-unknown-unknown
- run: cargo build --verbose
- run: cargo build --verbose --target wasm32-unknown-unknown
- run: cargo test --verbose
- run: (cd examples/hello && cargo build --features glutin)
- run: (cd examples/hello && cargo build --target wasm32-unknown-unknown)
- name: sdl
if: ${{ matrix.sdl == true }}
run: |
sudo apt-get -qq update
sudo apt-get -qq install libsdl2-dev
cargo build --verbose
(cd examples/hello && cargo build --features sdl2)
- name: android
if: matrix.build == 'stable'
run: |
rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android
cargo build --verbose --target aarch64-linux-android
cargo build --verbose --target armv7-linux-androideabi
cargo build --verbose --target x86_64-linux-android

112
third_party/rust/glow/Cargo.toml поставляемый
Просмотреть файл

@ -1,94 +1,40 @@
[package]
name = "glow"
version = "0.11.1"
description = "GL on Whatever: a set of bindings to run GL (Open GL, OpenGL ES, and WebGL) anywhere, and avoid target-specific code."
authors = [
"Joshua Groves <josh@joshgroves.com>",
"Dzmitry Malyshau <kvarkus@gmail.com>",
]
homepage = "https://github.com/grovesNL/glow.git"
repository = "https://github.com/grovesNL/glow"
license = "MIT OR Apache-2.0"
edition = "2018"
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.
[package]
edition = "2018"
name = "glow"
version = "0.11.2"
authors = ["Joshua Groves <josh@joshgroves.com>", "Dzmitry Malyshau <kvarkus@gmail.com>"]
description = "GL on Whatever: a set of bindings to run GL (Open GL, OpenGL ES, and WebGL) anywhere, and avoid target-specific code."
homepage = "https://github.com/grovesNL/glow.git"
license = "MIT OR Apache-2.0"
repository = "https://github.com/grovesNL/glow"
[package.metadata.docs.rs]
default-target = "x86_64-unknown-linux-gnu"
targets = [
"x86_64-unknown-linux-gnu",
"x86_64-apple-darwin",
"x86_64-pc-windows-msvc",
"i686-unknown-linux-gnu",
"i686-pc-windows-msvc",
"wasm32-unknown-unknown"
]
targets = ["x86_64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-pc-windows-msvc", "i686-unknown-linux-gnu", "i686-pc-windows-msvc", "wasm32-unknown-unknown"]
[lib]
name = "glow"
path = "src/lib.rs"
[target."cfg(target_arch = \"wasm32\")".dependencies.js-sys]
version = "~0.3"
[target.'cfg(target_arch = "wasm32")'.dependencies]
js-sys = "~0.3"
wasm-bindgen = "~0.2"
slotmap = "1"
[target."cfg(target_arch = \"wasm32\")".dependencies.slotmap]
version = "1"
[target.'cfg(target_arch = "wasm32")'.dependencies.web_sys]
[target."cfg(target_arch = \"wasm32\")".dependencies.wasm-bindgen]
version = "~0.2"
[target."cfg(target_arch = \"wasm32\")".dependencies.web_sys]
version = "~0.3.37"
features = ["Document", "Element", "HtmlCanvasElement", "HtmlImageElement", "ImageBitmap", "WebGlActiveInfo", "WebGlBuffer", "WebGlFramebuffer", "WebGlProgram", "WebGlQuery", "WebGlRenderbuffer", "WebGlRenderingContext", "WebGl2RenderingContext", "WebGlSampler", "WebGlShader", "WebGlSync", "WebGlTexture", "WebGlTransformFeedback", "WebGlUniformLocation", "WebGlVertexArrayObject", "Window", "AngleInstancedArrays", "ExtBlendMinmax", "ExtColorBufferFloat", "ExtColorBufferHalfFloat", "ExtDisjointTimerQuery", "ExtFragDepth", "ExtShaderTextureLod", "ExtSRgb", "ExtTextureFilterAnisotropic", "OesElementIndexUint", "OesStandardDerivatives", "OesTextureFloat", "OesTextureFloatLinear", "OesTextureHalfFloat", "OesTextureHalfFloatLinear", "OesVertexArrayObject", "WebglColorBufferFloat", "WebglCompressedTextureAstc", "WebglCompressedTextureEtc", "WebglCompressedTextureEtc1", "WebglCompressedTexturePvrtc", "WebglCompressedTextureS3tc", "WebglCompressedTextureS3tcSrgb", "WebglDebugRendererInfo", "WebglDebugShaders", "WebglDepthTexture", "WebglDrawBuffers", "WebglLoseContext"]
package = "web-sys"
features = [
"Document",
"Element",
"HtmlCanvasElement",
"HtmlImageElement",
"ImageBitmap",
"WebGlActiveInfo",
"WebGlBuffer",
"WebGlFramebuffer",
"WebGlProgram",
"WebGlQuery",
"WebGlRenderbuffer",
"WebGlRenderingContext",
"WebGl2RenderingContext",
"WebGlSampler",
"WebGlShader",
"WebGlSync",
"WebGlTexture",
"WebGlTransformFeedback",
"WebGlUniformLocation",
"WebGlVertexArrayObject",
"Window",
"AngleInstancedArrays",
"ExtBlendMinmax",
"ExtColorBufferFloat",
"ExtColorBufferHalfFloat",
"ExtDisjointTimerQuery",
"ExtFragDepth",
"ExtShaderTextureLod",
"ExtSRgb",
"ExtTextureFilterAnisotropic",
"OesElementIndexUint",
"OesStandardDerivatives",
"OesTextureFloat",
"OesTextureFloatLinear",
"OesTextureHalfFloat",
"OesTextureHalfFloatLinear",
"OesVertexArrayObject",
"WebglColorBufferFloat",
"WebglCompressedTextureAstc",
"WebglCompressedTextureEtc",
"WebglCompressedTextureEtc1",
"WebglCompressedTexturePvrtc",
"WebglCompressedTextureS3tc",
"WebglCompressedTextureS3tcSrgb",
"WebglDebugRendererInfo",
"WebglDebugShaders",
"WebglDepthTexture",
"WebglDrawBuffers",
"WebglLoseContext",
]
[workspace]
members = [
"examples/hello",
"examples/howto",
]

400
third_party/rust/glow/LICENSE-APACHE поставляемый
Просмотреть файл

@ -1,201 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

44
third_party/rust/glow/LICENSE-MIT поставляемый
Просмотреть файл

@ -1,23 +1,23 @@
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

68
third_party/rust/glow/README.md поставляемый
Просмотреть файл

@ -1,34 +1,34 @@
<h1 align="center">
glow
</h1>
<div align="center">
GL on Whatever: a set of bindings to run GL anywhere (Open GL, OpenGL ES, and WebGL) and avoid target-specific code.
</div>
<br />
<div align="center">
<img src="https://img.shields.io/badge/Min%20Rust-1.49-green.svg" alt="Minimum Rust Version">
<a href="https://crates.io/crates/glow"><img src="https://img.shields.io/crates/v/glow.svg?label=glow" alt="crates.io"></a>
<a href="https://docs.rs/glow"><img src="https://docs.rs/glow/badge.svg" alt="docs.rs"></a>
<a href="https://github.com/grovesNL/glow/actions"><img src="https://github.com/grovesNL/glow/workflows/CI/badge.svg?branch=main" alt="Build Status" /></a>
</div>
## Build commands
```sh
# native
cargo build
# web-sys
cargo build --target wasm32-unknown-unknown
```
## License
This project is licensed under either of [Apache License, Version
2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT), at your option.
## Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in this project by you, as defined in the Apache 2.0 license,
shall be dual licensed as above, without any additional terms or conditions.
<h1 align="center">
glow
</h1>
<div align="center">
GL on Whatever: a set of bindings to run GL anywhere (Open GL, OpenGL ES, and WebGL) and avoid target-specific code.
</div>
<br />
<div align="center">
<img src="https://img.shields.io/badge/Min%20Rust-1.49-green.svg" alt="Minimum Rust Version">
<a href="https://crates.io/crates/glow"><img src="https://img.shields.io/crates/v/glow.svg?label=glow" alt="crates.io"></a>
<a href="https://docs.rs/glow"><img src="https://docs.rs/glow/badge.svg" alt="docs.rs"></a>
<a href="https://github.com/grovesNL/glow/actions"><img src="https://github.com/grovesNL/glow/workflows/CI/badge.svg?branch=main" alt="Build Status" /></a>
</div>
## Build commands
```sh
# native
cargo build
# web-sys
cargo build --target wasm32-unknown-unknown
```
## License
This project is licensed under either of [Apache License, Version
2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT), at your option.
## Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in this project by you, as defined in the Apache 2.0 license,
shall be dual licensed as above, without any additional terms or conditions.

16
third_party/rust/glow/bors.toml поставляемый
Просмотреть файл

@ -1,8 +1,8 @@
status = [
"build (pinned)",
"build (stable)",
"build (beta)",
"build (nightly)",
"build (macos)",
"build (windows)"
]
status = [
"build (pinned)",
"build (stable)",
"build (beta)",
"build (nightly)",
"build (macos)",
"build (windows)"
]

71808
third_party/rust/glow/src/gl46.rs поставляемый

Разница между файлами не показана из-за своего большого размера Загрузить разницу

7918
third_party/rust/glow/src/lib.rs поставляемый

Разница между файлами не показана из-за своего большого размера Загрузить разницу

5540
third_party/rust/glow/src/native.rs поставляемый

Разница между файлами не показана из-за своего большого размера Загрузить разницу

422
third_party/rust/glow/src/version.rs поставляемый
Просмотреть файл

@ -1,211 +1,211 @@
/// A version number for a specific component of an OpenGL implementation
#[derive(Clone, Eq, Ord, PartialEq, PartialOrd)]
pub struct Version {
pub major: u32,
pub minor: u32,
pub is_embedded: bool,
pub revision: Option<u32>,
pub vendor_info: String,
}
impl Version {
/// Create a new OpenGL version number
pub(crate) fn new(major: u32, minor: u32, revision: Option<u32>, vendor_info: String) -> Self {
Version {
major: major,
minor: minor,
is_embedded: false,
revision: revision,
vendor_info,
}
}
/// Create a new OpenGL ES version number
pub(crate) fn new_embedded(major: u32, minor: u32, vendor_info: String) -> Self {
Version {
major,
minor,
is_embedded: true,
revision: None,
vendor_info,
}
}
/// According to the OpenGL specification, the version information is
/// expected to follow the following syntax:
///
/// ~~~bnf
/// <major> ::= <number>
/// <minor> ::= <number>
/// <revision> ::= <number>
/// <vendor-info> ::= <string>
/// <release> ::= <major> "." <minor> ["." <release>]
/// <version> ::= <release> [" " <vendor-info>]
/// ~~~
///
/// Note that this function is intentionally lenient in regards to parsing,
/// and will try to recover at least the first two version numbers without
/// resulting in an `Err`.
/// # Notes
/// `WebGL 2` version returned as `OpenGL ES 3.0`
pub(crate) fn parse(mut src: &str) -> Result<Version, &str> {
let webgl_sig = "WebGL ";
// According to the WebGL specification
// VERSION WebGL<space>1.0<space><vendor-specific information>
// SHADING_LANGUAGE_VERSION WebGL<space>GLSL<space>ES<space>1.0<space><vendor-specific information>
let is_webgl = src.starts_with(webgl_sig);
let is_es = if is_webgl {
let pos = src.rfind(webgl_sig).unwrap_or(0);
src = &src[pos + webgl_sig.len()..];
true
} else {
let es_sig = " ES ";
match src.rfind(es_sig) {
Some(pos) => {
src = &src[pos + es_sig.len()..];
true
}
None => false,
}
};
let glsl_es_sig = "GLSL ES ";
let is_glsl = match src.find(glsl_es_sig) {
Some(pos) => {
src = &src[pos + glsl_es_sig.len()..];
true
}
None => false,
};
let (version, vendor_info) = match src.find(' ') {
Some(i) => (&src[..i], src[i + 1..].to_string()),
None => (src, String::new()),
};
// TODO: make this even more lenient so that we can also accept
// `<major> "." <minor> [<???>]`
let mut it = version.split('.');
let major = it.next().and_then(|s| s.parse().ok());
let minor = it.next().and_then(|s| {
let trimmed = if s.starts_with('0') {
"0"
} else {
s.trim_end_matches('0')
};
trimmed.parse().ok()
});
let revision = if is_webgl {
None
} else {
it.next().and_then(|s| s.parse().ok())
};
match (major, minor, revision) {
(Some(major), Some(minor), revision) => Ok(Version {
// Return WebGL 2.0 version as OpenGL ES 3.0
major: if is_webgl && !is_glsl {
major + 1
} else {
major
},
minor,
is_embedded: is_es,
revision,
vendor_info,
}),
(_, _, _) => Err(src),
}
}
}
impl std::fmt::Debug for Version {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match (
self.major,
self.minor,
self.revision,
self.vendor_info.as_str(),
) {
(major, minor, Some(revision), "") => write!(f, "{}.{}.{}", major, minor, revision),
(major, minor, None, "") => write!(f, "{}.{}", major, minor),
(major, minor, Some(revision), vendor_info) => {
write!(f, "{}.{}.{}, {}", major, minor, revision, vendor_info)
}
(major, minor, None, vendor_info) => write!(f, "{}.{}, {}", major, minor, vendor_info),
}
}
}
#[cfg(test)]
mod tests {
use super::Version;
#[test]
fn test_version_parse() {
assert_eq!(Version::parse("1"), Err("1"));
assert_eq!(Version::parse("1."), Err("1."));
assert_eq!(Version::parse("1 h3l1o. W0rld"), Err("1 h3l1o. W0rld"));
assert_eq!(Version::parse("1. h3l1o. W0rld"), Err("1. h3l1o. W0rld"));
assert_eq!(
Version::parse("1.2.3"),
Ok(Version::new(1, 2, Some(3), String::new()))
);
assert_eq!(
Version::parse("1.2"),
Ok(Version::new(1, 2, None, String::new()))
);
assert_eq!(
Version::parse("1.2 h3l1o. W0rld"),
Ok(Version::new(1, 2, None, "h3l1o. W0rld".to_string()))
);
assert_eq!(
Version::parse("1.2.h3l1o. W0rld"),
Ok(Version::new(1, 2, None, "W0rld".to_string()))
);
assert_eq!(
Version::parse("1.2. h3l1o. W0rld"),
Ok(Version::new(1, 2, None, "h3l1o. W0rld".to_string()))
);
assert_eq!(
Version::parse("1.2.3.h3l1o. W0rld"),
Ok(Version::new(1, 2, Some(3), "W0rld".to_string()))
);
assert_eq!(
Version::parse("1.2.3 h3l1o. W0rld"),
Ok(Version::new(1, 2, Some(3), "h3l1o. W0rld".to_string()))
);
assert_eq!(
Version::parse("OpenGL ES 3.1"),
Ok(Version::new_embedded(3, 1, String::new()))
);
assert_eq!(
Version::parse("OpenGL ES 2.0 Google Nexus"),
Ok(Version::new_embedded(2, 0, "Google Nexus".to_string()))
);
assert_eq!(
Version::parse("GLSL ES 1.1"),
Ok(Version::new_embedded(1, 1, String::new()))
);
assert_eq!(
Version::parse("OpenGL ES GLSL ES 3.20"),
Ok(Version::new_embedded(3, 2, String::new()))
);
assert_eq!(
// WebGL 2.0 should parse as OpenGL ES 3.0
Version::parse("WebGL 2.0 (OpenGL ES 3.0 Chromium)"),
Ok(Version::new_embedded(
3,
0,
"(OpenGL ES 3.0 Chromium)".to_string()
))
);
assert_eq!(
Version::parse("WebGL GLSL ES 3.00 (OpenGL ES GLSL ES 3.0 Chromium)"),
Ok(Version::new_embedded(
3,
0,
"(OpenGL ES GLSL ES 3.0 Chromium)".to_string()
))
);
}
}
/// A version number for a specific component of an OpenGL implementation
#[derive(Clone, Eq, Ord, PartialEq, PartialOrd)]
pub struct Version {
pub major: u32,
pub minor: u32,
pub is_embedded: bool,
pub revision: Option<u32>,
pub vendor_info: String,
}
impl Version {
/// Create a new OpenGL version number
pub(crate) fn new(major: u32, minor: u32, revision: Option<u32>, vendor_info: String) -> Self {
Version {
major: major,
minor: minor,
is_embedded: false,
revision: revision,
vendor_info,
}
}
/// Create a new OpenGL ES version number
pub(crate) fn new_embedded(major: u32, minor: u32, vendor_info: String) -> Self {
Version {
major,
minor,
is_embedded: true,
revision: None,
vendor_info,
}
}
/// According to the OpenGL specification, the version information is
/// expected to follow the following syntax:
///
/// ~~~bnf
/// <major> ::= <number>
/// <minor> ::= <number>
/// <revision> ::= <number>
/// <vendor-info> ::= <string>
/// <release> ::= <major> "." <minor> ["." <release>]
/// <version> ::= <release> [" " <vendor-info>]
/// ~~~
///
/// Note that this function is intentionally lenient in regards to parsing,
/// and will try to recover at least the first two version numbers without
/// resulting in an `Err`.
/// # Notes
/// `WebGL 2` version returned as `OpenGL ES 3.0`
pub(crate) fn parse(mut src: &str) -> Result<Version, &str> {
let webgl_sig = "WebGL ";
// According to the WebGL specification
// VERSION WebGL<space>1.0<space><vendor-specific information>
// SHADING_LANGUAGE_VERSION WebGL<space>GLSL<space>ES<space>1.0<space><vendor-specific information>
let is_webgl = src.starts_with(webgl_sig);
let is_es = if is_webgl {
let pos = src.rfind(webgl_sig).unwrap_or(0);
src = &src[pos + webgl_sig.len()..];
true
} else {
let es_sig = " ES ";
match src.rfind(es_sig) {
Some(pos) => {
src = &src[pos + es_sig.len()..];
true
}
None => false,
}
};
let glsl_es_sig = "GLSL ES ";
let is_glsl = match src.find(glsl_es_sig) {
Some(pos) => {
src = &src[pos + glsl_es_sig.len()..];
true
}
None => false,
};
let (version, vendor_info) = match src.find(' ') {
Some(i) => (&src[..i], src[i + 1..].to_string()),
None => (src, String::new()),
};
// TODO: make this even more lenient so that we can also accept
// `<major> "." <minor> [<???>]`
let mut it = version.split('.');
let major = it.next().and_then(|s| s.parse().ok());
let minor = it.next().and_then(|s| {
let trimmed = if s.starts_with('0') {
"0"
} else {
s.trim_end_matches('0')
};
trimmed.parse().ok()
});
let revision = if is_webgl {
None
} else {
it.next().and_then(|s| s.parse().ok())
};
match (major, minor, revision) {
(Some(major), Some(minor), revision) => Ok(Version {
// Return WebGL 2.0 version as OpenGL ES 3.0
major: if is_webgl && !is_glsl {
major + 1
} else {
major
},
minor,
is_embedded: is_es,
revision,
vendor_info,
}),
(_, _, _) => Err(src),
}
}
}
impl std::fmt::Debug for Version {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match (
self.major,
self.minor,
self.revision,
self.vendor_info.as_str(),
) {
(major, minor, Some(revision), "") => write!(f, "{}.{}.{}", major, minor, revision),
(major, minor, None, "") => write!(f, "{}.{}", major, minor),
(major, minor, Some(revision), vendor_info) => {
write!(f, "{}.{}.{}, {}", major, minor, revision, vendor_info)
}
(major, minor, None, vendor_info) => write!(f, "{}.{}, {}", major, minor, vendor_info),
}
}
}
#[cfg(test)]
mod tests {
use super::Version;
#[test]
fn test_version_parse() {
assert_eq!(Version::parse("1"), Err("1"));
assert_eq!(Version::parse("1."), Err("1."));
assert_eq!(Version::parse("1 h3l1o. W0rld"), Err("1 h3l1o. W0rld"));
assert_eq!(Version::parse("1. h3l1o. W0rld"), Err("1. h3l1o. W0rld"));
assert_eq!(
Version::parse("1.2.3"),
Ok(Version::new(1, 2, Some(3), String::new()))
);
assert_eq!(
Version::parse("1.2"),
Ok(Version::new(1, 2, None, String::new()))
);
assert_eq!(
Version::parse("1.2 h3l1o. W0rld"),
Ok(Version::new(1, 2, None, "h3l1o. W0rld".to_string()))
);
assert_eq!(
Version::parse("1.2.h3l1o. W0rld"),
Ok(Version::new(1, 2, None, "W0rld".to_string()))
);
assert_eq!(
Version::parse("1.2. h3l1o. W0rld"),
Ok(Version::new(1, 2, None, "h3l1o. W0rld".to_string()))
);
assert_eq!(
Version::parse("1.2.3.h3l1o. W0rld"),
Ok(Version::new(1, 2, Some(3), "W0rld".to_string()))
);
assert_eq!(
Version::parse("1.2.3 h3l1o. W0rld"),
Ok(Version::new(1, 2, Some(3), "h3l1o. W0rld".to_string()))
);
assert_eq!(
Version::parse("OpenGL ES 3.1"),
Ok(Version::new_embedded(3, 1, String::new()))
);
assert_eq!(
Version::parse("OpenGL ES 2.0 Google Nexus"),
Ok(Version::new_embedded(2, 0, "Google Nexus".to_string()))
);
assert_eq!(
Version::parse("GLSL ES 1.1"),
Ok(Version::new_embedded(1, 1, String::new()))
);
assert_eq!(
Version::parse("OpenGL ES GLSL ES 3.20"),
Ok(Version::new_embedded(3, 2, String::new()))
);
assert_eq!(
// WebGL 2.0 should parse as OpenGL ES 3.0
Version::parse("WebGL 2.0 (OpenGL ES 3.0 Chromium)"),
Ok(Version::new_embedded(
3,
0,
"(OpenGL ES 3.0 Chromium)".to_string()
))
);
assert_eq!(
Version::parse("WebGL GLSL ES 3.00 (OpenGL ES GLSL ES 3.0 Chromium)"),
Ok(Version::new_embedded(
3,
0,
"(OpenGL ES GLSL ES 3.0 Chromium)".to_string()
))
);
}
}

7526
third_party/rust/glow/src/web_sys.rs поставляемый

Разница между файлами не показана из-за своего большого размера Загрузить разницу

2
third_party/rust/metal/.cargo-checksum.json поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

49
third_party/rust/metal/.github/workflows/ci.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,49 @@
name: ci
on: [pull_request, push]
jobs:
build:
runs-on: macos-latest
strategy:
matrix:
channel: [stable, nightly]
steps:
- uses: actions/checkout@v1
- uses: actions-rs/cargo@v1
- name: Select Rust channel
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.channel }}
override: true
- name: Rust Version Info
run: rustc --version && cargo --version
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-${{ matrix.channel }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-${{ matrix.channel }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-${{ matrix.channel }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: cargo check
run: cargo check --all-features
- name: Run all tests
run: cargo test --all-features

1071
third_party/rust/metal/Cargo.lock сгенерированный поставляемый

Разница между файлами не показана из-за своего большого размера Загрузить разницу

91
third_party/rust/metal/Cargo.toml поставляемый
Просмотреть файл

@ -1,31 +1,44 @@
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies
#
# If you believe there's an error in this file please file an
# issue against the rust-lang/cargo repository. If you're
# editing this file be aware that the upstream Cargo.toml
# will likely look very different (and much more reasonable)
[package]
edition = "2018"
name = "metal"
version = "0.23.1"
authors = ["GFX Developers"]
exclude = ["guide/**/*", "examples/texture/**/*", "tests/**/*", "Cargo.lock", "target/**/*"]
description = "Rust bindings for Metal"
homepage = "https://github.com/gfx-rs/metal-rs"
documentation = "https://docs.rs/crate/metal"
homepage = "https://github.com/gfx-rs/metal-rs"
repository = "https://github.com/gfx-rs/metal-rs"
authors = ["GFX Developers"]
readme = "README.md"
keywords = ["metal", "graphics", "bindings"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/gfx-rs/metal-rs"
edition = "2018"
exclude = ["guide/**/*", "examples/texture/**/*", "tests/**/*", "Cargo.lock", "target/**/*"]
[package.metadata.docs.rs]
default-target = "x86_64-apple-darwin"
[features]
default = []
private = []
mps = []
[dependencies]
core-graphics-types = "0.1"
bitflags = "1"
log = "0.4"
block = "0.1.6"
foreign-types = "0.3.2"
dispatch = { version = "0.2", optional = true }
[dependencies.objc]
version = "0.2.4"
features = ["objc_exception"]
[dev-dependencies]
cocoa = "0.24.0"
cty = "0.2.1"
winit = "0.24"
sema = "0.1.4"
png = "0.16"
[[example]]
name = "window"
@ -73,44 +86,8 @@ required-features = ["dispatch"]
[[example]]
name = "fence"
[dependencies.bitflags]
version = "1"
[dependencies.block]
version = "0.1.6"
[dependencies.core-graphics-types]
version = "0.1"
[dependencies.dispatch]
version = "0.2"
optional = true
[dependencies.foreign-types]
version = "0.3.2"
[dependencies.log]
version = "0.4"
[dependencies.objc]
version = "0.2.4"
features = ["objc_exception"]
[dev-dependencies.cocoa]
version = "0.24.0"
[dev-dependencies.cty]
version = "0.2.1"
[dev-dependencies.png]
version = "0.16"
[dev-dependencies.sema]
version = "0.1.4"
[dev-dependencies.winit]
version = "0.22"
[features]
default = []
mps = []
private = []
[workspace]
members = [
"examples/texture",
]

1
third_party/rust/metal/examples/headless-render/.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1 @@
out.png

Просмотреть файл

@ -60,16 +60,16 @@ fn main() {
println!("{:?}", desc);
#[cfg(features = "private")]
let _reflection = unsafe {
RenderPipelineReflection::new(
desc.serialize_vertex_data(),
desc.serialize_fragment_data(),
vertex_desc.serialize_descriptor(),
&device,
0x8,
0x0,
)
};
let reflect_options = MTLPipelineOption::ArgumentInfo | MTLPipelineOption::BufferTypeInfo;
let (_, reflection) = device
.new_render_pipeline_state_with_reflection(&desc, reflect_options)
.unwrap();
println!("Vertex arguments: ");
let vertex_arguments = reflection.vertex_arguments();
for index in 0..vertex_arguments.count() {
let argument = vertex_arguments.object_at(index).unwrap();
println!("{:?}", argument);
}
});
}

22
third_party/rust/metal/src/argument.rs поставляемый
Просмотреть файл

@ -5,7 +5,7 @@
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use super::{Array, MTLTextureType, NSUInteger};
use super::{MTLTextureType, NSUInteger};
use objc::runtime::{NO, YES};
#[repr(u64)]
@ -161,6 +161,24 @@ impl StructMemberRef {
}
}
pub enum MTLStructMemberArray {}
foreign_obj_type! {
type CType = MTLStructMemberArray;
pub struct StructMemberArray;
pub struct StructMemberArrayRef;
}
impl StructMemberArrayRef {
pub fn object_at(&self, index: NSUInteger) -> Option<&StructMemberRef> {
unsafe { msg_send![self, objectAtIndexedSubscript: index] }
}
pub fn count(&self) -> NSUInteger {
unsafe { msg_send![self, count] }
}
}
pub enum MTLStructType {}
foreign_obj_type! {
@ -170,7 +188,7 @@ foreign_obj_type! {
}
impl StructTypeRef {
pub fn members(&self) -> &Array<StructMember> {
pub fn members(&self) -> &StructMemberArrayRef {
unsafe { msg_send![self, members] }
}

73
third_party/rust/metal/src/device.rs поставляемый
Просмотреть файл

@ -52,6 +52,7 @@ pub enum MTLFeatureSet {
#[repr(i64)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
#[non_exhaustive]
pub enum MTLGPUFamily {
Common1 = 3001,
Common2 = 3002,
@ -62,6 +63,9 @@ pub enum MTLGPUFamily {
Apple4 = 1004,
Apple5 = 1005,
Apple6 = 1006,
Apple7 = 1007,
Apple8 = 1008,
Apple9 = 1009,
Mac1 = 2001,
Mac2 = 2002,
MacCatalyst1 = 4001,
@ -1391,10 +1395,17 @@ pub enum MTLSparseTextureRegionAlignmentMode {
}
bitflags! {
struct MTLPipelineOption: NSUInteger {
/// Options that determine how Metal prepares the pipeline.
pub struct MTLPipelineOption: NSUInteger {
/// Do not provide any reflection information.
const None = 0;
/// An option that requests argument information for buffers, textures, and threadgroup memory.
const ArgumentInfo = 1 << 0;
/// An option that requests detailed buffer type information for buffer arguments.
const BufferTypeInfo = 1 << 1;
/// An option that specifies that Metal should create the pipeline state object only if the
/// compiled shader is present inside the binary archive.
///
/// Only available on (macos(11.0), ios(14.0))
const FailOnBinaryArchiveMiss = 1 << 2;
}
@ -1809,44 +1820,27 @@ impl DeviceRef {
}
}
/// Synchronously creates a render pipeline state object and associated reflection information.
pub fn new_render_pipeline_state_with_reflection(
&self,
descriptor: &RenderPipelineDescriptorRef,
reflection: &RenderPipelineReflectionRef,
) -> Result<RenderPipelineState, String> {
reflection_options: MTLPipelineOption,
) -> Result<(RenderPipelineState, RenderPipelineReflection), String> {
unsafe {
let reflection_options =
MTLPipelineOption::ArgumentInfo | MTLPipelineOption::BufferTypeInfo;
let mut reflection: *mut Object = ptr::null_mut();
let pipeline_state: *mut MTLRenderPipelineState = try_objc! { err =>
msg_send![self, newRenderPipelineStateWithDescriptor:descriptor
options:reflection_options
reflection:reflection
reflection:&mut reflection
error:&mut err]
};
Ok(RenderPipelineState::from_ptr(pipeline_state))
}
}
let state = RenderPipelineState::from_ptr(pipeline_state);
/// Useful for debugging binary archives.
pub fn new_render_pipeline_state_with_fail_on_binary_archive_miss(
&self,
descriptor: &RenderPipelineDescriptorRef,
) -> Result<RenderPipelineState, String> {
unsafe {
let pipeline_options = MTLPipelineOption::FailOnBinaryArchiveMiss;
let () = msg_send![reflection, retain];
let reflection = RenderPipelineReflection::from_ptr(reflection as _);
let reflection: *mut MTLRenderPipelineReflection = std::ptr::null_mut();
let pipeline_state: *mut MTLRenderPipelineState = try_objc! { err =>
msg_send![self, newRenderPipelineStateWithDescriptor:descriptor
options:pipeline_options
reflection:reflection
error:&mut err]
};
Ok(RenderPipelineState::from_ptr(pipeline_state))
Ok((state, reflection))
}
}
@ -1892,6 +1886,31 @@ impl DeviceRef {
}
}
/// Synchronously creates a compute pipeline state object and associated reflection information,
/// using a compute pipeline descriptor.
pub fn new_compute_pipeline_state_with_reflection(
&self,
descriptor: &ComputePipelineDescriptorRef,
reflection_options: MTLPipelineOption,
) -> Result<(ComputePipelineState, ComputePipelineReflection), String> {
unsafe {
let mut reflection: *mut Object = ptr::null_mut();
let pipeline_state: *mut MTLComputePipelineState = try_objc! { err =>
msg_send![self, newComputePipelineStateWithDescriptor:descriptor
options:reflection_options
reflection:&mut reflection
error:&mut err]
};
let state = ComputePipelineState::from_ptr(pipeline_state);
let () = msg_send![reflection, retain];
let reflection = ComputePipelineReflection::from_ptr(reflection as _);
Ok((state, reflection))
}
}
pub fn new_buffer(&self, length: u64, options: MTLResourceOptions) -> Buffer {
unsafe {
msg_send![self, newBufferWithLength:length

44
third_party/rust/metal/src/pipeline/render.rs поставляемый
Просмотреть файл

@ -193,13 +193,53 @@ impl RenderPipelineReflection {
}
impl RenderPipelineReflectionRef {
pub fn fragment_arguments(&self) -> &Array<Argument> {
/// An array of objects that describe the arguments of a fragment function.
pub fn fragment_arguments(&self) -> &ArgumentArrayRef {
unsafe { msg_send![self, fragmentArguments] }
}
pub fn vertex_arguments(&self) -> &Array<Argument> {
/// An array of objects that describe the arguments of a vertex function.
pub fn vertex_arguments(&self) -> &ArgumentArrayRef {
unsafe { msg_send![self, vertexArguments] }
}
/// An array of objects that describe the arguments of a tile shading function.
pub fn tile_arguments(&self) -> &ArgumentArrayRef {
unsafe { msg_send![self, tileArguments] }
}
}
pub enum MTLArgumentArray {}
foreign_obj_type! {
type CType = MTLArgumentArray;
pub struct ArgumentArray;
pub struct ArgumentArrayRef;
}
impl ArgumentArrayRef {
pub fn object_at(&self, index: NSUInteger) -> Option<&ArgumentRef> {
unsafe { msg_send![self, objectAtIndexedSubscript: index] }
}
pub fn count(&self) -> NSUInteger {
unsafe { msg_send![self, count] }
}
}
pub enum MTLComputePipelineReflection {}
foreign_obj_type! {
type CType = MTLComputePipelineReflection;
pub struct ComputePipelineReflection;
pub struct ComputePipelineReflectionRef;
}
impl ComputePipelineReflectionRef {
/// An array of objects that describe the arguments of a compute function.
pub fn arguments(&self) -> &ArgumentArrayRef {
unsafe { msg_send![self, arguments] }
}
}
pub enum MTLRenderPipelineDescriptor {}

2
third_party/rust/naga/.cargo-checksum.json поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

36
third_party/rust/naga/CHANGELOG.md поставляемый
Просмотреть файл

@ -1,8 +1,42 @@
# Change Log
## v0.8 (TBD)
## v0.8 (2021-12-18)
- development release for wgpu-0.12
- lots of fixes in all parts
- validator:
- now gated by `validate` feature
- nicely detailed error messages with spans
- API:
- image gather operations
- WGSL-in:
- remove `[[block]]` attribute
- `elseif` is removed in favor of `else if`
- MSL-out:
- full out-of-bounds checking
### v0.7.3 (2021-12-14)
- API:
- `view_index` builtin
- GLSL-out:
- reflect textures without samplers
- SPV-out:
- fix incorrect pack/unpack
### v0.7.2 (2021-12-01)
- validator:
- check stores for proper pointer class
- HLSL-out:
- fix stores into `mat3`
- respect array strides
- SPV-out:
- fix multi-word constants
- WGSL-in:
- permit names starting with underscores
- SPV-in:
- cull unused builtins
- support empty debug labels
- GLSL-in:
- don't panic on invalid integer operations
### v0.7.1 (2021-10-12)
- implement casts from and to booleans in the backends

12
third_party/rust/naga/Cargo.toml поставляемый
Просмотреть файл

@ -1,11 +1,11 @@
[package]
name = "naga"
version = "0.7.1"
version = "0.8.0"
authors = ["Naga Developers"]
edition = "2018"
description = "Shader translation infrastructure"
homepage = "https://github.com/gfx-rs/naga"
repository = "https://github.com/gfx-rs/naga/tree/v0.7"
repository = "https://github.com/gfx-rs/naga/tree/v0.8"
keywords = ["shader", "SPIR-V", "GLSL", "MSL"]
license = "MIT OR Apache-2.0"
exclude = ["bin/**/*", "tests/**/*", "Cargo.lock", "target/**/*"]
@ -20,7 +20,7 @@ bitflags = "1"
bit-set = "0.5"
codespan-reporting = { version = "0.11.0", optional = true }
rustc-hash = "1.1.0"
indexmap = "1.6" # 1.7 has MSRV 1.49
indexmap = "~1.6" # 1.7 has MSRV 1.49
log = "0.4"
num-traits = "0.2"
spirv = { version = "0.2", optional = true }
@ -30,6 +30,12 @@ petgraph = { version ="0.6", optional = true }
pp-rs = { version = "0.2.1", optional = true }
hexf-parse = { version = "0.2.1", optional = true }
[profile.release]
panic = "abort"
[profile.dev]
panic = "abort"
[features]
default = []
dot-out = []

7
third_party/rust/naga/src/back/dot/mod.rs поставляемый
Просмотреть файл

@ -231,6 +231,7 @@ fn write_fun(
E::ImageSample {
image,
sampler,
gather,
coordinate,
array_index,
offset: _,
@ -260,7 +261,11 @@ fn write_fun(
if let Some(expr) = depth_ref {
edges.insert("depth_ref", expr);
}
("ImageSample".into(), 5)
let string = match gather {
Some(component) => Cow::Owned(format!("ImageGather{:?}", component)),
_ => Cow::Borrowed("ImageSample"),
};
(string, 5)
}
E::ImageLoad {
image,

Просмотреть файл

@ -1,7 +1,7 @@
use super::{BackendResult, Error, Version, Writer};
use crate::{
Binding, Bytes, Handle, ImageClass, ImageDimension, Interpolation, Sampling, ScalarKind,
ShaderStage, StorageClass, StorageFormat, Type, TypeInner,
Binding, Bytes, Expression, Handle, ImageClass, ImageDimension, Interpolation, MathFunction,
Sampling, ScalarKind, ShaderStage, StorageClass, StorageFormat, Type, TypeInner,
};
use std::fmt::Write;
@ -33,6 +33,8 @@ bitflags::bitflags! {
/// Arrays with a dynamic length
const DYNAMIC_ARRAY_SIZE = 1 << 16;
const MULTI_VIEW = 1 << 17;
/// Adds support for fused multiply-add
const FMA = 1 << 18;
}
}
@ -98,6 +100,7 @@ impl FeaturesManager {
check_feature!(SAMPLE_VARIABLES, 400, 300);
check_feature!(DYNAMIC_ARRAY_SIZE, 430, 310);
check_feature!(MULTI_VIEW, 140, 310);
check_feature!(FMA, 400, 310);
// Return an error if there are missing features
if missing.is_empty() {
@ -201,6 +204,11 @@ impl FeaturesManager {
writeln!(out, "#extension GL_EXT_multiview : require")?;
}
if self.0.contains(Features::FMA) && version.is_es() {
// https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_gpu_shader5.txt
writeln!(out, "#extension GL_EXT_gpu_shader5 : require")?;
}
Ok(())
}
}
@ -347,6 +355,27 @@ impl<'a, W> Writer<'a, W> {
}
}
if self.options.version.supports_fma_function() {
let has_fma = self
.module
.functions
.iter()
.flat_map(|(_, f)| f.expressions.iter())
.chain(
self.module
.entry_points
.iter()
.flat_map(|e| e.function.expressions.iter()),
)
.any(|(_, e)| match *e {
Expression::Math { fun, .. } if fun == MathFunction::Fma => true,
_ => false,
});
if has_fma {
self.features.request(Features::FMA);
}
}
self.features.check_availability(self.options.version)
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше