Clamp the depth passed from glClearDepthf to (0,1) in Renderer11::clear.

This fixes potential out of range D3D11 errors. TRAC #22643 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods Author: Jamie Madill git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1939 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent bdf2d80f
...@@ -1467,7 +1467,7 @@ void Renderer11::clear(const gl::ClearParameters &clearParams, gl::Framebuffer * ...@@ -1467,7 +1467,7 @@ void Renderer11::clear(const gl::ClearParameters &clearParams, gl::Framebuffer *
clearFlags |= D3D11_CLEAR_STENCIL; clearFlags |= D3D11_CLEAR_STENCIL;
} }
float depthClear = clearParams.depthClearValue; float depthClear = gl::clamp01(clearParams.depthClearValue);
UINT8 stencilClear = clearParams.stencilClearValue & 0x000000FF; UINT8 stencilClear = clearParams.stencilClearValue & 0x000000FF;
mDeviceContext->ClearDepthStencilView(framebufferDSV, clearFlags, depthClear, stencilClear); mDeviceContext->ClearDepthStencilView(framebufferDSV, clearFlags, depthClear, stencilClear);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment