Skip to content

Commit 762d7df

Browse files
fixup! fix: reject fragment shader output locations > max_color_attachments limit
1 parent 5f9d9bc commit 762d7df

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

wgpu-core/src/validation.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,12 @@ pub enum StageError {
313313
MultipleEntryPointsFound,
314314
#[error(transparent)]
315315
InvalidResource(#[from] InvalidResourceError),
316-
#[error(
317-
"Location[{location}] {var}'s index exceeds `max_color_attachments` ({})",
318-
hal::MAX_COLOR_ATTACHMENTS
319-
)]
320-
ColorAttachmentLocationExceedsLimit { location: u32, var: InterfaceVar },
316+
#[error("Location[{location}] {var}'s index exceeds `max_color_attachments` ({limit})")]
317+
ColorAttachmentLocationExceedsLimit {
318+
location: u32,
319+
var: InterfaceVar,
320+
limit: u32,
321+
},
321322
}
322323

323324
impl WebGpuError for StageError {
@@ -1366,6 +1367,7 @@ impl Interface {
13661367
return Err(StageError::ColorAttachmentLocationExceedsLimit {
13671368
location,
13681369
var: iv.clone(),
1370+
limit: self.limits.max_color_attachments,
13691371
});
13701372
}
13711373
}

0 commit comments

Comments
 (0)