@@ -54,7 +54,7 @@ struct Temp {
54
54
///
55
55
/// An `Adapter` can be used to open a connection to the corresponding device on the host system,
56
56
/// yielding a [`Device`] object.
57
- #[ derive( Debug ) ]
57
+ #[ derive( Debug , Hash , PartialEq ) ]
58
58
pub struct Adapter {
59
59
id : wgc:: id:: AdapterId ,
60
60
}
@@ -70,14 +70,14 @@ pub struct Device {
70
70
}
71
71
72
72
/// A handle to a GPU-accessible buffer.
73
- #[ derive( Debug ) ]
73
+ #[ derive( Debug , Hash , PartialEq ) ]
74
74
pub struct Buffer {
75
75
id : wgc:: id:: BufferId ,
76
76
device_id : wgc:: id:: DeviceId ,
77
77
}
78
78
79
79
/// A handle to a texture on the GPU.
80
- #[ derive( Debug ) ]
80
+ #[ derive( Debug , Hash , PartialEq ) ]
81
81
pub struct Texture {
82
82
id : wgc:: id:: TextureId ,
83
83
owned : bool ,
@@ -87,7 +87,7 @@ pub struct Texture {
87
87
///
88
88
/// A `TextureView` object describes a texture and associated metadata needed by a
89
89
/// [`RenderPipeline`] or [`BindGroup`].
90
- #[ derive( Debug ) ]
90
+ #[ derive( Debug , Hash , PartialEq ) ]
91
91
pub struct TextureView {
92
92
id : wgc:: id:: TextureViewId ,
93
93
owned : bool ,
@@ -98,7 +98,7 @@ pub struct TextureView {
98
98
/// A `Sampler` object defines how a pipeline will sample from a [`TextureView`]. Samplers define
99
99
/// image filters (including anisotropy) and address (wrapping) modes, among other things. See
100
100
/// the documentation for [`SamplerDescriptor`] for more information.
101
- #[ derive( Debug ) ]
101
+ #[ derive( Debug , Hash , PartialEq ) ]
102
102
pub struct Sampler {
103
103
id : wgc:: id:: SamplerId ,
104
104
}
@@ -107,7 +107,7 @@ pub struct Sampler {
107
107
///
108
108
/// A `Surface` represents a platform-specific surface (e.g. a window) to which rendered images may
109
109
/// be presented. A `Surface` may be created with [`Surface::create`].
110
- #[ derive( Debug ) ]
110
+ #[ derive( Debug , Hash , PartialEq ) ]
111
111
pub struct Surface {
112
112
id : wgc:: id:: SurfaceId ,
113
113
}
@@ -116,7 +116,7 @@ pub struct Surface {
116
116
///
117
117
/// A `SwapChain` represents the image or series of images that will be presented to a [`Surface`].
118
118
/// A `SwapChain` may be created with [`Device::create_swap_chain`].
119
- #[ derive( Debug ) ]
119
+ #[ derive( Debug , Hash , PartialEq ) ]
120
120
pub struct SwapChain {
121
121
id : wgc:: id:: SwapChainId ,
122
122
}
@@ -127,7 +127,7 @@ pub struct SwapChain {
127
127
/// create a [`BindGroupDescriptor`] object, which in turn can be used to create a [`BindGroup`]
128
128
/// object with [`Device::create_bind_group`]. A series of `BindGroupLayout`s can also be used to
129
129
/// create a [`PipelineLayoutDescriptor`], which can be used to create a [`PipelineLayout`].
130
- #[ derive( Debug ) ]
130
+ #[ derive( Debug , Hash , PartialEq ) ]
131
131
pub struct BindGroupLayout {
132
132
id : wgc:: id:: BindGroupLayoutId ,
133
133
}
@@ -138,7 +138,7 @@ pub struct BindGroupLayout {
138
138
/// [`BindGroupLayout`]. It can be created with [`Device::create_bind_group`]. A `BindGroup` can
139
139
/// be bound to a particular [`RenderPass`] with [`RenderPass::set_bind_group`], or to a
140
140
/// [`ComputePass`] with [`ComputePass::set_bind_group`].
141
- #[ derive( Debug ) ]
141
+ #[ derive( Debug , Hash , PartialEq ) ]
142
142
pub struct BindGroup {
143
143
id : wgc:: id:: BindGroupId ,
144
144
}
@@ -154,15 +154,15 @@ impl Drop for BindGroup {
154
154
/// A `ShaderModule` represents a compiled shader module on the GPU. It can be created by passing
155
155
/// valid SPIR-V source code to [`Device::create_shader_module`]. Shader modules are used to define
156
156
/// programmable stages of a pipeline.
157
- #[ derive( Debug ) ]
157
+ #[ derive( Debug , Hash , PartialEq ) ]
158
158
pub struct ShaderModule {
159
159
id : wgc:: id:: ShaderModuleId ,
160
160
}
161
161
162
162
/// An opaque handle to a pipeline layout.
163
163
///
164
164
/// A `PipelineLayout` object describes the available binding groups of a pipeline.
165
- #[ derive( Debug ) ]
165
+ #[ derive( Debug , Hash , PartialEq ) ]
166
166
pub struct PipelineLayout {
167
167
id : wgc:: id:: PipelineLayoutId ,
168
168
}
@@ -171,13 +171,13 @@ pub struct PipelineLayout {
171
171
///
172
172
/// A `RenderPipeline` object represents a graphics pipeline and its stages, bindings, vertex
173
173
/// buffers and targets. A `RenderPipeline` may be created with [`Device::create_render_pipeline`].
174
- #[ derive( Debug ) ]
174
+ #[ derive( Debug , Hash , PartialEq ) ]
175
175
pub struct RenderPipeline {
176
176
id : wgc:: id:: RenderPipelineId ,
177
177
}
178
178
179
179
/// A handle to a compute pipeline.
180
- #[ derive( Debug ) ]
180
+ #[ derive( Debug , Hash , PartialEq ) ]
181
181
pub struct ComputePipeline {
182
182
id : wgc:: id:: ComputePipelineId ,
183
183
}
@@ -187,7 +187,7 @@ pub struct ComputePipeline {
187
187
/// A `CommandBuffer` represents a complete sequence of commands that may be submitted to a command
188
188
/// queue with [`Queue::submit`]. A `CommandBuffer` is obtained by recording a series of commands to
189
189
/// a [`CommandEncoder`] and then calling [`CommandEncoder::finish`].
190
- #[ derive( Debug ) ]
190
+ #[ derive( Debug , Hash , PartialEq ) ]
191
191
pub struct CommandBuffer {
192
192
id : wgc:: id:: CommandBufferId ,
193
193
}
@@ -224,7 +224,7 @@ pub struct ComputePass<'a> {
224
224
/// A handle to a command queue on a device.
225
225
///
226
226
/// A `Queue` executes recorded [`CommandBuffer`] objects.
227
- #[ derive( Debug ) ]
227
+ #[ derive( Debug , Hash , PartialEq ) ]
228
228
pub struct Queue {
229
229
id : wgc:: id:: QueueId ,
230
230
}
0 commit comments