|
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>
|
|
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>
|
|
0e5d019e
|
2019-11-08T08:43:21
|
|
Vulkan: Enable 3.0 as default context version
Now that 3.0 support is passing dEQP, always return that as the
context version to use (unless app asks for 1.0).
Test: angle_end2end --gtest_filter=EGLBackwardsCompatibleContextTest.BackwardsCompatibleEnabledES3/*
Bug: angleproject:3750
Change-Id: I0402ac015acfc22e84a985fe75346999bcc47188
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1906202
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Tobin Ehlis <tobine@google.com>
Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
|
|
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>
|
|
35f02850
|
2019-07-23T17:20:25
|
|
Vulkan: Reduce getMaxConformantESVersion() to 2.0
We are currently returning a 3.0 context for Vulkan backends (issue
3425). However, we aren't quite 3.0 conformant yet, so this bug
will drop that back down to 2.0 in getMaxConformantESVersion().
Bug: angleproject:3734
Test: dEQP
Change-Id: I2c5a6ee0ddb3bd52fdc92fdc9b12cf3c6d8e0510
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1716244
Commit-Queue: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
610f2388
|
2019-07-18T16:28:49
|
|
Return backwards compatible context versions in Vulkan, GL and D3D11.
This allows us to pass some dEQP GLES 2.0 tests that require using an ES 3.0
context and matches native driver behaviour of returning a higher-than-
requested context version when it's backwards compatible.
BUG=angleproject:3425
BUG=angleproject:3300
BUG=angleproject:3715
BUG=angleproject:3243
BUG=angleproject:3240
BUG=angleproject:3716
Change-Id: I03dfd56deb6191c3363808717e0eea6fdcf5f3ac
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1709111
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
|
|
6a02f06d
|
2019-07-18T16:27:14
|
|
Implement EGL_ANGLE_create_context_backwards_compatible
This extension allows the user to specify if ANGLE should create a
context of the exact requested version or a higher version context that
is backwards compatible.
BUG=angleproject:3425
Change-Id: I7d0b75cdd7e34a2fc888aa238e1eeb67af82ae0d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1601560
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
|