Do not use degenerate frames in EGL tests
authorMichael Chock <mchock@nvidia.com>
Mon, 14 Aug 2017 18:55:14 +0000 (11:55 -0700)
committerMichael Chock <mchock@nvidia.com>
Wed, 16 Aug 2017 16:26:06 +0000 (09:26 -0700)
The dEQP-EGL.functional.buffer_age.* and
dEQP-EGL.functional.partial_update.* tests use randomly-generated frames
for rendering. The test allows the generation of frames with a width or
height of 0, but the tcu::PixelBufferAccess interface does not permit
0-sized subregions (see assertions inside getSubregion overloads in
tcuTextureUtil.cpp).

Skip the rendering of degenerate frames in the reference renderer, as
they are unsupported but would not affect the rendering if they were.

Change-Id: I3977c3c293715db633dde74132e56b5d9303ab28

modules/egl/teglBufferAgeTests.cpp
modules/egl/teglPartialUpdateTests.cpp

index 7aac350..e1a3dc2 100644 (file)
@@ -345,6 +345,10 @@ void ReferenceRenderer::render (tcu::Surface* target, const Frame& frame) const
                const ColoredRect& coloredRect = frame.draws[drawNdx].rect;
                if (frame.draws[drawNdx].drawType == BufferAgeTest::DRAWTYPE_GLES2_RENDER || frame.draws[drawNdx].drawType == BufferAgeTest::DRAWTYPE_GLES2_CLEAR)
                {
+                       // tcu does not support degenerate subregions. Since they correspond to no-op rendering, just skip them.
+                       if (coloredRect.bottomLeft.x() == coloredRect.topRight.x() || coloredRect.bottomLeft.y() == coloredRect.topRight.y())
+                               continue;
+
                        const tcu::UVec4 color(coloredRect.color.x(), coloredRect.color.y(), coloredRect.color.z(), 255);
                        tcu::clear(tcu::getSubregion(target->getAccess(), coloredRect.bottomLeft.x(), coloredRect.bottomLeft.y(),
                                                                                 coloredRect.topRight.x()-coloredRect.bottomLeft.x(), coloredRect.topRight.y()-coloredRect.bottomLeft.y()), color);
index 097701a..a70374a 100644 (file)
@@ -334,6 +334,10 @@ void ReferenceRenderer::render (tcu::Surface* target, const Frame& frame) const
                const ColoredRect& coloredRect = frame.draws[drawNdx].rect;
                if (frame.draws[drawNdx].drawType == PartialUpdateTest::DRAWTYPE_GLES2_RENDER || frame.draws[drawNdx].drawType == PartialUpdateTest::DRAWTYPE_GLES2_CLEAR)
                {
+                       // tcu does not support degenerate subregions. Since they correspond to no-op rendering, just skip them.
+                       if (coloredRect.bottomLeft.x() == coloredRect.topRight.x() || coloredRect.bottomLeft.y() == coloredRect.topRight.y())
+                               continue;
+
                        const tcu::UVec4 color(coloredRect.color.x(), coloredRect.color.y(), coloredRect.color.z(), 255);
                        tcu::clear(tcu::getSubregion(target->getAccess(), coloredRect.bottomLeft.x(), coloredRect.bottomLeft.y(),
                                                                                 coloredRect.topRight.x()-coloredRect.bottomLeft.x(), coloredRect.topRight.y()-coloredRect.bottomLeft.y()), color);