src/libANGLE/Display.cpp


Log

Author Commit Date CI Message
Justin Novosad fbff065c 2023-05-03T22:19:07 Replace GetResourceFromHashSet with map lookup Function GetResourceFromHashSet had linear time complexity because it was sweeping through the set until a resource with a matching ID was found. This change replaces hash sets with hash maps to get constant time lookup. This solves, among other things, O(N^2) time complexity for rendering scenes containing a large number of surfaces. Function GetResourceFromHashSet was consuming over 50% of all CPU time on the main thread of Chrome's GPU process while running the MotionMark 1.2 Images test. With this change, the benchmark score increases by 70% on an M1 MacBook running a PGO official build of Chrome. Bug: chromium:1435066 Change-Id: I895ac0141a91d324c63adec2c0efb8e030d9675b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4505950 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Justin Novosad <junov@chromium.org> Reviewed-by: Igor Nazarov <i.nazarov@samsung.com>
Shahbaz Youssefi 2ceb04e0 2023-05-02T10:45:11 Initialize display TLS at thread creation time Bug: chromium:1441754 Change-Id: I611c6f591f2a6d3439e3c5d1250e2fde996c0ecf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4496673 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 144f2d2c 2023-04-24T12:52:27 Vulkan: Use thread-local space for EGL errors The assumption in anglebug.com/3041 that ANGLE is "single-threaded anyway" no longer holds. Bug: angleproject:3041 Change-Id: I613395c8003cad60764362d2776aaf7b6804b788 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4468107 Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 1328f2f3 2023-04-17T16:43:12 Vulkan: Destroy the surface without holding the EGL lock This change defers surface destruction to the end of the entry point that causes it so that it is done without holding the EGL lock. This works around a specific deadlock in Android. On this platform: - For EGL applications, parts of surface creation and destruction are handled by the platform, and parts of it are done by the native EGL driver. Namely, on surface destruction, native_window_api_disconnect is called outside the EGL driver. - For Vulkan applications, vkDestroySurfaceKHR takes full responsibility for destroying the surface, including calling native_window_api_disconnect. Unfortunately, native_window_api_disconnect may use EGL sync objects and can lead to calling into the EGL driver. For ANGLE, this is particularly problematic because it is simultaneously a Vulkan application and the EGL driver, causing `vkDestroySurfaceKHR` to call back into ANGLE and attempt to reacquire the EGL lock. Since there are no users of the surface when calling vkDestroySurfaceKHR, it is safe for ANGLE to destroy it without holding the EGL lock. Note that only eglDestroySurface and eglMakeCurrent may lead to the destruction of a window surface. Bug: b/275176234 Bug: angleproject:8127 Change-Id: I02dc52e53e150943457e3f503e7ef30469f96b05 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4428754 Reviewed-by: Charlie Lao <cclao@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen 20b6624a 2023-04-17T13:55:09 Metal: Support compiling on iOS without EAGL Makes EAGL and CGL compilation exclusive to each other. Catalyst would compile with both on ARM64, but only use EAGL. Remove use of GLSL generation in MSL. Generating GLSL for MSL compute and geometry shaders do not make sense. Remove compilation of RewriteRowMajorMatrices for Metal. It was removed from Metal in: b23bf47c9e999532a684beab9ac901552420b0b8 Reland "Metal: rewrite default uniforms and uniform blocks" Remove use of ANGLE_ENABLE_APPLE_WORKAROUNDS and gn variable angle_enable_apple_translator_workarounds. The workarounds are just unconditional business-as-usual implementation of ANGLE when ANGLE is compile for PLATFORM_APPLE. Fixed: angleproject:8129 Change-Id: I3af249708803fba816e2a7c92c35dddb84ce6946 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4428875 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Kyle Piddington <kpiddington@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Dan Glastonbury <djg@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Scott Violet 4e6cea96 2023-04-17T15:56:40 Removes UNREACHABLE in display initialization As it's possible for metal to be unavailable, UNREACHABLE() should not be used. Chrome has started shipping some builds with asserts enabled, so that it's possible for the gpu to crash here. Removing the UNREACHABLE makes it so the code doesn't crash and gpu fallback happens. Bug: chromium:1354718 Change-Id: I613c44b428c1de73b4b9937505e151d9416388ef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4437615 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Scott Violet <sky@chromium.org>
Kimmo Kinnunen c19b66f6 2023-04-06T11:30:03 EAGL: Define ANGLE_ENABLE_EAGL in build system ANGLE_ENABLE_EAGL is a "build system" decision. Set this and new variable ANGLE_ENABLE_CGL in BUILD.gn file. This is consistent with the other backends. Remove ANGLE_CPU_ARM64. This was used to do ANGLE_ENABLE_EAGL=TRUE when on Catalyst. Instead, let the build system set this. For ANGLE/Chrome buildsystem, this is not set, as Catalyst is not implemented. For WebKit, this should be set at WebKit build settings. Replace `defined(ANGLE_PLATFORM_MACCATALYST) && defined(ANGLE_CPU_ARM64)` with simpler expression: `defined(ANGLE_ENABLE_EAGL)`. Replace `defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_IOS)` with simpler expression: `defined(ANGLE_PLATFORM_APPLE)`. Bug: angleproject:8121 Change-Id: I3a0bbabb4347ad11f693e3f7c336ff12f66203d7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4404160 Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Dan Glastonbury <djg@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Chris Dalton 51ddcabf 2023-03-02T17:52:46 Enable pixel local storage by default We're ready to start hooking this extension up in Chrome. Bug: angleproject:7279 Change-Id: I5cb887a6641aa61c2da0dfcc24d2195cf0494f20 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4305361 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Peng Huang 1633a1bb 2023-02-17T15:16:06 Fix EGLImage importing problem Chrome DrDC uses EGLImage to share textures between contexts. Sometimes, chrome will create texture with a GLES 3.x context, and then create EGLImage from it, and then import EGLImage to a GLES 2.0 (WebGL 1.0) context. In this case, ANGLE may report errors if the original texture is created with formats which are not supported with GLES 2.0, but actually the texture can be sampled and rendered by ANGLE. Fix the problem by adding mIsTexturable & mIsRenderable in Image, and calculating them against the original context which owns the texture. Bug: chromium:1417294 Change-Id: I4c304422f0d0fc01a48c942d05758f8c2ce438e4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4265252 Commit-Queue: Peng Huang <penghuang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jonah Ryan-Davis 13e8dabc 2023-02-15T14:34:05 Add EGL_PLATFORM_ANGLE_DISPLAY_KEY_ANGLE To allow the creation of multiple EGLDisplays on the same graphics device, we need a value to key for the display cache. When the display key is specified, the cache will return a new display for that key, even if there is an existing display on the same graphics device. Bug: chromium:1251724 Change-Id: I55e169776770734fc33b8bc8e1265ea6f7472fe3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4255730 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Gert Wollny a52c0a6c 2023-02-06T16:01:27 Capture/Replay: Add and handle new resource type for EGLSync So far calls involving EGLSync were not tracking the actual sync objects, and this may lead to race conditions in multi-threaded and multi-context scenarios. This CL adds the type EGLSyncID and some specialized code handling of egl::Sync to distinguish EGLSync from the already existing GLSync objects in order to track them separately. Bug: angleproject:7911 Change-Id: I91b188a41069bc0620f51c55ee516d23b55bdd38 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4200095 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Yuly Novikov 1e32988c 2022-12-21T15:53:15 Revert "Metal: expose Metal backend only on supported GPUs." This reverts commit 9364246f08d34a378252e517210b68e97282f764. Reason for revert: iOS build fails Original change's description: > Metal: expose Metal backend only on supported GPUs. > > Query all the GPUs on the system during ANGLE's initialization, and do > not expose the EGL_ANGLE_platform_angle_metal client extension unless > all of them support the required GPU families or feature sets. > > Tested locally on a 2015 MacBook Pro with dual Intel Iris Pro and AMD > Radeon R9 M370X GPUs. The AMD GPU supports Metal GPU family macOS 2, > but the Intel GPU, only family macOS 1. With this change, Chrome > properly falls back to using ANGLE's OpenGL backend when > --use-angle=metal is specified, and renders correctly. > > Bug: chromium:1365598 > Change-Id: I2c3533afe733e0d06d7755cae272bbd12aa9e676 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4117716 > Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> > Reviewed-by: Gregg Tavares <gman@chromium.org> > Commit-Queue: Kenneth Russell <kbr@chromium.org> Bug: chromium:1365598 Change-Id: Iedbe8978f2a2d39a33359fa236a1d305c284266e No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4114291 Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: Yuly Novikov <ynovikov@chromium.org>
Kenneth Russell 9364246f 2022-12-19T16:28:44 Metal: expose Metal backend only on supported GPUs. Query all the GPUs on the system during ANGLE's initialization, and do not expose the EGL_ANGLE_platform_angle_metal client extension unless all of them support the required GPU families or feature sets. Tested locally on a 2015 MacBook Pro with dual Intel Iris Pro and AMD Radeon R9 M370X GPUs. The AMD GPU supports Metal GPU family macOS 2, but the Intel GPU, only family macOS 1. With this change, Chrome properly falls back to using ANGLE's OpenGL backend when --use-angle=metal is specified, and renders correctly. Bug: chromium:1365598 Change-Id: I2c3533afe733e0d06d7755cae272bbd12aa9e676 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4117716 Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Gregg Tavares <gman@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Shahbaz Youssefi 1a8bcbda 2022-12-17T20:12:41 Vulkan: Re-enable async pipeline cache sync by default This is a reland of c7414946b84410bfcc8705759a902577c13d9fc4 The change here is that the program, shader and blob caches are now reset _after_ the backend is torn down. Otherwise the pipeline cache sync thread's use of the caches races with that. Bug: b/246683126 Change-Id: Ifc3d67279de50a2ee2866476aa5df85d4c10d30d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4111972 Reviewed-by: Charlie Lao <cclao@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Gregg Tavares be9e8e7b 2022-12-14T14:13:39 Add EGL_ANGLE_wait_until_work_scheduled extension We're changing eglReleaseTexImage so it calls flushCommandBuffer(mtl::NoWait) instead of flushCommandBuffer(mtl::WaitUntilScheduled) and then adding an extension to allow us to WaitUntilScheduled. This is because Chrome calls eglReleaseTexImage for every canvas and having it WaitUntilScheduled per call is very slow. So instead we'll call eglWaitUntilWorkScheduledANGLE once which will effectively wait just once. Bug: angleproject:7890 Change-Id: I87bc9f9a1a7f4a0f99d93736cc3083799e76afeb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4109311 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Gregg Tavares <gman@chromium.org>
Mohan Maiya eafdf206 2022-12-01T12:33:11 Reset thread context during threadCleanup Once thread cleanup is complete reset its mContext member to nullptr. Running CTS tests in batches sometimes exposes a bug where Thread::mContext is accessed after Display::threadCleanup is complete. Bug: angleproject:6723 Bug: angleproject:6798 Change-Id: Ie252954e60b5d4565697095939fd19d002dfccf3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4072208 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang f37a32f0 2022-11-14T14:11:06 Remove DisplayGbm and SurfaceGbm. The Gbm classes were used to emulate WindowSurfaces on ChromeOS for testing. These emulated features are not used in any shipping configuration and cause issues because ANGLE opens drm devices uneccessarily. Bug: chromium:1344962 Change-Id: If564e40744f7825035bbbd63c141b154c534ed72 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4023096 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Brian Ho <hob@chromium.org>
Shahbaz Youssefi 70cf2322 2022-11-16T10:25:07 Vulkan: Move async pipeline cache sync feature to backend Bug: b/246683126 Change-Id: I194e488e04580cee7055c0674091f1228984edf9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4031486 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Solti Ho <solti@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Greg Schlomoff 81a244de 2022-10-10T15:32:25 Adding a class to perform ASTC texture decompression on the CPU This significantly improves performance by caching and re-using the ASTC decoder context, and using multi-threaded decompression. This code was originally written for gfxstream. Bug: b/250688943 Change-Id: I1727447907f2e25cf9b854ffcc9ccfc04db2fb91 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3929008 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 8403e4c5 2022-10-10T20:59:29 EGL: Resource IDs for Surface, Context and EGL Image. This will make these classes play nicely with resource maps. As these objects are used in a lot of places, and simplified C can't handle unordered_map, it's necessary to index the maps by simple packed IDs in capture/replay code. This indirection will also have increased safety as we validate EGL resource ID handle values before accessing the memory directly. Also hides some of the other EGL capture methods behind helper methods to simplify the C code and hide assignments and other complex maps. Bug: angleproject:7758 Change-Id: Ibc7bb56430d3068bd38877c9dfb011979d4ea234 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3957164 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi 025504b9 2022-10-17T17:03:03 Pass worker pools to image load functions In preparation for the ASTC decoder using threaded decoding. Bug: b/250688943 Change-Id: I70d669bcb57b900dbb633304182e174aec362203 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3961339 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Greg Schlomoff <gregschlom@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi b5929ac6 2022-10-17T18:06:32 Move worker pools to Display It doesn't make sense for each context to have its own set of CPU-count workers. This change also facilitates access to the thread pools where gl::Context is not available (but egl::Display is). Bug: b/250688943 Change-Id: I240353abba26c15338d59631b4179a58dfd662f5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3961334 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 0d203aef 2022-10-16T10:08:01 EGL: Add ID types for egl::Surface and egl::Image. This is in preparation for using resource maps for Context, Surface and EGLImage. The map change will make it much easier to work with the trace fixture. It will also have a small benefit in safety as we will longer be casting raw pointers for these types. As these objects are used in a lot of places, and simplified C can't handle unordered_map, it's necessary to index the maps by simple packed IDs in capture/replay code. Bug: angleproject:7758 Change-Id: Ib1d19622a4f2a6f0458cc28f5bbe30bb9f349b98 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3957163 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 01285f16 2022-09-26T23:19:28 Remove Platform.h Overloaded name. Causing trouble with gles1's platform.h on case-insensitive file systems despite the different case. Bug: angleproject:3408 Change-Id: Icc1644a4c6a9c9076a2bbafbfb1d6eac578b731a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3920895 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 818a8ace 2022-09-26T19:50:03 Revert "Vulkan: Add missing part for supporting GBM Platform type" This reverts commit 43354edbe671af534c469089066e0259731563c7. Reason for revert: Fails on ChromeOS bots in Chrome. Original change's description: > Vulkan: Add missing part for supporting GBM Platform type > > Adds missing part to support GBM platform type. > > Bug: angleproject:7481 > Signed-off-by: Sungyong Choi <sywow.choi@samsung.com> > Change-Id: I46caa4a958274de1111b30b144df592ac4cdcf6e > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3736243 > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jeff Vigil <j.vigil@samsung.com> > Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com> Bug: angleproject:7481 Bug: angleproject:7696 Change-Id: I76fa4e38ea1f866575bc38725c23b697d17b53a6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3918856 Reviewed-by: Geoff Lang <geofflang@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Roman Lavrov <romanl@google.com>
Sungyong Choi 43354edb 2022-06-30T10:18:41 Vulkan: Add missing part for supporting GBM Platform type Adds missing part to support GBM platform type. Bug: angleproject:7481 Signed-off-by: Sungyong Choi <sywow.choi@samsung.com> Change-Id: I46caa4a958274de1111b30b144df592ac4cdcf6e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3736243 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jeff Vigil <j.vigil@samsung.com> Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Shahbaz Youssefi 9c17232a 2022-09-02T16:05:48 Vulkan: Make robustness affect all of share group Since contexts in a share group can share their program, if any context in the share group is robust, programs in all contexts in the share group need to be created with robustness in mind. This fixes the situation when the programs are created after a robust context has been created. However, if programs are created first, then a robust context is added to a share group, there remains a bug where the old programs aren't recreated to have robust behavior. Bug: angleproject:7629 Change-Id: I4922091962a32ca75a6107343df0cd87e5e9592d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3872506 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Eddie Hatfield 3960e63b 2022-08-09T14:02:59 Infra: Enable angle_deqp_gl46_tests on SwiftShader This change disables the WGL frontend by default on Windows when building ANGLE for desktop GL. This is because the WGL frontend is not yet fully implemented and it causes some of the trace tests to fail. The WGL frontend should be enabled by default on windows when more of its functionality gets implemented. Test: angle_deqp_gl46_tests --use-angle=swiftshader Bug: angleproject:7566 Bug: angleproject:7628 Change-Id: I69c695eb56d3858f715eeb86d28cc805e25c60eb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3858142 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Eddie Hatfield 955adb77 2022-08-12T10:14:48 Cache compiled shader By storing the compiled shader in the blob cache, the time to recompile the same shader is reduced. Based on work by <hckim.kim@samsung.com> Bug: angleproject:7036 Change-Id: I884ae40e715c49a9ccd12903012e8327811e3557 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3808235 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Mohan Maiya 7a87e90d 2022-07-16T11:39:08 An inactive but alive thread shouldn't prevent cleanup 1. Acquire EGL global lock before thread cleanup and remove all clean up related mutexes 2. Mark contexts that are not current as invalid during terminate 3. During thread exit, if there are other active threads, terminate with TerminateReason::InternalCleanup. This gives an opportunity for well behaved threads to cleanup up invalid objects. Bug: angleproject:6723 Bug: angleproject:6798 Test: EGLContextSharingTestNoFixture.InactiveThreadDoesntPreventCleanup* Change-Id: I418e5f8b486d3d309bd58c4cfb04b7dc1149ffc1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3768667 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Peng Huang b9fd47b8 2022-08-12T10:55:49 Not use Android TLS slot for chromium In the profile, GetGlobalContext() & GetValidGlobalContext() have extra overhead for checking angle::gUseAndroidOpenGLTlsSlot. Since angle::gUseAndroidOpenGLTlsSlot is always false for now, so add a build flag to disable it for chromium build. In the profile, with angle_use_android_tls_slot = false, GetValidGlobalContext() is reduced from 0.153% to 0.044%. Bug: chromium:1336126 Change-Id: Id5e1752b0a03289fb299e8de2ed6e962e35291c0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3827955 Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Peng Huang <penghuang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Peng Huang 44791792 2022-08-12T00:13:45 Use angle::FlatUnorderedSet for ImageSibling::mSourcesOf As my test with Chromium on Android, ImageSibling::mSourcesOf only contains one item, so change it to angle::FlatUnorderedSet with default size 2. Bug: chromium:1336126 Change-Id: Ie1ba3ebb195170ad5c9f4713b599a91de5052702 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3828444 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Peng Huang <penghuang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Peng Huang afdd5106 2022-08-11T21:14:23 Use angle::FlatUnorderedMap in Display.cpp Bug: chromium:1336126 Change-Id: I57d97d37749de2abbba88b6558bde31fa8346764 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3828442 Commit-Queue: Peng Huang <penghuang@chromium.org> Auto-Submit: Peng Huang <penghuang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Peng Huang 4cab7f38 2022-08-10T20:33:07 Fix EGL_ANGLE_program_cache_control for eglCreateContext EGL_CONTEXT_PROGRAM_BINARY_CACHE_ENABLED_ANGLE is an attribute for creating EGL context, but ANGLE reads it from mAttributeMap which is not the attribs passed to eglCreateContext(). Bug: chromium:1336126 Change-Id: Id3ea1955f927a7e051285c79b590dcf1f11f22ed Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3823621 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Peng Huang <penghuang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Peng Huang 0d5ba4dc 2022-08-05T19:43:54 Minor performance improvement Use angle::FixedVector to replace std::vector in SyncEGL::initialize() Use std::move() to avoid copy in Display::destroyInvalidEglObjects Bug: chromium:1336126 Change-Id: If4c13babb14ed9995caf3c3dd3cfc362124b24cf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3812561 Auto-Submit: Peng Huang <penghuang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jonah Ryan-Davis de5c6c79 2022-08-03T13:56:11 Remove unused ANGLE histograms This CL removes the following histograms: GPU.ANGLE.D3DCompileMS GPU.ANGLE.DisplayInitializeMS GPU.ANGLE.ProgramCache.CacheResult GPU.ANGLE.ProgramCache.LoadBinarySuccess GPU.ANGLE.ProgramCache.ProgramBinarySizeBytes Bug: chromium:1317194 Change-Id: Iad01cff591df83c015bc79fe4e7b7c094357f02a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3807767 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Eddie Hatfield c54ed790 2022-07-21T10:38:47 Get desktop GL conformance tests to build The target for these tests is angle_deqp_gl_tests. Bug: angleproject:7533 Change-Id: I290822671d99da020f9a6a1f02bee43987644bf9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3766435 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Eddie Hatfield <eddiehatfield@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Steven Noonan b8e741d2 2022-06-23T13:36:17 Vulkan: allow selecting render device by PCI device/vendor IDs The EGL_ANGLE_platform_angle_device_id extension is deliberately vague about the meaning of "device ID high" and "device ID low", stating it's platform-specific. We can use these for representing the PCI device/vendor IDs that can be discovered via various (OS-specific) external means. Bug: angleproject:7460 Change-Id: Iff462687749e815fa074ef8ff392b6730ef46fa8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3720733 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Chris Dalton 15cc0013 2022-07-14T23:32:05 Add a GL_ANGLE_shader_pixel_local_storage extension Plumbs through "GL_ANGLE_shader_pixel_local_storage" and "GL_ANGLE_shader_pixel_local_storage_coherent" extension strings advertised by ANGLE and stubs out an initial spec document. This change doesn't add any new procedures or shader constructs, but it does allow the PLS tests to start checking for the real extension strings and requiring the GL_ANGLE_shader_pixel_local_storage extension. Bug: angleproject:7279 Change-Id: I36877fe4117185a2121f803288123cd69a447cf3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3739590 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app>
Mohan Maiya 12efe5b2 2022-06-21T15:43:42 Cleanup invalid EGL handles only if app called eglTermiate Maintain set of active threads instead of a global refCount and free display's invalid EGL resources iff - 1. app previously called eglTerminate on that display 2. there are no more active threads associated with that display Bug: angleproject:6723 Test: EGLMultiContextTest.RepeatedEglInitAndTerminate* Test: EGLMultiContextTest.ReuseUnterminatedDisplay* Change-Id: I868491bbbf0664e9129dcb0d1fa9e2243ef36d82 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3717277 Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com>
Antonio Caggiano 44d8bf76 2022-03-16T14:38:37 Vulkan: Support EGL_EXT_platform_wayland Improve GetPlatformDisplay by supporting EGL_PLATFORM_WAYLAND_EXT. Bug: angleproject:6902 Change-Id: Ia4c342097f47b7c41778ac02517451f51a94d8be Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3528758 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 9d08c29a 2022-05-25T11:39:29 Expose the EGL Display Context Set in the DisplayState. This will let the Vulkan back-end iterate through and flush pending command buffers in other Contexts. Bug: angleproject:5664 Change-Id: I0d22eb68fa754a97b4836ec8c59ff8c6e5ef2d96 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3668145 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Ian Elliott 0f8f760d 2022-06-07T17:52:52 Disable KHR_no_error for Android/SwiftShader Speculatively fix crash in Skia on ANGLE that has been happening. In addition, prevent other crashes in the future. Bug: b/220069903 Change-Id: I01b9896a6feb8be524849dafbc1df9526fc98754 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3694160 Commit-Queue: Ian Elliott <ianelliott@google.com> Auto-Submit: Ian Elliott <ianelliott@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Antonio Caggiano 68634d5c 2022-01-05T20:33:32 Vulkan: Enable VK_EXT_platform_wayland Bug: angleproject:6902 Change-Id: I6a27e3f610bd48dd31937255b287b11fe84c05ca Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3528756 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Faye Zhang c608df69 2022-05-23T17:19:02 Code Cleanup In Debug.h, we unconditionally set UNREACHABLE_IS_NORETURN to 0. Since UNREACHABLE_IS_NORETURN is only used in #if directives and it is always false, we can remove all uses of UNREACHABLE_IS_NORETURN. Bug: angleproject:6134 Change-Id: I3aa88d802099d70990eae697d4f056a3f650b48d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3661376 Commit-Queue: Faye Zhang <ffz@google.com> Auto-Submit: Faye Zhang <ffz@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Faye Zhang <ffz@google.com>
Antonio Caggiano 2fb58a95 2022-02-15T15:40:23 Re-land: "Vulkan: GBM platform" Add support for GBM platform by implementing a Display with no WSI extension. Re-land fixes build script, including GBM Vulkan backend whenever ozone platform GBM is enabled. Bug: angleproject:7217 Change-Id: Icbf2d034b700e22ab4c351e479f472d65d832ebe Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3637562 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Yuly Novikov 0db4c39b 2022-05-09T20:02:58 Revert "Vulkan: GBM platform" This reverts commit 825d5b2c59b463253c82262a0c50f75d28860db4. Reason for revert: Fails link rolling into Chrome crrev.com/c/3635013 https://ci.chromium.org/ui/p/chromium/builders/try/chromeos-amd64-generic-rel/1149608/overview https://ci.chromium.org/ui/p/chromium/builders/try/linux-chromeos-compile-dbg/1013047/overview https://ci.chromium.org/ui/p/chromium/builders/try/linux-chromeos-rel/1189185/overview Original change's description: > Vulkan: GBM platform > > Add support for GBM platform by implementing a Display with no WSI > extension. > > Bug: angleproject:7217 > Change-Id: Ia9089131c5984dfdd926d2f85f1c218df1e84d9a > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3596042 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bug: angleproject:7217 Change-Id: Ia8a4ca753a8f18d6a2c607010b5afabf6a78fe9a No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3636059 Auto-Submit: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Antonio Caggiano 825d5b2c 2022-02-15T15:40:23 Vulkan: GBM platform Add support for GBM platform by implementing a Display with no WSI extension. Bug: angleproject:7217 Change-Id: Ia9089131c5984dfdd926d2f85f1c218df1e84d9a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3596042 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Antonio Caggiano 9ad43bdd 2021-12-09T16:52:35 Re-land: "Vulkan: Support Wayland" Implement DisplayVkWayland and WindowSurfaceVkWayland. Get window size from native window and check egl config is just empty. An EGL wayland test is added for testing rendering and buffers swapping. Re-land fixes: - link failure in systems with no libwayland installed. - XCB display availability check. Bug: angleproject:6902 Change-Id: I5daecf3591493308ac71a7dd3bc0802f492e6fed Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3621059 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuly Novikov 4bbc55f4 2022-05-03T08:19:55 Revert "Re-land: "Vulkan: Support Wayland"" This reverts commit e0dd196a0e0aace17dfaa204163d798f504ea94e. Reason for revert: blocks ANGLE roll into Chromium Original change's description: > Re-land: "Vulkan: Support Wayland" > > Implement DisplayVkWayland and WindowSurfaceVkWayland. Get window size > from native window and check egl config is just empty. An EGL wayland > test is added for testing rendering and buffers swapping. > > Re-land fixes link failure in systems with no libwayland installed. > > Bug: angleproject:6902 > Change-Id: I4f091d4f479a537d0390caedce88a5d39f8b356f > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3608088 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Jamie Madill <jmadill@chromium.org> Bug: angleproject:6902, angleproject:7260 Change-Id: I7e92bf811b191eee6679d577006cddc0e1286fad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3621057 Auto-Submit: Yuly Novikov <ynovikov@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Antonio Caggiano e0dd196a 2021-12-09T16:52:35 Re-land: "Vulkan: Support Wayland" Implement DisplayVkWayland and WindowSurfaceVkWayland. Get window size from native window and check egl config is just empty. An EGL wayland test is added for testing rendering and buffers swapping. Re-land fixes link failure in systems with no libwayland installed. Bug: angleproject:6902 Change-Id: I4f091d4f479a537d0390caedce88a5d39f8b356f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3608088 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jeff Vigil 95c1ff52 2022-02-24T08:31:52 EGL: Fix EGL_KHR_mutable_render_buffer Fixes for eglSurfaceAttrib error cases. Improve query for render buffer Add test case to EGLSurfaceTest Test: angle_end2end_test --gtest_filter=EGLSingleBufferTest Bug: angleproject:7134 Change-Id: I4fa568c9530312003dc17111be212bf5b66d97fb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3556088 Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Antonio Caggiano 01811839 2022-03-17T15:08:38 Refactor platform code Use switch constructs instead of if-else to allow reuse of code and simplify addition of other platforms as new cases. Bug: angleproject:6902 Change-Id: Ia941d0d7bc03538bbc8d96ebece60224994a6c66 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3532260 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com> Commit-Queue: Antonio Caggiano <antonio.caggiano@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Cody Northrop e0183a42 2022-04-25T09:07:55 Revert "Mark contexts as shared when importing EGL images." This reverts commit e18240d136d15e5cdfa4fa4a6355ca21c8d807b6. Reason for revert: Applications not responding in AOSP: https://buganizer.corp.google.com/issues/229807074 Original change's description: > Mark contexts as shared when importing EGL images. > > Once a context references an EGL image, it can share resources with > contexts in other share groups. Marking the context as shared ensures > that locks are held by all contexts referencing EGL images for GL > functions. > > Bug: angleproject:6957 > Change-Id: Ic3901c458f388306c59f6bb01560a7c66d0574c0 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3424659 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: mohan maiya <m.maiya@samsung.com> > Commit-Queue: Geoff Lang <geofflang@chromium.org> Test: CtsWindowManagerDeviceTestCases Bug: b/229807074 Change-Id: I5b7050bd68f67925f77242e483e2aa970ed0ca17 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3602954 Commit-Queue: Cody Northrop <cnorthrop@google.com> Auto-Submit: Cody Northrop <cnorthrop@google.com> Reviewed-by: Lingfeng Yang <lfy@google.com> Commit-Queue: Lingfeng Yang <lfy@google.com>
Antonio Caggiano 0f3710d9 2022-03-16T14:30:17 Generalize GetDisplayFromNativeDisplay Add a platform parameter to this function to possibly accept other platforms besides EGL_PLATFORM_ANGLE_ANGLE. Bug: angleproject:6902 Change-Id: I90bd9cf2e8142ca0e656dee4bf687953515b71a3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3528757 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 768c7d47 2022-04-21T16:55:05 Revert "Re-land: "Vulkan: Support Wayland"" This reverts commit f6cdd02fb4bceb4072430e3dbcb1e945809471e0. Reason for revert: Still warns about extra dependency on wayland. https://ci.chromium.org/ui/p/chromium/builders/try/linux-rel/990820/overview Original change's description: > Re-land: "Vulkan: Support Wayland" > > Implement DisplayVkWayland and WindowSurfaceVkWayland. Get window size > from native window and check egl config is just empty. An EGL wayland > test is added for testing rendering and buffers swapping. > > Re-land fixes link failure in systems with no libwayland installed. > > Bug: angleproject:6902 > Change-Id: I706af14620d6298275009f5caf93b0e60339219b > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3578765 > Auto-Submit: Antonio Caggiano <antonio.caggiano@collabora.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Jamie Madill <jmadill@chromium.org> Bug: angleproject:6902 Change-Id: I11b1fe473fceb2fddb85bd562b769d18426ce07b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3600378 Auto-Submit: Jamie Madill <jmadill@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Antonio Caggiano f6cdd02f 2021-12-09T16:52:35 Re-land: "Vulkan: Support Wayland" Implement DisplayVkWayland and WindowSurfaceVkWayland. Get window size from native window and check egl config is just empty. An EGL wayland test is added for testing rendering and buffers swapping. Re-land fixes link failure in systems with no libwayland installed. Bug: angleproject:6902 Change-Id: I706af14620d6298275009f5caf93b0e60339219b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3578765 Auto-Submit: Antonio Caggiano <antonio.caggiano@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang e18240d1 2022-01-28T13:46:41 Mark contexts as shared when importing EGL images. Once a context references an EGL image, it can share resources with contexts in other share groups. Marking the context as shared ensures that locks are held by all contexts referencing EGL images for GL functions. Bug: angleproject:6957 Change-Id: Ic3901c458f388306c59f6bb01560a7c66d0574c0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3424659 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: mohan maiya <m.maiya@samsung.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jonah Ryan-Davis 01c0bc21 2022-04-13T17:56:13 Revert "Vulkan: Support Wayland" This reverts commit 510351f2006e32ffc6da722f1fc9ea5666e9c0da. Reason for revert: Breaking ANGLE roll: https://bugs.chromium.org/p/angleproject/issues/detail?id=7202 Original change's description: > Vulkan: Support Wayland > > Implement DisplayVkWayland and WindowSurfaceVkWayland. Get window size > from native window and check egl config is just empty. > > Then add an EGL wayland test for testing rendering and buffers swapping. > > Bug: angleproject:6902 > Change-Id: I8204a5cc99f26330b74caba241bebf14c5650c2d > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3395898 > Reviewed-by: mohan maiya <m.maiya@samsung.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Auto-Submit: Antonio Caggiano <antonio.caggiano@collabora.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Jamie Madill <jmadill@chromium.org> Bug: angleproject:6902 Change-Id: Idd0cb78c84baeb1b2ab6910173160206901799f6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3584921 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Antonio Caggiano 510351f2 2021-12-09T16:52:35 Vulkan: Support Wayland Implement DisplayVkWayland and WindowSurfaceVkWayland. Get window size from native window and check egl config is just empty. Then add an EGL wayland test for testing rendering and buffers swapping. Bug: angleproject:6902 Change-Id: I8204a5cc99f26330b74caba241bebf14c5650c2d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3395898 Reviewed-by: mohan maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Antonio Caggiano <antonio.caggiano@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Mohan Maiya 5aaa402c 2022-03-30T06:13:02 Fix Surface use-after-free bug In Display::destroyContext we would incorrectly destroy current surfaces while trying to makeCurrent the context to be destroyed. Introduce ScopedSurfaceRef, mirroring ScopedContextRef, to keep the surfaces alive while destroying the context. Bug: angleproject:7141 Test: EGLSurfaceTest.SurfaceUseAfterFreeBug* Change-Id: Ie9b3d7841e5ee561d96c13bfee9c7c87b40cc39d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3561354 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Kimmo Kinnunen 9637185c 2022-03-10T15:38:13 Add ForceGPUSwitch to EGL_ANGLE_power_preference eglHandleGPUSwitch() does not work with WebKit sandbox profile. The root cause is that we do not know the primary display, and as such we do not know which GPU drives this. Add eglForceGPUSwitchANGLE(display, gpuIDHigh, gpuIDLow). This lets the caller figure out the GPU in another process. Then the caller can just set the GPU in the sandboxed process. Add tests that are disabled by default until the runner and the infrastructure supports running the tests with automatic switching enabled. Bug: angleproject:7092 Change-Id: I316ee431156596effbdb89659a5e24291719a204 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3516274 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Kimmo Kinnunen d914e7fb 2022-03-09T16:28:06 Add device id as a part of the key in EGLDisplay cache Otherwise eglGetPlatformDisplay would return displays created with other devices. Bug: angleproject:7087 Change-Id: I6ad3fa03f02892afe43de7e7691fbba17a89d616 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3513753 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Antonio Caggiano 47977b0e 2022-03-01T15:24:51 EGL: Validate and implement dmabuf extensions Add validation and default implementation of dmabuf extensions. Actual implementation should be defined by concrete Display subclasses. Bug: angleproject:7065 Change-Id: Ie8d7081f7bcb065c809a52a42abdb7af0e75c816 Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com> Signed-off-by: Constantine Shablya <constantine.shablya@collabora.com> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3497840 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Sean Risser 3adace15 2022-01-10T22:53:19 Don't expose detailed driver version info to webGL WebGL's GL_RENDERER string now only includes basic version information on all backends. This is controlled through a bool passed through getBackendVersionString. Bug: angleproject:6777 Change-Id: Ie4e3d91d22c96f175a8139fac1c66e985ed9e1b7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3380263 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Sean Risser <srisser@google.com>
Cody Northrop 6cced91b 2022-02-08T10:24:11 FrameCapture: Remove destroyed contexts from share group If a GL Context is destroyed, remove it from the list of shared contexts tracked by FrameCapture. Before this CL, we would crash in runMidExecutionCapture when trying to iterate through contexts that were gone: INFO: checking for SetupCalls in context id: 1 INFO: checking for SetupCalls in context id: 2 INFO: checking for SetupCalls in context id: 1769237601 Test: Mortal Kombat MEC Bug: angleproject:6997 Change-Id: I3c2f6a77419d241af9a0b300936e7784446306f8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3448681 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Jonah Ryan-Davis 4349904b 2022-02-04T14:22:53 Add keying on backend to ANGLE Display caching. Webkit needs to use one ANGLE display with OpenGL and another with Metal. Our display caching is interfering with this, so it should be updated to also key on the selected backend. Bug: angleproject:6978 Change-Id: I9ec47a28e16646f5fc75956e3bd78236990cc392 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3440780 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Yuly Novikov da87b1db 2022-02-03T21:07:59 Fix GLES Display creation on ChromeOS when Vulkan is enabled GetPlatformTypeFromEnvironment() returns EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE on ChromeOS when Vulkan backend is enabled in build. Previously it returned 0, which caused DisplayGbm to be created on ChromeOS. Restore the previous state of GLES backend by creating DisplayGbm even for EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE platform. Note that this is a hack, and a proper solution would be to always use DisplayEGL on ChromeOS. Bug: chromium:1293420, chromium:1225003 Change-Id: Iab0324a56f0d426310d7db19fec3fc69e9bb5525 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3437779 Reviewed-by: Alexis Hétu <sugoi@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Jonah Ryan-Davis 453cd955 2022-01-17T13:26:39 Add EGL_ANGLE_platform_angle_display_id to D3D11 backend. Uses the same LUID parts as ANGLE_platform_angle_d3d_luid. This new extension is available on D3D11 on Windows and Metal on Mac. Bug: angleproject:6903 Change-Id: Ib695affe47e822c4dfd7f41d8a62a85e74b9b90a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3396416 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Jonah Ryan-Davis 2f4f5f8a 2021-12-14T17:30:42 Add EGL_ANGLE_platform_angle_device_id for the Metal backend. This extension takes in a 64-bit device ID in two parts as parameters to eglGetPlatformDisplay and uses it to initialize a display backed by a specific device. The deviceID should match the MTLDevice's registryId. Bug: angleproject:6143 Change-Id: I02188b8266f8d0ac657b04325d191ab89bbef751 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3337985 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Tim Van Patten b0e15ee4 2021-12-28T20:37:33 Decide GL_KHR_parallel_shader_compile in backends GL_KHR_parallel_shader_compile was previously being enabled unconditionally in the front end. However, some backends (Vulkan) perform worse with parallel shader compilation. This CL moves the decision of enabling GL_KHR_parallel_shader_compile to the backends. To support single-threaded shader compilation without affecting the generic worker thread pool, Context::mSingleThreadPool is added to own the single-threaded WorkerThreadPool and can be returned by the new function Context::getShaderCompileThreadPool(). Otherwise, if the extension is enabled, the (renamed) Context::mMultiThreadPool is returned. Bug: angleproject:6748 Change-Id: Ic8d3a183f397608f3002a05480deb976dfe44792 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3360337 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
Mohan Maiya feb599ad 2021-12-09T20:17:14 Invalidate EGL handles during eglTerminate EGL 1.5 spec says - Termination marks all EGL-specific resources, such as contexts and surfaces, associated with the specified display for deletion. Handles to all such resources are invalid as soon as eglTerminate returns Move EGL object handles to another set, tracking invalid objects, during display terminate. Destroy these invalid objects during eglReleaseThread Bug: angleproject:6798 Test: EGLMultiContextTest.NegativeTestAfterEglTerminate* Test: EGLMultiContextTest.RepeatedEglInitAndTerminate* Test: Android CTS WrapperTest.testThreadCleanup Change-Id: Ie160212c98367493e645d9d1c8260e7a30649386 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3329273 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Mohan Maiya 6c172e4b 2021-11-20T16:27:14 Add support for memory cleanup on process exit This patch adds a callback to cleanup memory on process exit. Bug: angleproject:6723 Test: Android CTS WrapperTest.testThreadCleanup Change-Id: Ia517d4c6ae280ddc1f17a3b6f77d437aaaad0678 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3294581 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Jonah Ryan-Davis f422f21a 2021-11-09T18:42:15 Reland "Metal: Reintroduce GPU power preference selection code." This reverts commit 67a8cf07a740c5ce3aafd2ad7fddd370451b3525. Reason for revert: Landed Chromium-side dependency: https://chromium-review.googlesource.com/c/chromium/src/+/3271170 Original change's description: > Revert "Metal: Reintroduce GPU power preference selection code." > > This reverts commit 017161701b7dbf70a13f3c180a39e1fa45c27d9f. > > Reason for revert: Blocking roller, please re-land with the fix. > > Original change's description: > > Metal: Reintroduce GPU power preference selection code. > > > > This CL re-introduces the GPU power preference code to > > the metal backend. It also reworks EGLDisplay caching > > in the frontend to cache based on the native display > > as well as the power preference attribute. > > A new extension, EGL_ANGLE_display_power_preference is > > added based on EGL_ANGLE_power_preference. This extension > > is a client extension that allows selection of GPU on > > display creation, similar to how GPUs are selected on > > context creation in EGL_ANGLE_power_preference. > > This CL adds EGLDisplayPowerPreferenceTest and enables it on > > the metal backend. > > > > Bug: angleproject:6143 > > Change-Id: I0a081dcd2e3f18ab365fdd3498ddcb6e2ba35212 > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3231986 > > Reviewed-by: Kenneth Russell <kbr@chromium.org> > > Reviewed-by: Jamie Madill <jmadill@chromium.org> > > Reviewed-by: Gregg Tavares <gman@chromium.org> > > Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> > > TBR=kbr@chromium.org,gman@chromium.org,jonahr@google.com,jmadill@chromium.org,angle-scoped@luci-project-accounts.iam.gserviceaccount.com > > Change-Id: I4f775bf7139253a87b033a30e0da2100b3c1bb02 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: angleproject:6143 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3270749 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Jamie Madill <jmadill@chromium.org> # Not skipping CQ checks because this is a reland. Bug: angleproject:6143 Change-Id: Id9b0a5cbb76e4dea9e2f2da2b1c47a0587dfdaf5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3270970 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Jamie Madill 67a8cf07 2021-11-09T15:10:50 Revert "Metal: Reintroduce GPU power preference selection code." This reverts commit 017161701b7dbf70a13f3c180a39e1fa45c27d9f. Reason for revert: Blocking roller, please re-land with the fix. Original change's description: > Metal: Reintroduce GPU power preference selection code. > > This CL re-introduces the GPU power preference code to > the metal backend. It also reworks EGLDisplay caching > in the frontend to cache based on the native display > as well as the power preference attribute. > A new extension, EGL_ANGLE_display_power_preference is > added based on EGL_ANGLE_power_preference. This extension > is a client extension that allows selection of GPU on > display creation, similar to how GPUs are selected on > context creation in EGL_ANGLE_power_preference. > This CL adds EGLDisplayPowerPreferenceTest and enables it on > the metal backend. > > Bug: angleproject:6143 > Change-Id: I0a081dcd2e3f18ab365fdd3498ddcb6e2ba35212 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3231986 > Reviewed-by: Kenneth Russell <kbr@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Gregg Tavares <gman@chromium.org> > Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> TBR=kbr@chromium.org,gman@chromium.org,jonahr@google.com,jmadill@chromium.org,angle-scoped@luci-project-accounts.iam.gserviceaccount.com Change-Id: I4f775bf7139253a87b033a30e0da2100b3c1bb02 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:6143 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3270749 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis 01716170 2021-10-14T13:24:41 Metal: Reintroduce GPU power preference selection code. This CL re-introduces the GPU power preference code to the metal backend. It also reworks EGLDisplay caching in the frontend to cache based on the native display as well as the power preference attribute. A new extension, EGL_ANGLE_display_power_preference is added based on EGL_ANGLE_power_preference. This extension is a client extension that allows selection of GPU on display creation, similar to how GPUs are selected on context creation in EGL_ANGLE_power_preference. This CL adds EGLDisplayPowerPreferenceTest and enables it on the metal backend. Bug: angleproject:6143 Change-Id: I0a081dcd2e3f18ab365fdd3498ddcb6e2ba35212 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3231986 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Gregg Tavares <gman@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Tim Van Patten 8c9b8f03 2021-11-03T14:50:54 Capture/Replay: Don't finish() destroyed Contexts If an app destroys a context, but keeps it current on a thread, ANGLE will reset the context, but can't delete it. This can lead to a segfault if ANGLE attempts to call Context::finish() on a destroyed context. To solve this, check if the context has been destroyed in ShareGroup::finishAllContexts(). Bug: angleproject:6653 Change-Id: Ib30e352ad6395e01f8fab0095cd6231dfb10d8ae Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3260726 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
Geoff Lang d2c01d2c 2021-09-17T12:57:14 GL: Allow selecting virtualization groups at context creation Rewrite EGL_ANGLE_platform_angle_context_virtualization to EGL_ANGLE_context_virtualization, changing the context virtualization parameter to an identifier for what virtualization group the frontend context should be added to. This allows ANGLE's GL backend to be used by multiple threads if the user creates contexts with different virtualization groups. Bug: angleproject:6406 Change-Id: I7414d4705ce10bdf63a9b824043d5dd040dad875 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3169193 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 4e22c2c3 2021-01-19T12:42:38 EGL: Merge DisplayAndroid/Gmb into DisplayEGL. These classes classes have a lot of duplicated code for no reason. DisplayGmb still needs more work. Bug: angleproject:5563 Change-Id: Ia3d3d7f0bd7c03b4ac1aece4369c49118426b9de Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3140498 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Maksim Sisov <msisov@igalia.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Tim Van Patten c85d9a19 2021-09-07T11:41:10 Destroy all unreferenced Contexts resources during terminate() When eglTerminate() is called, all of the Contexts that the Display owns need to be destroyed if they are not referenced by (current to) any Threads. This also requires a change to Display::releaseContext(), to remove the recursive call to Display::terminate() that could occur when releasing the Contexts during terminate(). Bug: skia:12413 Test: EGLContextSharingTestNoFixture.EglTerminateMultipleTimes Change-Id: Ibd0a3e22725d29875c4089bdaae47c98e5084f35 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3144146 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 1ca1589f 2021-09-13T10:56:58 Give GLES extension bools a vendor suffix. This is in preparation for auto-generation which will give all of these bools suffixes. Bug: angleproject:6379 Change-Id: I7e3f6c9b644c41a2165e6bf7b62d661fd352a250 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3158503 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Tim Van Patten 8bb3c827 2021-07-22T19:06:40 Fix Multithreaded eglDestroyContext()/eglTerminate() The following EGL calls can lead to a crash in eglMakeCurrent(): Thread A: eglMakeCurrent(context A) Thread B: eglDestroyContext(context A) B: eglTerminate() <<--- this release context A Thread A: eglMakeCurrent(context B) The eglMakeCurrent(context B) call will assert when attempting to unMakeCurrent(), since thread A doesn't know that context A was already destroyed by thread B. To fix this: 1.) A Context will only be released once there are no Threads that currently have a reference to it (no longer have the Context current). - Context::mIsCurrent is being removed, since it was inaccurate and not thread-safe. For example, when eglTerminate() was called, the eglTerminate()'ing-Thread would "steal" the Context that was current on another Thread to destroy it. 2.) A Display will only be fully terminated and its resources released once all Contexts have been destroyed and are no longer current. Otherwise, Display::terminate() will return if any Contexts are still in use by a Thread. EGL 1.5 Specification 3.2 Initialization If contexts or surfaces, created with respect to dpy are current (see section 3.7.3) to any thread, then they are not actually destroyed while they remain current. If other resources created with respect to dpy are in use by any current context or surface, then they are also not destroyed until the corresponding context or surface is no longer current. With this fix, the app com.netmarble.sknightsmmo can start. This also exposed an issue with GlslangFinalize(), since glslang can only be initialized/finalized once per process. Otherwise, the following EGL commands will call GlslangFinalize() without ever being able to GlslangInitialize() again, leading to crashes since GlslangFinalize() cleans up glslang for the entire process. dpy1 = eglGetPlatformDisplay() | eglInitialize(dpy1) | GlslangInitialize() dpy2 = eglGetPlatformDisplay() | eglInitialize(dpy2) | GlslangInitialize() eglTerminate(dpy2) | GlslangFinalize() eglInitialize(dpy1) | isInitialized() == true Since Display::isInitialized() == true, the rest of Display::initialize() is skipped and GlslangInitialize() is not called. Later, the next test that attempts to compile a program will crash due to glslang no longer being initialized. Finally, this exposed the following tests leaking EGLContext handles: - EGLSurfaceTest::initializeContext() - EGLContextSharingTest.DisplayShareGroupContextCreation - EGLCreateContextAttribsTest.IMGContextPriorityExtension - EGLMultiContextTest.TestContextDestroySimple Other tests were failing to reset the context, preventing the Display from being terminated since there were still references to Contexts owned by the display: eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); Bug: angleproject:6208 Bug: angleproject:6304 Bug: angleproject:6322 Test: EGLContextSharingTest.EglTerminateMultiThreaded Test: EGLContextSharingTestNoFixture.EglDestoryContextManyTimesSameContext Test: Load com.netmarble.sknightsmmo Change-Id: I160922af93db6cabe0ed396be77762fa8dfc7656 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3046961 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
Cody Northrop 96a48a30 2021-08-18T14:33:41 FrameCapture: Only finish contexts that have been current The finish() was crashing during initial Fortnite debug. Test: Fortnite MEC Bug: b/180418810 Bug: angleproject:5658 Change-Id: If8c7376c8ff3ee82581db40c5611309cf700c00d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3105388 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 839d5318 2021-08-16T08:29:28 Capture/Replay: Changes to MEC first frame capture. Recent changes made it so it was impossible to trigger MEC *after* the first frame and *before* the second frame. Instead it was only possible to capture *before* the first frame or *after* the second frame. Makes it possible for the retracing script to do identical captures. Also includes a number of refactorings to make it simpler to follow the code, including renaming methods, and removing some extra output files. Bug: angleproject:5133 Change-Id: Ice6a189eb9f4d53e8ee1ba39beb537af2ef5fd9f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3097807 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Alexis Hetu 729cbcf1 2021-07-23T11:18:18 Make Display and X11 available in the same build Chromium can use the 'use_ozone' and 'use_x11' build flags simultaneously, so we need the Vulkan display to still be selectable, even when the 'use_x11' flag is used. This is required to make SwANGLE work with Ozone/Wayland, which is going to use EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE when SwANGLE is requested. Bug: chromium:1231934 Change-Id: I2ac1d3d9bc231608d7f77e9a2540f4c538840076 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3049351 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexis Hétu <sugoi@chromium.org>
Jamie Madill 8c1cbc5a 2021-07-16T14:01:53 Implement EGL_KHR_mutable_render_buffer in the front-end. Note that we do not currently expose any mutable configs. Bug: b/192352791 Change-Id: Ib97f7889fedd91d09ef32dc7e7494ea4476cd7bd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3035583 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Geoff Lang 232e5236 2021-07-08T15:08:35 Remove the explicit context extension. This extension currently has no known users and doubles the number of entry points that ANGLE exports which is a significant binary size cost. This saves about 130kb of binary size on Android. Bug: chromium:1084580 Change-Id: Ib0fc4930b38a33bd61434f7d0030ba9fb9b93ba7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3015518 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Peng Huang a8e98a23 2021-07-10T15:25:20 Fix gl::Context::unMakeCurrent crashes The crash is because Display::makeCurrent() may fail, in that case, egl_stubs.cpp will not update the current context in global_state and Thread accordingly. And then Context::refCount could be reach 0, and be released, however egl_stubs.cpp still thinks the context is current, and then user-after-free happens. This CL fixes the problem by updating current context of Thread in Display::makeCurrent, and reading the current context of Thread in egl_stubs.cpp and setting it to global_state. Bug: chromium:1171371 Change-Id: Ifc5fffb0e4902c9c72514839d03e5783d50fe283 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3017210 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org>
Kyle Piddington d33a2222 2021-04-26T16:56:15 Upstream Apple's direct-to-Metal backend: compile libANGLE. This change is meant to merge the metal backend changes from Apple's direct-to-Metal backend. Taken from Kyle Piddington's CL: https://chromium-review.googlesource.com/c/angle/angle/+/2857366/ The goal of this CL is to merge the metal backend code in a state that compiles, but not to switch the Metal backend over to using the direct-to-metal backend yet. Bug: angleproject:5505 Bug: angleproject:6127 Change-Id: If6783e06e0086b3a1dd25c6f53caca5cfc96cb86 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2950067 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Sergey Ulanov b73eee71 2021-07-07T18:51:35 Reland: [Vulkan] Add DisplayVkNull Currently all DisplayVk implementations depend on VK_KHR_swapchain and VK_KHR_surface extensions. When running Chromium on Fuchsia these extensions are never used (content is shown on the screen using ImagePipe API without dependency on swapchain). ANGLE still depended on these extensions for DisplayVkFuchsia. This CL adds DisplayVkNull, which allows to run ANGLE without dependency on swapchain. It's usable only offscreen and cannot present content on a surface. Bug: chromium:1203879 Change-Id: I5cadcdf46ed1cfb5ebb3cb69dbfef063e9e2b826 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3012368 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Peter Kasting 1bffabe8 2021-06-29T18:13:39 Fix -Wunreachable-code-aggressive. Bug: chromium:1066980 Change-Id: I1fa08a40dbf223d60a10681af33ca8a29b12bf8b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2991094 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Gert Wollny b6009f64 2021-06-17T14:53:03 Capture/Replay: Add feature for robust resource init Query the feature when creating the display and the context, and pass the flag to the created context and also to durfaces. With that we create surfaces that will be marked "MayNeedInit" and are initialized if the resource is cleared or invalidated. Bug: angleproject:6041 Change-Id: I292f2e3f931736a18db93695441407e17d2265b6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2976656 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Geoff Lang 88156d26 2021-05-18T23:55:32 Revert "[Vulkan] Add DisplayVkNull" This reverts commit cbbaf76b758fb6a37175795b1f424549d535fbdc. Reason for revert: Suspecting this breaks the fuchsia_x64 bot WebGL tests. Ex: https://chromium-review.googlesource.com/c/chromium/src/+/2904812 Original change's description: > [Vulkan] Add DisplayVkNull > > Currently all DisplayVk implementations depend on VK_KHR_swapchain and > VK_KHR_surface extensions. When running Chromium on Fuchsia these > extensions are never used (content is shown on the screen using > ImagePipe API without dependency on swapchain). ANGLE still depended > on these extensions for DisplayVkFuchsia. > This CL adds DisplayVkNull, which allows to run ANGLE without dependency > on swapchain. It's usable only offscreen and cannot present content on > a surface. > > Bug: chromium:1203879 > Change-Id: I4d1307060967ffa68877c4300ea4d5590eeb2152 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2861313 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Jamie Madill <jmadill@chromium.org> Bug: chromium:1203879 Change-Id: I6701ffff48fcb925f387e63b356d2d5cf360ea7e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2904183 Reviewed-by: Geoff Lang <geofflang@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Sergey Ulanov cbbaf76b 2021-04-29T16:09:09 [Vulkan] Add DisplayVkNull Currently all DisplayVk implementations depend on VK_KHR_swapchain and VK_KHR_surface extensions. When running Chromium on Fuchsia these extensions are never used (content is shown on the screen using ImagePipe API without dependency on swapchain). ANGLE still depended on these extensions for DisplayVkFuchsia. This CL adds DisplayVkNull, which allows to run ANGLE without dependency on swapchain. It's usable only offscreen and cannot present content on a surface. Bug: chromium:1203879 Change-Id: I4d1307060967ffa68877c4300ea4d5590eeb2152 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2861313 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Amy Liu 95935176 2021-03-26T17:38:21 Handle the compression of big pipeline cache. Big pipeline cache will cost much time to compress. Regarding the perfomance, handle the compression of big pipeline cache in this way: 1)Return when the pipeline cache data is larger than 10M. 2)Use worker thread to complete compression. Bug: angleproject:4722 Change-Id: I62eb69d8c46729261f0502af01450ec301c258f3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2788169 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Doug Horn fdba40fe 2021-03-31T12:52:00 Reland "Fix multithreaded crash on draw commands on D3D11 backend." This is a reland of 8b9889bf62272fea2495331b622bde1f7c781bd0 The previous CL relied on a define which now only exists in a specific gn configuration. This reland removes D3D11 as a multithread-supported platform in the test configuration. Original change's description: > Fix multithreaded crash on draw commands on D3D11 backend. > > A crash can occur if thread A is executing eglDestroyContext while > thread B issues a draw call, if the threads are interleaved in such a > manner that a makeCurrent occurs without triggering a change to the > global context and a dirtyAllState call. We handle that case by > explicitly making current the proper contexts in the eglDestroyContext > call. > > A test has been added that triggers a crash without this fix when > running on the D3D11 backend. In addition, all of MultithreadingTest > is enabled for the D3D11 backend. > > Test: Ran MultithreadingTest. Test exhibits a crash before this > change, and does not after this change. Also ran: > dEQP-EGL.functional.sharing.gles2.multithread.* > dEQP-EGL.functional.multithread.* > > Bug: b/183756357 > Change-Id: Ic6f76a062868b2f3b4e60d29dc087ec180bfb7cd > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2798591 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Doug Horn <doughorn@google.com> Bug: b/183756357 Change-Id: I5be9a011ea99a69730eddc9e4da23bcf92ed3bf2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2815243 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Doug Horn <doughorn@google.com>
Doug Horn fc189386 2021-04-08T21:51:46 Revert "Fix multithreaded crash on draw commands on D3D11 backend." This reverts commit 8b9889bf62272fea2495331b622bde1f7c781bd0. Reason for revert: Breaks CI Original change's description: > Fix multithreaded crash on draw commands on D3D11 backend. > > A crash can occur if thread A is executing eglDestroyContext while > thread B issues a draw call, if the threads are interleaved in such a > manner that a makeCurrent occurs without triggering a change to the > global context and a dirtyAllState call. We handle that case by > explicitly making current the proper contexts in the eglDestroyContext > call. > > A test has been added that triggers a crash without this fix when > running on the D3D11 backend. In addition, all of MultithreadingTest > is enabled for the D3D11 backend. > > Test: Ran MultithreadingTest. Test exhibits a crash before this > change, and does not after this change. Also ran: > dEQP-EGL.functional.sharing.gles2.multithread.* > dEQP-EGL.functional.multithread.* > > Bug: b/183756357 > Change-Id: Ic6f76a062868b2f3b4e60d29dc087ec180bfb7cd > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2798591 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Doug Horn <doughorn@google.com> Bug: b/183756357 Change-Id: I2e9d6385576330f84623d7dafbf690642fcb441f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2815242 Commit-Queue: Doug Horn <doughorn@google.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Doug Horn 8b9889bf 2021-03-31T12:52:00 Fix multithreaded crash on draw commands on D3D11 backend. A crash can occur if thread A is executing eglDestroyContext while thread B issues a draw call, if the threads are interleaved in such a manner that a makeCurrent occurs without triggering a change to the global context and a dirtyAllState call. We handle that case by explicitly making current the proper contexts in the eglDestroyContext call. A test has been added that triggers a crash without this fix when running on the D3D11 backend. In addition, all of MultithreadingTest is enabled for the D3D11 backend. Test: Ran MultithreadingTest. Test exhibits a crash before this change, and does not after this change. Also ran: dEQP-EGL.functional.sharing.gles2.multithread.* dEQP-EGL.functional.multithread.* Bug: b/183756357 Change-Id: Ic6f76a062868b2f3b4e60d29dc087ec180bfb7cd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2798591 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Doug Horn <doughorn@google.com>
Peng Huang 0e8f7727 2021-02-10T15:03:10 Fix crash in gl::Context::unMakeCurrent() gl::Context's ctor may need to create a native EGL context and it can fail. If it fails, the context->mImplementation will be nullptr, and it will cause crash elsewhere. Fix the problem by checking it after create a gl::Context instance. Bug: chromium:1171371 Change-Id: Ic57f088dcbf9716b85fee92bf54d557eb94642d0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2686439 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org>
Jamie Madill 6fc10389 2021-02-10T11:20:16 Move Frame Capture to capture/ folder. This will make it easier to trigger the trace tests when these files are modified. Bug: angleproject:5530 Change-Id: I5f0c450595b380cd91b20c1477dc1845bee35dd9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2686120 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>