Allow unrestricted depth bounds
SwiftShader exposes VK_EXT_depth_range_unrestricted which allows depth
values outside [0, 1]. depthBoundsTest code asserted on values outside
that range and were causing test failures.
Bug: b/181655689
Tests: dEQP-VK.pipeline.depth_range_unrestricted.*
Change-Id: Iae9103b802672960f2f0f67710f75165780f1368
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/54110
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Commit-Queue: Sean Risser <srisser@google.com>
Tested-by: Sean Risser <srisser@google.com>
diff --git a/src/Device/Context.cpp b/src/Device/Context.cpp
index 96e0b8d..fd0964e 100644
--- a/src/Device/Context.cpp
+++ b/src/Device/Context.cpp
@@ -630,11 +630,6 @@
if(hasDynamicState(VK_DYNAMIC_STATE_DEPTH_BOUNDS) && depthBoundsTestEnable)
{
- // Unless the VK_EXT_depth_range_unrestricted extension is enabled,
- // minDepthBounds and maxDepthBounds must be between 0.0 and 1.0, inclusive
- ASSERT(dynamicState.minDepthBounds >= 0.0f && dynamicState.minDepthBounds <= 1.0f);
- ASSERT(dynamicState.maxDepthBounds >= 0.0f && dynamicState.maxDepthBounds <= 1.0f);
-
combinedState.minDepthBounds = dynamicState.minDepthBounds;
combinedState.maxDepthBounds = dynamicState.maxDepthBounds;
}