Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve some error messages #2446

Merged
merged 2 commits into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion wgpu-core/src/command/compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub struct ComputePassDescriptor<'a> {
pub enum DispatchError {
#[error("compute pipeline must be set")]
MissingPipeline,
#[error("current compute pipeline has a layout which is incompatible with a currently set bind group, first differing at entry index {index}")]
#[error("the pipeline layout, associated with the current compute pipeline, contains a bind group layout at index {index} which is incompatible with the bind group layout associated with the bind group at {index}")]
IncompatibleBindGroup {
index: u32,
//expected: BindGroupLayoutId,
Expand Down
2 changes: 1 addition & 1 deletion wgpu-core/src/command/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub enum DrawError {
MissingVertexBuffer { index: u32 },
#[error("index buffer must be set")]
MissingIndexBuffer,
#[error("current render pipeline has a layout which is incompatible with a currently set bind group, first differing at entry index {index}")]
#[error("the pipeline layout, associated with the current render pipeline, contains a bind group layout at index {index} which is incompatible with the bind group layout associated with the bind group at {index}")]
IncompatibleBindGroup {
index: u32,
//expected: BindGroupLayoutId,
Expand Down
12 changes: 7 additions & 5 deletions wgpu-core/src/device/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,23 @@ pub(crate) struct RenderPassContext {
}
#[derive(Clone, Debug, Error)]
pub enum RenderPassCompatibilityError {
#[error("Incompatible color attachment: {0:?} != {1:?}")]
#[error("Incompatible color attachment: the renderpass expected {0:?} but was given {1:?}")]
IncompatibleColorAttachment(
ArrayVec<TextureFormat, { hal::MAX_COLOR_TARGETS }>,
ArrayVec<TextureFormat, { hal::MAX_COLOR_TARGETS }>,
),
#[error("Incompatible depth-stencil attachment: {0:?} != {1:?}")]
#[error(
"Incompatible depth-stencil attachment: the renderpass expected {0:?} but was given {1:?}"
)]
IncompatibleDepthStencilAttachment(Option<TextureFormat>, Option<TextureFormat>),
#[error("Incompatible sample count: {0:?} != {1:?}")]
#[error("Incompatible sample count: the renderpass expected {0:?} but was given {1:?}")]
IncompatibleSampleCount(u32, u32),
#[error("Incompatible multiview: {0:?} != {1:?}")]
#[error("Incompatible multiview: the renderpass expected {0:?} but was given {1:?}")]
IncompatibleMultiview(Option<NonZeroU32>, Option<NonZeroU32>),
}

impl RenderPassContext {
// Assumed the renderpass only contains one subpass
// Assumes the renderpass only contains one subpass
pub(crate) fn check_compatible(
&self,
other: &Self,
Expand Down