From 70d6a60cc7df660554055602275e53ad20cafe42 Mon Sep 17 00:00:00 2001 From: George Liu Date: Wed, 9 Nov 2022 15:55:45 +0800 Subject: [PATCH] Corrected shaders to draw uniform colors. For MSAA, the subsample of the pixel may be in the triangle, but the center of the pixel is outside the triangle. This pixel depth may be out of the depth range and gl_FragCoord.z is negative, especially when the triangle is narrow and the depth gradient is large. This will draw an unexpected black for the pixel after the calculation. This only happens for configs that are not in the must-pass: '--deqp-surface-width=3840 --deqp-surface-height=2160 --deqp-gl-config-name=rgba8888d24s8ms4' Components: OpenGL ES VK-GL-CTS issue: 4110 Affects: dEQP-GLES3.functional.occlusion_query.* Change-Id: Ib92fe4b90e326bc8a313f123b1df1cdc4417f6d1 --- modules/gles3/functional/es3fOcclusionQueryTests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gles3/functional/es3fOcclusionQueryTests.cpp b/modules/gles3/functional/es3fOcclusionQueryTests.cpp index ca513e5..b528a9a 100644 --- a/modules/gles3/functional/es3fOcclusionQueryTests.cpp +++ b/modules/gles3/functional/es3fOcclusionQueryTests.cpp @@ -158,7 +158,7 @@ void OcclusionQueryCase::init (void) "\n" "void main (void)\n" "{\n" - " mediump float depth_gradient = gl_FragCoord.z;\n" + " mediump float depth_gradient = max(gl_FragCoord.z, 0.0);\n" " mediump float bias = 0.1;\n" " dEQP_FragColor = vec4(u_color.xyz * (depth_gradient + bias), 1.0);\n" "}\n"; -- 2.7.4