Fix invocation count verification
authorJames Fitzpatrick <james.fitzpatrick@imgtec.com>
Wed, 3 Nov 2021 14:31:50 +0000 (14:31 +0000)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Fri, 5 Nov 2021 16:18:46 +0000 (16:18 +0000)
The shaders in these tests track the number of invocations executed and
verify that against the expected number of invocations for the test.

The spec only guarentees that each fragment is executed at least once.
So an implementation is free to execute each fragment multiple times
if required (for example, an implementation might required a shader to
be run at sample rate).

Change this verification to only check against the minmum number of
invocations.

Affects: dEQP-VK.fragment_operations.early_fragment.samplemask_*

Components: Vulkan

VK-GL-CTS issue: 3278

Change-Id: I93f1aa42dd6a13486bed044e361671e5a2f2cb07

external/vulkancts/modules/vulkan/fragment_ops/vktFragmentOperationsEarlyFragmentTests.cpp

index 5a7e598..f92f1bb 100644 (file)
@@ -1519,15 +1519,12 @@ tcu::TestStatus EarlyFragmentSampleMaskTestInstance::iterate (void)
                const int  expectedCounter         = expectPartialResult ? renderSize.x() * renderSize.y() / 2 : renderSize.x() * renderSize.y();
                const int  tolerance               = expectPartialResult ? de::max(renderSize.x(), renderSize.y()) * 3  : 0;
                const int  expectedMin         = de::max(0, expectedCounter - tolerance);
-               const int  expectedMax             = expectedCounter + tolerance;
 
                tcu::TestLog& log = m_context.getTestContext().getLog();
-               log << tcu::TestLog::Message << "Expected value"
-                       << (expectPartialResult ? " in range: [" + de::toString(expectedMin) + ", " + de::toString(expectedMax) + "]" : ": " + de::toString(expectedCounter))
-                       << tcu::TestLog::EndMessage;
+               log << tcu::TestLog::Message << "Minimum expected value: " + de::toString(expectedMin) << tcu::TestLog::EndMessage;
                log << tcu::TestLog::Message << "Result value: " << de::toString(actualCounter) << tcu::TestLog::EndMessage;
 
-               if (expectedMin <= actualCounter && actualCounter <= expectedMax)
+               if (expectedMin <= actualCounter)
                        return tcu::TestStatus::pass("Success");
                else
                        return tcu::TestStatus::fail("Value out of range");