mirror of
https://github.com/servo/servo.git
synced 2025-08-09 07:25:35 +01:00
webxr: Add some missing internal checks/validation (#33318)
* Ensure depthFar is non-negative Signed-off-by: Daniel Adams <msub2official@gmail.com> * Properly append default features in requestSession Signed-off-by: Daniel Adams <msub2official@gmail.com> * Ensure XRRigidTransform init members have finite values Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
This commit is contained in:
parent
aadc212b95
commit
75c7712905
9 changed files with 35 additions and 40 deletions
|
@ -709,11 +709,16 @@ impl XRSessionMethods for XRSession {
|
|||
pending.set_depth_near(near);
|
||||
}
|
||||
if let Some(far) = init.depthFar {
|
||||
let mut far = *far;
|
||||
// Step 9 from #apply-the-pending-render-state
|
||||
// this may need to be changed if backends wish to impose
|
||||
// further constraints
|
||||
// currently the maximum is infinity, so we do nothing
|
||||
pending.set_depth_far(*far);
|
||||
// currently the maximum is infinity, so just check that
|
||||
// the value is non-negative
|
||||
if far < 0. {
|
||||
far = 0.;
|
||||
}
|
||||
pending.set_depth_far(far);
|
||||
}
|
||||
if let Some(fov) = init.inlineVerticalFieldOfView {
|
||||
let mut fov = *fov;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue