src/libGLESv2/global_state.cpp


Log

Author Commit Date CI Message
Jamie Madill 3ff097ff 2019-10-31T10:42:00 Win: Add ANGLE_WAIT_FOR_DEBUGGER option. Setting this environment variable will make ANGLE pop up a dialog. The dev can then attach a debugger to this dialog. Only implemented on Windows currently. This option is only available when ASSERTs are enabled in libGLESv2. The code is based on SwiftShader's implementation of WaitForDebugger: https://cs.chromium.org/chromium/src/third_party/swiftshader/src/Vulkan/main.cpp Bug: angleproject:4072 Change-Id: I160cb91a423a6d4517f067f2a6f3a2d953b26505 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1892173 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jaime Bernardo 755417dd 2019-09-30T17:53:56 GLES2: Use require_constant_initialization for g_Mutex A static assert to verify that the global mutex g_Mutex is trivially constructed fails to compile with clang when using the STL shipped with Visual Studio 2019. Use __attribute__((require_constant_initialization)) instead to verify for constant initialization. BUG=angleproject:3936 Change-Id: I5969762ad5a99033143513d7c4992344da276b1a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1832164 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Stuart Morgan 9d737966 2019-08-14T12:25:12 Standardize copyright notices to project style For all "ANGLE Project" copyrights, standardize to the format specified by the style guide. Changes: - "Copyright (c)" and "Copyright(c)" changed to just "Copyright". - Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1"). - Fixed a small number of files that had no copyright date using the initial commit year from the version control history. - Fixed one instance of copyright being "The ANGLE Project" rather than "The ANGLE Project Authors" These changes are applied both to the copyright of source file, and where applicable to copyright statements that are generated by templates. BUG=angleproject:3811 Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 9ac15d05 2019-07-08T10:30:22 Ensure the global mutex is not locked before deleting it. It is undefined behaviour to delete a mutex that is locked by a thread. To ensure that the global mutex is not locked, lock/unlock it before deleting it. BUG=angleproject:2464 Change-Id: I735e924abfa06070f2b4103230be8593649ca340 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1690674 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 067687f4 2019-05-29T12:48:49 Removal global locks from GL entry points. Always lock in EGL. The ANGLE Vulkan backend is now thread safe for non-share group contexts. This means that a global GL lock only adds overhead for most use cases. Remove the angle_force_thread_safety gn argument. BUG=angleproject:2464 Change-Id: Ic6ba89e18b46e5dd72aa83d0f409097441fcca3a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1635749 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com>
Jamie Madill 77db6f4a 2018-09-23T17:28:55 Use global Context lookup in single-threaded cases. In single-threaded cases we don't need to use a TLS lookup for the current Context. Assume a global context has 3 states: unset, set, and multi-threaded: * global context unset -> set the global context * global context set, matches TLS context -> set the global context * global context set, doesn't match TLS -> set multi-threaded * global context multi-threaded -> leave it This also inlines the global context/TLS check into global_state.h. Increases performance of the binding perf overhead test by up to 25% and the draw call perf test by up to 3%. Bug: angleproject:2824 Change-Id: Ib95953ca918f2408fe72ca83061f4e2d1bd1adad Reviewed-on: https://chromium-review.googlesource.com/1231993 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang b02fc662 2018-08-21T09:48:01 Lock around all EGL and GL calls with a global mutex. BUG=angleproject:2464 Change-Id: I0231cc84777272f9cf26298c6a137f1ad3fd51d6 Reviewed-on: https://chromium-review.googlesource.com/1183441 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 75359664 2018-04-11T01:42:27 Implement EGL_KHR_debug. BUG=angleproject:1618 Change-Id: I790944b49badc910b6c72266469fcb8e86ac4252 Reviewed-on: https://chromium-review.googlesource.com/1019387 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Yuly Novikov d73f852f 2017-01-13T17:48:57 Reland "Replace gl::trace logging with Chromium style logging" Removing one usage of FormatString() and its static buffer. And preparation for Platform logging. Fix incorrect enabling of ERR() calls in UNIMPLEMENTED() and UNREACHABLE(), resulting in increased code size and <iostream> adding 5 static initializers to chrome because of cerr referenced in statically linked translator. BUG=angleproject:1660 Change-Id: I7caa18036118d532e0544f75278602559172ae04 Reviewed-on: https://chromium-review.googlesource.com/431457 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 6a6b09c9 2017-01-12T21:52:29 Revert "Replace gl::trace logging with Chromium style logging" Failing Chromium static initializers check: FAILED linux-release-64/sizes/chrome-si/initializers: actual 8, expected 7, better lower Possibly due to the static initializer for std::array for the log severity types. We should change it to POD. BUG=angleproject:1660 This reverts commit afcc41cee4ff63e7f6c9e60e55fc061adbba7dd4. Change-Id: Ifb362a4af78542608397c7a0b19e6afe076f2cf3 Reviewed-on: https://chromium-review.googlesource.com/427235 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuly Novikov afcc41ce 2016-12-13T12:59:39 Replace gl::trace logging with Chromium style logging Removing one usage of FormatString() and its static buffer. And preparation for Platform logging. BUG=angleproject:1660 Change-Id: I58192988ad16196706fe48d0c0ab0fd1a10c0210 Reviewed-on: https://chromium-review.googlesource.com/424173 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang 7b8f3c9b 2016-11-10T10:42:48 Encapsulate the thread local storage into an egl::Thread class. Instead of having separate GetGlobal* functions, interact with the global objects through a single Thread object. This reduces the number of TLS lookups in many EGL functions and allows the Thread object to be passed down to other objects if needed. BUG=angleproject:1618 Change-Id: I1f9a89e8899d637633f4e91fda0e38ac308dd020 Reviewed-on: https://chromium-review.googlesource.com/409637 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 437fa654 2016-05-03T15:13:24 Add a ContextImpl class. This class can contain impl-specific functionality for a Context. This will eventually replace the Renderer class, and we can then start passing around a gl::Context instead of gl::ContextState. In D3D11, the ContextImpl could hold a DeferredContext, which would enable multi-thread rendering. In GL, we can implement non-virtual (native) Contexts. In Vulkan it might store the logical device. BUG=angleproject:1363 Change-Id: I39617e6d1a605d1a9574832e4d322400b09867ec Reviewed-on: https://chromium-review.googlesource.com/340745 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
hendrikw f3586994 2015-10-14T18:27:07 angle: move DeallocateCurrent into windows only code DeallocateCurrent is only called from within DllMain, which means it's only called on windows. On the mac, the warning unused-function may be triggered. Move DeallocateCurrent to windows only code. Change-Id: I61ba602af78d546a91cf009ae7350cf03eaa84dd Reviewed-on: https://chromium-review.googlesource.com/305880 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tryjob-Request: Corentin Wallez <cwallez@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang e7c6e43c 2014-12-03T14:48:07 Implement all entry points in libGLES and have libEGL act as a shim. This allows libANGLE to only be included in libGLESv2 and moves all TLS data to libGLESv2.dll. BUG=angle:733 Change-Id: I34f0b47987a5efbe906c290d3ca656142e69ea9a Reviewed-on: https://chromium-review.googlesource.com/232962 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>