From e52b99b089c44860a89e8b6878f3ed5b9a5a36f4 Mon Sep 17 00:00:00 2001 From: Piotr Byszewski Date: Fri, 19 Jan 2018 15:15:07 +0100 Subject: [PATCH] Fix ES2 rbo clear tests for RGB5_A1 color_clear and stencil_clear tests for GL_RGB5_A1 format should not perform validation for alpha channel as test thresholds for this channel do not account for dithering. Components: OpenGL VK-GL-CTS issue: 348 Affects: dEQP-GLES2.functional.fbo.render.color_clear.* dEQP-GLES2.functional.fbo.render.stencil_clear.* Change-Id: I72fb6ec98dacfe9b2ad8178d0a01f7bb0bee01fc --- modules/gles2/functional/es2fFboRenderTest.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/modules/gles2/functional/es2fFboRenderTest.cpp b/modules/gles2/functional/es2fFboRenderTest.cpp index c517d68..0007801 100644 --- a/modules/gles2/functional/es2fFboRenderTest.cpp +++ b/modules/gles2/functional/es2fFboRenderTest.cpp @@ -714,6 +714,16 @@ void ColorClearsTest::render (sglr::Context& context, Surface& dst) } else { + // clear alpha channel for GL_RGB5_A1 format because test + // thresholds for the alpha channel do not account for dithering + if(getConfig().colorbufferFormat == GL_RGB5_A1) + { + context.colorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE); + context.clearColor(0.0f, 0.0f, 0.0f, 1.0f); + context.clear(GL_COLOR_BUFFER_BIT); + context.colorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); + } + // Read from fbo context.readPixels(dst, 0, 0, width, height); } @@ -1058,7 +1068,19 @@ void StencilClearsTest::render (sglr::Context& context, Surface& dst) context.readPixels(dst, 0, 0, context.getWidth(), context.getHeight()); } else + { + // clear alpha channel for GL_RGB5_A1 format because test + // thresholds for the alpha channel do not account for dithering + if(getConfig().colorbufferFormat == GL_RGB5_A1) + { + context.colorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE); + context.clearColor(0.0f, 0.0f, 0.0f, 1.0f); + context.clear(GL_COLOR_BUFFER_BIT); + context.colorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); + } + context.readPixels(dst, 0, 0, width, height); + } } bool StencilClearsTest::isConfigSupported (const FboConfig& config) -- 2.7.4