From 7169372985127db005ca02009674bf2ce6a1b74b Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Tue, 1 Feb 2022 15:19:40 -0500 Subject: [PATCH 1/2] Fix render target mismatch error message --- wgpu-core/src/device/mod.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index 9ab1e5e9ad..99d994d60b 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -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, ArrayVec, ), - #[error("Incompatible depth-stencil attachment: {0:?} != {1:?}")] + #[error( + "Incompatible depth-stencil attachment: the renderpass expected {0:?} but was given {1:?}" + )] IncompatibleDepthStencilAttachment(Option, Option), - #[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, Option), } impl RenderPassContext { - // Assumed the renderpass only contains one subpass + // Assumes the renderpass only contains one subpass pub(crate) fn check_compatible( &self, other: &Self, From b0cfc1be883181676eeac8406c6e916f2273807f Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Tue, 1 Feb 2022 15:28:13 -0500 Subject: [PATCH 2/2] Reword bind group layout mismatch error --- wgpu-core/src/command/compute.rs | 2 +- wgpu-core/src/command/draw.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wgpu-core/src/command/compute.rs b/wgpu-core/src/command/compute.rs index 4037bc1f3d..8ffff41aa5 100644 --- a/wgpu-core/src/command/compute.rs +++ b/wgpu-core/src/command/compute.rs @@ -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, diff --git a/wgpu-core/src/command/draw.rs b/wgpu-core/src/command/draw.rs index b70a4de92e..e8e53e3ade 100644 --- a/wgpu-core/src/command/draw.rs +++ b/wgpu-core/src/command/draw.rs @@ -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,