src/tests/egl_tests/EGLDisplayTest.cpp

Branch


Log

Author Commit Date CI Message
Tim Van Patten de40b6e5 2025-06-06T13:18:09 tests: Add GetEglPlatform() Testing the system EGL library was recently added to ANGLE's end2end tests, breaking the assumption that the tests were interacting with the ANGLE EGL library directly. Many EGL end2end tests call eglGetPlatformDisplay() with the platform value EGL_PLATFORM_ANGLE_ANGLE. However, Android only allows EGL_PLATFORM_ANDROID_KHR, rejecting all other values (returning EGL_NO_DISPLAY). Add GetEglPlatform() to return the platform value to pass to eglGetPlatformDisplay(), based on things like the driver being tested and the OS the tests are running on. Currently, this only supports returning EGL_PLATFORM_ANDROID_KHR for SystemEGL+Android, and EGL_PLATFORM_ANGLE_ANGLE for everything else. Bug: b/279980674 Change-Id: Ib8d7970c8e178beb14ecc6a4f96156783e60c257 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6634554 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Tim Van Patten 3b7528e1 2025-05-20T12:31:28 Support running the full end2end suite against the System EGL Update the end2end test instantiation to either fully target the packaged ANGLE libraries or the system EGL, but not a combination of both simultaneously. The GN argument |angle_test_enable_system_egl| controls which driver is being tested by all the instantiated tests. It's default value is "false", which means the tests target the ANGLE libraries by default: kDefaultGLESDriver = GLESDriverType::AngleEGL When |angle_test_enable_system_egl = true|: kDefaultGLESDriver = GLESDriverType::SystemEGL This allows for testing the system EGL with the full end2end test suite, which is useful on devices where ANGLE is the system EGL (e.g., Android). It also allows for specifying which backend to use (or all) during system EGL testing, when ANGLE is the EGL driver. This also includes removing the various ESx_EGL() functions, because the end2end tests must now fully commit to testing either the ANGLE driver or system driver, rather than a combination of both. This is similar to many other test suites, such as the Khronos CTS (dEQP), which only test validate a single driver per invocation. Bug: b/279980674 Test: angle_end2end_tests Change-Id: I4f7dc2ccb4f26b3bd02767d0a0d2876f8612f2ae Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6580876 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Tim Van Patten dcbcee8a 2025-05-15T10:39:55 Tests: Use eglGetPlatformDisplay() From the EGL 1.5 spec: Appendix F Version 1.5 EGL version 1.5 was voted out of the Khronos Technical Working Group on January 31, 2014, and formally approved by the Khronos Board of Promoters on March 14, 2014. EGL 1.5 is the sixth release of EGL. It introduces the following new features (the EGL extension(s) each feature is based on are also shown parenthetically): * Platform support: – Providing a mechanism for support of multiple platforms (such as window systems or offscreen rendering frameworks) in a single EGL implementation at runtime (EGL_EXT_platform_base). Many tests use eglGetPlatformDisplayEXT() which is provided by the EGL extension EGL_EXT_platform_base. With the promotion of the EGL_EXT_platform_base functions to core EGL in version 1.5 and ANGLE supporting EGL 1.5 (as of at least 2019), update the calls to use eglGetPlatformDisplay(). This is in preparation for running the ANGLE end2end tests in Android, which only exposes the EGL 1.5 functions, and not the EGL_EXT_platform_base functions. Bug: b/391967165 Test: angle_end2end_tests Change-Id: I58109c3afe270f46db952e124ee3f5c11200ca35 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6552257 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Tim Van Patten <timvp@google.com>
Tim Van Patten e7277deb 2025-05-19T11:16:56 Add test to validate eglGetPlatformDisplayEXT() Add a test to validate eglGetPlatformDisplayEXT() returns a valid display on devices that support the EGL extension EGL_EXT_platform_base. Bug: b/279980674 Test: EGLDisplayTest.GetPlatformDisplayEXT/* Change-Id: I8cbb9c3905deb960e567a07d64e6c9d590a4ae70 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6565328 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Yuxiang Qian a5d750fb 2025-03-25T14:24:19 Add test to check EGL_KHR_platform_android Add an end2end test to check that eglGetPlatformDisplayEXT can use EGL_PLATFORM_ANDROID_KHR to get display. Also, to follow the spec, ValidateGetPlatformDisplayCommon should set EGL_BAD_PARAMETER for unsupported platform. Bug: angleproject:404581995 Change-Id: I20a962adb2dab4434141417b11c959924aff1597 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6369995 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 9e8b104e 2024-10-14T00:00:00 Do not test OpenGL backend on iOS Added Metal platform to tests that require instantiation. Bug: angleproject:40050022 Bug: angleproject:42264029 Bug: angleproject:42266119 Bug: angleproject:42266226 Bug: angleproject:42266239 Bug: angleproject:42266249 Bug: angleproject:359136169 Fixed: angleproject:373478551 Change-Id: I915f09c7f24acce27bf0d489932645338ac3fbe8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5932659 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Igor Nazarov 86b22745 2024-07-17T19:05:51 Vulkan: Fix mPipelineCache is not initialized after terminate Very old regression: https://chromium-review.googlesource.com/c/angle/angle/+/1683807 Problem happens only if call `eglInitialize()` again on terminated display without also calling `eglGetDisplay()`. Note: calling `eglGetDisplay()` on terminated display will call `setupDisplayPlatform()`, which will destroy old `mImplementation`. Test: angle_end2end_tests --gtest_filter=EGLDisplayTest.InitializeDrawSwapTerminateLoop* Bug: angleproject:3318 Change-Id: I94bc7eba97be2d9b194c1a22a37662a2836f60b4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5717753 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yuxin Hu 7d9c1d5f 2024-01-11T23:09:22 Add a test to check eglInitialize works in multithread Bug: angleproject:8265 Change-Id: Ib87c5e66be1387c21642353cb3f3dc8841150ba9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5190063 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi e3708149 2024-01-11T15:23:30 Add a test to ensure multiple eglInitialize calls work Bug: angleproject:8265 Change-Id: I186942a7830a35c563df503aa2b06e407288eef3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5191165 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Igor Nazarov c95ffadf 2023-07-24T13:00:32 Perform Display terminate(InternalCleanup) from makeCurrent() Current state: - Call to `eglTerminate()` is canceled if there are Contexts current. - All not current Contexts are invalidated in `eglTerminate()` call. - Full Display termination will happen only when last Context is actually destroyed in `eglDestroyContext()` or last active thread terminates (Android only). Problem: - Context is not marked invalid after it is unmade from current when `eglTerminate()` was already called. - If `eglDestroyContext()` was called while context was current, it will be destroyed when unmade from current - in this case actual Display termination will NOT happen. After this change: - Context immediately invalidated after it is unmade from current when `eglTerminate()` was already called. - Full Display termination will happen after the last Context is unmade from current (all Contexts are invalid). Bug: angleproject:6798 Test: angle_end2end_tests --gtest_filter=EGLDisplayTest.ContextLeakAfterTerminate* Change-Id: Idcce94b041649db58d3d879858fba99109347baf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4708328 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jason Macnak 2de99d47 2022-11-17T12:19:35 Reset instance/device extensions in RendererVk::onDestroy() RendererVk::initialize() adds a nullptr to the end of RendererVk::mEnabledInstanceExtensions (presumably to ensure the VK implementation crashes if it tries to read past?). If RendererVk::onDestroy() fails to clear this nullptr, it can lead to a crash when sorting the extension lists when the renderer is re-initialized the second time. Bug: b/249457381 Test: cvd start --gpu_mode=guest_swiftshader Test: EGLDisplayTest.InitalizeTerminateInitalize/ES3_Vulkan_NoFixture Change-Id: Ib24af11024cad6b28284f3a75cc862c48abec258 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4035646 Commit-Queue: Jason Macnak <natsu@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>