From 6718efacbbeab1e8df00d0cd272d654b19bec6af Mon Sep 17 00:00:00 2001 From: Piers Daniell Date: Tue, 3 Mar 2020 23:29:28 -0700 Subject: [PATCH] OpenGL ES CTS fixes for passing on WGL When running cts-runner --type=es32 on a WGL platform it will pick up several pixel formats for the default framebuffer that aren't supported correctly by the existing OpenGL ES 3.2 tests. 1. OpenGL ES 3.2 CTS expects the platform to expose rgb565, but that is not available on WGL and should not be a requirement of OpenGL ES 3.2 conformance. This CL disables rgb565 is a requirement for all non-Android platforms, which extends the change originally made for X11 in https://gerrit.khronos.org/#/c/4615/ for issue VK-GL-CTS issue: 1474. 2. The 10-bit+ bits per pixel component WGL pixel formats are skipped since the existing OpenGL ES 3.2 tests, which use pixel transfer functions like glReadPixels, and assume an 8-bit type, don't work correctly since glReadPixels is not defined to do format and type conversions like it does with OpenGL. 3. Default framebuffers with sRGB color space are skipped because under OpenGL ES sRGB encoded will default for on in this case and the existing OpenGL ES tests do not currently support a non-linear default framebuffer. This is not a problem with OpenGL since with OpenGL sRGB encoding has to be enabled explicitly. Affects: cts-runner --type=es32 on WGL Components: OpenGL VK-GL-CTS issue: 2257 Change-Id: If12aff8c10571b7c0f72da618b13753c340a60c4 --- .../data/mustpass/gles/aosp_mustpass/3.2.2.x/mustpass.xml | 4 ++-- .../data/mustpass/gles/aosp_mustpass/3.2.3.x/mustpass.xml | 4 ++-- .../data/mustpass/gles/aosp_mustpass/3.2.4.x/mustpass.xml | 4 ++-- .../data/mustpass/gles/aosp_mustpass/3.2.5.x/mustpass.xml | 4 ++-- .../data/mustpass/gles/aosp_mustpass/3.2.6.x/mustpass.xml | 4 ++-- .../data/mustpass/gles/aosp_mustpass/master/mustpass.xml | 4 ++-- external/openglcts/modules/common/glcConfigListWGL.cpp | 15 +++++++++++++++ external/openglcts/modules/runner/CMakeLists.txt | 4 ++++ external/openglcts/modules/runner/glcAospMustpassEs.hpp | 8 ++++---- external/openglcts/scripts/build_mustpass.py | 12 ++++++------ framework/platform/win32/tcuWGL.cpp | 7 +++++++ framework/platform/win32/tcuWGL.hpp | 4 ++++ 12 files changed, 52 insertions(+), 22 deletions(-) diff --git a/external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.2.x/mustpass.xml b/external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.2.x/mustpass.xml index edf72af..27eaf5d 100644 --- a/external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.2.x/mustpass.xml +++ b/external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.2.x/mustpass.xml @@ -25,13 +25,13 @@ - + - + diff --git a/external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.3.x/mustpass.xml b/external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.3.x/mustpass.xml index 1de5351..b4864fb 100644 --- a/external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.3.x/mustpass.xml +++ b/external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.3.x/mustpass.xml @@ -25,13 +25,13 @@ - + - + diff --git a/external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.4.x/mustpass.xml b/external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.4.x/mustpass.xml index 59e97aa..fde291f 100644 --- a/external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.4.x/mustpass.xml +++ b/external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.4.x/mustpass.xml @@ -25,13 +25,13 @@ - + - + diff --git a/external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.5.x/mustpass.xml b/external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.5.x/mustpass.xml index 267cdbe..44fa0fc 100644 --- a/external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.5.x/mustpass.xml +++ b/external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.5.x/mustpass.xml @@ -25,13 +25,13 @@ - + - + diff --git a/external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.6.x/mustpass.xml b/external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.6.x/mustpass.xml index 9f8518a..ef81694 100644 --- a/external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.6.x/mustpass.xml +++ b/external/openglcts/data/mustpass/gles/aosp_mustpass/3.2.6.x/mustpass.xml @@ -25,13 +25,13 @@ - + - + diff --git a/external/openglcts/data/mustpass/gles/aosp_mustpass/master/mustpass.xml b/external/openglcts/data/mustpass/gles/aosp_mustpass/master/mustpass.xml index 60d679d..ae63c30 100644 --- a/external/openglcts/data/mustpass/gles/aosp_mustpass/master/mustpass.xml +++ b/external/openglcts/data/mustpass/gles/aosp_mustpass/master/mustpass.xml @@ -25,13 +25,13 @@ - + - + diff --git a/external/openglcts/modules/common/glcConfigListWGL.cpp b/external/openglcts/modules/common/glcConfigListWGL.cpp index 2990605..b3250f0 100644 --- a/external/openglcts/modules/common/glcConfigListWGL.cpp +++ b/external/openglcts/modules/common/glcConfigListWGL.cpp @@ -59,6 +59,21 @@ static void getDefaultWglConfigList(tcu::win32::Platform& wglPlatform, glu::ApiT fmtInfo.pixelType == tcu::wgl::PixelFormatInfo::PIXELTYPE_RGBA; bool isOk = isAOSPOk && (fmtInfo.sampleBuffers == 0); + if (isOk && (type.getProfile() == glu::PROFILE_ES) && + (fmtInfo.redBits > 8 || fmtInfo.greenBits > 8 || fmtInfo.blueBits > 8 || fmtInfo.alphaBits > 8)) + { + // The OpenGL ES tests use of glReadPixels is not compatible with default framebufer pixel + // formats with more than 8-bits per pixel component. + isOk = false; + } + + if (isOk && (type.getProfile() == glu::PROFILE_ES) && fmtInfo.sRGB) + { + // The OpenGL ES tests don't interact correctly with a default framebuffer + // in the sRGB color space. + isOk = false; + } + if (isAOSPOk) { configList.aospConfigs.push_back(AOSPConfig( diff --git a/external/openglcts/modules/runner/CMakeLists.txt b/external/openglcts/modules/runner/CMakeLists.txt index 0acc033..dde879f 100644 --- a/external/openglcts/modules/runner/CMakeLists.txt +++ b/external/openglcts/modules/runner/CMakeLists.txt @@ -7,6 +7,10 @@ if (DEQP_USE_X11) add_definitions(-DDEQP_SUPPORT_X11=1) endif () +if (DEQP_SUPPORT_WGL) + add_definitions(-DDEQP_SUPPORT_WGL=1) +endif () + if (DE_OS_IS_ANDROID) include_directories(${PROJECT_SOURCE_DIR}/framework/platform/android) diff --git a/external/openglcts/modules/runner/glcAospMustpassEs.hpp b/external/openglcts/modules/runner/glcAospMustpassEs.hpp index 2a00fe9..8ff4fef 100644 --- a/external/openglcts/modules/runner/glcAospMustpassEs.hpp +++ b/external/openglcts/modules/runner/glcAospMustpassEs.hpp @@ -37,9 +37,9 @@ static const RunParams aosp_mustpass_es_first_cfg[] = { { glu::ApiType::es(3, 0), "rotate-reverse-landscape", "rgba8888d24s8ms0", "270", -1, DE_NULL, 256, 256 }, #endif // DE_OS == DE_OS_ANDROID { glu::ApiType::es(3, 0), "multisample", "rgba8888d24s8ms4", "unspecified", -1, DE_NULL, 256, 256 }, -#ifndef DEQP_SUPPORT_X11 +#if DE_OS == DE_OS_ANDROID { glu::ApiType::es(3, 0), "565-no-depth-no-stencil", "rgb565d0s0ms0", "unspecified", -1, DE_NULL, 256, 256 }, -#endif // DEQP_SUPPORT_X11 +#endif // DE_OS == DE_OS_ANDROID { glu::ApiType::es(3, 1), "master", "rgba8888d24s8ms0", "unspecified", -1, DE_NULL, 256, 256 }, #if DE_OS == DE_OS_ANDROID { glu::ApiType::es(3, 1), "rotate-portrait", "rgba8888d24s8ms0", "0", -1, DE_NULL, 256, 256 }, @@ -54,9 +54,9 @@ static const RunParams aosp_mustpass_es_first_cfg[] = { { glu::ApiType::es(3, 1), "rotate-reverse-landscape", "rgba8888d24s8ms0", "270", -1, DE_NULL, 256, 256 }, #endif // DE_OS == DE_OS_ANDROID { glu::ApiType::es(3, 1), "multisample", "rgba8888d24s8ms4", "unspecified", -1, DE_NULL, 256, 256 }, -#ifndef DEQP_SUPPORT_X11 +#if DE_OS == DE_OS_ANDROID { glu::ApiType::es(3, 1), "565-no-depth-no-stencil", "rgb565d0s0ms0", "unspecified", -1, DE_NULL, 256, 256 }, -#endif // DEQP_SUPPORT_X11 +#endif // DE_OS == DE_OS_ANDROID }; #endif // _GLCAOSPMUSTPASSES_HPP diff --git a/external/openglcts/scripts/build_mustpass.py b/external/openglcts/scripts/build_mustpass.py index c7409ea..bc5b4e9 100644 --- a/external/openglcts/scripts/build_mustpass.py +++ b/external/openglcts/scripts/build_mustpass.py @@ -166,7 +166,7 @@ GLCTS_3_2_2_GLES3_PKG = Package(module = ES3CTS_MODULE, configurations = [ rotation = "unspecified", surfacewidth = "256", surfaceheight = "256", - skip = "x11", + os = "android", filters = [include("gles3-master.txt"), include("gles3-pixelformat.txt"), exclude("gles3-pixelformat-issues.txt")]), @@ -223,7 +223,7 @@ GLCTS_3_2_2_GLES31_PKG = Package(module = ES31CTS_MODULE, configurations = [ rotation = "unspecified", surfacewidth = "256", surfaceheight = "256", - skip = "x11", + os = "android", filters = [include("gles31-master.txt"), include("gles31-pixelformat.txt")]), ]) @@ -319,7 +319,7 @@ GLCTS_3_2_3_GLES3_PKG = Package(module = ES3CTS_MODULE, configurations = [ rotation = "unspecified", surfacewidth = "256", surfaceheight = "256", - skip = "x11", + os = "android", filters = GLCTS_3_2_3_GLES3_COMMON_FILTERS + [include("gles3-pixelformat.txt")]), ]) @@ -387,7 +387,7 @@ GLCTS_3_2_3_GLES31_PKG = Package(module = ES31CTS_MODULE, configurations = [ rotation = "unspecified", surfacewidth = "256", surfaceheight = "256", - skip = "x11", + os = "android", filters = GLCTS_3_2_3_GLES31_COMMON_FILTERS + [include("gles31-pixelformat.txt")]), ]) @@ -523,7 +523,7 @@ MASTER_GLES3_PKG = Package(module = ES3CTS_MODULE, configurations = [ rotation = "unspecified", surfacewidth = "256", surfaceheight = "256", - skip = "x11", + os = "android", filters = MASTER_GLES3_COMMON_FILTERS + [include("gles3-pixelformat.txt")]), ]) MASTER_GLES31_COMMON_FILTERS = [ @@ -585,7 +585,7 @@ MASTER_GLES31_PKG = Package(module = ES31CTS_MODULE, configurations = [ rotation = "unspecified", surfacewidth = "256", surfaceheight = "256", - skip = "x11", + os = "android", filters = MASTER_GLES31_COMMON_FILTERS + [include("gles31-pixelformat.txt")]), ]) diff --git a/framework/platform/win32/tcuWGL.cpp b/framework/platform/win32/tcuWGL.cpp index e871b4c..189a334 100644 --- a/framework/platform/win32/tcuWGL.cpp +++ b/framework/platform/win32/tcuWGL.cpp @@ -97,6 +97,11 @@ #define WGL_SAMPLE_BUFFERS_ARB 0x2041 #define WGL_SAMPLES_ARB 0x2042 +// WGL_EXT_colorspace +#define WGL_COLORSPACE_EXT 0x309D +#define WGL_COLORSPACE_SRGB_EXT 0x3089 +#define WGL_COLORSPACE_LINEAR_EXT 0x308A + // WGL_ARB_create_context #define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 #define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 @@ -372,6 +377,7 @@ PixelFormatInfo Core::getPixelFormatInfo (HDC deviceCtx, int pixelFormat) const WGL_AUX_BUFFERS_ARB, WGL_SAMPLE_BUFFERS_ARB, WGL_SAMPLES_ARB, + WGL_COLORSPACE_EXT }; const Functions& wgl = m_library->getFunctions(); std::map values; @@ -403,6 +409,7 @@ PixelFormatInfo Core::getPixelFormatInfo (HDC deviceCtx, int pixelFormat) const info.numAuxBuffers = values[WGL_AUX_BUFFERS_ARB]; info.sampleBuffers = values[WGL_SAMPLE_BUFFERS_ARB]; info.samples = values[WGL_SAMPLES_ARB]; + info.sRGB = values[WGL_COLORSPACE_EXT] == WGL_COLORSPACE_SRGB_EXT; return info; } diff --git a/framework/platform/win32/tcuWGL.hpp b/framework/platform/win32/tcuWGL.hpp index 6f50632..b7abfde 100644 --- a/framework/platform/win32/tcuWGL.hpp +++ b/framework/platform/win32/tcuWGL.hpp @@ -128,6 +128,9 @@ public: int sampleBuffers; int samples; + // From WGL_EXT_colorspace + bool sRGB; + // \todo [2013-04-14 pyry] Version bits? PixelFormatInfo (void) @@ -152,6 +155,7 @@ public: , numAuxBuffers (0) , sampleBuffers (0) , samples (0) + , sRGB (false) { } }; -- 2.7.4