mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Manually clamp the argument of WebGLRenderingContext.clearDepth
Better be safe than to feed stuff to some GPU driver that wouldn't clamp it.
This commit is contained in:
parent
fc6335c01d
commit
7b4d66b621
3 changed files with 5 additions and 4 deletions
|
@ -678,8 +678,9 @@ impl WebGLImpl {
|
|||
ctx.gl().clear(mask),
|
||||
WebGLCommand::ClearColor(r, g, b, a) =>
|
||||
ctx.gl().clear_color(r, g, b, a),
|
||||
WebGLCommand::ClearDepth(depth) =>
|
||||
ctx.gl().clear_depth(depth),
|
||||
WebGLCommand::ClearDepth(depth) => {
|
||||
ctx.gl().clear_depth(depth.max(0.).min(1.) as f64)
|
||||
}
|
||||
WebGLCommand::ClearStencil(stencil) =>
|
||||
ctx.gl().clear_stencil(stencil),
|
||||
WebGLCommand::ColorMask(r, g, b, a) =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue