OSDN Git Service

Fix clamping depth output to [0, 1] range.
authorNicolas Capens <capn@google.com>
Tue, 2 Jan 2018 20:55:11 +0000 (15:55 -0500)
committerNicolas Capens <nicolascapens@google.com>
Wed, 3 Jan 2018 14:11:25 +0000 (14:11 +0000)
commit7bc079c277ad95ecd3c964aa6a9285029bf2fe81
tree627dcf30753f877cb17c44440ac7043a01ff5739
parente70208e42b5ab745d34abdd8acdfe3db81ab82c1
Fix clamping depth output to [0, 1] range.

OpenGL ES 3.0 specifies that "For fixed-point depth buffers, the final
fragment depth written by a fragment shader is first clamped to [0, 1]
and then converted to fixed-point as if it were a window z value (see
section 2.13.1). For floating-point depth buffers, conversion is not
performed but clamping is."

Change-Id: Ic7f22f7e47106aaa86c4916fbbbe23ad9c52e186
Reviewed-on: https://swiftshader-review.googlesource.com/15628
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
src/Shader/PixelPipeline.cpp
src/Shader/PixelProgram.cpp