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 WGPUFlags,
18 WGPUBool,
19 WGPUChainedStruct,
20};
21
22impl WGPUStringView {
23 pub fn from_bytes(bytes: &[u8]) -> Self {
24 WGPUStringView {
25 data: bytes.as_ptr().cast(),
26 length: bytes.len(),
27 }
28 }
29
30 pub fn as_bytes(&self) -> &[u8] {
31 unsafe {
32 core::slice::from_raw_parts(
33 self.data.cast(),
34 self.length)
35 }
36 }
37}
38
39pub const WGPU_TRUE: WGPUBool = 1;
41
42pub const WGPU_FALSE: WGPUBool = 0;
44
45pub const WGPU_ARRAY_LAYER_COUNT_UNDEFINED: u32 = u32::MAX;
47
48pub const WGPU_COPY_STRIDE_UNDEFINED: u32 = u32::MAX;
50
51pub const WGPU_DEPTH_CLEAR_VALUE_UNDEFINED: f32 = f32::NAN;
53
54pub const WGPU_DEPTH_SLICE_UNDEFINED: u32 = u32::MAX;
56
57pub const WGPU_LIMIT_U32_UNDEFINED: u32 = u32::MAX;
59
60pub const WGPU_LIMIT_U64_UNDEFINED: u64 = u64::MAX;
62
63pub const WGPU_MIP_LEVEL_COUNT_UNDEFINED: u32 = u32::MAX;
65
66pub const WGPU_QUERY_SET_INDEX_UNDEFINED: u32 = u32::MAX;
68
69pub const WGPU_STRLEN: usize = usize::MAX;
71
72pub const WGPU_WHOLE_MAP_SIZE: usize = usize::MAX;
74
75pub const WGPU_WHOLE_SIZE: u64 = u64::MAX;