Improve InvalidScissorRect error message (#2713)

This commit is contained in:
Jinlei Li 2022-06-02 15:35:13 +08:00 committed by GitHub
parent 32af4f5607
commit 75db572bf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -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<u32>, wgt::Extent3d),
#[error("Support for {0} is not implemented yet")]
Unimplemented(&'static str),
}

View File

@ -1510,7 +1510,8 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|| 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,