From b05e9705bf879ec7a1b6303cd273ab503facb17b Mon Sep 17 00:00:00 2001 From: Erich Gubler Date: Thu, 13 Feb 2025 08:41:46 -0700 Subject: [PATCH] fix: add `cbindgen:ignore` on `const` with the same ident. --- wgpu-hal/src/auxil/mod.rs | 9 +++++++++ wgpu-hal/src/lib.rs | 2 ++ wgpu-types/src/lib.rs | 13 +++++++++++++ 3 files changed, 24 insertions(+) diff --git a/wgpu-hal/src/auxil/mod.rs b/wgpu-hal/src/auxil/mod.rs index 81358c596..f77aeedda 100644 --- a/wgpu-hal/src/auxil/mod.rs +++ b/wgpu-hal/src/auxil/mod.rs @@ -6,21 +6,27 @@ pub(super) mod renderdoc; pub mod db { pub mod amd { + /// cbindgen:ignore pub const VENDOR: u32 = 0x1002; } pub mod apple { + /// cbindgen:ignore pub const VENDOR: u32 = 0x106B; } pub mod arm { + /// cbindgen:ignore pub const VENDOR: u32 = 0x13B5; } pub mod broadcom { + /// cbindgen:ignore pub const VENDOR: u32 = 0x14E4; } pub mod imgtec { + /// cbindgen:ignore pub const VENDOR: u32 = 0x1010; } pub mod intel { + /// cbindgen:ignore pub const VENDOR: u32 = 0x8086; pub const DEVICE_KABY_LAKE_MASK: u32 = 0x5900; pub const DEVICE_SKY_LAKE_MASK: u32 = 0x1900; @@ -30,12 +36,15 @@ pub mod db { // // To match Vulkan, we use the VkVendorId for Mesa in the gles backend so that lavapipe (Vulkan) and // llvmpipe (OpenGL) have the same vendor id. + /// cbindgen:ignore pub const VENDOR: u32 = 0x10005; } pub mod nvidia { + /// cbindgen:ignore pub const VENDOR: u32 = 0x10DE; } pub mod qualcomm { + /// cbindgen:ignore pub const VENDOR: u32 = 0x5143; } } diff --git a/wgpu-hal/src/lib.rs b/wgpu-hal/src/lib.rs index dd2ecb9de..249a002dd 100644 --- a/wgpu-hal/src/lib.rs +++ b/wgpu-hal/src/lib.rs @@ -299,6 +299,7 @@ pub const MAX_VERTEX_BUFFERS: usize = 16; pub const MAX_COLOR_ATTACHMENTS: usize = 8; pub const MAX_MIP_LEVELS: u32 = 16; /// Size of a single occlusion/timestamp query, when copied into a buffer, in bytes. +/// cbindgen:ignore pub const QUERY_SIZE: wgt::BufferAddress = 8; pub type Label<'a> = Option<&'a str>; @@ -1969,6 +1970,7 @@ impl<'a, T: DynTextureView + ?Sized> Clone for TextureBinding<'a, T> { } } +/// cbindgen:ignore #[derive(Clone, Debug)] pub struct BindGroupEntry { pub binding: u32, diff --git a/wgpu-types/src/lib.rs b/wgpu-types/src/lib.rs index e81f8b090..c0be96f8b 100644 --- a/wgpu-types/src/lib.rs +++ b/wgpu-types/src/lib.rs @@ -4751,8 +4751,10 @@ bitflags::bitflags! { /// The argument to a write-only mapping. const MAP_WRITE = 1 << 1; /// The source of a hardware copy. + /// cbindgen:ignore const COPY_SRC = 1 << 2; /// The destination of a hardware copy. + /// cbindgen:ignore const COPY_DST = 1 << 3; /// The index buffer used for drawing. const INDEX = 1 << 4; @@ -4761,8 +4763,10 @@ bitflags::bitflags! { /// A uniform buffer bound in a bind group. const UNIFORM = 1 << 6; /// A read-only storage buffer used in a bind group. + /// cbindgen:ignore const STORAGE_READ_ONLY = 1 << 7; /// A read-write buffer used in a bind group. + /// cbindgen:ignore const STORAGE_READ_WRITE = 1 << 8; /// The indirect or count buffer in a indirect draw or dispatch. const INDIRECT = 1 << 9; @@ -5021,8 +5025,10 @@ bitflags::bitflags! { /// Ready to present image to the surface. const PRESENT = 1 << 1; /// The source of a hardware copy. + /// cbindgen:ignore const COPY_SRC = 1 << 2; /// The destination of a hardware copy. + /// cbindgen:ignore const COPY_DST = 1 << 3; /// Read-only sampled or fetched resource. const RESOURCE = 1 << 4; @@ -5033,20 +5039,27 @@ bitflags::bitflags! { /// Read-write depth stencil usage const DEPTH_STENCIL_WRITE = 1 << 7; /// Read-only storage texture usage. Corresponds to a UAV in d3d, so is exclusive, despite being read only. + /// cbindgen:ignore const STORAGE_READ_ONLY = 1 << 8; /// Write-only storage texture usage. + /// cbindgen:ignore const STORAGE_WRITE_ONLY = 1 << 9; /// Read-write storage texture usage. + /// cbindgen:ignore const STORAGE_READ_WRITE = 1 << 10; /// Image atomic enabled storage. + /// cbindgen:ignore const STORAGE_ATOMIC = 1 << 11; /// The combination of states that a texture may be in _at the same time_. + /// cbindgen:ignore const INCLUSIVE = Self::COPY_SRC.bits() | Self::RESOURCE.bits() | Self::DEPTH_STENCIL_READ.bits(); /// The combination of states that a texture must exclusively be in. + /// cbindgen:ignore const EXCLUSIVE = Self::COPY_DST.bits() | Self::COLOR_TARGET.bits() | Self::DEPTH_STENCIL_WRITE.bits() | Self::STORAGE_READ_ONLY.bits() | Self::STORAGE_WRITE_ONLY.bits() | Self::STORAGE_READ_WRITE.bits() | Self::STORAGE_ATOMIC.bits() | Self::PRESENT.bits(); /// The combination of all usages that the are guaranteed to be be ordered by the hardware. /// If a usage is ordered, then if the texture state doesn't change between draw calls, there /// are no barriers needed for synchronization. + /// cbindgen:ignore const ORDERED = Self::INCLUSIVE.bits() | Self::COLOR_TARGET.bits() | Self::DEPTH_STENCIL_WRITE.bits() | Self::STORAGE_READ_ONLY.bits(); /// Flag used by the wgpu-core texture tracker to say a texture is in different states for every sub-resource