Properly clamp arguments to WebGLRenderingContext.depthRange

This commit is contained in:
Anthony Ramine 2018-04-04 17:14:53 +02:00
parent 7b4d66b621
commit fb290e9c9e
3 changed files with 6 additions and 10 deletions

View file

@ -695,8 +695,9 @@ impl WebGLImpl {
ctx.gl().depth_func(func),
WebGLCommand::DepthMask(flag) =>
ctx.gl().depth_mask(flag),
WebGLCommand::DepthRange(near, far) =>
ctx.gl().depth_range(near, far),
WebGLCommand::DepthRange(near, far) => {
ctx.gl().depth_range(near.max(0.).min(1.) as f64, far.max(0.).min(1.) as f64)
}
WebGLCommand::Disable(cap) =>
ctx.gl().disable(cap),
WebGLCommand::Enable(cap) =>