From cf5827e7d76c19ceb737a94103d89405e36875c5 Mon Sep 17 00:00:00 2001 From: Ricardo Garcia Date: Wed, 15 Jul 2020 15:22:33 +0200 Subject: [PATCH] Allow Bresenham for single-sample non-strict lines Bresenham rasterization is allowed by Vulkan when using single-sample non-strict lines but the current test verification function only checks that possibility when the line width is 1.0. Affected tests: dEQP-VK.rasterization.interpolation.*line* dEQP-VK.rasterization.flatshading.*line* Components: Framework, Vulkan VK-GL-CTS issue: 2437 Change-Id: I98a8a393fa387989faa40325629bfbf0b1f0567b --- .../modules/vulkan/rasterization/vktRasterizationTests.cpp | 2 +- framework/common/tcuRasterizationVerifier.cpp | 11 ++++++----- framework/common/tcuRasterizationVerifier.hpp | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/external/vulkancts/modules/vulkan/rasterization/vktRasterizationTests.cpp b/external/vulkancts/modules/vulkan/rasterization/vktRasterizationTests.cpp index 2bf4695..80fc096 100644 --- a/external/vulkancts/modules/vulkan/rasterization/vktRasterizationTests.cpp +++ b/external/vulkancts/modules/vulkan/rasterization/vktRasterizationTests.cpp @@ -3858,7 +3858,7 @@ tcu::TestStatus LineInterpolationTestInstance::iterate (void) case PRIMITIVESTRICTNESS_NONSTRICT: case PRIMITIVESTRICTNESS_IGNORE: { - if (!verifyTriangulatedLineGroupInterpolation(resultImage, scene, args, m_context.getTestContext().getLog(), false)) + if (!verifyTriangulatedLineGroupInterpolation(resultImage, scene, args, m_context.getTestContext().getLog(), false, true)) m_allIterationsPassed = false; break; diff --git a/framework/common/tcuRasterizationVerifier.cpp b/framework/common/tcuRasterizationVerifier.cpp index 6660fcd..1dc36e8 100644 --- a/framework/common/tcuRasterizationVerifier.cpp +++ b/framework/common/tcuRasterizationVerifier.cpp @@ -1178,7 +1178,7 @@ static bool verifyMultisampleLineGroupInterpolationInternal (const tcu::Surface& // with values effectively duplicated in the minor axis direction. In other cases, implementations // will use the original parameters of the line to calculate attribute interpolation so it will // follow the direction of the line-segment. - logStash.messages.push_back("Verify using trangle interpolator"); + logStash.messages.push_back("Verify using triangle interpolator"); if (!verifyTriangleGroupInterpolationWithInterpolator(surface, triangleScene, args, logStash, TriangleInterpolator(triangleScene))) { logStash.messages.push_back("Verify using line interpolator"); @@ -1218,7 +1218,8 @@ static bool verifyMultisampleLineGroupInterpolation (const tcu::Surface& surfa const LineSceneSpec& scene, const RasterizationArguments& args, tcu::TestLog& log, - const bool strictMode = true) + const bool strictMode = true, + const bool allowBresenhamForNonStrictLines = false) { bool result = false; VerifyTriangleGroupInterpolationLogStash nonStrictModeLogStash; @@ -1261,7 +1262,7 @@ static bool verifyMultisampleLineGroupInterpolation (const tcu::Surface& surfa { log << tcu::TestLog::Message << "Checking line rasterisation using verifySinglesampleNarrowLineGroupInterpolation for nonStrict lines" << tcu::TestLog::EndMessage; if (args.numSamples <= 1 && - scene.lineWidth == 1.0f && + allowBresenhamForNonStrictLines && verifyLineGroupInterpolationWithProjectedWeights(surface, scene, args, log)) { log << tcu::TestLog::Message << "verifySinglesampleNarrowLineGroupInterpolation for nonStrict lines Passed" << tcu::TestLog::EndMessage; @@ -2835,9 +2836,9 @@ LineInterpolationMethod verifyLineGroupInterpolation (const tcu::Surface& surfac } } -bool verifyTriangulatedLineGroupInterpolation (const tcu::Surface& surface, const LineSceneSpec& scene, const RasterizationArguments& args, tcu::TestLog& log, const bool strictMode) +bool verifyTriangulatedLineGroupInterpolation (const tcu::Surface& surface, const LineSceneSpec& scene, const RasterizationArguments& args, tcu::TestLog& log, const bool strictMode, const bool allowBresenhamForNonStrictLines) { - return verifyMultisampleLineGroupInterpolation(surface, scene, args, log, strictMode); + return verifyMultisampleLineGroupInterpolation(surface, scene, args, log, strictMode, allowBresenhamForNonStrictLines); } } // tcu diff --git a/framework/common/tcuRasterizationVerifier.hpp b/framework/common/tcuRasterizationVerifier.hpp index eb8323c..9f7ab1f 100644 --- a/framework/common/tcuRasterizationVerifier.hpp +++ b/framework/common/tcuRasterizationVerifier.hpp @@ -232,7 +232,7 @@ LineInterpolationMethod verifyLineGroupInterpolation (const tcu::Surface& surfac * * Returns false if invalid rasterization interpolation is found. *//*--------------------------------------------------------------------*/ -bool verifyTriangulatedLineGroupInterpolation (const tcu::Surface& surface, const LineSceneSpec& scene, const RasterizationArguments& args, tcu::TestLog& log, const bool strictMode = true); +bool verifyTriangulatedLineGroupInterpolation (const tcu::Surface& surface, const LineSceneSpec& scene, const RasterizationArguments& args, tcu::TestLog& log, const bool strictMode = true, const bool allowBresenhamForNonStrictLines = false); } // tcu -- 2.7.4