From 575313bd9b06b3be3c1eb1593d9f5b4adac80269 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mika=20Isoj=C3=A4rvi?= Date: Tue, 2 Feb 2016 16:02:21 -0800 Subject: [PATCH] Allow helper invocations inside primitive. Test required that helper invocations would only happen on primitive edges, which produced false negatives if wide lines are rendered as two triangles. This change allows helper invocations anywhere inside the primitive. Bug: 22180525 Change-Id: Iee7b50e7a46e4b172c3a61298a7f737d00b29750 --- .../cts/master/com.drawelements.deqp.gles31.xml | 27 ++++++++++++++++++++++ android/cts/master/gles31-master.txt | 9 ++++++++ android/cts/master/src/gles31-test-issues.txt | 3 --- .../es31fShaderHelperInvocationTests.cpp | 24 +++++++------------ 4 files changed, 44 insertions(+), 19 deletions(-) diff --git a/android/cts/master/com.drawelements.deqp.gles31.xml b/android/cts/master/com.drawelements.deqp.gles31.xml index 72145a2..75c65a5 100644 --- a/android/cts/master/com.drawelements.deqp.gles31.xml +++ b/android/cts/master/com.drawelements.deqp.gles31.xml @@ -13173,6 +13173,15 @@ + + + + + + + + + @@ -13209,6 +13218,15 @@ + + + + + + + + + @@ -13245,6 +13263,15 @@ + + + + + + + + + diff --git a/android/cts/master/gles31-master.txt b/android/cts/master/gles31-master.txt index d7f3cc2..5e2887c 100644 --- a/android/cts/master/gles31-master.txt +++ b/android/cts/master/gles31-master.txt @@ -4064,6 +4064,9 @@ dEQP-GLES31.functional.shaders.helper_invocation.derivate.triangles_4_samples_fw dEQP-GLES31.functional.shaders.helper_invocation.derivate.lines_4_samples_dfdx dEQP-GLES31.functional.shaders.helper_invocation.derivate.lines_4_samples_dfdy dEQP-GLES31.functional.shaders.helper_invocation.derivate.lines_4_samples_fwidth +dEQP-GLES31.functional.shaders.helper_invocation.derivate.wide_lines_4_samples_dfdx +dEQP-GLES31.functional.shaders.helper_invocation.derivate.wide_lines_4_samples_dfdy +dEQP-GLES31.functional.shaders.helper_invocation.derivate.wide_lines_4_samples_fwidth dEQP-GLES31.functional.shaders.helper_invocation.derivate.points_4_samples_dfdx dEQP-GLES31.functional.shaders.helper_invocation.derivate.points_4_samples_dfdy dEQP-GLES31.functional.shaders.helper_invocation.derivate.points_4_samples_fwidth @@ -4076,6 +4079,9 @@ dEQP-GLES31.functional.shaders.helper_invocation.derivate.triangles_8_samples_fw dEQP-GLES31.functional.shaders.helper_invocation.derivate.lines_8_samples_dfdx dEQP-GLES31.functional.shaders.helper_invocation.derivate.lines_8_samples_dfdy dEQP-GLES31.functional.shaders.helper_invocation.derivate.lines_8_samples_fwidth +dEQP-GLES31.functional.shaders.helper_invocation.derivate.wide_lines_8_samples_dfdx +dEQP-GLES31.functional.shaders.helper_invocation.derivate.wide_lines_8_samples_dfdy +dEQP-GLES31.functional.shaders.helper_invocation.derivate.wide_lines_8_samples_fwidth dEQP-GLES31.functional.shaders.helper_invocation.derivate.points_8_samples_dfdx dEQP-GLES31.functional.shaders.helper_invocation.derivate.points_8_samples_dfdy dEQP-GLES31.functional.shaders.helper_invocation.derivate.points_8_samples_fwidth @@ -4088,6 +4094,9 @@ dEQP-GLES31.functional.shaders.helper_invocation.derivate.triangles_max_samples_ dEQP-GLES31.functional.shaders.helper_invocation.derivate.lines_max_samples_dfdx dEQP-GLES31.functional.shaders.helper_invocation.derivate.lines_max_samples_dfdy dEQP-GLES31.functional.shaders.helper_invocation.derivate.lines_max_samples_fwidth +dEQP-GLES31.functional.shaders.helper_invocation.derivate.wide_lines_max_samples_dfdx +dEQP-GLES31.functional.shaders.helper_invocation.derivate.wide_lines_max_samples_dfdy +dEQP-GLES31.functional.shaders.helper_invocation.derivate.wide_lines_max_samples_fwidth dEQP-GLES31.functional.shaders.helper_invocation.derivate.points_max_samples_dfdx dEQP-GLES31.functional.shaders.helper_invocation.derivate.points_max_samples_dfdy dEQP-GLES31.functional.shaders.helper_invocation.derivate.points_max_samples_fwidth diff --git a/android/cts/master/src/gles31-test-issues.txt b/android/cts/master/src/gles31-test-issues.txt index b9169b6..f6e1cef 100644 --- a/android/cts/master/src/gles31-test-issues.txt +++ b/android/cts/master/src/gles31-test-issues.txt @@ -19,9 +19,6 @@ dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_centroid dEQP-GLES31.functional.shaders.builtin_functions.precision.atan2.mediump_* dEQP-GLES31.functional.shaders.builtin_functions.precision.atan2.highp_* -# Bug 22180525 -dEQP-GLES31.functional.shaders.helper_invocation.derivate.wide_lines_*_samples_* - # Bug 22302334 dEQP-GLES31.functional.shaders.builtin_functions.precision.acosh.highp_* dEQP-GLES31.functional.shaders.builtin_functions.precision.atanh.highp_* diff --git a/modules/gles31/functional/es31fShaderHelperInvocationTests.cpp b/modules/gles31/functional/es31fShaderHelperInvocationTests.cpp index 125496b..a173d51 100644 --- a/modules/gles31/functional/es31fShaderHelperInvocationTests.cpp +++ b/modules/gles31/functional/es31fShaderHelperInvocationTests.cpp @@ -542,24 +542,16 @@ void HelperInvocationDerivateCase::deinit (void) static bool hasNeighborWithColor (const tcu::Surface& surface, int x, int y, tcu::RGBA color, tcu::RGBA threshold) { - static const IVec2 s_neighbors[] = - { - IVec2(-1, -1), - IVec2( 0, -1), - IVec2(+1, -1), - IVec2(-1, 0), - IVec2(+1, 0), - IVec2(-1, +1), - IVec2( 0, +1), - IVec2(+1, +1) - }; - const int w = surface.getWidth(); const int h = surface.getHeight(); - for (int sample = 0; sample < DE_LENGTH_OF_ARRAY(s_neighbors); sample++) + for (int dx = -1; dx < 2; dx++) + for (int dy = -1; dy < 2; dy++) { - const IVec2 pos = IVec2(x, y) + s_neighbors[sample]; + const IVec2 pos = IVec2(x + dx, y + dy); + + if (dx == 0 && dy == 0) + continue; if (de::inBounds(pos.x(), 0, w) && de::inBounds(pos.y(), 0, h)) { @@ -598,8 +590,8 @@ static bool verifyHelperInvocationDerivate (TestLog& log, const tcu::Surface& re if (nonZeroDeriv) numNonZeroDeriv += 1; - if ((!isBg && !isFg) || // Neither of valid colors (ignoring blue channel that has derivate) - (nonZeroDeriv && !neighborBg)) // Has non-zero derivate, but sample not at primitive edge + if ((!isBg && !isFg) || // Neither of valid colors (ignoring blue channel that has derivate) + (nonZeroDeriv && !neighborBg && !isFg)) // Has non-zero derivate, but sample not at primitive edge or inside primitive numInvalidPixels += 1; if (isFg) -- 2.7.4