Skip to content
This repository was archived by the owner on Jun 18, 2021. It is now read-only.

Commit 751fcea

Browse files
committed
Remove Hash implementations for now but keep PartialEq and Eq
1 parent ea2a737 commit 751fcea

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

src/lib.rs

-17
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ impl std::hash::Hash for Temp {
100100
/// An `Adapter` can be used to open a connection to the corresponding device on the host system,
101101
/// yielding a [`Device`] object.
102102
#[derive(Debug, PartialEq, Eq)]
103-
#[cfg_attr(not(target_arch = "wasm32"), derive(Hash))]
104103
pub struct Adapter {
105104
id: wgc::id::AdapterId,
106105
}
@@ -119,7 +118,6 @@ pub struct RequestAdapterOptions<'a> {
119118
/// The `Device` is the responsible for the creation of most rendering and compute resources, as
120119
/// well as exposing [`Queue`] objects.
121120
#[derive(Debug, PartialEq, Eq)]
122-
#[cfg_attr(not(target_arch = "wasm32"), derive(Hash))]
123121
pub struct Device {
124122
id: wgc::id::DeviceId,
125123
temp: Temp,
@@ -135,15 +133,13 @@ pub enum Maintain {
135133

136134
/// A handle to a GPU-accessible buffer.
137135
#[derive(Debug, PartialEq, Eq)]
138-
#[cfg_attr(not(target_arch = "wasm32"), derive(Hash))]
139136
pub struct Buffer {
140137
id: wgc::id::BufferId,
141138
device_id: wgc::id::DeviceId,
142139
}
143140

144141
/// A handle to a texture on the GPU.
145142
#[derive(Debug, PartialEq, Eq)]
146-
#[cfg_attr(not(target_arch = "wasm32"), derive(Hash))]
147143
pub struct Texture {
148144
id: wgc::id::TextureId,
149145
owned: bool,
@@ -154,7 +150,6 @@ pub struct Texture {
154150
/// A `TextureView` object describes a texture and associated metadata needed by a
155151
/// [`RenderPipeline`] or [`BindGroup`].
156152
#[derive(Debug, PartialEq, Eq)]
157-
#[cfg_attr(not(target_arch = "wasm32"), derive(Hash))]
158153
pub struct TextureView {
159154
id: wgc::id::TextureViewId,
160155
owned: bool,
@@ -166,7 +161,6 @@ pub struct TextureView {
166161
/// image filters (including anisotropy) and address (wrapping) modes, among other things. See
167162
/// the documentation for [`SamplerDescriptor`] for more information.
168163
#[derive(Debug, PartialEq, Eq)]
169-
#[cfg_attr(not(target_arch = "wasm32"), derive(Hash))]
170164
pub struct Sampler {
171165
id: wgc::id::SamplerId,
172166
}
@@ -176,7 +170,6 @@ pub struct Sampler {
176170
/// A `Surface` represents a platform-specific surface (e.g. a window) to which rendered images may
177171
/// be presented. A `Surface` may be created with [`Surface::create`].
178172
#[derive(Debug, PartialEq, Eq)]
179-
#[cfg_attr(not(target_arch = "wasm32"), derive(Hash))]
180173
pub struct Surface {
181174
id: wgc::id::SurfaceId,
182175
}
@@ -186,7 +179,6 @@ pub struct Surface {
186179
/// A `SwapChain` represents the image or series of images that will be presented to a [`Surface`].
187180
/// A `SwapChain` may be created with [`Device::create_swap_chain`].
188181
#[derive(Debug, PartialEq, Eq)]
189-
#[cfg_attr(not(target_arch = "wasm32"), derive(Hash))]
190182
pub struct SwapChain {
191183
id: wgc::id::SwapChainId,
192184
}
@@ -198,7 +190,6 @@ pub struct SwapChain {
198190
/// object with [`Device::create_bind_group`]. A series of `BindGroupLayout`s can also be used to
199191
/// create a [`PipelineLayoutDescriptor`], which can be used to create a [`PipelineLayout`].
200192
#[derive(Debug, PartialEq, Eq)]
201-
#[cfg_attr(not(target_arch = "wasm32"), derive(Hash))]
202193
pub struct BindGroupLayout {
203194
id: wgc::id::BindGroupLayoutId,
204195
}
@@ -210,7 +201,6 @@ pub struct BindGroupLayout {
210201
/// be bound to a particular [`RenderPass`] with [`RenderPass::set_bind_group`], or to a
211202
/// [`ComputePass`] with [`ComputePass::set_bind_group`].
212203
#[derive(Debug, PartialEq, Eq)]
213-
#[cfg_attr(not(target_arch = "wasm32"), derive(Hash))]
214204
pub struct BindGroup {
215205
id: wgc::id::BindGroupId,
216206
}
@@ -227,7 +217,6 @@ impl Drop for BindGroup {
227217
/// valid SPIR-V source code to [`Device::create_shader_module`]. Shader modules are used to define
228218
/// programmable stages of a pipeline.
229219
#[derive(Debug, PartialEq, Eq)]
230-
#[cfg_attr(not(target_arch = "wasm32"), derive(Hash))]
231220
pub struct ShaderModule {
232221
id: wgc::id::ShaderModuleId,
233222
}
@@ -236,7 +225,6 @@ pub struct ShaderModule {
236225
///
237226
/// A `PipelineLayout` object describes the available binding groups of a pipeline.
238227
#[derive(Debug, PartialEq, Eq)]
239-
#[cfg_attr(not(target_arch = "wasm32"), derive(Hash))]
240228
pub struct PipelineLayout {
241229
id: wgc::id::PipelineLayoutId,
242230
}
@@ -246,14 +234,12 @@ pub struct PipelineLayout {
246234
/// A `RenderPipeline` object represents a graphics pipeline and its stages, bindings, vertex
247235
/// buffers and targets. A `RenderPipeline` may be created with [`Device::create_render_pipeline`].
248236
#[derive(Debug, PartialEq, Eq)]
249-
#[cfg_attr(not(target_arch = "wasm32"), derive(Hash))]
250237
pub struct RenderPipeline {
251238
id: wgc::id::RenderPipelineId,
252239
}
253240

254241
/// A handle to a compute pipeline.
255242
#[derive(Debug, PartialEq, Eq)]
256-
#[cfg_attr(not(target_arch = "wasm32"), derive(Hash))]
257243
pub struct ComputePipeline {
258244
id: wgc::id::ComputePipelineId,
259245
}
@@ -264,7 +250,6 @@ pub struct ComputePipeline {
264250
/// queue with [`Queue::submit`]. A `CommandBuffer` is obtained by recording a series of commands to
265251
/// a [`CommandEncoder`] and then calling [`CommandEncoder::finish`].
266252
#[derive(Debug, PartialEq, Eq)]
267-
#[cfg_attr(not(target_arch = "wasm32"), derive(Hash))]
268253
pub struct CommandBuffer {
269254
id: wgc::id::CommandBufferId,
270255
}
@@ -277,7 +262,6 @@ pub struct CommandBuffer {
277262
/// When finished recording, call [`CommandEncoder::finish`] to obtain a [`CommandBuffer`] which may
278263
/// be submitted for execution.
279264
#[derive(Debug, PartialEq, Eq)]
280-
#[cfg_attr(not(target_arch = "wasm32"), derive(Hash))]
281265
pub struct CommandEncoder {
282266
id: wgc::id::CommandEncoderId,
283267
/// This type should be !Send !Sync, because it represents an allocation on this thread's
@@ -303,7 +287,6 @@ pub struct ComputePass<'a> {
303287
///
304288
/// A `Queue` executes recorded [`CommandBuffer`] objects.
305289
#[derive(Debug, PartialEq, Eq)]
306-
#[cfg_attr(not(target_arch = "wasm32"), derive(Hash))]
307290
pub struct Queue {
308291
id: wgc::id::QueueId,
309292
}

0 commit comments

Comments
 (0)