src/common/tls.cpp


Log

Author Commit Date CI Message
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>
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 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>
Yuly Novikov bb7534ee 2020-02-14T16:23:28 Use ASSERT() instead of assert() when possible. Since ASSERT() works in Release builds. Left assert() in a few places where calling a function may not be safe. Bug: angleproject:4396 Change-Id: Ic75a3d41d846e327097f8c37fe2336dcd3be6cb8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2057745 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@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>
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>
Jamie Madill 7fa8824b 2018-11-26T13:22:57 Update clang-format settings. To allow for extern "C" declarations to not break on a brace. This preserves the current code style. Also add indented preprocessor definitions. This makes the formatting of "platform.h" much nicer. Bug: angleproject:2971 Change-Id: I392babe0c8d67539a8e026a36a023a7404bb63c2 Reviewed-on: https://chromium-review.googlesource.com/c/1347452 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Yunchao He f81ce4a3 2017-04-24T10:49:17 Refactoring: replace NULL by nullptr for pointers (3rd CL). This CL mainly handles passing/returning NULL to/from a function. BUG=angleproject:2001 Change-Id: I34802f792e710e3d7ff697cbe4701dc1bf5ab009 Reviewed-on: https://chromium-review.googlesource.com/485060 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Cooper Partin 88d3b8cb 2014-10-08T10:41:56 Added IInspectable EGLNativeWindowType and ICoreWindow support Change-Id: I6dd7fef72a73572d4a3deda7ce36a11da3a75c81 Reviewed-on: https://chromium-review.googlesource.com/224366 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill e020bed5 2014-10-20T16:16:46 Revert "Added IInspectable EGLNativeWindowType and ICoreWindow support" Causing regressions in the build: http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Mac%20Builder/builds/20182 This reverts commit 756aebfc7afa6d0de14e96637ef396dd7b290c2d. Change-Id: I2f4bdb5aeb429c9bbc5e655a1761704f33737841 Reviewed-on: https://chromium-review.googlesource.com/224221 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Cooper Partin 756aebfc 2014-10-08T10:41:56 Added IInspectable EGLNativeWindowType and ICoreWindow support Change-Id: I34e443b1e194800460e441ac6cee42cf68430564 Reviewed-on: https://chromium-review.googlesource.com/224302 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Shannon Woods 8858cf0a 2014-10-17T20:53:32 Revert "Added IInspectable EGLNativeWindowType and ICoreWindow support" due to build failures on Chromium FYI bots. This reverts commit 406a3be91cc8175df95bd390425e35830778f2d5. Change-Id: Ica2abd2e557a4fd9852d85b7fc018e3d272b6edf Reviewed-on: https://chromium-review.googlesource.com/224051 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Shannon Woods <shannonwoods@chromium.org>
Cooper Partin 406a3be9 2014-10-08T10:41:56 Added IInspectable EGLNativeWindowType and ICoreWindow support Change-Id: I9ad82b7819bcca1c05e7aa60dc2baec4a7bc403c Reviewed-on: https://chromium-review.googlesource.com/222360 Tested-by: Cooper Partin <coopp@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shannon Woods fb839475 2014-06-16T13:21:41 Fix ifdef complaints in clang BUG=angle:677 Change-Id: Iee457dfc0990e5ffd61932b1f286f3c0208568bc Reviewed-on: https://chromium-review.googlesource.com/203427 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Shannon Woods <shannonwoods@chromium.org>
Geoff Lang 44fa7594 2014-05-30T11:50:07 Refactor platform related functionality into platform.h and tls.h. Since libGLESv2 and libEGL will eventually be cross platform, it will be useful to have platform defines and TLS functions that work everywhere. BUG=angle:664 Change-Id: Ia357925a0992d82e8b446d88d32a1984d319e6e8 Reviewed-on: https://chromium-review.googlesource.com/202133 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>