Fix error message when render pipeline vertex attribute location is greater or equal to the maximum number of vertex attributes (fixes #8064) (#8065)

This commit is contained in:
Lisitsa Nikita authored and GitHub committed 2025-08-09 17:48:11 +02:00
1 parent f6a3af1f1d
commit b1bf444b7a
2 files changed
+4 -1

No files matched your search

+1 -1
View File
@@ -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,
},
+3
View File
@@ -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 { .. }