diff --git a/wgpu-core/src/command/draw.rs b/wgpu-core/src/command/draw.rs index 2206f3f20..39f2adf01 100644 --- a/wgpu-core/src/command/draw.rs +++ b/wgpu-core/src/command/draw.rs @@ -89,8 +89,8 @@ pub enum RenderCommandError { PushConstants(#[from] PushConstantUploadError), #[error("Invalid Viewport parameters")] InvalidViewport, - #[error("Invalid ScissorRect parameters")] - InvalidScissorRect, + #[error("Scissor {0:?} is not contained in the render target {1:?}")] + InvalidScissorRect(Rect, wgt::Extent3d), #[error("Support for {0} is not implemented yet")] Unimplemented(&'static str), } diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index 7ef45aa0a..61aa28484 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -1510,7 +1510,8 @@ impl Global { || rect.x + rect.w > info.extent.width || rect.y + rect.h > info.extent.height { - return Err(RenderCommandError::InvalidScissorRect).map_pass_err(scope); + return Err(RenderCommandError::InvalidScissorRect(*rect, info.extent)) + .map_pass_err(scope); } let r = hal::Rect { x: rect.x,