Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused enum variants #6550

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions wgpu-core/src/command/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ pub enum RenderCommandError {
BindGroupIndexOutOfRange { index: u32, max: u32 },
#[error("Vertex buffer index {index} is greater than the device's requested `max_vertex_buffers` limit {max}")]
VertexBufferIndexOutOfRange { index: u32, max: u32 },
#[error("Dynamic buffer offset {0} does not respect device's requested `{1}` limit {2}")]
UnalignedBufferOffset(u64, &'static str, u32),
#[error("Render pipeline targets are incompatible with render pass")]
IncompatiblePipelineTargets(#[from] crate::device::RenderPassCompatibilityError),
#[error("{0} writes to depth, while the pass has read-only depth access")]
Expand Down
2 changes: 0 additions & 2 deletions wgpu-core/src/command/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -914,8 +914,6 @@ pub enum PassErrorScope {
SetScissorRect,
#[error("In a draw command, kind: {kind:?}")]
Draw { kind: DrawKind, indexed: bool },
#[error("While resetting queries after the renderpass was ran")]
QueryReset,
#[error("In a write_timestamp command")]
WriteTimestamp,
#[error("In a begin_occlusion_query command")]
Expand Down
4 changes: 0 additions & 4 deletions wgpu-core/src/command/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -624,10 +624,6 @@ pub enum RenderPassErrorInner {
src: wgt::TextureFormat,
dst: wgt::TextureFormat,
},
#[error("Surface texture is dropped before the render pass is finished")]
SurfaceTextureDropped,
#[error("Not enough memory left for render pass")]
OutOfMemory,
#[error("Unable to clear non-present/read-only depth")]
InvalidDepthOps,
#[error("Unable to clear non-present/read-only stencil")]
Expand Down
2 changes: 0 additions & 2 deletions wgpu-core/src/command/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ pub enum TransferError {
UnspecifiedRowsPerImage,
#[error("Number of bytes per row is less than the number of bytes in a complete row")]
InvalidBytesPerRow,
#[error("Image is 1D and the copy height and depth are not both set to 1")]
InvalidCopySize,
#[error("Number of rows per image is invalid")]
InvalidRowsPerImage,
#[error("Copy source aspects must refer to all aspects of the source texture format")]
Expand Down
2 changes: 0 additions & 2 deletions wgpu-core/src/device/life.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ pub enum WaitIdleError {
Device(#[from] DeviceError),
#[error("Tried to wait using a submission index ({0}) that has not been returned by a successful submission (last successful submission: {1})")]
WrongSubmissionIndex(SubmissionIndex, SubmissionIndex),
#[error("GPU got stuck :(")]
StuckGpu,
}

/// Resource tracking for a device.
Expand Down
7 changes: 0 additions & 7 deletions wgpu-core/src/device/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,12 +537,6 @@ pub enum QueueSubmitError {
Unmap(#[from] BufferAccessError),
#[error("{0} is still mapped")]
BufferStillMapped(ResourceErrorIdent),
#[error("Surface output was dropped before the command buffer got submitted")]
SurfaceOutputDropped,
#[error("Surface was unconfigured before the command buffer got submitted")]
SurfaceUnconfigured,
#[error("GPU got stuck :(")]
StuckGpu,
#[error(transparent)]
InvalidResource(#[from] InvalidResourceError),
#[error(transparent)]
Expand Down Expand Up @@ -1430,7 +1424,6 @@ impl Queue {
Err(WaitIdleError::Device(err)) => {
break 'error Err(QueueSubmitError::Queue(err))
}
Err(WaitIdleError::StuckGpu) => break 'error Err(QueueSubmitError::StuckGpu),
Err(WaitIdleError::WrongSubmissionIndex(..)) => unreachable!(),
};

Expand Down
2 changes: 0 additions & 2 deletions wgpu-core/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,8 +660,6 @@ pub enum RequestDeviceError {
Device(#[from] DeviceError),
#[error(transparent)]
LimitsExceeded(#[from] FailedLimit),
#[error("Device has no queue supporting graphics")]
NoGraphicsQueue,
#[error("Unsupported features were requested: {0:?}")]
UnsupportedFeature(wgt::Features),
}
Expand Down
4 changes: 0 additions & 4 deletions wgpu-core/src/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,6 @@ pub enum CreatePipelineCacheError {
Validation(#[from] PipelineCacheValidationError),
#[error(transparent)]
MissingFeatures(#[from] MissingFeatures),
#[error("Internal error: {0}")]
Internal(String),
}

#[derive(Debug)]
Expand Down Expand Up @@ -439,8 +437,6 @@ pub enum ColorStateError {
pipeline: validation::NumericType,
shader: validation::NumericType,
},
#[error("Blend factors for {0:?} must be `One`")]
InvalidMinMaxBlendFactors(wgt::BlendComponent),
#[error("Invalid write mask {0:?}")]
InvalidWriteMask(wgt::ColorWrites),
}
Expand Down
5 changes: 0 additions & 5 deletions wgpu-core/src/present.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ pub enum SurfaceError {
AlreadyAcquired,
#[error("Texture has been destroyed")]
TextureDestroyed,
#[error("Acquired frame is still referenced")]
StillReferenced,
}

#[derive(Clone, Debug, Error)]
Expand Down Expand Up @@ -94,16 +92,13 @@ pub enum ConfigureSurfaceError {
requested: hal::TextureUses,
available: hal::TextureUses,
},
#[error("Gpu got stuck :(")]
StuckGpu,
}

impl From<WaitIdleError> for ConfigureSurfaceError {
fn from(e: WaitIdleError) -> Self {
match e {
WaitIdleError::Device(d) => ConfigureSurfaceError::Device(d),
WaitIdleError::WrongSubmissionIndex(..) => unreachable!(),
WaitIdleError::StuckGpu => ConfigureSurfaceError::StuckGpu,
}
}
}
Expand Down
11 changes: 0 additions & 11 deletions wgpu-core/src/ray_tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ pub enum CreateTlasError {
CreateBufferError(#[from] CreateBufferError),
#[error("Features::RAY_TRACING_ACCELERATION_STRUCTURE is not enabled")]
MissingFeature,
#[error("Unimplemented Tlas error: this error is not yet implemented")]
Unimplemented,
}

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

#[error("Blas {0:?} is invalid or destroyed (for instance)")]
InvalidBlasForInstance(ResourceErrorIdent),

#[error("TlasId is invalid or destroyed")]
InvalidTlasId,

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

#[derive(Clone, Debug, Error)]
pub enum ValidateBlasActionsError {
#[error("BlasId is invalid or destroyed")]
InvalidBlas,

#[error("Blas {0:?} is used before it is built")]
UsedUnbuilt(ResourceErrorIdent),
}

#[derive(Clone, Debug, Error)]
pub enum ValidateTlasActionsError {
#[error("Tlas {0:?} is invalid or destroyed")]
InvalidTlas(ResourceErrorIdent),

#[error("Tlas {0:?} is used before it is built")]
UsedUnbuilt(ResourceErrorIdent),

Expand Down
8 changes: 0 additions & 8 deletions wgpu-core/src/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,6 @@ pub enum BufferMapAsyncStatus {
MapAlreadyPending,
/// An unknown error.
Error,
/// Mapping was aborted (by unmapping or destroying the buffer before mapping
/// happened).
Aborted,
/// The context is Lost.
ContextLost,
/// The buffer is in an invalid state.
Expand Down Expand Up @@ -1746,8 +1743,6 @@ pub enum CreateTextureViewError {
Device(#[from] DeviceError),
#[error(transparent)]
DestroyedResource(#[from] DestroyedResourceError),
#[error("Not enough memory left to create texture view")]
OutOfMemory,
#[error("Invalid texture view dimension `{view:?}` with texture of dimension `{texture:?}`")]
InvalidTextureViewDimension {
view: wgt::TextureViewDimension,
Expand Down Expand Up @@ -1896,9 +1891,6 @@ pub enum CreateSamplerError {
filter_mode: wgt::FilterMode,
anisotropic_clamp: u16,
},
#[error("Cannot create any more samplers")]
TooManyObjects,
/// AddressMode::ClampToBorder requires feature ADDRESS_MODE_CLAMP_TO_BORDER.
#[error(transparent)]
MissingFeatures(#[from] MissingFeatures),
}
Expand Down
4 changes: 0 additions & 4 deletions wgpu-core/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,6 @@ pub enum BindingError {
InconsistentlyDerivedType,
#[error("Texture format {0:?} is not supported for storage use")]
BadStorageFormat(wgt::TextureFormat),
#[error(
"Storage texture with access {0:?} doesn't have a matching supported `StorageTextureAccess`"
)]
UnsupportedTextureStorageAccess(naga::StorageAccess),
}

#[derive(Clone, Debug, Error)]
Expand Down