|
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>
|
|
d2c01d2c
|
2021-09-17T12:57:14
|
|
GL: Allow selecting virtualization groups at context creation
Rewrite EGL_ANGLE_platform_angle_context_virtualization to
EGL_ANGLE_context_virtualization, changing the context virtualization
parameter to an identifier for what virtualization group the frontend
context should be added to.
This allows ANGLE's GL backend to be used by multiple threads if the
user creates contexts with different virtualization groups.
Bug: angleproject:6406
Change-Id: I7414d4705ce10bdf63a9b824043d5dd040dad875
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3169193
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
|
|
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>
|
|
460618ad
|
2021-08-20T18:34:10
|
|
Refactor EGLMultiThreadSteps.h -> MultiThreadSteps.h
The class ThreadSynchronization is very useful when synchronizing
multiple threads in ANGLE tests, so it's being moved from
egl_tests/EGLMultiThreadSteps.h to test_utils/MultiThreadSteps.h.
Bug: angleproject:5971
Change-Id: I5df469aa68b79cf72d95e0276f42ab33a091314e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3111887
Reviewed-by: Ian Elliott <ianelliott@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Tim Van Patten <timvp@google.com>
|
|
fdba40fe
|
2021-03-31T12:52:00
|
|
Reland "Fix multithreaded crash on draw commands on D3D11 backend."
This is a reland of 8b9889bf62272fea2495331b622bde1f7c781bd0
The previous CL relied on a define which now only exists in
a specific gn configuration. This reland removes D3D11 as a
multithread-supported platform in the test configuration.
Original change's description:
> Fix multithreaded crash on draw commands on D3D11 backend.
>
> A crash can occur if thread A is executing eglDestroyContext while
> thread B issues a draw call, if the threads are interleaved in such a
> manner that a makeCurrent occurs without triggering a change to the
> global context and a dirtyAllState call. We handle that case by
> explicitly making current the proper contexts in the eglDestroyContext
> call.
>
> A test has been added that triggers a crash without this fix when
> running on the D3D11 backend. In addition, all of MultithreadingTest
> is enabled for the D3D11 backend.
>
> Test: Ran MultithreadingTest. Test exhibits a crash before this
> change, and does not after this change. Also ran:
> dEQP-EGL.functional.sharing.gles2.multithread.*
> dEQP-EGL.functional.multithread.*
>
> Bug: b/183756357
> Change-Id: Ic6f76a062868b2f3b4e60d29dc087ec180bfb7cd
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2798591
> Reviewed-by: Geoff Lang <geofflang@chromium.org>
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
> Commit-Queue: Doug Horn <doughorn@google.com>
Bug: b/183756357
Change-Id: I5be9a011ea99a69730eddc9e4da23bcf92ed3bf2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2815243
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Doug Horn <doughorn@google.com>
|
|
fc189386
|
2021-04-08T21:51:46
|
|
Revert "Fix multithreaded crash on draw commands on D3D11 backend."
This reverts commit 8b9889bf62272fea2495331b622bde1f7c781bd0.
Reason for revert: Breaks CI
Original change's description:
> Fix multithreaded crash on draw commands on D3D11 backend.
>
> A crash can occur if thread A is executing eglDestroyContext while
> thread B issues a draw call, if the threads are interleaved in such a
> manner that a makeCurrent occurs without triggering a change to the
> global context and a dirtyAllState call. We handle that case by
> explicitly making current the proper contexts in the eglDestroyContext
> call.
>
> A test has been added that triggers a crash without this fix when
> running on the D3D11 backend. In addition, all of MultithreadingTest
> is enabled for the D3D11 backend.
>
> Test: Ran MultithreadingTest. Test exhibits a crash before this
> change, and does not after this change. Also ran:
> dEQP-EGL.functional.sharing.gles2.multithread.*
> dEQP-EGL.functional.multithread.*
>
> Bug: b/183756357
> Change-Id: Ic6f76a062868b2f3b4e60d29dc087ec180bfb7cd
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2798591
> Reviewed-by: Geoff Lang <geofflang@chromium.org>
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
> Commit-Queue: Doug Horn <doughorn@google.com>
Bug: b/183756357
Change-Id: I2e9d6385576330f84623d7dafbf690642fcb441f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2815242
Commit-Queue: Doug Horn <doughorn@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
|
|
8b9889bf
|
2021-03-31T12:52:00
|
|
Fix multithreaded crash on draw commands on D3D11 backend.
A crash can occur if thread A is executing eglDestroyContext while
thread B issues a draw call, if the threads are interleaved in such a
manner that a makeCurrent occurs without triggering a change to the
global context and a dirtyAllState call. We handle that case by
explicitly making current the proper contexts in the eglDestroyContext
call.
A test has been added that triggers a crash without this fix when
running on the D3D11 backend. In addition, all of MultithreadingTest
is enabled for the D3D11 backend.
Test: Ran MultithreadingTest. Test exhibits a crash before this
change, and does not after this change. Also ran:
dEQP-EGL.functional.sharing.gles2.multithread.*
dEQP-EGL.functional.multithread.*
Bug: b/183756357
Change-Id: Ic6f76a062868b2f3b4e60d29dc087ec180bfb7cd
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2798591
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Doug Horn <doughorn@google.com>
|
|
c4b1f366
|
2021-03-22T17:56:54
|
|
Fix copyright dates of new test files per Shabi
Bug: b/181711029
Change-Id: Ie619ba90f699dd8234cf185198cb6eeac9142758
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2780560
Reviewed-by: Ian Elliott <ianelliott@google.com>
Commit-Queue: Ian Elliott <ianelliott@google.com>
|
|
90cf278c
|
2021-03-19T16:17:43
|
|
Add multi-thread/context test for compute shaders
The "Ragnarok M: Eternal Love" game uncovered a bug where 2 contexts
shared a VkCommandBuffer. The one context was used by one thread for
rendering, and the other context/thread dispatched compute shaders.
When the rendering thread destroyed a VkCommandBuffer, future compute
dispatches crashed because the new VkCommandBuffer didn't have a
compute pipeline bound.
Bug: b/181711029
Change-Id: I8bc85150c1c6202e02feb84a7ccc0ad7b9c39258
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2770681
Commit-Queue: Ian Elliott <ianelliott@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
|