From 46ba977ddd965d5fb9b1d400544878cf2b93aef8 Mon Sep 17 00:00:00 2001 From: Jeannot Breton Date: Tue, 2 May 2017 14:41:55 -0500 Subject: [PATCH] Fix texture_size_promotion snorm/RGB10_A2UI issue Read color clamping was not considered in the snorm expected value, so the change clamp the expected value The alpha component in RGB10_A2UI didn't have enough bits to hold an expected value of 4. So we change the expected alpha value to 1 Affects: KHR-GL45.texture_size_promotion.functional Components: OpenGL VK-GL-CTS issue: 395 Change-Id: I920eb187e558faf9557f886be0269ea0c927918b --- external/openglcts/modules/gl/gl3cTextureSizePromotion.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/external/openglcts/modules/gl/gl3cTextureSizePromotion.cpp b/external/openglcts/modules/gl/gl3cTextureSizePromotion.cpp index 569b958..1ead7fc 100644 --- a/external/openglcts/modules/gl/gl3cTextureSizePromotion.cpp +++ b/external/openglcts/modules/gl/gl3cTextureSizePromotion.cpp @@ -870,9 +870,10 @@ bool FunctionalTest::checkDestinationTexture(TextureInternalFormatDescriptor des GLU_EXPECT_NO_ERROR(gl.getError(), "glReadPixels have failed"); /* Setup expected value. */ + /* Signed fixed-point read color are clamped to [0, 1] by default */ glw::GLfloat expected_value = isChannelTypeNone(descriptor, channel) ? ((channel == ALPHA_COMPONENT) ? 1.f : 0.f) : - s_source_texture_data_sn[channel]; + deFloatClamp(s_source_texture_data_sn[channel], 0, 1); /* Compare expected and fetched values. */ if (fabs(pixel - expected_value) <= getMinPrecision(descriptor, channel)) @@ -1157,7 +1158,7 @@ const glw::GLfloat FunctionalTest::s_source_texture_data_sn[] = { -0.125f, 0.25f const glw::GLint FunctionalTest::s_source_texture_data_i[] = { -1, 2, -3, 4 }; -const glw::GLuint FunctionalTest::s_source_texture_data_ui[] = { 1, 2, 3, 4 }; +const glw::GLuint FunctionalTest::s_source_texture_data_ui[] = { 4, 3, 2, 1 }; const glw::GLfloat FunctionalTest::s_destination_texture_data_f[] = { 5.f -- 2.7.4