Skip to content

Commit 1abf3fe

Browse files
authored
remove unused enum variants (#6550)
1 parent 92ca5a3 commit 1abf3fe

File tree

12 files changed

+0
-53
lines changed

12 files changed

+0
-53
lines changed

wgpu-core/src/command/draw.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ pub enum RenderCommandError {
7171
BindGroupIndexOutOfRange { index: u32, max: u32 },
7272
#[error("Vertex buffer index {index} is greater than the device's requested `max_vertex_buffers` limit {max}")]
7373
VertexBufferIndexOutOfRange { index: u32, max: u32 },
74-
#[error("Dynamic buffer offset {0} does not respect device's requested `{1}` limit {2}")]
75-
UnalignedBufferOffset(u64, &'static str, u32),
7674
#[error("Render pipeline targets are incompatible with render pass")]
7775
IncompatiblePipelineTargets(#[from] crate::device::RenderPassCompatibilityError),
7876
#[error("{0} writes to depth, while the pass has read-only depth access")]

wgpu-core/src/command/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -914,8 +914,6 @@ pub enum PassErrorScope {
914914
SetScissorRect,
915915
#[error("In a draw command, kind: {kind:?}")]
916916
Draw { kind: DrawKind, indexed: bool },
917-
#[error("While resetting queries after the renderpass was ran")]
918-
QueryReset,
919917
#[error("In a write_timestamp command")]
920918
WriteTimestamp,
921919
#[error("In a begin_occlusion_query command")]

wgpu-core/src/command/render.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -624,10 +624,6 @@ pub enum RenderPassErrorInner {
624624
src: wgt::TextureFormat,
625625
dst: wgt::TextureFormat,
626626
},
627-
#[error("Surface texture is dropped before the render pass is finished")]
628-
SurfaceTextureDropped,
629-
#[error("Not enough memory left for render pass")]
630-
OutOfMemory,
631627
#[error("Unable to clear non-present/read-only depth")]
632628
InvalidDepthOps,
633629
#[error("Unable to clear non-present/read-only stencil")]

wgpu-core/src/command/transfer.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ pub enum TransferError {
9191
UnspecifiedRowsPerImage,
9292
#[error("Number of bytes per row is less than the number of bytes in a complete row")]
9393
InvalidBytesPerRow,
94-
#[error("Image is 1D and the copy height and depth are not both set to 1")]
95-
InvalidCopySize,
9694
#[error("Number of rows per image is invalid")]
9795
InvalidRowsPerImage,
9896
#[error("Copy source aspects must refer to all aspects of the source texture format")]

wgpu-core/src/device/life.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@ pub enum WaitIdleError {
151151
Device(#[from] DeviceError),
152152
#[error("Tried to wait using a submission index ({0}) that has not been returned by a successful submission (last successful submission: {1})")]
153153
WrongSubmissionIndex(SubmissionIndex, SubmissionIndex),
154-
#[error("GPU got stuck :(")]
155-
StuckGpu,
156154
}
157155

158156
/// Resource tracking for a device.

wgpu-core/src/device/queue.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -537,12 +537,6 @@ pub enum QueueSubmitError {
537537
Unmap(#[from] BufferAccessError),
538538
#[error("{0} is still mapped")]
539539
BufferStillMapped(ResourceErrorIdent),
540-
#[error("Surface output was dropped before the command buffer got submitted")]
541-
SurfaceOutputDropped,
542-
#[error("Surface was unconfigured before the command buffer got submitted")]
543-
SurfaceUnconfigured,
544-
#[error("GPU got stuck :(")]
545-
StuckGpu,
546540
#[error(transparent)]
547541
InvalidResource(#[from] InvalidResourceError),
548542
#[error(transparent)]
@@ -1430,7 +1424,6 @@ impl Queue {
14301424
Err(WaitIdleError::Device(err)) => {
14311425
break 'error Err(QueueSubmitError::Queue(err))
14321426
}
1433-
Err(WaitIdleError::StuckGpu) => break 'error Err(QueueSubmitError::StuckGpu),
14341427
Err(WaitIdleError::WrongSubmissionIndex(..)) => unreachable!(),
14351428
};
14361429

wgpu-core/src/instance.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,8 +660,6 @@ pub enum RequestDeviceError {
660660
Device(#[from] DeviceError),
661661
#[error(transparent)]
662662
LimitsExceeded(#[from] FailedLimit),
663-
#[error("Device has no queue supporting graphics")]
664-
NoGraphicsQueue,
665663
#[error("Unsupported features were requested: {0:?}")]
666664
UnsupportedFeature(wgt::Features),
667665
}

wgpu-core/src/pipeline.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,6 @@ pub enum CreatePipelineCacheError {
280280
Validation(#[from] PipelineCacheValidationError),
281281
#[error(transparent)]
282282
MissingFeatures(#[from] MissingFeatures),
283-
#[error("Internal error: {0}")]
284-
Internal(String),
285283
}
286284

287285
#[derive(Debug)]
@@ -439,8 +437,6 @@ pub enum ColorStateError {
439437
pipeline: validation::NumericType,
440438
shader: validation::NumericType,
441439
},
442-
#[error("Blend factors for {0:?} must be `One`")]
443-
InvalidMinMaxBlendFactors(wgt::BlendComponent),
444440
#[error("Invalid write mask {0:?}")]
445441
InvalidWriteMask(wgt::ColorWrites),
446442
}

wgpu-core/src/present.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ pub enum SurfaceError {
4747
AlreadyAcquired,
4848
#[error("Texture has been destroyed")]
4949
TextureDestroyed,
50-
#[error("Acquired frame is still referenced")]
51-
StillReferenced,
5250
}
5351

5452
#[derive(Clone, Debug, Error)]
@@ -94,16 +92,13 @@ pub enum ConfigureSurfaceError {
9492
requested: hal::TextureUses,
9593
available: hal::TextureUses,
9694
},
97-
#[error("Gpu got stuck :(")]
98-
StuckGpu,
9995
}
10096

10197
impl From<WaitIdleError> for ConfigureSurfaceError {
10298
fn from(e: WaitIdleError) -> Self {
10399
match e {
104100
WaitIdleError::Device(d) => ConfigureSurfaceError::Device(d),
105101
WaitIdleError::WrongSubmissionIndex(..) => unreachable!(),
106-
WaitIdleError::StuckGpu => ConfigureSurfaceError::StuckGpu,
107102
}
108103
}
109104
}

wgpu-core/src/ray_tracing.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ pub enum CreateTlasError {
4444
CreateBufferError(#[from] CreateBufferError),
4545
#[error("Features::RAY_TRACING_ACCELERATION_STRUCTURE is not enabled")]
4646
MissingFeature,
47-
#[error("Unimplemented Tlas error: this error is not yet implemented")]
48-
Unimplemented,
4947
}
5048

5149
/// Error encountered while attempting to do a copy on a command encoder.
@@ -132,9 +130,6 @@ pub enum BuildAccelerationStructureError {
132130
#[error("BlasId is invalid or destroyed (for instance)")]
133131
InvalidBlasIdForInstance,
134132

135-
#[error("Blas {0:?} is invalid or destroyed (for instance)")]
136-
InvalidBlasForInstance(ResourceErrorIdent),
137-
138133
#[error("TlasId is invalid or destroyed")]
139134
InvalidTlasId,
140135

@@ -150,18 +145,12 @@ pub enum BuildAccelerationStructureError {
150145

151146
#[derive(Clone, Debug, Error)]
152147
pub enum ValidateBlasActionsError {
153-
#[error("BlasId is invalid or destroyed")]
154-
InvalidBlas,
155-
156148
#[error("Blas {0:?} is used before it is built")]
157149
UsedUnbuilt(ResourceErrorIdent),
158150
}
159151

160152
#[derive(Clone, Debug, Error)]
161153
pub enum ValidateTlasActionsError {
162-
#[error("Tlas {0:?} is invalid or destroyed")]
163-
InvalidTlas(ResourceErrorIdent),
164-
165154
#[error("Tlas {0:?} is used before it is built")]
166155
UsedUnbuilt(ResourceErrorIdent),
167156

wgpu-core/src/resource.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,6 @@ pub enum BufferMapAsyncStatus {
206206
MapAlreadyPending,
207207
/// An unknown error.
208208
Error,
209-
/// Mapping was aborted (by unmapping or destroying the buffer before mapping
210-
/// happened).
211-
Aborted,
212209
/// The context is Lost.
213210
ContextLost,
214211
/// The buffer is in an invalid state.
@@ -1746,8 +1743,6 @@ pub enum CreateTextureViewError {
17461743
Device(#[from] DeviceError),
17471744
#[error(transparent)]
17481745
DestroyedResource(#[from] DestroyedResourceError),
1749-
#[error("Not enough memory left to create texture view")]
1750-
OutOfMemory,
17511746
#[error("Invalid texture view dimension `{view:?}` with texture of dimension `{texture:?}`")]
17521747
InvalidTextureViewDimension {
17531748
view: wgt::TextureViewDimension,
@@ -1896,9 +1891,6 @@ pub enum CreateSamplerError {
18961891
filter_mode: wgt::FilterMode,
18971892
anisotropic_clamp: u16,
18981893
},
1899-
#[error("Cannot create any more samplers")]
1900-
TooManyObjects,
1901-
/// AddressMode::ClampToBorder requires feature ADDRESS_MODE_CLAMP_TO_BORDER.
19021894
#[error(transparent)]
19031895
MissingFeatures(#[from] MissingFeatures),
19041896
}

wgpu-core/src/validation.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,6 @@ pub enum BindingError {
169169
InconsistentlyDerivedType,
170170
#[error("Texture format {0:?} is not supported for storage use")]
171171
BadStorageFormat(wgt::TextureFormat),
172-
#[error(
173-
"Storage texture with access {0:?} doesn't have a matching supported `StorageTextureAccess`"
174-
)]
175-
UnsupportedTextureStorageAccess(naga::StorageAccess),
176172
}
177173

178174
#[derive(Clone, Debug, Error)]

0 commit comments

Comments
 (0)