src/libANGLE/Display.cpp


Log

Author Commit Date CI Message
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>
Stephen White ad60c22d 2021-02-09T13:22:09 Add an option to use "metal" as ANGLE_DEFAULT_PLATFORM. Bug: angleproject:5632 Change-Id: Id470993a01609ace851372b1bbe01fee8cde274b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2684635 Commit-Queue: Stephen White <senorblanco@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jonah Ryan-Davis 4968f6f2 2021-02-04T16:40:36 Move getRendererDescription from ContextImpl to DisplayImpl The other backend description strings are in DisplayImpl. This will help with caching the result of glGetString in the GL backend. Also Update the getters to not be const in order to allow caching. Bug: chromium:1173672 Change-Id: I43df35688762b23429f47f169c04482cf4cd089a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2676881 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Kenneth Russell 572afd90 2021-01-29T22:45:29 Disable SH_SCALARIZE_VEC_AND_MAT_CONSTRUCTOR_ARGS workaround. It causes incorrect compilation of some shaders. The original graphics driver bugs that motivated enabling it have been fixed, at least on one of the platforms (macOS). Tested with new WebGL conformance test in https://github.com/KhronosGroup/WebGL/pull/3214 . Bug: chromium:1165751 Change-Id: Iee9747769ca918aab143592d6cf158ce02a75ee0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2661024 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jonah Ryan-Davis 0be050a4 2020-09-23T15:12:56 Pass GL_VERSION info through ANGLE's GL_RENDERER string Chrome needs ANGLE to pass through the underlying driver vendor and version, which cannot always be determined by the SystemInfo library. This is done by construction GL_RENDERER in the frontend through combining GL_VENDOR, GL_RENDERER, and GL_VERSION from the backends. Example changes are in the doc: https://docs.google.com/document/d/1p0dvrLlu8NKhO-RCU5gqlQ_LvcQj-ZqhvfwSk1n3Sz8/edit?usp=sharing Bug: chromium:1126526 Bug: chromium:1131248 Bug: chromium:1134669 Bug: chromium:1169861 Change-Id: Ia618ebcd7f3caaeb376b4b6a03446732efdaeecb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2427383 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Peng Huang f5d56799 2021-01-20T10:00:54 Do not make context current during context deletion. ANGLE will make a context current during deletion, so ANGLE can release related resources, but for an external context, the API user should make sure the native context is current during deleting the ANGLE external context, so ANGLE doesn't need to make the context current. Bug: angleproject:5509 Change-Id: Ia4cee4e3965e9e9e811e3f989f6f6d72bd940f41 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2640593 Commit-Queue: Peng Huang <penghuang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Peng Huang 5635dbb9 2021-01-15T09:43:25 Only call context::unMakeCurrent() if context is changed. Bug: angleproject:5509 Change-Id: Ifbc6aa23a218498c5e2f6a094296045b2d5dfacf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2633421 Commit-Queue: Peng Huang <penghuang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jonah Ryan-Davis ec0acf64 2020-11-25T09:58:31 Reland "Reinitialize GL_VENDOR string when GPU switches" This is a reland of 0f083ab02635f48dfa3393df0d229287f466f480 Original change's description: > Reinitialize GL_VENDOR string when GPU switches > > We already update the GL_RENDERER string. We should do the same for > GL_VENDOR so this information is passed along correctly. > > Bug: chromium:1152212 > Change-Id: I639700bfebdc9e77ec3c6b41fcd6516e8c32139d > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2560824 > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Bug: chromium:1152212 Change-Id: I044313366ce6ce7040e5c203a979b148dcb564dd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2569364 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Ian Elliott 5b9fac78 2020-12-02T17:54:09 Revert "Reinitialize GL_VENDOR string when GPU switches" This reverts commit 0f083ab02635f48dfa3393df0d229287f466f480. Reason for revert: Seems to be blocking the ANGLE auto-roller (see: http://anglebug.com/5422) Original change's description: > Reinitialize GL_VENDOR string when GPU switches > > We already update the GL_RENDERER string. We should do the same for > GL_VENDOR so this information is passed along correctly. > > Bug: chromium:1152212 > Change-Id: I639700bfebdc9e77ec3c6b41fcd6516e8c32139d > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2560824 > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> TBR=geofflang@chromium.org,syoussefi@chromium.org,jonahr@google.com Change-Id: I01bbb08946d16cf821f4fb1bfd8b1cade1ab70f1 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:1152212 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2567460 Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Jonah Ryan-Davis 0f083ab0 2020-11-25T09:58:31 Reinitialize GL_VENDOR string when GPU switches We already update the GL_RENDERER string. We should do the same for GL_VENDOR so this information is passed along correctly. Bug: chromium:1152212 Change-Id: I639700bfebdc9e77ec3c6b41fcd6516e8c32139d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2560824 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Jamie Madill fb82b119 2020-11-22T09:05:06 EGL: Add const to several methods. This is in preparatino for auto-generating the EGL validation header. The auto-generation script will force multiple parameters to const. Bug: angleproject:2621 Change-Id: I04e442c6ff118fd7c296341f12f442901f6fb8c0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2552979 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 56663dbf 2020-11-19T21:21:19 EGL: Expose device query as a client extension. This matches the extension spec. Previously we were exposing the ext as a normal display extension. The extension should work without needing a display. Because the extension requires a non-null device for every display we also add a MockDevice class to handle back-ends which don't implement any attribute query extensions. By default the device query ext does not expose any way to use devices so this works fine. Bug: angleproject:5372 Change-Id: I474310a86aff6a83bd6f9a6b21c8a07c649f306d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2551543 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Xiaoxuan Liu 1f344d60 2020-11-05T16:33:42 Vulkan: Add support for headless surface How to enable: add below args config to args.gn in linux build ``` use_x11=false use_ozone=false angle_vulkan_display_mode="headless" ``` Bug: angleproject:5260 Change-Id: Iec931e74c061b56376ef028814859aa58af07f2f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2536518 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
James Darpinian e53efb18 2020-11-03T16:22:19 Allow choosing EAGL or CGL at runtime Dean Jackson made this change downstream in WebKit: https://bugs.webkit.org/show_bug.cgi?id=216722 Change ANGLE to dynamically load either EAGL (OpenGLES) or CGL (OpenGL) depending on both compile and runtime configurations. Intel Mac -> CGL Intel Mac Catalyst -> CGL Intel iOS Simulator -> EAGL iOS Device -> EAGL Apple Silicon Mac -> CGL Apple Silicon Mac Catalyst (with Mac app) -> CGL Apple Silicon Mac Catalyst (with iOS app) -> EAGL The trickiest bit is Apple Silicon Mac Catalyst, which depends on the type of the application it is attempting to run. In that case ANGLE must compile both the CGL and EAGL interfaces and then pick one to use after launch. Bug: angleproject:5253 Change-Id: Iba167b3cc3105e457dcfc9bc14147d0fc3e70bac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2500185 Commit-Queue: James Darpinian <jdarpinian@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
James Darpinian 27af0b2d 2020-10-19T16:49:48 Reland "ANGLE_platform_angle_device_context_volatile_* extensions" This is a reland of e70f6aa679dd72eca5c88c71b0932928e92d6067 Original change's description: > ANGLE_platform_angle_device_context_volatile_* extensions > > Change from Kimmo Kinnunen downstream: > https://bugs.webkit.org/show_bug.cgi?id=216106 > > Add two extensions for EAGL and CGL backends to declare the > underlying platform context being "volatile". It means that > the thread-global current context is being modified behind > ANGLE. If ANGLE context is marked volatile for a particular > API, it will sync the underlying context for every EGL > function that needs the context. Most intuitive use is > for the client to call eglMakeCurrent before calling any > gl function if the client knowns the platform state might > be dirty. > > Implement eglReleaseThread for EAGL and CGL backends. > Releasing thread will unset the platform current context. > > Fix a bug of omitting EGL_ANGLE_device_eagl from being > advertised. > > Bug: angleproject:5104 > Change-Id: I1ec98ad35bc0caada23556ae8697fdef20f65b1a > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2486548 > Commit-Queue: James Darpinian <jdarpinian@chromium.org> > Reviewed-by: Kenneth Russell <kbr@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> Bug: angleproject:5104 Change-Id: I88265625a4bb4c1412532768d17d7b4356c7be41 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2508842 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: James Darpinian <jdarpinian@chromium.org>
Xiaoxuan Liu 61180d01 2020-10-12T16:40:13 Reland "Add support for Linux vulkan backend with VK_KHR_display" This is a reland of a7bb6a9b15ddeb8497523f8871deb25de2676d9f Original change's description: > Add support for Linux vulkan backend with VK_KHR_display > > Implement Linux simple display mode with vulkan backend > through VK_KHR_display. > > Added value 'EGL_PLATFORM_VULKAN_DISPLAY_MODE_SIMPLE_ANGLE' for > attribute EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE to identify > the new simple display mode. Also reserved > EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE for headless mode. > > How to enable: > Add > > ``` > use_x11=false > angle_vulkan_display_mode="simple" # default value > ``` > > into args.gn, then compile with linux vulkan args. > > Bug: angleproject:5214 > Change-Id: I1247585b9de8b55df106aba99322281f1c183203 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2494320 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bug: angleproject:5214 Change-Id: I3921f6cb292c86658f39e739a878baad1ef64dba Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2515327 Commit-Queue: Xiaoxuan Liu <xiaoxuan.liu@arm.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 807e6b33 2020-11-02T17:15:03 Revert "Add support for Linux vulkan backend with VK_KHR_display" This reverts commit a7bb6a9b15ddeb8497523f8871deb25de2676d9f. Reason for revert: Failing on Ozone builder, see bug. Bug: angleproject:5289 Original change's description: > Add support for Linux vulkan backend with VK_KHR_display > > Implement Linux simple display mode with vulkan backend > through VK_KHR_display. > > Added value 'EGL_PLATFORM_VULKAN_DISPLAY_MODE_SIMPLE_ANGLE' for > attribute EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE to identify > the new simple display mode. Also reserved > EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE for headless mode. > > How to enable: > Add > > ``` > use_x11=false > angle_vulkan_display_mode="simple" # default value > ``` > > into args.gn, then compile with linux vulkan args. > > Bug: angleproject:5214 > Change-Id: I1247585b9de8b55df106aba99322281f1c183203 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2494320 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> TBR=syoussefi@chromium.org,sunny.sun@arm.com,jmadill@chromium.org,xiaoxuan.liu@arm.com Change-Id: I3e2a2a044c220ed8d25be0d82184e5fba7b9c06a No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:5214 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2514637 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Xiaoxuan Liu a7bb6a9b 2020-10-12T16:40:13 Add support for Linux vulkan backend with VK_KHR_display Implement Linux simple display mode with vulkan backend through VK_KHR_display. Added value 'EGL_PLATFORM_VULKAN_DISPLAY_MODE_SIMPLE_ANGLE' for attribute EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE to identify the new simple display mode. Also reserved EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE for headless mode. How to enable: Add ``` use_x11=false angle_vulkan_display_mode="simple" # default value ``` into args.gn, then compile with linux vulkan args. Bug: angleproject:5214 Change-Id: I1247585b9de8b55df106aba99322281f1c183203 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2494320 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 68b95b63 2020-10-29T14:09:08 Revert "ANGLE_platform_angle_device_context_volatile_* extensions" This reverts commit e70f6aa679dd72eca5c88c71b0932928e92d6067. Reason for revert: dEQP failures: dEQP.EGL/functional_get_frame_timestamps_rgb565_no_depth_no_stencil dEQP.EGL/functional_get_frame_timestamps_rgb565_no_depth_stencil dEQP.EGL/functional_hdr_metadata_cta861_3 dEQP.EGL/functional_hdr_metadata_smpte2086 dEQP.EGL/functional_mutable_render_buffer_basic dEQP.EGL/functional_swap_buffers_with_damage_resize_after_swap_buffer_age_clear dEQP.EGL/functional_swap_buffers_with_damage_resize_after_swap_buffer_age_clear_clear dEQP.EGL/functional_swap_buffers_with_damage_resize_after_swap_buffer_age_render dEQP.EGL/functional_swap_buffers_with_damage_resize_before_swap_buffer_age_clear dEQP.EGL/functional_swap_buffers_with_damage_resize_before_swap_buffer_age_clear_clear dEQP.EGL/functional_swap_buffers_with_damage_resize_before_swap_buffer_age_render Original change's description: > ANGLE_platform_angle_device_context_volatile_* extensions > > Change from Kimmo Kinnunen downstream: > https://bugs.webkit.org/show_bug.cgi?id=216106 > > Add two extensions for EAGL and CGL backends to declare the > underlying platform context being "volatile". It means that > the thread-global current context is being modified behind > ANGLE. If ANGLE context is marked volatile for a particular > API, it will sync the underlying context for every EGL > function that needs the context. Most intuitive use is > for the client to call eglMakeCurrent before calling any > gl function if the client knowns the platform state might > be dirty. > > Implement eglReleaseThread for EAGL and CGL backends. > Releasing thread will unset the platform current context. > > Fix a bug of omitting EGL_ANGLE_device_eagl from being > advertised. > > Bug: angleproject:5104 > Change-Id: I1ec98ad35bc0caada23556ae8697fdef20f65b1a > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2486548 > Commit-Queue: James Darpinian <jdarpinian@chromium.org> > Reviewed-by: Kenneth Russell <kbr@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> TBR=geofflang@chromium.org,kbr@chromium.org,jdarpinian@chromium.org,jonahr@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: angleproject:5104 Change-Id: Ib683625a55a582c39e5a4a0466038cfa6e782e6c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2507260 Reviewed-by: Geoff Lang <geofflang@chromium.org>
James Darpinian e70f6aa6 2020-10-19T16:49:48 ANGLE_platform_angle_device_context_volatile_* extensions Change from Kimmo Kinnunen downstream: https://bugs.webkit.org/show_bug.cgi?id=216106 Add two extensions for EAGL and CGL backends to declare the underlying platform context being "volatile". It means that the thread-global current context is being modified behind ANGLE. If ANGLE context is marked volatile for a particular API, it will sync the underlying context for every EGL function that needs the context. Most intuitive use is for the client to call eglMakeCurrent before calling any gl function if the client knowns the platform state might be dirty. Implement eglReleaseThread for EAGL and CGL backends. Releasing thread will unset the platform current context. Fix a bug of omitting EGL_ANGLE_device_eagl from being advertised. Bug: angleproject:5104 Change-Id: I1ec98ad35bc0caada23556ae8697fdef20f65b1a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2486548 Commit-Queue: James Darpinian <jdarpinian@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jeff Vigil 00a49766 2020-10-14T10:27:56 EGL: Implement EGL_KHR_reusable_sync Add extension string and flags Add EGLReusableSync files to libANGLE and gni Test: angle_deqp_egl_tests --deqp-case=dEQP-EGL.functional.reusable_sync.* --deqp-case=dEQP-EGL.functional.fence_sync.* Bug: angleproject:5168 Change-Id: I967a10cf387047c9ee1963acfc854a8288325a8e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2477293 Commit-Queue: Jeff Vigil <j.vigil@samsung.com> Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Cody Northrop 3e8305f5 2020-10-06T23:16:38 FrameCapture: Move compressed texture cache to shared location In support of tracking compressed texture data across multiple threads and contexts, move our cache to FrameCaptureShared. Make this accessible only via egl::ShareGroup, which will ensure unique texture IDs. Test: Asphalt 8 MEC Bug: b/150484427 Bug: angleproject:4048 Change-Id: I4e75b323d7aedc0333ceffba305439e54c4d6ac1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2455266 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Ian Elliott 08142700 2020-10-01T19:30:03 Work-around test runner & DebugAnnotator Note: This precedes another CL that needs this change. DebugAnnotator uses a global variable. The test runner doesn't change state between testing different back-ends. This works-around the problem by setting the global variable when the context is switched. Because the GL back-end doesn't have its own DebugAnnotator sub-class, add a Display* to DisplayImpl::makeCurrent(), so that DisplayGL::makeCurrent() can install the front-end-Display's DebugAnnotator. Note: the Vulkan back-end gets this fix even though the new DebugAnnotatorVk class will be added in a follow-on CL. Bug: b/162068318 Bug: b/169243237 Bug: angleproject:5121 Change-Id: If08626a5310f9b4e3210e1a897a6886248e4d8ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2451423 Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Kai Ninomiya da61c40e 2020-10-06T01:57:55 Revert "Work-around test runner & DebugAnnotator" This reverts commit e44c94d96a9b65615fe8f5038e124763ac8c45e5. Reason for revert: Breaks build of DisplayGbm on ChromeOS: src/libANGLE/renderer/gl/egl/gbm/DisplayGbm.{h,cpp} First failing builds: https://ci.chromium.org/p/chromium/builders/ci/ChromeOS%20FYI%20Release%20%28amd64-generic%29/1608 https://ci.chromium.org/p/chromium/builders/ci/ChromeOS%20FYI%20Release%20%28kevin%29/2212 Original change's description: > Work-around test runner & DebugAnnotator > > Note: This precedes another CL that needs this change. > > DebugAnnotator uses a global variable. The test runner doesn't change > state between testing different back-ends. This works-around the > problem by setting the global variable when the context is switched. > > Because the GL back-end doesn't have its own DebugAnnotator sub-class, > add a Display* to DisplayImpl::makeCurrent(), so that > DisplayGL::makeCurrent() can install the front-end-Display's > DebugAnnotator. > > Note: the Vulkan back-end gets this fix even though the new > DebugAnnotatorVk class will be added in a follow-on CL. > > Bug: b/162068318 > Bug: b/169243237 > Bug: angleproject:5121 > Change-Id: I748e8a1fd09b72e07242ac7fb39154537dcce534 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2444095 > Reviewed-by: Ian Elliott <ianelliott@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> > Commit-Queue: Ian Elliott <ianelliott@google.com> TBR=courtneygo@google.com,ianelliott@google.com,jmadill@chromium.org Change-Id: I99df2716951726ead24961dc3d27a7ec63aeda80 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: b/162068318 Bug: b/169243237 Bug: angleproject:5121 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2451420 Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Ian Elliott e44c94d9 2020-10-01T19:30:03 Work-around test runner & DebugAnnotator Note: This precedes another CL that needs this change. DebugAnnotator uses a global variable. The test runner doesn't change state between testing different back-ends. This works-around the problem by setting the global variable when the context is switched. Because the GL back-end doesn't have its own DebugAnnotator sub-class, add a Display* to DisplayImpl::makeCurrent(), so that DisplayGL::makeCurrent() can install the front-end-Display's DebugAnnotator. Note: the Vulkan back-end gets this fix even though the new DebugAnnotatorVk class will be added in a follow-on CL. Bug: b/162068318 Bug: b/169243237 Bug: angleproject:5121 Change-Id: I748e8a1fd09b72e07242ac7fb39154537dcce534 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2444095 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Courtney Goeltzenleuchter b156a753 2020-09-28T16:43:50 Move LayoutCaches to ShareGroup Testing with TSN found a race condition with RefCounted objects (DescriptorSetLayout and PipelineLayout). Rather than add more lock calls to protect accesses to mRefCount and mObject recommendation was to put these caches in the ShareGroup (basically part of the context). Locking at the GL level will ensure that two threads that share the same context will not access the ShareGroup at the same time. The ShareGroup also works because these layouts are not destroyed until the context is destroyed so don't have to worry about other threads (e.g. command processor thread) accessing them. Bug: b/168744561 Change-Id: Icc0aa07bf4787a69572d6ec62da2f21d286232c3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2437509 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Jamie Madill cb286073 2020-09-20T21:59:24 Use c++ thread_local for current thread. This solves a race condition using the global context. Sadly we can't use an unprotected variable safely because it can be written/read from multiple threads doing MakeCurrent. Has about a 2 ns regression when tested in Linux/Release per call. "null" benchmark test went from 27 -> 29 ns/iteration. Fixes a TSAN warning that popped up in angle_end2end_tests. Test: DrawCallPerfBenchmark.Run/vulkan_null Test: EGLContextASANTest.DestroyContextInUse/ES3_Vulkan Bug: b/168744561 Change-Id: Ic56f3faae81c1087b942a3cfc0e011b9ab439e0f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2419641 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Mohan Maiya c99c22bb 2020-09-15T16:53:26 EGL: Add support for EGL_ANDROID_create_native_client_buffer This EGL extension will add support for creating EGLClientBuffer backed by an Android window buffer (struct ANativeWindowBuffer) which can be later used to create an EGLImage. Bug: angleproject:5018 Tests: angle_end2end_tests --gtest_filter=ImageTest.SourceNativeClientBufferTarget* Change-Id: If78ed7b80ad09629b8c5f5b5a0eb07a548e82e6e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2404320 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Jamie Madill 5b0b1830 2020-09-12T23:21:41 Add feature for disabling compressed formats. Can be useful when doing captures to make the replay more portable. Bug: angleproject:5040 Change-Id: I3a045c636bc2638d601aff2536eed3d0e49c3643 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2408714 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Jonah Ryan-Davis 1ab73f0f 2020-09-10T14:32:58 Cleanup disable_program_binary workaround This workaround should also clear the shader binary formats. Also, we can use this workaround when disabling program binaries for capture/replay. Bug: angleproject:5007 Change-Id: I57c78e2cc95e7148cb8a1e7fb9bf3ed958fa69c8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2404383 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Courtney Goeltzenleuchter 3a3d419d 2020-08-04T09:06:01 Reference count context to fix ASAN issues Running with ASAN there are several use after free issues because a eglDestroyContext destroys the context right away even though it's in use in other thread(s). Adding reference count to context so that it's not destroyed until all users are done using it. Bug: b/162609728 Change-Id: I00b24b53d760e38ff61dd9ce652a49b1f32f0cd2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2336447 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Peng Huang 4cf2501c 2020-07-27T13:19:27 Add extension EGL_ANGLE_display_semaphore_share_group For sharing semaphores globally. Bug: angleproject:4877 Change-Id: I472e0902fd04ca8350d74e6c0ae6925ee930ccf9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2319370 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Mohan Maiya 33c28e35 2020-06-12T08:17:47 Optimize thread specific storage and retrieval with native ASM Android reserves specific TLS slots to store thread specific values. Given that the Context object gets queried on every call we leverage Android's ASM code to improve the speed of this operation. TLS_SLOT_OPENGL is an unused slot in Android and using that in combination with the ASM code,rather than using the pthread API, allows angle to store and retrieve thread specific context object much more efficiently. Bug: angleproject:4717 Change-Id: I27a117fe82e62407e01c8c372918b866aaea9ee5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2231883 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Kenneth Russell af727792 2020-06-10T21:55:43 Improve EGL_ANGLE_power_preference on dual-GPU MacBook Pros. Add the ability to release and reacquire the high-power GPU, and to respond to changes in the active GPU. In Chromium, the GPU process can not access the WindowServer. An external process must inform ANGLE that the active GPU has changed, and that ANGLE should switch its internal context to the new GPU. Incorporates a couple of functions from WebKit, used with permission, to effect this GPU switch. A follow-on change in Chromium which uses these new APIs will make the existing dual-GPU tests pass with ANGLE and the passthrough command decoder. Carry forward Chromium's workaround of disabling GPU switching on older MacBook Pros to ensure stability. Document the process of adding new EGL extensions to ANGLE. Bug: chromium:1091824 Change-Id: I499739156e851b493555d4d6e4aef87d8b97fa31 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2240638 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 4e6f6545 2020-04-16T16:31:24 GLX: Support X11 pixmaps Add support for creating EGL pixmaps from X11 pixmaps using GLX. Pixmaps are needed for various external APIs such as VAAPI. Add support for EGL_NOK_texture_from_pixmap to allow binding pixmaps to textures. BUG=angleproject:4560 Change-Id: I4a6d3ad7e87151ff5317bbdaaf093ac1b46daf5f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2153805 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Maksim Sisov 8ba5cf99 2020-05-28T13:57:07 Add EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE This CL adds a new attribute that helps to identify lower platform angle should use. We identified several different use cases that ANGLE must comply with when choose a display implementation. Please refer to the Support Matrix for EGL_ANGLE_platform_angle table Bug: chromium:1084458 Change-Id: I6ea3d5081012ddf450f1c641343d1ba1a673483b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2210151 Commit-Queue: Michael Spang <spang@chromium.org> Reviewed-by: Michael Spang <spang@chromium.org>
Maksim Sisov 56a4cc12 2020-05-21T13:17:21 Rename DisplayOzone to DisplayGbm. DisplayOzone doesn't really have anything related to Ozone. Instead, it's the gbm platform that is used there. Thus, rename it to DisplayGbm. Bug: chromium:1084458 Change-Id: I4d974f6afbf0daa28fc3e83943b35814dca203fd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2211763 Reviewed-by: Michael Spang <spang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Charlie Lao 29bb612e 2020-05-28T10:32:26 Add egl::ShareGroup class to abstract the share context group Vulkan backend has a barrier tracker that tracks memory barrier needs of all shared resources. Because the buffer/texture objects are shared resources within a shared group, the tracker can not live in a context. Putting it in a device/renderer requires locks. It fits perfectly in a shareGroup object. The work is already done at API level to handle the mutex lock for shared context access so that no extra lock needs to be taken in the backend. This CL adds egl::ShareGroup class that represents the object that are shared among all share context group. At the front end this usually will include all the shared resource managers (not done in this CL). The ShareGroup object is accessible from gl::State object. This CL also adds ability for backend driver to allocate implementation specific ShareGroupImpl object. Vulkan backend will then use it to keeps the barrier tracker and other things that naturally fits the share group concept. Bug: angleproject:4664 Change-Id: Ifcd975cbdf5130022e21c41397894afc28f572e7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2217252 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Courtney Goeltzenleuchter 390ef299 2020-03-25T14:10:38 Enable blob cache when debugging We've had several issues with shader caches which are only implemented on Android which makes them challenging to debug. The existing BlobCache object has a default implementation that is disabled by default. When debug layers are enabled resize the default cache so that it gets used and provides behavior closer to Android. This caching will be enabled when debug layers are enabled, e.g. EGL_PLATFORM_ANGLE_DEBUG_LAYERS_ENABLED_ANGLE attribute is true. This is done for angle_end2end_tests and deqp tests. Reland after bugfix angleproject:4535 Bug: b:152292873 Bug: angleproject:4535 Change-Id: Icefa8c55e39985d653d8d8a8bc8c734210025b50 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2134449 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
Corentin Wallez 7939e367 2020-03-30T18:52:19 Revert "Enable blob cache when debugging" This reverts commit 617cb015f3e95c3c89090870bae086e92515a91d. Reason for revert: Seems to cause rolls in Chromium to fail: https://chromium-review.googlesource.com/c/chromium/src/+/2127135 Original change's description: > Enable blob cache when debugging > > We've had several issues with shader caches which are only implemented > on Android which makes them challenging to debug. > The existing BlobCache object has a default implementation that is > disabled by default. When debug layers are enabled resize the default > cache so that it gets used and provides behavior closer to Android. > This caching will be enabled when debug layers are enabled, e.g. > EGL_PLATFORM_ANGLE_DEBUG_LAYERS_ENABLED_ANGLE attribute is true. > This is done for angle_end2end_tests and deqp tests. > > Bug: b:152292873 > Change-Id: I9dcd90a1a8da88127bf8dac25031056b7279207e > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2113133 > Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=courtneygo@google.com,ianelliott@google.com,jmadill@chromium.org Change-Id: I42a445b93eff1237b05a82d2836c218b9bbbd08b No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: b:152292873 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2128106 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Courtney Goeltzenleuchter 617cb015 2020-03-25T14:10:38 Enable blob cache when debugging We've had several issues with shader caches which are only implemented on Android which makes them challenging to debug. The existing BlobCache object has a default implementation that is disabled by default. When debug layers are enabled resize the default cache so that it gets used and provides behavior closer to Android. This caching will be enabled when debug layers are enabled, e.g. EGL_PLATFORM_ANGLE_DEBUG_LAYERS_ENABLED_ANGLE attribute is true. This is done for angle_end2end_tests and deqp tests. Bug: b:152292873 Change-Id: I9dcd90a1a8da88127bf8dac25031056b7279207e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2113133 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Julien Isorce 07044c65 2020-03-03T00:13:03 Reland "Instantiate rx::DisplayEGL when device type EGL is selected" This is a reland of 7455b54401dd55833944b5ad857ccd9852ef6a79 Original change's description: > Instantiate rx::DisplayEGL when device type EGL is selected > > Define EGL_PLATFORM_ANGLE_DEVICE_TYPE_EGL_ANGLE that should be > used to request a driver egl-backed implementation with ANGLE. > > Bug: angleproject:4328 > Change-Id: I6871d3a27e2bfc02af9815dcf86ae1cb6524f0cc > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2030038 > Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> Bug: angleproject:4328 Change-Id: I4e997c4fa1b5b59f081436f05bd208303ffe38e9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2093412 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Julien Isorce <julien.isorce@chromium.org>
Ian Elliott 03ed5f6c 2020-03-06T22:15:42 Revert "Instantiate rx::DisplayEGL when device type EGL is selected" This reverts commit 7455b54401dd55833944b5ad857ccd9852ef6a79. Reason for revert: This appears to break the "Linux FYI Ozone (Intel)" bots on the chromium.gpu.fyi waterfall. Ozone means ChromeOS. Original change's description: > Instantiate rx::DisplayEGL when device type EGL is selected > > Define EGL_PLATFORM_ANGLE_DEVICE_TYPE_EGL_ANGLE that should be > used to request a driver egl-backed implementation with ANGLE. > > Bug: angleproject:4328 > Change-Id: I6871d3a27e2bfc02af9815dcf86ae1cb6524f0cc > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2030038 > Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> TBR=geofflang@chromium.org,syoussefi@chromium.org,jonahr@google.com,julien.isorce@chromium.org Change-Id: I8aec6c2783b0acb67d3315d351cdc9e526f58d6b No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:4328 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2091864 Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Julien Isorce 7455b544 2020-03-03T00:13:03 Instantiate rx::DisplayEGL when device type EGL is selected Define EGL_PLATFORM_ANGLE_DEVICE_TYPE_EGL_ANGLE that should be used to request a driver egl-backed implementation with ANGLE. Bug: angleproject:4328 Change-Id: I6871d3a27e2bfc02af9815dcf86ae1cb6524f0cc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2030038 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Xinyi He 4864413b 2020-02-17T15:34:33 Vulkan: Implement eglWaitNative function Implement eglWaitNative API. It will call XSync() on XCB and do nothing on other systems. Bug: angleproject:4281 Change-Id: I597b75124a380df519ab10af3cab9b6e26f3194f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2059620 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill eb63016d 2020-02-04T16:15:41 Add environment overrides for ANGLE features. Allows the application to override ANGLE behaviour without having to modify the code or use the ANGLE extension. Useful for testing with the command graph refactor. Adds a new string utility for parsing lists of strings from environment variables. Bug: angleproject:4029 Change-Id: Ibae93b743c0c385392cd259d9604ce2f2ed988dc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2037784 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang aa6dd50d 2020-02-03T17:10:58 Share scratch buffers between contexts. The Display now owns scratch buffers and loans them out to contexts while they are current. This allows us to to only allocate one scratch buffer in a single-threaded use case. Tick the scratch buffers every time a new context is made current. Lower the lifetime from 1000 to 64 to ensure that in the worst case, the buffers are cleared after not being used for ~1 second. BUG=chromium:1030835 BUG=angleproject:4363 Change-Id: I83552424e2beac62b9e41152876b04fc84f53692 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2031698 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Geoff Lang a36f8bd4 2020-01-29T12:10:17 Mark MemoryBuffer allocation functions as NO_DISCARD Not all call sites were checking the return value of MemoryBuffer::resize, mark the return value as NO_DISCARD and fix all the warnings. BUG=chromium:1030835 Change-Id: I762796e3d11efc131a814069d78a195b0d4c9f8f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2028151 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Kenneth Russell 12ce8f68 2020-01-03T16:40:06 Upstream WebKit's iOS port of ANGLE. Added the EAGL backend authored by Dean Jackson from Apple, and the refactoring changes needed to support it side-by-side with the macOS backend. Ran "git cl format" against these diffs. Defined the EGL_ANGLE_device_eagl extension and allocated an enum out of ANGLE's reserved range. The iOS backend is not yet included in any of the GN files. Bug: angleproject:4263 Change-Id: I631c32930433c03bb16a242955ffedf55174bb29 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1987278 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: James Darpinian <jdarpinian@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Brandon Schade 3eaf6294 2019-11-25T18:08:18 Vulkan: Add options to select more device types Add support to set a default device type using existing ANGLE_DEFAULT_PLATFORM environment variable. The valid vulkan options are as follows: vulkan - vulkan with device hardware vulkan-null - vulkan with null device (Mock ICD) swiftshader - vulkan with swiftshader Bug: angleproject:3998 Change-Id: I15f00e8024818fbaf674ca6fcdbcdac5a90cace2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1956140 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jonah Ryan-Davis 5afd5ec6 2019-10-25T10:53:40 Vulkan support for MacOS (using SwiftShader) Created a new WindowSurface/Display for MacOS/Vulkan, along with some GN changes to get it working. Bug: 1015454 Change-Id: I3f7a12f173795efe598856c702ce53b1e50831eb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1880163 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2ed71c81 2019-11-27T11:42:08 Vulkan: Isolate DisplayVk.h from Display.cpp. With this change we no longer can access Vulkan (or Volk) headers in the ANGLE front-end. The only header that needs to be visible is the new "DisplayVk_api.h". This will simplify a bit of Volk integration. Also reworks how the entry points and headers are exposed to the tests. Bug: angleproject:3740 Change-Id: Ic1434f304619427ed6ad6370bc090ceb7858df94 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1936707 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com>
Jonah Ryan-Davis f9c3eaf4 2019-11-19T15:19:04 Add ability to disable all ANGLE features Chrome has a --disable-gpu-driver-bug-workarounds flag that needs to be able to be forwarded to ANGLE Bug: 1016377 Change-Id: Ied6c8656742e25c32d508b8bfe76a902d82bcf93 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1925249 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Le Hoang Quyen deae1fce 2019-11-09T17:22:40 Enable Metal backend. Metal will be secondary default backend after OpenGL for now. The tests will be enabled for metal in CL http://crrev.com/c/1906607. Bug: angleproject:2634 Change-Id: I109c641d749c2a207bbb7d500bc281ffb0b13848 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1906612 Commit-Queue: Le Hoang Quyen <le.hoang.q@gmail.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Josh Matthews 67527cb4 2019-10-25T13:47:55 Fix compilation on UWP targets. Bug: angleproject:4053 Change-Id: Iaa358c8ce61d0ebaae11672bfb6dac2d3e847be1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1881343 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill c898ec1a 2019-11-04T15:20:18 Add EGL GGP extensions. This CL adds two new extensions: * EGL_ANGLE_ggp_stream_descriptor: Introduces a new attribute to CreateWindowSurface. Allows the app to pass in a stream descriptor to VkCreateSurfaceKHR. Mirrors VK_GGP_stream_descriptor_surface. * EGL_ANGLE_swap_with_frame_token: Introduces a new function 'eglSwapBuffersWithFrameTokenANGLE'. This allows the app to pass a GGP frame token down to vkQueuePresentKHR. Mirrors VK_GGP_frame_token. Bug: angleproject:4078 Change-Id: I4313ac4c264e68999905049f661bc64b44f72fab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1897315 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Le Quyen fe26bae4 2019-10-29T18:38:53 Metal backend implementation pt 2 This is without Metal specific shader translator implemented yet. Bug: angleproject:2634 Change-Id: I95d589442251c9ba111bd05a2dc379a36739046c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1855069 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis ae1b7786 2019-10-16T16:42:53 Fix ANGLE_FEATURE_CONDITION style issue Macro should end with a ; Bug: angleproject:3976 Change-Id: I4aaa146464d9d7e6230a3de44c30cfd1179a89ae Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1864620 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Le Quyen d200a77a 2019-10-10T00:44:01 Metal backend skeleton implementation. Bug: angleproject:2634 Change-Id: I34be82f4a80a6851fecb53a51e069b134d82613a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1849079 Commit-Queue: Le Hoang Quyen <le.hoang.q@gmail.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Nathan Zabriskie 5d9c4ee3 2019-09-17T15:36:25 Add D3D11on12 device option This CL adds a new D3D11on12 device option which runs the D3D11 API on top of D3D12. This is done to aid in preliminary investigations into the feasibility of creating a full D3D12 backend implementation. Bug: angleproject:3919 Change-Id: I0ad4250eb3c93b0b74274c904aac74f03753c7ad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1814404 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis 7dd03446 2019-09-30T13:50:12 Ensure Features* descriptions stay up to date Created a macro to help keep Features' descriptions up to date. This will avoid confusion in the future when conditions change. Also update all descriptions to match current state. Bug: angleproject:3947 Change-Id: Ifc65e7789c916fab79f1323798dfb59d7a4efad2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1829584 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 8be7a4c7 2019-09-19T12:48:31 Re-land "Vulkan: SwiftShader integration." Re-land fixes Win7 configs and placement of the SwiftShader module for ASAN/TSAN configs. Adds a new EGL extension for picking SwiftShader when using the Vulkan back-end. Also cleans up ICD enabling code RendererVk. Also includes a change to a buffer size necessary to support SwiftShader's minimum limits. Bug: angleproject:3876 Bug: b/140251624 Change-Id: I5e16057ac4de07bbdbbd248542b1b9103133294f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1810065 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Austin Kinross 11dc1635 2019-09-18T14:46:23 Add support for generating UWP (Windows Store) projects again Until late 2017, ANGLE supported Windows Store apps on Windows 8.1, Windows Phone 8.1, and Windows 10 (via the Universal Windows Platform, aka UWP). Unfortunately ANGLE deprecated support for Windows Store when it switched from GYP to GN in 2017. Since then, users have been able to use Microsoft\angle for their UWP apps but this isn't ideal since it's based on a 2017 copy of Google\angle. This PR bring back support for UWPs, so that UWP users can use Google\angle again. Specifically it: - Adds support for generating UWP projects via GN - Adds helper/util functions specific to UWP (they're mostly similar to the desktop Windows helpers) - Fixes some existing Windows Store code that's rotted since 2017 - Disables async shader compilation for UWPs, since its implementation calls wait on the UI thread (which is forbidden in UWPs) - Renames 'ANGLE_ENABLE_WINDOWS_STORE' to 'ANGLE_ENABLE_WINDOWS_UWP', since ANGLE only support UWPs now - Fixes misc other related issues (such as dependencies on D3D9 headers in API-agnostic code) Note that this doesn't bring back support for Windows/Phone 8.1. BUG=angleproject:3922 Change-Id: Ia79ae05a5e0e0a0625eb633bf1928722dfd3e85f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1811871 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Austin Kinross bf4268a3 2019-09-17T13:33:56 Fix misc VS2019 bool conversion warnings BUG=angleproject:3921 Change-Id: I06de5131f98b27c2556ed60dd7228c9cfa154802 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1811858 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Zhenyao Mo db7a36f4 2019-09-17T00:22:32 Revert "Vulkan: SwiftShader integration." This reverts commit 1224802c214d8f3d5b1f31a35d4461ada39b94c1. Reason for revert: https://bugs.chromium.org/p/angleproject/issues/detail?id=3912 Original change's description: > Vulkan: SwiftShader integration. > > Adds a new EGL extension for picking SwiftShader when using the Vulkan > back-end. Also cleans up ICD enabling code RendererVk. Also includes a > change to a buffer size necessary to support SwiftShader's minimum > limits. > > 32-bit is currently left disabled to work around an issue on AMD Win7. > > Bug: angleproject:3876 > Bug: b/140251624 > Change-Id: I33c55d994801d6154caca0cad0a608c1e808d517 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1776231 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> TBR=geofflang@chromium.org,jonahr@google.com,jmadill@chromium.org Change-Id: Id7464250f6941b0228a6b2a9bd0349823727275b No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:3876, b/140251624 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1808101 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Jamie Madill 1224802c 2019-09-16T15:17:33 Vulkan: SwiftShader integration. Adds a new EGL extension for picking SwiftShader when using the Vulkan back-end. Also cleans up ICD enabling code RendererVk. Also includes a change to a buffer size necessary to support SwiftShader's minimum limits. 32-bit is currently left disabled to work around an issue on AMD Win7. Bug: angleproject:3876 Bug: b/140251624 Change-Id: I33c55d994801d6154caca0cad0a608c1e808d517 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1776231 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>