Use sRGB encoded reference values for 8-bit Display P3 tests
authorWeiwan Liu <weiwliu@nvidia.com>
Wed, 26 Sep 2018 01:47:47 +0000 (18:47 -0700)
committerWeiwan Liu <weiwliu@nvidia.com>
Wed, 26 Sep 2018 17:54:25 +0000 (10:54 -0700)
Per EGL_EXT_gl_colorspace_display_p3 spec, Display P3 assumes
sRGB transfer function. So use the reference values computed
in sRGB space for 8-bit Display P3 tests, instead of linear ones.

Components: AOSP
VK-GL-CTS issue: 1384

Affects:
dEQP-EGL.functional.wide_color.pbuffer_8888_colorspace_p3
dEQP-EGL.functional.wide_color.window_8888_colorspace_p3

Change-Id: I77cf0f84b3189ce4e64f28a83d771b21eccd9214

modules/egl/teglWideColorTests.cpp

index 2bdaf22..dfc46b9 100644 (file)
@@ -864,9 +864,10 @@ deUint8 WideColorSurfaceTest::expectedUint8 (float reference)
        }
        else
        {
-               // Apply sRGB transfer function when colorspace is sRGB and pixel component
-               // size is 8 bits (which is why we are here in expectedUint8).
-               if (m_colorSpace == EGL_GL_COLORSPACE_SRGB_KHR)
+               // Apply sRGB transfer function when colorspace is sRGB or Display P3 and
+               // pixel component size is 8 bits (which is why we are here in expectedUint8).
+               if (m_colorSpace == EGL_GL_COLORSPACE_SRGB_KHR ||
+                               m_colorSpace == EGL_GL_COLORSPACE_DISPLAY_P3_EXT)
                {
                        float srgbReference;