haikuwebkit/Source/ThirdParty/ANGLE/src/libGLESv2
Dean Jackson 070b8db9d0 3.5 MB system-wide footprint impact due to thread-locals in libANGLE
https://bugs.webkit.org/show_bug.cgi?id=228240
rdar://79504783

Reviewed by Ken Russell and Geoff Garen.

Apple's dyld has a bug where thread_local variables are dirtied on
process launch, causing a memory regression. Work around this
temporarily in ANGLE by using pthread thread local storage.

I don't expect this to be upstreamed to ANGLE unless they
want it. If it isn't, this patch will have to be applied until
the dyld bug is fixed.

* src/libANGLE/Context.cpp: Implement some methods to get/set what was
the global variable gCurrentValidContext.
(gl::GetCurrentValidContextTLSIndex):
(gl::GetCurrentValidContextTLS):
(gl::SetCurrentValidContextTLS):
(gl::Context::setContextLost):
* src/libANGLE/Context.h:
* src/libGLESv2/global_state.cpp: Ditto, but for gCurrentThread.
(egl::GetCurrentThreadTLSIndex):
(egl::GetCurrentThreadTLS):
(egl::SetCurrentThreadTLS):
(egl::GetCurrentThread):
(egl::SetContextCurrent):
* src/libGLESv2/global_state.h:
(gl::GetGlobalContext):
(gl::GetValidGlobalContext):

Canonical link: https://commits.webkit.org/239996@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-27 21:36:17 +00:00
..
entry_points_egl.cpp
entry_points_egl.h
entry_points_egl_ext.cpp
entry_points_egl_ext.h
entry_points_gles_1_0_autogen.cpp
entry_points_gles_1_0_autogen.h
entry_points_gles_2_0_autogen.cpp
entry_points_gles_2_0_autogen.h
entry_points_gles_3_0_autogen.cpp
entry_points_gles_3_0_autogen.h
entry_points_gles_3_1_autogen.cpp
entry_points_gles_3_1_autogen.h
entry_points_gles_3_2_autogen.cpp
entry_points_gles_3_2_autogen.h
entry_points_gles_ext_autogen.cpp
entry_points_gles_ext_autogen.h
global_state.cpp
global_state.h
libGLESv2.rc
libGLESv2_autogen.cpp
libGLESv2_autogen.def
libGLESv2_no_capture_autogen.def
libGLESv2_with_capture_autogen.def
proc_table_egl.h
proc_table_egl_autogen.cpp
resource.h