Fix sample_mask_in.bit_count_per_two_samples tests for 2x MSAA.
authorKenneth Graunke <kenneth.w.graunke@intel.com>
Sun, 4 Sep 2016 07:34:47 +0000 (00:34 -0700)
committerChad Versace <chadversary@google.com>
Tue, 18 Oct 2016 22:03:47 +0000 (15:03 -0700)
The dEQP-GLES31.functional.shaders.sample_variables.sample_mask_in.
bit_count_per_two_samples.multisample_{texture,renderbuffer}_{1,2}
tests report:

    Verifying gl_SampleMaskIn.
    Fragment shader may be invoked [ceil(numSamples/2), numSamples] times.
    => gl_SampleMaskIn should have the number of bits set in range
       [1, numSamples - ceil(numSamples/2) + 1]:

which suggests that maxBitCount should be ceil(2/2) + 1 = 1 + 1 = 2.

However, it then says:

    Setting minBitCount = 1, maxBitCount = 1.

Having two bits should be acceptable for 2x MSAA.

This patch drops the special case for 1x/2x MSAA, making them work
like all the other MSAA levels.

Change-Id: Ie615c82150588dab53226dc46670182a29d85ef5
(cherry picked from commit 724519b8fda9c2a92d646c3dfd1478e0daa282e9)

modules/gles31/functional/es31fSampleVariableTests.cpp

index 3172a5e..84035f9 100644 (file)
@@ -1303,7 +1303,7 @@ void SampleMaskCountCase::preDraw (void)
                // Worst case: all but one shader invocations get one sample, one shader invocation the rest of the samples
                const int minInvocationCount = ((m_numTargetSamples + 1) / 2);
                const int minBitCount = 1;
-               const int maxBitCount = (m_numTargetSamples <= 2) ? (1) : (m_numTargetSamples - ((minInvocationCount-1) * minBitCount));
+               const int maxBitCount = m_numTargetSamples - ((minInvocationCount-1) * minBitCount);
 
                if (maxLoc == -1)
                        throw tcu::TestError("Location of u_maxBitCount was -1");