Fix polygon offset depth clamp and units resolution.
OpenGL requires depth values to be clamped to the [0, 1] range. Due to
frustum clipping already limiting the range, this can only happen when
non-zero polygon offset parameters are active.
Also fix the 'minimum resolvable difference' for the 32-bit floating-
point internal depth format that we use.
Bug swiftshader:82
Change-Id: Ic9ebcac182a2bc81ab51d79cfe0bb451d340bd1e
Reviewed-on: https://swiftshader-review.googlesource.com/12108
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/Renderer/PixelProcessor.hpp b/src/Renderer/PixelProcessor.hpp
index 65f6b92..d3b0602 100644
--- a/src/Renderer/PixelProcessor.hpp
+++ b/src/Renderer/PixelProcessor.hpp
@@ -66,6 +66,7 @@
bool occlusionEnabled : 1;
bool wBasedFog : 1;
bool perspective : 1;
+ bool depthClamp : 1;
bool alphaBlendActive : 1;
BlendFactor sourceBlendFactor : BITS(BLEND_LAST);