Fix various issues in primitive_bbox tests.
authorJarkko Pöyry <jpoyry@google.com>
Tue, 10 Feb 2015 05:32:19 +0000 (21:32 -0800)
committerJarkko Pöyry <jpoyry@google.com>
Tue, 10 Feb 2015 05:32:19 +0000 (21:32 -0800)
- Fix broken assert.
- Don't expect half to propagate accurately through all shader stages.

Change-Id: I85364c5820f8047dc3315bb56b3243e87342830b

modules/gles31/functional/es31fPrimitiveBoundingBoxTests.cpp

index e5e5067..92766c8 100644 (file)
@@ -903,7 +903,8 @@ const char* BBoxRenderCase::genShaderFunction (ShaderFunction func) const
                                        "       if (gl_FragCoord.x < float(u_viewportPos.x) + wc.x || gl_FragCoord.x > float(u_viewportPos.x) + wc.z ||\n"
                                        "           gl_FragCoord.y < float(u_viewportPos.y) + wc.y || gl_FragCoord.y > float(u_viewportPos.y) + wc.w)\n"
                                        "           return false;\n"
-                                       "       if (depth*2.0-1.0 < v_bbox_clipMin.z || depth*2.0-1.0 > v_bbox_clipMax.z)\n"
+                                       "       const highp float dEpsilon = 0.001;\n"
+                                       "       if (depth*2.0-1.0 < v_bbox_clipMin.z - dEpsilon || depth*2.0-1.0 > v_bbox_clipMax.z + dEpsilon)\n"
                                        "           return false;\n"
                                        "       return true;\n"
                                        "}\n";
@@ -4170,7 +4171,7 @@ void ClearCase::renderTo (tcu::Surface& dst, bool useBBox)
 bool ClearCase::verifyImagesEqual (const tcu::PixelBufferAccess& withoutBBox, const tcu::PixelBufferAccess& withBBox)
 {
        DE_ASSERT(withoutBBox.getWidth() == withBBox.getWidth());
-       DE_ASSERT(withoutBBox.getHeight() == withBBox.getWidth());
+       DE_ASSERT(withoutBBox.getHeight() == withBBox.getHeight());
 
        tcu::Surface    errorMask       (withoutBBox.getWidth(), withoutBBox.getHeight());
        bool                    anyError        = false;