We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a9279de commit ab38e8eCopy full SHA for ab38e8e
1 file changed
wgpu-core/src/command/render.rs
@@ -2408,7 +2408,9 @@ fn set_push_constant(
2408
fn set_scissor(state: &mut State, rect: Rect<u32>) -> Result<(), RenderPassErrorInner> {
2409
api_log!("RenderPass::set_scissor_rect {rect:?}");
2410
2411
- if rect.x + rect.w > state.info.extent.width || rect.y + rect.h > state.info.extent.height {
+ if rect.x.saturating_add(rect.w) > state.info.extent.width
2412
+ || rect.y.saturating_add(rect.h) > state.info.extent.height
2413
+ {
2414
return Err(RenderCommandError::InvalidScissorRect(rect, state.info.extent).into());
2415
}
2416
let r = hal::Rect {
0 commit comments