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
2025-08-09 18:48:11 +03:00
committed by GitHub
parent f6a3af1f1d
commit b1bf444b7a
2 changed files with 4 additions and 1 deletions

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,
},

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 { .. }