Add a missing condition to viewport validation (#8040)

This commit is contained in:
Andy Leiserson 2025-07-31 22:10:15 -07:00 committed by GitHub
parent 45e96e593f
commit f25a79595a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -29,6 +29,7 @@ webgpu:api,validation,encoding,cmds,index_access:*
//FAIL: webgpu:api,validation,encoding,cmds,render,draw:*
webgpu:api,validation,encoding,cmds,render,draw:index_buffer_OOB:*
webgpu:api,validation,encoding,cmds,render,draw:unused_buffer_bound:*
webgpu:api,validation,encoding,cmds,render,dynamic_state:*
webgpu:api,validation,encoding,cmds,render,setIndexBuffer:*
webgpu:api,validation,encoding,cmds,render,setVertexBuffer:*
webgpu:api,validation,encoding,encoder_state:*

View File

@ -2520,7 +2520,10 @@ fn set_viewport(
}
.into());
}
if !(0.0..=1.0).contains(&depth_min) || !(0.0..=1.0).contains(&depth_max) {
if !(0.0..=1.0).contains(&depth_min)
|| !(0.0..=1.0).contains(&depth_max)
|| depth_min > depth_max
{
return Err(RenderCommandError::InvalidViewportDepth(depth_min, depth_max).into());
}
let r = hal::Rect {