1#![no_std]
2#![doc = include_str!("../README.md")]
3
4mod raw {
5 #![allow(clippy::all)]
6 #![allow(non_camel_case_types)]
7 #![allow(non_snake_case)]
8 #![allow(non_upper_case_globals)]
9 #![allow(unused)]
10
11 include!("../generated/bindings.rs");
12}
13
14include!("../generated/lib.rs");
15
16pub use raw::{
17 WGPUStringView,
18 WGPUFlags,
19 WGPUBool,
20 WGPUChainedStruct,
21};
22
23impl WGPUStringView {
24 pub fn from_bytes(bytes: &[u8]) -> Self {
25 WGPUStringView {
26 data: bytes.as_ptr() as _,
27 length: bytes.len(),
28 }
29 }
30
31 pub fn as_bytes(&self) -> &[u8] {
32 unsafe {
33 core::slice::from_raw_parts(
34 self.data as _,
35 self.length)
36 }
37 }
38}
39
40pub const WGPU_TRUE: WGPUBool = 1;
42
43pub const WGPU_FALSE: WGPUBool = 0;
45
46pub const WGPU_ARRAY_LAYER_COUNT_UNDEFINED: u32 = u32::MAX;
48
49pub const WGPU_COPY_STRIDE_UNDEFINED: u32 = u32::MAX;
51
52pub const WGPU_DEPTH_CLEAR_VALUE_UNDEFINED: f32 = f32::NAN;
54
55pub const WGPU_DEPTH_SLICE_UNDEFINED: u32 = u32::MAX;
57
58pub const WGPU_LIMIT_U32_UNDEFINED: u32 = u32::MAX;
60
61pub const WGPU_LIMIT_U64_UNDEFINED: u64 = u64::MAX;
63
64pub const WGPU_MIP_LEVEL_COUNT_UNDEFINED: u32 = u32::MAX;
66
67pub const WGPU_QUERY_SET_INDEX_UNDEFINED: u32 = u32::MAX;
69
70pub const WGPU_STRLEN: usize = usize::MAX;
72
73pub const WGPU_WHOLE_MAP_SIZE: usize = usize::MAX;
75
76pub const WGPU_WHOLE_SIZE: u64 = u64::MAX;