diff --git a/wgpu-core/src/device/resource.rs b/wgpu-core/src/device/resource.rs index eed295bdf..a7cacea59 100644 --- a/wgpu-core/src/device/resource.rs +++ b/wgpu-core/src/device/resource.rs @@ -3697,7 +3697,7 @@ impl Device { if attribute.shader_location >= self.limits.max_vertex_attributes { return Err( - pipeline::CreateRenderPipelineError::TooManyVertexAttributes { + pipeline::CreateRenderPipelineError::VertexAttributeLocationTooLarge { given: attribute.shader_location, limit: self.limits.max_vertex_attributes, }, diff --git a/wgpu-core/src/pipeline.rs b/wgpu-core/src/pipeline.rs index f67cc65e2..580fdc4d9 100644 --- a/wgpu-core/src/pipeline.rs +++ b/wgpu-core/src/pipeline.rs @@ -624,6 +624,8 @@ pub enum CreateRenderPipelineError { TooManyVertexBuffers { given: u32, limit: u32 }, #[error("The total number of vertex attributes {given} exceeds the limit {limit}")] TooManyVertexAttributes { given: u32, limit: u32 }, + #[error("Vertex attribute location {given} must be less than limit {limit}")] + VertexAttributeLocationTooLarge { given: u32, limit: u32 }, #[error("Vertex buffer {index} stride {given} exceeds the limit {limit}")] VertexStrideTooLarge { index: u32, given: u32, limit: u32 }, #[error("Vertex attribute at location {location} stride {given} exceeds the limit {limit}")] @@ -708,6 +710,7 @@ impl WebGpuError for CreateRenderPipelineError { | Self::InvalidSampleCount(_) | Self::TooManyVertexBuffers { .. } | Self::TooManyVertexAttributes { .. } + | Self::VertexAttributeLocationTooLarge { .. } | Self::VertexStrideTooLarge { .. } | Self::UnalignedVertexStride { .. } | Self::InvalidVertexAttributeOffset { .. }