Skip to content

Commit

Permalink
Lock around all EGL and GL calls with a global mutex.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
vonture authored and Commit Bot committed Aug 31, 2018
1 parent 86792f4 commit b02fc66
Show file tree
Hide file tree
Showing 14 changed files with 1,321 additions and 5 deletions.
4 changes: 4 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ config("internal_config") {
} else {
defines += [ "ANGLE_IS_32_BIT_CPU" ]
}

if (angle_force_thread_safety) {
defines += [ "ANGLE_FORCE_THREAD_SAFETY=1" ]
}
}

config("extra_warnings") {
Expand Down
1 change: 1 addition & 0 deletions gni/angle.gni
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ declare_args() {
angle_enable_null = true
angle_enable_essl = true
angle_enable_glsl = true
angle_force_thread_safety = false
}

declare_args() {
Expand Down
1 change: 1 addition & 0 deletions scripts/generate_entry_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@

template_entry_point_def = """{return_type}GL_APIENTRY {name}{explicit_context_suffix}({explicit_context_param}{explicit_context_comma}{params})
{{
ANGLE_SCOPED_GLOBAL_LOCK();
{event_comment}EVENT("({format_params})"{comma_if_needed}{pass_params});
Context *context = {context_getter};
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_code_generation_hashes.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"GL entry point:scripts/entry_point_packed_gl_enums.json":
"df2c879ccb62109a31c24d4b1df45354",
"GL entry point:scripts/generate_entry_points.py":
"bfe4041311e3ae882ed218e306d7b683",
"5a110a1e99777cf8c904f30e54af15a1",
"GL entry point:scripts/gl.xml":
"b470cb06b06cbbe7adb2c8129ec85708",
"GL format map:src/libANGLE/es3_format_type_combinations.json":
Expand Down
7 changes: 6 additions & 1 deletion src/libANGLE/features.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,9 @@
#endif // defined(ANGLE_PLATFORM_WINDOWS)
#endif // !defined(ANGLE_STD_ASYNC_WORKERS)

#endif // LIBANGLE_FEATURES_H_
// Force thread safety in all of ANGLE by locking a global mutex in every ANGLE entry point.
#if !defined(ANGLE_FORCE_THREAD_SAFETY)
#define ANGLE_FORCE_THREAD_SAFETY ANGLE_DISABLED
#endif // !defined(ANGLE_FORCE_THREAD_SAFETY)

#endif // LIBANGLE_FEATURES_H_
Loading

0 comments on commit b02fc66

Please sign in to comment.