Skip to content

Commit b1bf444

Browse files
authored
Fix error message when render pipeline vertex attribute location is greater or equal to the maximum number of vertex attributes (fixes #8064) (#8065)
1 parent f6a3af1 commit b1bf444

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

wgpu-core/src/device/resource.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3697,7 +3697,7 @@ impl Device {
36973697

36983698
if attribute.shader_location >= self.limits.max_vertex_attributes {
36993699
return Err(
3700-
pipeline::CreateRenderPipelineError::TooManyVertexAttributes {
3700+
pipeline::CreateRenderPipelineError::VertexAttributeLocationTooLarge {
37013701
given: attribute.shader_location,
37023702
limit: self.limits.max_vertex_attributes,
37033703
},

wgpu-core/src/pipeline.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,8 @@ pub enum CreateRenderPipelineError {
624624
TooManyVertexBuffers { given: u32, limit: u32 },
625625
#[error("The total number of vertex attributes {given} exceeds the limit {limit}")]
626626
TooManyVertexAttributes { given: u32, limit: u32 },
627+
#[error("Vertex attribute location {given} must be less than limit {limit}")]
628+
VertexAttributeLocationTooLarge { given: u32, limit: u32 },
627629
#[error("Vertex buffer {index} stride {given} exceeds the limit {limit}")]
628630
VertexStrideTooLarge { index: u32, given: u32, limit: u32 },
629631
#[error("Vertex attribute at location {location} stride {given} exceeds the limit {limit}")]
@@ -708,6 +710,7 @@ impl WebGpuError for CreateRenderPipelineError {
708710
| Self::InvalidSampleCount(_)
709711
| Self::TooManyVertexBuffers { .. }
710712
| Self::TooManyVertexAttributes { .. }
713+
| Self::VertexAttributeLocationTooLarge { .. }
711714
| Self::VertexStrideTooLarge { .. }
712715
| Self::UnalignedVertexStride { .. }
713716
| Self::InvalidVertexAttributeOffset { .. }

0 commit comments

Comments
 (0)