external/swiftshader
修订版 | 81e08df29531f0723fadb8e5e90c5850809efc90 (tree) |
---|---|
时间 | 2020-04-15 12:13:18 |
作者 | Alexis Hetu <sugoi@goog...> |
Commiter | Alexis Hétu |
Fix fragments depth values not being clamped
According to the Vulkan 1.2 spec:
"For fixed-point depth buffers, fragment depth values are
So, unless the VK_EXT_depth_range_unrestricted extension
is enabled, clamping should always occur.
Bug: b/152634772
Change-Id: I2aee2aeb91efed7399580689fc0ffc0634b2f487
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43869
Presubmit-Ready: Alexis Hétu <sugoi@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
@@ -123,7 +123,6 @@ const PixelProcessor::State PixelProcessor::update(const Context *context) const | ||
123 | 123 | } |
124 | 124 | |
125 | 125 | state.occlusionEnabled = context->occlusionEnabled; |
126 | - state.depthClamp = (context->depthBias != 0.0f) || (context->slopeDepthBias != 0.0f); | |
127 | 126 | |
128 | 127 | for(int i = 0; i < RENDERTARGETS; i++) |
129 | 128 | { |
@@ -77,7 +77,6 @@ public: | ||
77 | 77 | bool depthTestActive; |
78 | 78 | bool occlusionEnabled; |
79 | 79 | bool perspective; |
80 | - bool depthClamp; | |
81 | 80 | |
82 | 81 | BlendState blendState[RENDERTARGETS]; |
83 | 82 |
@@ -85,7 +85,7 @@ void PixelRoutine::quad(Pointer<Byte> cBuffer[RENDERTARGETS], Pointer<Byte> &zBu | ||
85 | 85 | x -= *Pointer<Float4>(constants + OFFSET(Constants, X) + q * sizeof(float4)); |
86 | 86 | } |
87 | 87 | |
88 | - z[q] = interpolate(x, Dz[q], z[q], primitive + OFFSET(Primitive, z), false, false, state.depthClamp); | |
88 | + z[q] = interpolate(x, Dz[q], z[q], primitive + OFFSET(Primitive, z), false, false, true); | |
89 | 89 | } |
90 | 90 | } |
91 | 91 |