src/tests/egl_tests/EGLContextSharingTest.cpp


Log

Author Commit Date CI Message
Peng Huang a8e98a23 2021-07-10T15:25:20 Fix gl::Context::unMakeCurrent crashes The crash is because Display::makeCurrent() may fail, in that case, egl_stubs.cpp will not update the current context in global_state and Thread accordingly. And then Context::refCount could be reach 0, and be released, however egl_stubs.cpp still thinks the context is current, and then user-after-free happens. This CL fixes the problem by updating current context of Thread in Display::makeCurrent, and reading the current context of Thread in egl_stubs.cpp and setting it to global_state. Bug: chromium:1171371 Change-Id: Ifc5fffb0e4902c9c72514839d03e5783d50fe283 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3017210 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org>
Ian Elliott 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>
Yuly Novikov c03a4235 2021-02-20T16:14:37 Suppress UNINSTANTIATED_PARAMETERIZED_TEST failures on Nexus 5X GTest complains that we don't run some tests on GLES backend. Bug: chromium:1180570 Change-Id: I9427ac25c3b6f06f3c042caa3c0afc7000cf1599 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2710783 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Tim Van Patten 909ea88b 2020-11-20T13:07:53 Reland "Vulkan: Ignore glFlush to reduce vkQueueSubmits in Asphalt 9" This is a reland of 5cf7472dd161bbda329dfc5e4e65bb6ce0c06fbd The ShareGroupVk::mResourceUseLists was not being cleared each call to RendererVk::submitFrame(), so it was growing indefinitely. Each vk::ResourceUseList within it was cleared, so it was holding an essentially "infinite" list of empty lists, but that caused the loop in RendererVk::submitFrame() to take more and more time until the tests timed out. The fix is to do 'resourceUseLists.clear()' once the loop to release all resources has completed, like releaseResourceUsesAndUpdateSerials() does for each individual list. Additionally, ASSERTs are added to guarantee that the lists are empty when the ContextVk and ShareGroupVk are destroyed. Original change's description: > Vulkan: Ignore glFlush to reduce vkQueueSubmits in Asphalt 9 > > Multithreaded apps can use the following pattern: > > glDrawElements() > glFenceSync() > glFlush() > glWaitSync() > > This currently results in a vkQueueSubmit for every glFlush() to ensure > that the work has landed in the command queue in the correct order. > However, ANGLE can instead avoid the vkQueueSubmit during the glFlush() > in this situation by instead flushing the ContextVk's commands and > ending the render pass to ensure the commands are submitted in the > correct order to the renderer. This improves performance for Asphalt 9 > by reducing frame times from 150-200msec to 35-55msec. > > Specifically, ANGLE will call flushCommandsAndEndRenderPass() when > there is a sync object pending a flush or if the ContextVk is currently > shared. > > Additionally, on all devices except Qualcomm, ANGLE can ignore all other > glFlush() calls entirely and return immediately. For Qualcomm devices, > ANGLE is still required to perform a full flush (resulting in a > vkQueueSubmit), since ignoring the glFlush() reduces the Manhattan 3.0 > offscreen score by ~3%. > > Bug: angleproject:5306 > Bug: angleproject:5425 > Change-Id: I9d747caf5bf306166be0fec630a78caf41208c27 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2552718 > Commit-Queue: Tim Van Patten <timvp@google.com> > Reviewed-by: Charlie Lao <cclao@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> Bug: angleproject:5306 Bug: angleproject:5425 Bug: angleproject:5470 Change-Id: I14ee424d032f22e5285d67accbec078ad1955dd0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2595811 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez a19bd601 2020-12-16T13:04:38 Revert "Vulkan: Ignore glFlush to reduce vkQueueSubmits in Asphalt 9" This reverts commit 5cf7472dd161bbda329dfc5e4e65bb6ce0c06fbd. Reason for revert: causes timeouts, see anglebug.com/5470 Original change's description: > Vulkan: Ignore glFlush to reduce vkQueueSubmits in Asphalt 9 > > Multithreaded apps can use the following pattern: > > glDrawElements() > glFenceSync() > glFlush() > glWaitSync() > > This currently results in a vkQueueSubmit for every glFlush() to ensure > that the work has landed in the command queue in the correct order. > However, ANGLE can instead avoid the vkQueueSubmit during the glFlush() > in this situation by instead flushing the ContextVk's commands and > ending the render pass to ensure the commands are submitted in the > correct order to the renderer. This improves performance for Asphalt 9 > by reducing frame times from 150-200msec to 35-55msec. > > Specifically, ANGLE will call flushCommandsAndEndRenderPass() when > there is a sync object pending a flush or if the ContextVk is currently > shared. > > Additionally, on all devices except Qualcomm, ANGLE can ignore all other > glFlush() calls entirely and return immediately. For Qualcomm devices, > ANGLE is still required to perform a full flush (resulting in a > vkQueueSubmit), since ignoring the glFlush() reduces the Manhattan 3.0 > offscreen score by ~3%. > > Bug: angleproject:5306 > Bug: angleproject:5425 > Change-Id: I9d747caf5bf306166be0fec630a78caf41208c27 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2552718 > Commit-Queue: Tim Van Patten <timvp@google.com> > Reviewed-by: Charlie Lao <cclao@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=timvp@google.com,jmadill@chromium.org,cclao@google.com Change-Id: I9886bf901a835d408b6a4b8be7ea408fa2121be0 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:5306 Bug: angleproject:5425 Bug: angleproject:5470 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2595032 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Tim Van Patten 5cf7472d 2020-11-20T13:07:53 Vulkan: Ignore glFlush to reduce vkQueueSubmits in Asphalt 9 Multithreaded apps can use the following pattern: glDrawElements() glFenceSync() glFlush() glWaitSync() This currently results in a vkQueueSubmit for every glFlush() to ensure that the work has landed in the command queue in the correct order. However, ANGLE can instead avoid the vkQueueSubmit during the glFlush() in this situation by instead flushing the ContextVk's commands and ending the render pass to ensure the commands are submitted in the correct order to the renderer. This improves performance for Asphalt 9 by reducing frame times from 150-200msec to 35-55msec. Specifically, ANGLE will call flushCommandsAndEndRenderPass() when there is a sync object pending a flush or if the ContextVk is currently shared. Additionally, on all devices except Qualcomm, ANGLE can ignore all other glFlush() calls entirely and return immediately. For Qualcomm devices, ANGLE is still required to perform a full flush (resulting in a vkQueueSubmit), since ignoring the glFlush() reduces the Manhattan 3.0 offscreen score by ~3%. Bug: angleproject:5306 Bug: angleproject:5425 Change-Id: I9d747caf5bf306166be0fec630a78caf41208c27 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2552718 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Ian Elliott 09924221 2020-08-24T17:17:17 Convert the EGL end2end tests to use RAII types/macros These tests are frequently cloned to make new tests, and so it's good to do a more-global refactor so that these and future tests will use RAII. Bug: angleproject:4947 Change-Id: I2973e70ee075629965b18c685793975537e96b6c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2372627 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Jonah Ryan-Davis f9de2e20 2020-08-04T11:53:05 Enable required extensions for Chromium to use the Metal backend. This includes: EGL_ANGLE_display_texture_share_group EGL_ANGLE_display_semaphore_share_group EGL_ANGLE_robust_resource_initialization GL_EXT_debug_marker Bug: angleproject:4847 Bug: angleproject:4930 Bug: angleproject:4929 Bug: chromium:1112800 Bug: angleproject:4946 Change-Id: Ibacb6badf9f784dae3ca42514142ef13ee7297b8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2332863 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Manh Nguyen 3688cb36 2020-06-28T15:28:10 Fix bugs in angle_end2end_tests and frame capture 1. CaptureGetShaderInfoLog_infoLog method should not require shader object to be compiled 2. glCompressedTexImage3D's parameter locations are off by 1 3. EGLContextSharingTest.DisplayShareGroupObjectSharing test should not delete buffers it has no access to since it will crash when running capture replay Bug: angleproject:4801 Change-Id: I0d407cdb44eb41eea4209eebab0996d3dd8ae5f5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2272862 Commit-Queue: Manh Nguyen <nguyenmh@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill 25097b6c 2020-02-19T08:07:23 Vulkan: Lift failing test suppression. EGLContextSharingTest.DeleteReaderOfSharedTexture/ES2_Vulkan Passes with the new command graph linearization. Bug: angleproject:4130 Change-Id: Ic7233696d2c06303ddf46947610b793a1a9e8a65 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2063041 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 745999a9 2019-11-19T12:59:02 Add test for multithreaded shared-context resource The test does this: 1. Context 1: Read Texture 1 and draw into Framebuffer 1 2. Context 2: Read Texture 1 and draw into Framebuffer 2 3. Context 1: Delete Framebuffer 1 4. Context 1: Flush 5. Context 2: Modify Texture 1 Issue is Texture 1's mCurrentReadingNodes contains one node from each context's command graph, one of which is deleted at step 4. At step 5, a dependency is added from both nodes (one already deleted) to a new node, causing use-after-free. Bug: angleproject:4130 Change-Id: I06720aec20d0b49114937f1cd9b193a4f1df9d8d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1924790 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 1efcbdb6 2019-10-22T12:32:04 Vulkan: Fix sampler object lifetime. Using the same scheme as we do for VkImageViews we can track VkSampler lifetime using SharedResourceUse. This fixes the race condition that could occur when samplers are deleted in one Context while being used in another. This fixes the last known resource lifetime issue. The multithreading tests should now pass without validation errors. Also adds regression tests to angle_end2end_tests. Bug: angleproject:2464 Change-Id: I9dbed5062a0863b240ddf1a9b5d28560334934de Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1869548 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
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 5cbaa3f8 2019-05-07T15:49:22 Don't inherit ANGLETest SetUp and TearDown. Instead of inheriting from testing::Test's SetUp and TearDown we add new methods 'testSetUp' and 'testTearDown'. This helps prevent a common error of forgetting to call the base class method. Also add a check in the ANGLETest destructor that SetUp and TearDown have been called. Bug: angleproject:3393 Change-Id: Iab211305cc06ffea9ca649e864ddc9b180f2cba0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1593960 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill b8149075 2019-04-30T16:14:44 Clean up ANGLE test extension functions. None of these functions needed to be member functions. Also make the naming more consistent. Bug: angleproject:3393 Change-Id: I7aafe2269a48af703a87bd9a8cf4cfab9e177dd3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1574673 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill ba319ba3 2018-12-29T10:29:33 Re-land "Load entry points dynamically in tests and samples." Fixes the Android/ChromeOS/Fuchsia builds by using consistent EGL headers. This CL adds a dynamic loader generator based on XML files. It also refactors the entry point generation script to move the XML parsing into a helper class. Additionally this includes a new GLES 1.0 base header. The new header allows for function pointer types and hiding prototypes. All tests and samples now load ANGLE dynamically. In the future this will be extended to load entry points from the driver directly when possible. This will allow us to perform more accurate A/B testing. The new build configuration leads to some tests having more warnings applied. The CL includes fixes for the new warnings. Bug: angleproject:2995 Change-Id: I5a8772f41a0f89570b3736b785f44b7de1539b57 Reviewed-on: https://chromium-review.googlesource.com/c/1392382 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuly Novikov 9f088621 2018-12-29T20:46:15 Revert "Load entry points dynamically in tests and samples." This reverts commit 03923558a7103827ffec6a4d2a1453ed91f01c6f. Reason for revert: fails compilation on Android, ChromeOS and Fuchsia during roll https://chromium-review.googlesource.com/c/chromium/src/+/1392624 Original change's description: > Load entry points dynamically in tests and samples. > > This CL adds a dynamic loader generator based on XML files. It also > refactors the entry point generation script to move the XML parsing > into a helper class. > > Additionally this includes a new GLES 1.0 base header. The new > header allows for function pointer types and hiding prototypes. > > All tests and samples now load ANGLE dynamically. In the future this > will be extended to load entry points from the driver directly when > possible. This will allow us to perform more accurate A/B testing. > > The new build configuration leads to some tests having more warnings > applied. The CL includes fixes for the new warnings. > > Bug: angleproject:2995 > Change-Id: I6726d4163f7a6e54d2482f094c0a952f59702a05 > Reviewed-on: https://chromium-review.googlesource.com/c/1359516 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> TBR=ynovikov@chromium.org,jmadill@chromium.org,syoussefi@chromium.org Change-Id: I902bec2d733c2b879be29c02ab52a0b7d4eaa077 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2995 Reviewed-on: https://chromium-review.googlesource.com/c/1392381 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 03923558 2018-12-29T10:29:33 Load entry points dynamically in tests and samples. This CL adds a dynamic loader generator based on XML files. It also refactors the entry point generation script to move the XML parsing into a helper class. Additionally this includes a new GLES 1.0 base header. The new header allows for function pointer types and hiding prototypes. All tests and samples now load ANGLE dynamically. In the future this will be extended to load entry points from the driver directly when possible. This will allow us to perform more accurate A/B testing. The new build configuration leads to some tests having more warnings applied. The CL includes fixes for the new warnings. Bug: angleproject:2995 Change-Id: I6726d4163f7a6e54d2482f094c0a952f59702a05 Reviewed-on: https://chromium-review.googlesource.com/c/1359516 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 252ec919 2018-07-16T15:39:34 Vulkan: "Implement" EGL_ANGLE_display_texture_share_group BUG=angleproject:2724 Change-Id: I4a86c88ec8a1508a0961091ad6b4429dcd8775d4 Reviewed-on: https://chromium-review.googlesource.com/1138823 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill fe54834f 2017-06-19T11:13:24 Proliferate gl::Context. This enables a few small things: it will enable making the platform a property of the Display rather than a global. The same goes for the global logging annotator. Also it ensures all back-end implementations have access to the GL / EGL state when available. Also introduces a smart pointer helper class to angleutils for objects that prefer to be destroyed with a context (gl::Context/egl::Display) parameter. We were using std::unique_ptr in a few places that would not work well with these objects. BUG=angleproject:1156 Change-Id: I59e288a3d6f766ff8a0f4b48ff3a1fbf7489daba Reviewed-on: https://chromium-review.googlesource.com/529706 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 40dc8c10 2017-02-14T10:41:32 Release the global texture manager with the last referencing context. This ensures that when the global texture manager is released, there is a valid context. BUG=angleproject:1639 Change-Id: I1b75885e9dc02b607bb1a386de394f6087429f5d Reviewed-on: https://chromium-review.googlesource.com/442074 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang ce02f086 2017-02-06T16:46:21 Add an extension to share textures at the display level. BUG=angleproject:1639 Change-Id: If9140142ebce89f33921c13d9d212c17d1894162 Reviewed-on: https://chromium-review.googlesource.com/437618 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 901b379f 2016-05-26T09:20:40 Fix use-after-free when deleting share contexts. The pattern of gen context, share context, free context, then allocate a shared GL object in the second context would cause a use-after-free of the ContextImpl as a GLFactory. Fix this by passing the factory as a parameter to the resource manager allocation methods instead of storing the factory pointer. This allows the same ResourceManager to work with separate Context implementations, which will work with non-virtual contexts. BUG=612931 Change-Id: Ifceeb893bebd072f318963d935ff9d17181f5305 Reviewed-on: https://chromium-review.googlesource.com/347463 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>