Lines Matching refs:depth
103 result << "_clear_value_" << (int) param.depthBufferClearValue.depthStencil.depth;
143 DE_FATAL("No depth format");
160 DE_FATAL("No depth format");
165 deBool compareDepthResult (VkCompareOp compare, float depth, float clearValue)
180 result = depth == clearValue;
183 result = depth != clearValue;
186 result = depth > clearValue;
189 result = depth >= clearValue;
192 result = depth < clearValue;
195 result = depth <= clearValue;
732 throw tcu::NotSupportedError("Unsupported depth format");
770 // Create depth image
836 // Create depth attachment view
937 float clearValue = m_param.depthBufferClearValue.depthStencil.depth;
940 // For non-float depth formats, the value in the depth buffer is already clampled to the range [0, 1], which
941 // includes the clear depth value.
960 // Depth Clamp is enabled, then we clamp point depth to viewport's maxDepth and minDepth values, or [0.0f, 1.0f] is depth format is fixed-point.
962 float depth = de::min(de::max(scaling, m_param.viewportMinDepth), m_param.viewportMaxDepth);
964 // For non-float depth formats, depth value is clampled to the range [0, 1].
966 depth = de::min(de::max(depth, 0.0f), 1.0f);
968 if (compareDepthResult(m_param.depthCompareOp, depth, clearValue))
999 // Check depth buffer contents
1022 tcu::Vec4 depth = depthResult->getAccess().getPixel(x, y);
1024 // Check depth values are valid
1025 if (depth.y() != 0.0f || depth.z() != 0.0f || depth.w() != 1.0f)
1027 log << tcu::TestLog::Message << "Invalid depth buffer values for pixel (" << x << ", " << y << ") = ("
1028 << depth.x() << ", " << depth.y() << ", " << depth.z() << ", " << depth.w() << "." << tcu::TestLog::EndMessage;
1032 // Check the case where depth clamping is disabled.
1036 fabs(clearValue - depth.x()) > epsilon)
1038 log << tcu::TestLog::Message << "Error pixel (" << x << ", " << y << "). Depth value = " << depth
1050 // Calculate the expected depth value: first translate the value to from [0.0f, 1.0f] to [-1.0f, 1.0f].
1056 // For non-float depth formats, depth value is clampled to the range [0, 1].
1062 if (fabs(expectedDepth - depth.x()) > epsilon)
1065 << "). Depth value " << depth.x() << ", expected " << expectedDepth << ", error " << fabs(expectedDepth - depth.x()) << tcu::TestLog::EndMessage;
1072 // Depth Clamp is enabled, then we clamp point depth to viewport's maxDepth and minDepth values, or 0.0f and 1.0f is format is not float.
1076 // For non-float depth formats, depth value is clampled to the range [0, 1].
1082 if (fabs(expectedDepth - depth.x()) > epsilon)
1085 << "). Depth value " << depth.x() << ", expected " << expectedDepth << ", error " << fabs(expectedDepth - depth.x()) << tcu::TestLog::EndMessage;
1124 // Create render pass for second draw, we keep the first draw's contents of the depth buffer.
1170 // First one will render the points depending on if the pass the depth test and if clear depth value passes the
1173 // The second one, will render the same scene but the the point positions will have depth buffer values from
1174 // the first draw. If they pass the depth test, the depthBounds test will check the content of the depth buffer,
1230 float clearValue = m_param.depthBufferClearValue.depthStencil.depth;
1233 // For non-float depth formats, depth value is clampled to the range [0, 1].
1245 // Depth Clamp is enabled, then we clamp point depth to viewport's maxDepth and minDepth values and later check if it is inside depthBounds volume.
1247 float depth = de::min(de::max(scaling, m_param.viewportMinDepth), m_param.viewportMaxDepth);
1249 depth = de::min(de::max(depth, 0.0f), 1.0f);
1253 // Depending if the first draw call succeed, we need to know if the second draw call will render the points because the depth buffer content
1254 // will determine if it passes the depth test and the depth bounds test.
1256 float depthBufferValue = firstDrawHasPassedDepthBoundsTest ? depth : clearValue;
1258 // For non-float depth formats, depth value is clampled to the range [0, 1].
1262 // Check that the point passes the depth test and the depth bounds test.
1263 if (compareDepthResult(m_param.depthCompareOp, depth, depthBufferValue) &&
1303 // Check depth buffer contents
1312 tcu::Vec4 depth = depthResult->getAccess().getPixel(x, y);
1314 // Check depth values are valid
1315 if (depth.y() != 0.0f || depth.z() != 0.0f || depth.w() != 1.0f)
1317 log << tcu::TestLog::Message << "Draw " << (firstDraw ? "1" : "2") << ": Invalid depth buffer values for pixel (" << x << ", " << y << ") = ("
1318 << depth.x() << ", " << depth.y() << ", " << depth.z() << ", " << depth.w() << "." << tcu::TestLog::EndMessage;
1322 // Depth Clamp is enabled, so we clamp point depth to viewport's maxDepth and minDepth values, or 0.0f and 1.0f is format is not float.
1328 // Depending if the first draw call succeed, we need to know if the second draw call will render the points because the depth buffer content
1329 // will determine if it passes the depth test and the depth bounds test.
1332 // If we are in the first draw call, the depth buffer content is clearValue. If we are in the second draw call, it is going to be depth.x() if the first
1334 float depthBufferValue = firstDrawHasPassedDepthBoundsTest ? depth.x() : clearValue;
1336 // For non-float depth formats, depth value is clampled to the range [0, 1].
1340 // Calculate the expectd depth depending on the depth test and the depth bounds test results.
1345 // For non-float depth formats, depth value is clampled to the range [0, 1].
1349 if (fabs(expectedDepth - depth.x()) > epsilon)
1352 << "). Depth value " << depth.x() << ", expected " << expectedDepth << ", error " << fabs(expectedDepth - depth.x()) << tcu::TestLog::EndMessage;
1467 testParams.depthBufferClearValue.depthStencil.depth = clearValues[val];
1474 // Viewport's depth unrestricted range
1495 testParams.depthBufferClearValue.depthStencil.depth = clearValues[clearValue];
1512 // DepthBounds's depth unrestricted range
1531 testParams.depthBufferClearValue.depthStencil.depth = clearValues[clearValue];
1577 testParams.depthBufferClearValue.depthStencil.depth = clearValues[clearValue];