1mod adapter;
25mod bind_group;
26mod bind_group_layout;
27mod buffer;
28mod command_buffer;
29mod command_encoder;
30mod common_pipeline;
32mod compute_pass;
33mod compute_pipeline;
34mod device;
35mod instance;
36mod pipeline_cache;
37mod pipeline_layout;
38mod query_set;
39mod queue;
40mod render_bundle;
41mod render_bundle_encoder;
42mod render_pass;
43mod render_pipeline;
44mod sampler;
45mod shader_module;
46mod surface;
47mod surface_texture;
48mod texture;
49mod texture_view;
50
51pub use adapter::*;
52pub use bind_group::*;
53pub use bind_group_layout::*;
54pub use buffer::*;
55pub use command_buffer::*;
56pub use command_encoder::*;
57pub use common_pipeline::*;
58pub use compute_pass::*;
59pub use compute_pipeline::*;
60pub use device::*;
61pub use instance::*;
62pub use pipeline_cache::*;
63pub use pipeline_layout::*;
64pub use query_set::*;
65pub use queue::*;
66pub use render_bundle::*;
67pub use render_bundle_encoder::*;
68pub use render_pass::*;
69pub use render_pipeline::*;
70pub use sampler::*;
71pub use shader_module::*;
72pub use surface::*;
73pub use surface_texture::*;
74pub use texture::*;
75pub use texture_view::*;
76
77pub type Label<'a> = Option<&'a str>;
79
80macro_rules! impl_partialeq_eq_hash {
81 ($ty:ty) => {
82 impl PartialEq for $ty {
83 fn eq(&self, other: &Self) -> bool {
84 std::ptr::addr_eq(self.data.as_ref(), other.data.as_ref())
85 }
86 }
87 impl Eq for $ty {}
88
89 impl std::hash::Hash for $ty {
90 fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
91 let ptr = self.data.as_ref() as *const Data as *const ();
92 ptr.hash(state);
93 }
94 }
95
96 impl PartialOrd for $ty {
97 fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
98 Some(self.cmp(other))
99 }
100 }
101 impl Ord for $ty {
102 fn cmp(&self, other: &Self) -> std::cmp::Ordering {
103 let a = self.data.as_ref() as *const Data as *const ();
104 let b = other.data.as_ref() as *const Data as *const ();
105 a.cmp(&b)
106 }
107 }
108 };
109}
110pub(crate) use impl_partialeq_eq_hash;