From: Ari Suonpaa Date: Wed, 29 Jan 2020 06:50:45 +0000 (+0200) Subject: Prevent empty images from passing rasterization tests X-Git-Tag: upstream/1.3.5~1566 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=695114e33b5960b36701569abba335a595a0cbba;p=platform%2Fupstream%2FVK-GL-CTS.git Prevent empty images from passing rasterization tests Some of the rasterization tests passed even when skipping primitive drawing. Narrow lines had only edge pixels and those are not verified because the implementations may vary. Now a sanity check is performed in all cases to prevent empty results from passing. New tests: dEQP-VK.rasterization.* dEQP-GLES*.functional.rasterization.* Components: Framework, Vulkan, OpenGL ES VK-GL-CTS issue: 2168 Change-Id: I8df0a7a9490253e1f825697420b22cd9f15f3986 --- diff --git a/framework/common/tcuRasterizationVerifier.cpp b/framework/common/tcuRasterizationVerifier.cpp index ad2be99..3945bce 100644 --- a/framework/common/tcuRasterizationVerifier.cpp +++ b/framework/common/tcuRasterizationVerifier.cpp @@ -670,7 +670,7 @@ bool verifyTriangleGroupInterpolationWithInterpolator (const tcu::Surface& surfa if (args.redBits > 8 || args.greenBits > 8 || args.blueBits > 8) log << tcu::TestLog::Message << "Warning! More than 8 bits in a color channel, this may produce false negatives." << tcu::TestLog::EndMessage; - // subpixel bits in in a valid range? + // subpixel bits in a valid range? if (subPixelBits < 0) { @@ -2393,7 +2393,7 @@ bool verifyTriangleGroupRasterization (const tcu::Surface& surface, const Triang tcu::Surface errorMask (surface.getWidth(), surface.getHeight()); bool result = false; - // subpixel bits in in a valid range? + // subpixel bits in a valid range? if (subPixelBits < 0) { @@ -2466,6 +2466,10 @@ bool verifyTriangleGroupRasterization (const tcu::Surface& surface, const Triang tcu::clear(errorMask.getAccess(), tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f)); + // Use these to sanity check there is something drawn when a test expects something else than an empty picture. + bool referenceEmpty = true; + bool resultEmpty = true; + for (int y = 0; y < surface.getHeight(); ++y) for (int x = 0; x < surface.getWidth(); ++x) { @@ -2474,6 +2478,9 @@ bool verifyTriangleGroupRasterization (const tcu::Surface& surface, const Triang const bool imageFullCoverage = compareColors(color, triangleColor, args.redBits, args.greenBits, args.blueBits); CoverageType referenceCoverage = (CoverageType)coverageMap.getAccess().getPixelUint(x, y).x(); + if (!imageNoCoverage) + resultEmpty = false; + switch (referenceCoverage) { case COVERAGE_NONE: @@ -2487,6 +2494,7 @@ bool verifyTriangleGroupRasterization (const tcu::Surface& surface, const Triang case COVERAGE_PARTIAL: { + referenceEmpty = false; bool foundFragment = false; if (vulkanLinesTest == true) { @@ -2513,6 +2521,7 @@ bool verifyTriangleGroupRasterization (const tcu::Surface& surface, const Triang break; case COVERAGE_FULL: + referenceEmpty = false; if (!imageFullCoverage) { // no coverage where there should be @@ -2533,7 +2542,8 @@ bool verifyTriangleGroupRasterization (const tcu::Surface& surface, const Triang if (((mode == VERIFICATIONMODE_STRICT) && (missingPixels + unexpectedPixels > 0)) || ((mode == VERIFICATIONMODE_WEAK) && (missingPixels + unexpectedPixels > weakVerificationThreshold)) || ((mode == VERIFICATIONMODE_WEAKER) && (missingPixels + unexpectedPixels > weakerVerificationThreshold)) || - ((mode == VERIFICATIONMODE_SMOOTH) && (missingPixels > weakVerificationThreshold))) + ((mode == VERIFICATIONMODE_SMOOTH) && (missingPixels > weakVerificationThreshold)) || + referenceEmpty != resultEmpty) { result = false; }