src/libGLESv2


Log

Author Commit Date CI Message
Amirali Abdolrashidi 0b888d50 2024-06-13T11:32:53 Add KHR_blend_equation_advanced_coherent * Added this extension to registry_xml.py. Bug: angleproject:42262258 Change-Id: I2d69982b9ec876e3c21346039ed78aa21b1a1896 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5634379 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Geoff Lang 92148c2c 2024-06-17T11:13:46 GL: Implement GL_EXT_clear_texture. This extension is useful because it allows clearing textures without changing the framebuffer. Chrome uses this on Android when it's available. Bug: angleproject:347047859 Change-Id: I765d9991c4549b3655446d9f51847d1095792dbd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5631810 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi d193d51b 2024-06-17T22:46:08 Replace issue ids post migration to new issue tracker This change replaces anglebug.com/NNNN links. Bug: None Change-Id: I8ac3aec8d2a8a844b3d7b99fc0a6b2be8da31761 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5637912 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 2d8e15f8 2024-05-31T14:25:12 Add stubs for GL_QCOM_tiled_rendering Bug: angleproject:343900918 Change-Id: I77d742949565ebfecb5f4446db3510af4f94033c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5588629 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi 8042ebdc 2024-05-31T17:06:56 Add OES_tessellation_shader Bug: b/344030760 Change-Id: I49c5dd870a09cd6b43beea13c70b8c1a4266875b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5595610 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Amirali Abdolrashidi edaaacd9 2024-05-31T17:30:34 Add OES_gpu_shader5 Bug: b/344031022 Change-Id: Ib11b5835b566e299ce6a7a47a4e4a46bcfd670ad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5595608 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 147ba459 2024-05-30T00:00:00 Allow polygonMode* commands with active PLS Drive-by: * Test that polygonOffsetClampEXT is allowed when PLS is active. Fixed: angleproject:345253437 Change-Id: I5d9f60b3e70eaf8da19017a8b9d6c2592cb4f4f8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5601849 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 6968848e 2024-05-30T00:00:00 Remove PLS checks from GLES 1.x entry points Fixed: angleproject:345125742 Change-Id: If845ddb654221cfb88c3f69bb98e07dbee8b6b39 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5598770 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Roman Lavrov c8db5292 2024-05-31T19:35:32 Remove locks from most glUniform* calls Note: only the Vulkan backend claims to be thread safe. glUniform1i and glUniform1iv are kept locked as they might set samplers, which is more complicated. glUniformBlockBinding is a more complex state change with notifications. Other glUniform functions simply call setUniformImpl() or setUniformMatrixfv() in the vulkan backend, which as https://crrev.com/c/5588853 and https://crrev.com/c/5592968 show only update mDefaultUniformBlocks and mDefaultUniformBlocksDirty. This should be thread-safe as long as the application is not creating race conditions itself such as by changing the same object in parallel. This should yield a significant improvement in the driver_overhead_2 benchmark which is heavy on such calls. Bug: angleproject:8666 Bug: b/335295728 Change-Id: Iad1577b9ab2eb57b6a4599ec6d70fa90eb518e8d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5588385 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi ce6232fc 2024-05-21T11:15:51 Add KHR_robustness * From the spec, there are some differences between KHR_robustness and EXT_robustness (already in use). In this CL, the following are addressed: * Updating the EXT suffixes * Changing EXT to KHR for GLES * Removing EXT for GL * Adding GLGetnUniformuivKHR (no equivalent in EXT) * Added GL_KHR_robustness to the list of extensions. * The API implementations seem to be already in place. * Validation functions will be updated in a follow-up CL. Bug: angleproject:42262244 Change-Id: Ibbc1bc11ec08ac756f4a03d11f51ba1268d037a5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5555984 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 7ce42b42 2024-05-30T16:08:12 Skip Display::prepareForCall calls everywhere except Mac. Display::prepareForCall was added for CGL and EAGL backends which need to know when an EGL call on a new thread is about to happen. Making this virtual call on all EGL calls on all platforms adds overhead which we can avoid so compile out prepareForCall everywhere except Mac. Bug: angleproject:8434 Change-Id: I7b50463ed405a73eb993e18eb4f83434b4a4fd6e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5582015 Commit-Queue: Geoff Lang <geofflang@chromium.org> Auto-Submit: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 0e892a02 2024-05-30T14:07:47 EGL: Move egl surface timing calls into tail calls. eglGetCompositorTimingANDROID and eglGetFrameTimestampsANDROID can both take a lot of driver time to execute proportional to ANGLE's overhead. Bug: angleproject:42266858 Change-Id: I9b991f74a261b45aeb2aaf133fca7d22cabc41f8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5580877 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi f4140c76 2024-05-10T16:56:13 Remove share group lock from glBindBuffer This is a very hot function. Removing the share group lock from this function improves the driver_overhead_2 execution time by ~1ms on Pixel 6. Bug: angleproject:8667 Change-Id: I9ea04f48aa1d2d0efec21407374393e88a1316e3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5533081 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Geoff Lang a70ef7fc 2024-04-25T14:19:50 Add EGL_ANGLE_no_error for disabling EGL validation. Chrome makes many small EGL calls that can have proportionally expensive validation. Bug: angleproject:8434 Change-Id: I4f4d0e6eff64839f76a0f7bf48e5c94b8df9d809 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5491459 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 071e1e83 2024-05-08T10:33:49 EGL: eglCreateSyncKHR uses a return value for the tail call eglCreateSyncKHR was duplicated in two lists for using a tail call and needing a return value tail call. Bug: angleproject:8434, chromium:338902974 Change-Id: I9dffeaec3468e4ea3f5ed7d885e9ef418e8d8da5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5525854 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 038ad6c7 2024-04-23T13:23:04 EGL: Use unlocked tail calls for surface, sync and img calls EGL surface and sync calls can be expensive to do while holding the global lock on EGL. They are safe because the parameters are captured by value and the underlying EGL driver is also thread safe. EGL image creation also tends to be expensive and is called freqently by Chrome. Bug: angleproject:8434 Change-Id: I7e554fe2e3700d98469de267f7bbff1e96358c78 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5478229 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 884dc380 2024-04-24T16:46:01 EGL: Make eglGetCurrent(Context|Surface|Display) lockless. These functions access only egl::Thread state. Bug: angleproject:8434 Change-Id: I3dd6cd1f4fd145613f0be824e4f6e13815422997 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5485526 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi d9943e44 2024-04-09T23:53:48 Remove Program::syncState The last bit of responsibility still left in Program::syncState was to wait for post-link tasks for the sake of EGLBlobCacheTest tests. A new extension, GL_ANGLE_program_binary_readiness_query is created so that the wait can be done in the test itself. This extension is ultimately useful for applications as well, so they can avoid blocking the CPU by calling glGetProgramBinary prematurely. Bug: angleproject:8297 Change-Id: Ied6b755cb9b060198f82c7948bfd03441435a578 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5440302 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: mohan maiya <m.maiya@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Austin Annestrand 35c7e186 2024-04-03T14:31:59 CL: Introduce NDRange object/ops abstraction Create new FrontEnd type "NDRange" to encapsulate OpenCL's NDRange items. Update backend implementations to make use of this new object. Bug: angleproject:8650 Change-Id: I3c1549c50c85153b3ea77267e104eec04ba1bd93 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5421572 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Austin Annestrand <a.annestrand@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 318e5e02 2024-03-24T08:17:56 Vulkan: Update EGL_EXT_buffer_age implementation 1. Buffer age is always 1 when swap behavior is EGL_BUFFER_PRESERVED. 2. WindowSurfaceVk::getBufferAge no longer acquires a swapchain image. See commit: b46cf6989f6fe8db5f0759001f633681a96fadde 3. It is valid to pass attributes of eglQuerySurface API to eglQuerySurface64KHR API 4. Add deadlock fix to eglQuerySurface64KHR Bug: angleproject:3529 Bug: angleproject:6851 Tests: EGLLockSurface3Test.QuerySurfaceAndQuerySurface64Parity* Tests: EGLBufferAgeTest.QueryBufferAge* Change-Id: Idf3c4fc08364f671fb02e99111be2beb7a1d9f3d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5389461 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Steven Noonan c55c8ad2 2024-03-05T15:42:28 extension XML cleanup Add a bunch of missing extensions, commands, enums, and aliases to the extension XML files. These were missing when I generated a GL loader from the XML. Additionally, removing the unimplemented ANGLE_timer_query specification. Bug: angleproject:8432 Change-Id: I55b7393a313070719200c150a91b1751206ca2cb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5347156 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Auto-Submit: Steven Noonan <steven@uplinklabs.net> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi f044aaf8 2024-03-02T00:51:33 Vulkan: Create instance/device without access to Display The feature overrides are now encapsulated in a struct, a reference to which is passed around until features are initialized. Additionally, some window system information needed to decide which extensions to use or workarounds to apply are passed around. This is a step towards decoupling RendererVk from egl::Display for direct use with OpenCL. Bug: angleproject:8564 Change-Id: Id6c5d1c3b38aafcd4397e54cc6cad32bf849eeda Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5335823 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Austin Annestrand 82ba79ff 2024-01-08T15:22:59 OpenCL: Update CLtypes.h to cl_types.h This change/enhancement is to keep codebase more consistent since vulkan backend versions of this header use lowercase-snake_case for file name. Bug: angleproject:8501 Change-Id: I223712c72db06425d192ddfe7300e5475c341e38 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5233364 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Austin Annestrand f8c06f10 2023-11-30T17:45:35 OpenCL: Add types to cl_mem origin and region Now using cl::MemOffset and cl::Coordinate. Bug: angleproject:8439 Change-Id: Id775fe78467d3b56d2a7cc87f793221ab5e04bc5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5078244 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya d0f5a662 2024-01-25T13:01:24 Bugfix in entry points for QCOM foveated extensions Change framebuffer and texture parameter type from GLuint to FramebufferID and TextureID types respectively. Bug: angleproject:8484 Change-Id: I822897b268f2dab56cee3f5776c07ad46a6dd052 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5238212 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya d093c3d3 2024-01-17T11:33:46 Add entry points for QCOM foveated extensions Add entry points for GL_QCOM_framebuffer_foveated and GL_QCOM_texture_foveated extensions Bug: angleproject:8484 Change-Id: I59053f9be76fbb8eaed344aa460ecb1e178ce7db Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5206990 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya c2ad86bc 2024-01-09T15:39:26 eglGetError is now a lockless entrypoint eglGetError returns last recorded error in a thread, there is no need to lock the global mutex. Bug: b/318921454 Change-Id: I9e5192becc67dc81b54abfb63d2b32283ebc69d8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5181881 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Austin Annestrand c1aaa313 2023-11-29T18:54:06 OpenCL: Updated autogen script for updated CL error handling Part 3 of Issue 8435: Updated entrypoint autogen script for CL to: - Remove errorCode param for all CL APIs returning CL objects - Init CL error TLS object for all CL APIs prior to calling ANGLE FE Bug: angleproject:8435 Change-Id: I4f1784c0bda393d5f3126f205f17ec24662424ad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5075774 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Austin Annestrand ed7c31c7 2023-11-29T18:31:43 OpenCL: Replace error-passing APIs to use angle::Result Part 2 of Issue 8435: This part replaces existing error handling for all CL APIs that return CL objects to now use "angle::Result". Bug: angleproject:8435 Change-Id: I75e41c7cbb06220cabec7cc9f9cb5107a3b6bd6d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5075773 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Austin Annestrand a9512a9f 2023-11-29T14:56:29 OpenCL: Replace error-return APIs to use angle::Result The motivation of converting existing CL APIs using "cl_int errorCode" to now use "angle::Result" is for better interop with internal ANGLE plumbing/abstractions. To facilitate this, we now make use of a TLS errorCode object that we set internally and read from entrypoint/stubs layer so that we can propagate back to user. Bug: angleproject:8435 Change-Id: I7c2a786019c33c56649be4b6e8b61bc318497bb1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5075772 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi b46cf698 2023-11-30T11:00:18 Vulkan: Fix Android deadlock with querying buffer age Similar to eglSwapBuffers, eglQuerySurface with EGL_BUFFER_AGE_EXT can cause a call to vkAcquireNextImageKHR. Bug: angleproject:6851 Bug: b/313975825 Change-Id: If3f0521219cab9aba2aeb2b70958bf0f197bc96a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5077406 Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi ade3dacd 2023-11-06T21:56:41 Do compile/link unlocked if not threaded (but thread-safe) If GL_KHR_parallel_shader_compile is not supported, or it is not used to do threaded compilation and link, this change lets the compile and link jobs be done after releasing the share group lock. With multithreaded/multi-context applications, this allows the other context (typically the main context) to make progress in the meantime. A typical scenario where this optimization matters is games seamlessly loading a new area of the game and performing compilation and link in a separate context. Before this change, the game would stutter as the compile/link jobs prevent the main thread from drawing anything. With this change, the hitching is removed. Bug: angleproject:8297 Change-Id: I702d84324a7442561b49677bf42c16d650304313 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5006640 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 5149d210 2023-10-02T22:27:11 Vulkan: Deduplicate sync's clientWait logic As a side effect, both GL_NV_fence's client wait and external fence client wait is also done in an unlocked tail call. Bug: angleproject:8340 Change-Id: Ia0b882cc67ecf7ac5b2a8f9dc9e721060cca3c9e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4908351 Reviewed-by: mohan maiya <m.maiya@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi d919870f 2023-09-14T16:00:07 Vulkan: Do host image copy without holding the share group lock When an application uploads texture data such as with `glTexSubImage2D`, the share group lock is being hold while the data is being copied. Without VK_EXT_host_image_copy, this is a copy to a staging buffer, which may itself be expensive. With VK_EXT_host_image_copy, the cost of the copy is higher and so the lock would be held for a longer duration. This is particularly harmful to applications that spawn a separate thread for texture uploads (as the main thread is unable to make GL calls). This change moves the actual copy call to the tail of the call after the share group lock has been released. As a result: - The upload thread may be a bit slower, but - The copy does not interfere with the main thread, and - The copy does not interfere with the GPU's rendering work. As a result, games that load content seamlessly during gameplay should experience less stutter during texture uploads. Bug: angleproject:8341 Change-Id: I818c4389d4bf828847578da89414623e4b5e844e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4864290 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov 4b724130 2023-06-27T18:08:27 Rename SharedContexMutex into ContexMutex Follow up after: Replace (Single/Shared)ContextMutex classed with ContextMutex Renamed build option: angle_enable_shared_context_mutex -> angle_enable_context_mutex Renamed because there is no more SharedContexMutex class and ContextMutex is now used for both Shared and not Shared Contexts. Bug: angleproject:8226 Change-Id: I68eea84aa59441d9c5b19870910b2bb499311e08 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4650350 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Igor Nazarov ca4dc52e 2023-06-22T15:20:12 Replace (Single/Shared)ContextMutex classed with ContextMutex This CL removes `SingleContextMutex` class and not 100% safe `Context::lockAndActivateSharedContextMutex()` method. `SharedContextMutex<>` was replaced with `ContextMutex` with static mutex type which is defined in "SharedContextMutex.h": - ContextMutexType = std::mutex Above refactoring also allows storing `State::mContext` by value, instead by pointer. Actual mutex is referenced by `ContextMutex::mRoot` member. This removes extra pointer indirection and slightly improves performance. If newly created Context uses shared textures/samplers, then it uses `Display::mManagersMutex` root as its root. Performance in Single/Shared cases now will be the same, and it should be slightly faster then old Shared case (because of the reduced complexity). Bug: angleproject:8226 Change-Id: I7ca4d9ea008c665cbea98ace1c6e7bbc544f54b5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4632729 Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov f1345d1c 2023-08-02T14:23:59 Call ReleaseThread() entry point from ThreadCleanupCallback Change relevant only for the Android platform. Fixes problems: 1. Current code calls `thread->setCurrent(nullptr)` in `Display::threadCleanup()` method, while not executing other code that will actually unmake Context from current. This will affect following EGL calls from the application's side in its own thread cleanup callback. For example, calls to `eglMakeCurrent()` (to unmake from current) or `eglReleaseThread()` will be no-op. This may lead to memory leak if context was previously marked for destruction. 2. The `Display::threadCleanup()` did not also clears the `CurrentValidContext`. This may cause crashes or other UB if an application will call some GLES API in its thread termination callback (for example `glFinish()`), if ANGLE already destroyed the context in its ThreadCleanupCallback (use after delete). 3. Context will remain current to a thread that terminated. Current implementation of GLES drivers on Mali/Adreno GPUs automatically unmade context from current, so the application may make this context current to some other thread. ANGLE should mimic this behavior to avoid possible bugs. All of the above problems may be fixed by simply calling from the ThreadCleanupCallback either: - MakeCurrent(t, d, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT) - ReleaseThread(t) This CL choose to call `ReleaseThread()` because this is the API that the application may call in its own thread cleanup callback. And if application's callback will be called later than ANGLE's callback, then application's `eglReleaseThread()` call we be a no-op. Even if the application does not have its own thread cleanup callback (like most of the applications), there is no harm to call `ReleaseThread()` anyway. The only difference with `MakeCurrent()` is that it will also cleanup invalid objects and some other memory depending on the backend. This CL naturally replaces existing logic with Display termination when there is no active threads thanks to the previous CL: "Perform Display terminate(InternalCleanup) from makeCurrent()". Bug: angleproject:6723 Bug: angleproject:8283 Test: angle_end2end_tests --gtest_filter=EGLContextSharingTest.ThreadCleanupCallback* Test: angle_end2end_tests --gtest_filter=EGLContextSharingTest.UnmakeFromCurrentOnThreadExit* Change-Id: I8c5b31f34f91c4bfdac165ac30c213ff5fef992e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4742383 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Yuxin Hu ffd6ec26 2023-09-07T15:39:19 Reland "Make egl surface uncurrent when being destroyed" This relands commit 497440cdcb7d2ee59bca612dd07fc13cf09a6a57. This is to workaround errors when app does below behaviors: 1) while there is a context still bound to the current rendering thread and the surface, call eglDestroySurface() 2) create a new surface eglCreateWindowSurface() 3) call eglMakeCurrent() with the surface created in step 2) 4) does work on the new surface The old surface won't be destroyed in step 1) because it was still bound by the context of the current rendering thread. When creating new surface on step 2), some hardware will return error code EGL_BAD_ALLOC, because the old egl surface is still associated with the native window. To workaround, when destroying surface, if the surface is still bound by the context of the current rendering thread, release the context and surface by passing EGL_NO_CONTEXT and EGL_NO_SURFACE to eglMakeCurrent(). The workaround is controlled by a frontend feature uncurrentEglSurfaceUponSurfaceDestroy. This feature is only enabled on vulkan backends. Bug: b/292285899 Change-Id: Id4c47f1b20e0f90d1013a68893fd70e917c030e2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4867066 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Yuxin Hu 8a7ad933 2023-09-13T15:11:46 Revert "Make egl surface uncurrent when being destroyed" This reverts commit 497440cdcb7d2ee59bca612dd07fc13cf09a6a57. Reason for revert: this caused chromium webview tests failures: https://chromium-review.googlesource.com/c/chromium/src/+/4860891. Original change's description: > Make egl surface uncurrent when being destroyed > > This is to workaround errors when app does below behaviors: > > 1) while there is a context still bound to the current > rendering thread and the surface, call eglDestroySurface() > 2) create a new surface eglCreateWindowSurface() > 3) call eglMakeCurrent() with the surface created in step 2) > 4) does work on the new surface > > The old surface won't be destroyed in step 1) because > it was still bound by the context of the current rendering > thread. When creating new surface on step 2), some hardware > will return error code EGL_BAD_ALLOC, because the old egl > surface is still associated with the native window. > > To workaround, when destroying surface, if the surface > is still bound by the context of the current rendering > thread, release the context and surface by passing > EGL_NO_CONTEXT and EGL_NO_SURFACE to eglMakeCurrent(). > > The workaround is controlled by a frontend feature > uncurrentEglSurfaceUponSurfaceDestroy. This feature > is only enabled on vulkan and gl backends. > > Bug: b/292285899 > Change-Id: I872d2e116ba6860f58d1176f011a5ef7c5a5af4e > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4851255 > Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> > Reviewed-by: Charlie Lao <cclao@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Yuxin Hu <yuxinhu@google.com> Bug: b/292285899 Change-Id: I760054d856294e6691e79e165fd73ce9e560621f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4862958 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Yuxin Hu 497440cd 2023-09-07T15:39:19 Make egl surface uncurrent when being destroyed This is to workaround errors when app does below behaviors: 1) while there is a context still bound to the current rendering thread and the surface, call eglDestroySurface() 2) create a new surface eglCreateWindowSurface() 3) call eglMakeCurrent() with the surface created in step 2) 4) does work on the new surface The old surface won't be destroyed in step 1) because it was still bound by the context of the current rendering thread. When creating new surface on step 2), some hardware will return error code EGL_BAD_ALLOC, because the old egl surface is still associated with the native window. To workaround, when destroying surface, if the surface is still bound by the context of the current rendering thread, release the context and surface by passing EGL_NO_CONTEXT and EGL_NO_SURFACE to eglMakeCurrent(). The workaround is controlled by a frontend feature uncurrentEglSurfaceUponSurfaceDestroy. This feature is only enabled on vulkan and gl backends. Bug: b/292285899 Change-Id: I872d2e116ba6860f58d1176f011a5ef7c5a5af4e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4851255 Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Mohan Maiya ce263437 2023-09-11T12:25:28 Vulkan: Perform CPU wait in clientWait outside the global lock Leverage UnlockedTailCall and move the CPU side wait during a clientWait outside of the global mutex lock. Bug: angleproject:8340 Tests: FenceSyncTest.BasicOperations* Tests: EGLSyncTest.EglClientWaitSync* Change-Id: I8c05e62e74cc64d38bf8797d28faaf49135e71fc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4851649 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com>
Mohan Maiya 9740b01b 2023-09-08T16:30:08 Enhance UnlockedTailCall run method UnlockedTailCall::CallType is now std::function<void(void *)> This is in preparation for upcoming changes where unlocked tail calls need access to objects outside block and namespace scope. Bug: angleproject:8340 Tests: UnlockedTailCall* Change-Id: Ida6822b701c5c11ce4b8f6e3aae53108755e2cad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4852021 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Phan Quang Minh e408fc53 2023-08-09T06:25:38 Add support for EGL_MESA_platfrom_surfaceless extension This adds support for the EGL_PLATFORM_SURFACELESS_MESA platform type to allow applications to obtain an EGLDisplay that's independent of any native windowing systems. This will be used in Ozone/Wayland to create surfaceless EGLDisplays. Bug: angleproject:8331 Change-Id: If2ae7a811cfa63ab9f49d54d78f5a3782c8c2fed Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4749337 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 6c1bab07 2023-08-02T12:25:51 Add surface to eglAcquireExternalContextANGLE Bug: angleproject:5509 Change-Id: I51284ae4dc865dc31d1c5540c24e1e0abb95fe0f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4743719 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 2d5fb09d 2023-07-22T22:34:20 Stubs for EGL_ANGLE_external_context_and_surface Bug: angleproject:5509 Change-Id: I8e2395784abcd2b4e3e1f888e70a879ef49287bc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4706026 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 74cf6a3a 2023-07-12T14:44:17 Ensure lockless entry point validations only access private data Bug: angleproject:8224 Change-Id: I19e867923b088879f9f37d0a3b4ff8b681470be0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4678352 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi c9a42949 2023-07-12T15:07:17 Make validation make straight calls to ErrorSet ... and avoid going through the context (just to get a const cast). This change is also in preparation for an follow up where some entry points directly use ErrorSet and don't access context at all. Bug: angleproject:8224 Change-Id: Idef0a88d9407870e7a84b4fe6967fbff175c269b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4678350 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 9962f078 2023-07-11T15:39:50 Pass only context-private state to private entry points This change ensures that the implementation for these entry points cannot access anything other than context-private state. Bug: angleproject:8224 Change-Id: I988672b138d861db25e91d71ab8c34baa4e8ebee Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4678783 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 40111c68 2023-07-11T14:21:21 Rename context-local to context-private state Bug: angleproject:8224 Change-Id: I1bb39475043f8fb14d683d11a038b4850692a8c6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4678781 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 94ceedb7 2023-07-10T00:00:00 Add GL_EXT_texture_compression_astc_decode_mode stubs Bug: angleproject:8254 Change-Id: I2a839139b5738710e32842b04db35eab8fb04687 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4679683 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 51320fab 2023-07-06T16:01:58 Make most GLES1 entry points lockless These entry points only set context-local state and thus don't require locking. Bug: angleproject:8224 Change-Id: I80223340348d62a56109324ab3e4f935e53419b3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4670407 Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi eb205e68 2023-07-06T13:34:28 Make the glPatchParameteri entry point lockless This entry points only sets context-local state and thus doesn't require locking. Bug: angleproject:8224 Change-Id: I17975a97aa7f68c3ddf2ef78069b8f519fdc4c1a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4670405 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Igor Nazarov <i.nazarov@samsung.com>
Shahbaz Youssefi 7e0fb7e4 2023-07-05T17:20:23 Make glIsEnabled* entry points lockless These entry points only set context-local state and thus don't require locking. Bug: angleproject:8224 Change-Id: I6fe40bf4381e1d42248358f773ec9d5675883ada Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4666356 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 72c26926 2023-07-05T16:31:23 Make pack/unpack and hint entry points lockless These entry points only set context-local state and thus don't require locking. Bug: angleproject:8224 Change-Id: I5694d319df61a7a9df1766cf1f723b9a05208209 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4666352 Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 208dfe28 2023-07-05T15:18:57 Make glStencil* entry points lockless These entry points only set context-local state and thus don't require locking. Bug: angleproject:8224 Change-Id: I612d8219ba038464173490b2c261e9e7b229c83f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4661702 Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi c3c2f450 2023-07-05T14:52:10 Make glBlend* entry points lockless These entry points only set context-local state and thus don't require locking. Bug: angleproject:8224 Change-Id: Ie811c35ae7b65106db9af9f7531ad3a5e0bd4f8c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4661701 Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 44395930 2023-07-05T11:59:23 Make various state setting entry points lockless These entry points only set context-local state and thus don't require locking. Bug: angleproject:8224 Change-Id: I428c23cc862e9356d571bc085b5df0bf48017175 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4661700 Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 9daac2b7 2023-07-05T11:36:46 Make glEnable/Disable entry points lockless These entry points only set context-local state and thus don't require locking. Bug: angleproject:8224 Change-Id: Id4eab729115bd75f82e1ec7a27355c821a7c4320 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4661697 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi be41fe29 2023-07-04T15:35:46 Make glColor/DepthMask entry points lockless These entry points only set state that is entirely accessed by the owning context (context-local) and thus don't require locking. glColorMask* functions also affect the cached context state (in particular draw validity), so the relevant cached state is also modified to support being locklessly modified. Bug: angleproject:8224 Change-Id: I221b4efa25fc1c11419d1ac942f1c37e59ec92c0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4658173 Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 4db13081 2023-07-04T14:40:31 Make glClearColor/Depth/Stencil entry points lockless These entry points only set state that is entirely accessed by the owning context and thus don't require locking. Bug: angleproject:8224 Change-Id: I6cddee865ffd38e228f8f87dd14adffb916e0fed Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4658172 Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
L. E. Segovia ed391dae 2022-03-25T16:36:39 Replace `extern thread_local` to avoid GCC < 9.1 bug GCC generates broken code for mingw-w64 target when accessing `extern thread_local` variables from another compilation unit. See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104862 See: https://invent.kde.org/graphics/krita/-/blob/master/3rdparty/ext_googleangle/02-patches_krita/0017-Replace-extern-thread_local-to-avoid-GCC-mingw-w64-b.patch Co-authored-by: Alvin Wong <alvinhochun@gmail.com> Bug: None Change-Id: Ief0036054e644d40b8b0e86ed990280e566da2a9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4637587 Auto-Submit: L. E. Segovia <amy@amyspark.me> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov 3545ae0c 2023-06-09T16:11:47 Add isContextMutexStateConsistent() ASSERT Added `gl::Context::isContextMutexStateConsistent()` method. This method is primarily used to check if "SharedContextMutex" activation worked successfully. It is automatically called in the updated `ScopedContextMutexLock` before unlocking. This is to catch possible errors using ASSERT during normal ANGLE operation in applications and tests. The `ScopedContextMutexLock` is now also used instead of the `std::lock_guard<egl::ContextMutex>` in the `SCOPED_SHARE_CONTEXT_LOCK`. No performance regression observed. Important note: `lockAndActivateSharedContextMutex()` is NOT 100% safe regardless of the `kActivationDelayMicro` value, so `ASSERT` may still fail. However, failure does not necessary mean that there will be an undefined behavior, it means that UB might happen. Bug: angleproject:6957 Bug: chromium:1336126 Change-Id: Iee7357fede0d37fa315fe2cc7d27a4e30a304194 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4610227 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Igor Nazarov 36c3e0f5 2023-01-17T17:42:59 Implement "Shared Context Mutex" functionality. Existing implementation uses single `GlobalMutex` for - EGL calls - GL calls for Contexts with concurrent access. This CL introduces abstract `egl::ContextMutex` with two implementations: - SingleContextMutex; - SharedContextMutex<Mutex>; Note: `std::mutex` is used in this commit. It is very easy to change mutex type either at compile-time or at run-time (single type per Display). When Context: - is not Shared; - does not use `EGLImage`s; - does not use EGL_DISPLAY_TEXTURE_SHARE_GROUP_ANGLE - does not use EGL_DISPLAY_SEMAPHORE_SHARE_GROUP_ANGLE then it will be using `SingleContextMutex` with minimal overhead. Before such Context is used as `shareContext` or uses `EGLImage` its mutex replaced by `SharedContextMutex<Mutex>`. The `GlobalMutex` is only used for EGL calls, while `egl::ContextMutex` implementations for GL calls. Because some EGL calls use Context, explicit `egl::ContextMutex` lock is required. This is implemented by generating "egl_context_mutex_autogen.h" header, and insertion of `ANGLE_EGL_SCOPED_CONTEXT_LOCK()` macro before `ANGLE_EGL_VALIDATE()` in each EGL entry point. Implementation in "egl_context_lock_impl.h" returns lock for required APIs. Special cases of `egl::ContextMutex` lock handled separately. `std::unique_lock<>` is not used for performance reasons. `egl::ContextMutex` explicitly locked when capturing EGL calls. Fixes EGLImage problem: https://chromium.googlesource.com/angle/angle/+/e18240d136d15e5cdfa4fa4a6355ca21c8d807b6 Mark contexts as shared when importing EGL images. Details: - EGLImage inherits Context's mutex when created. Mutex is used when the EGLImage accessed or destroyed. - When EGLImage is used in Context with other `egl::ContextMutex`, two mutexes are merged into one. - After the mutex merge, Context Groups will remain separate, but will not be able to run in parallel. Fixes race when checking `context->isShared()` in the `SCOPED_SHARE_CONTEXT_LOCK()` macro. One Context may start executing GL call while not "Shared", but become "Shared" inside the call. New (second) "Shared" Context may immediately start using GL and potentially corrupt some "Shared" state. Possible performance benefit: allows parallel execution in some cases, when single `GlobalMutex` would block. Important note: Process of replacing the `SingleContextMutex` by `SharedContextMutex<Mutex>` is not 100% safe. This mean that original Context may still be using `SingleContextMutex` after activating `SharedContextMutex<Mutex>`. However, this was always the case before introduction of this CL. Old `Context::mShared` member update was not synchronized in any way at all. In other words, this solution does not 100% fix the original problem. For 100% safe solution `SingleContextMutex` should not be used (always pass `SharedContextMutex<Mutex>` to the `gl::Context` constructor). See `lockAndActivateSharedContextMutex()` for more details. CL adds new build option: angle_enable_shared_context_mutex = true Behavior with other build options: - When: `angle_enable_shared_context_mutex` is disabled or `angle_enable_share_context_lock` is disabled or `angle_force_context_check_every_call` is enabled, Contexts will always have `SingleContextMutex`, however it will be only used in special cases. `SCOPED_SHARE_CONTEXT_LOCK()` will use `GlobalMutex` when applicable. - Otherwise, `SCOPED_SHARE_CONTEXT_LOCK()` will use `egl::ContextMutex`. Some GFXBench "1080p Driver Overhead 2 Offscreen" performance numbers. Tested on S906B (Samsung Galaxy S22+) on old ANGLE base: https://chromium.googlesource.com/angle/angle/+/807c94ea85e046c6f279d081d99f0fb1bcf1191a Capture/Replay: Adjust tests do adhere to capture limits Each test result is an average frame number from 6 runs. SingleContextMutex 6579 ( +0.13%) (old) GetContextLock() (mShared is false) 6570 Forced `mShared = true` or NOT using `SingleContextMutex`. SharedContextMutex<std::mutex> FORCE 5061 (-22.97%) (old) GetContextLock() FORCE 4766 (-27.46%) Bug: angleproject:6957 Bug: chromium:1336126 Change-Id: Idcd919f9d4bf482b9ae489bd8b4415ec96048e32 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4374545 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Steven Noonan a01a566c 2023-06-09T00:31:06 extension xmls: fix incorrect use of <ptype> tags I was having trouble using some GL/EGL loader generators because of some errors in the XML definitions for ANGLE. The first major problem is the content of the <ptype> tags. Let's refer to the Khronos registry XML schema (which is annoyingly a PDF rather than an xsd that we can test against, though I don't know if an xsd would catch this anyway): https://raw.githubusercontent.com/KhronosGroup/OpenGL-Registry/master/xml/readme.pdf In section 12.4.2, "Contents of <param> tags" it states: The <ptype> tag is optional, and contains text which is a valid type name found in <type> tag, and indicates that this type must be previously defined for the definition of the command to succeed. Builtin C types, and any derived types which are expected to be found in other header files, should not be wrapped in <ptype> tags Note that the above is repeated for the contents of <proto> tags as well. The extension XML files currently have a bunch of <ptype> tags which don't meet the expectations described above. The correct transformation for them would be, for example: <ptype>GLfloat *</ptype> -> <ptype>GLfloat</ptype> * <ptype>void *</ptype> -> void * <ptype>const char *</ptype> -> const char * <ptype>EGLAttrib *</ptype> -> <ptype>EGLAttrib</ptype> * The next issue is that some tags have some typos, such as "<pytpe>" instead of "<ptype>". (Now *that* is something an .xsd would catch...) The last issue is the use of the typename "GLvoid" which is not as serious a problem. It is still defined in Khronos' gl.xml <types> block, but Khronos no longer uses it in their XML registries. The comment for the "GLvoid" type in their <types> block states: <type comment="Not an actual GL type, though used in headers in the past">typedef void <name>GLvoid</name>;</type> So we might as well replace those with just plain "void". Anyway, long story short: to apply these transformations, I used Perl regular expressions, and applied these expressions in order: - Fix the tag misspellings: s#<(/?)pytpe>#<\1ptype>#g - Move the const qualifiers (if present) and pointer asterisk(s) (if any) outside the <ptype> tag itself: s#<ptype>(const )?([A-Za-z0-9]+)[ ]?(\*\*?)</ptype> #\1<ptype>\2</ptype> \3#g - Replace "GLvoid", "char", and "void" inside ptype tags to normal C types outside tags: s#<ptype>(GLvoid|void|char)</ptype>#\1#g Bug: angleproject:8190 Change-Id: Ib0bea79fecb7e714910b6e92124bb9f52994d0fb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4603709 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Chris Dalton 7d4c6d1d 2023-05-09T12:19:54 Allow glDelete* while PLS is active Banning glDelete* is extremely dangerous. It will almost definitely cause memory leaks in client code, and it makes JS garbage collection needlessly complex. Instead, specify that PLS is implicity deactivated if the client deletes anything that is attached to the current draw framebuffer during a PLS rendering pass. Bug: chromium:1421437 Change-Id: I3a18ee6b5d5567431e6fa3eccea58cb049845502 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4521436 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app>
Shahbaz Youssefi 7fd01d03 2023-04-19T00:54:24 Vulkan: Throttle the CPU without holding the global lock CPU throttling goes through CommandQueue and is thread-safe. Performing it in an unlocked tail call allows other unrelated EGL calls to go through. Bug: angleproject:8135 Change-Id: Idb3841be5d8ea8c4b76217f6707be26b28ea39c2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4444027 Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 2ceb04e0 2023-05-02T10:45:11 Initialize display TLS at thread creation time Bug: chromium:1441754 Change-Id: I611c6f591f2a6d3439e3c5d1250e2fde996c0ecf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4496673 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi cd6a58f2 2023-04-18T12:45:10 Vulkan: Make eglPrepareSwapBuffersANGLE less special This function now uses the UnlockedTailCall mechanism so it doesn't require as much special-case code generation. This change does not fix the bug that this function is doing too much work without holding any locks. That will be done in a follow up. Bug: angleproject:6851 Bug: angleproject:8133 Change-Id: I77f4d514ff4aeef85bc1cc59214f7caa23aca7df Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4443186 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev b7a5714f 2023-03-31T00:00:00 Add polygon mode extension stubs * Added NV_polygon_mode * Specified a portable polygon mode extension implementable on all ANGLE backends Bug: angleproject:1791 Bug: angleproject:8132 Change-Id: I018aaaf1fb43ec16910859b152049e02169ede91 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4492684 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Shahbaz Youssefi 1328f2f3 2023-04-17T16:43:12 Vulkan: Destroy the surface without holding the EGL lock This change defers surface destruction to the end of the entry point that causes it so that it is done without holding the EGL lock. This works around a specific deadlock in Android. On this platform: - For EGL applications, parts of surface creation and destruction are handled by the platform, and parts of it are done by the native EGL driver. Namely, on surface destruction, native_window_api_disconnect is called outside the EGL driver. - For Vulkan applications, vkDestroySurfaceKHR takes full responsibility for destroying the surface, including calling native_window_api_disconnect. Unfortunately, native_window_api_disconnect may use EGL sync objects and can lead to calling into the EGL driver. For ANGLE, this is particularly problematic because it is simultaneously a Vulkan application and the EGL driver, causing `vkDestroySurfaceKHR` to call back into ANGLE and attempt to reacquire the EGL lock. Since there are no users of the surface when calling vkDestroySurfaceKHR, it is safe for ANGLE to destroy it without holding the EGL lock. Note that only eglDestroySurface and eglMakeCurrent may lead to the destruction of a window surface. Bug: b/275176234 Bug: angleproject:8127 Change-Id: I02dc52e53e150943457e3f503e7ef30469f96b05 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4428754 Reviewed-by: Charlie Lao <cclao@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Vikas Soni b5fa8728 2023-04-20T14:59:28 Add extension to skip texture renderability validation in ANGLE. Add a new extension to skip the texture renderability validation in ANGLE. Bug: angleproject:0000 Change-Id: Ia9e5a1eff233f5aced4706b7d3c183058d474c41 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4455549 Auto-Submit: vikas soni <vikassoni@chromium.org> Commit-Queue: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: vikas soni <vikassoni@chromium.org>
Shahbaz Youssefi 1acc6d40 2023-04-21T17:03:49 Vulkan: Use Android TLS for *valid* global context ... instead of just global context. This means that the majority of calls which call GetValidGlobalContext() will be faster (because they don't need to check for context loss). Bug: angleproject:8135 Change-Id: Ia91f8fadb5799088542c58d417f31c3e5028b3e0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4454769 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com>
Igor Nazarov b22124bd 2023-01-17T17:44:06 Implement new "Global Mutex" functionality. This CL improves performance compared to the existing code as well as allows using non-std mutex implementations. Also acts as a base for future changes. CL adds new build option: angle_enable_global_mutex_recursion = is_android && angle_enable_vulkan "mutex_recursion" work same way as `std::recursive_mutex` before. It will help in situations when Vulkan API may return back to the ANGLE. For example: RenderDoc layer EGL deadlock. Automatic loading of "libVkLayer_GLES_RenderDoc.so" layer causes deadlock in EGL. Recursion stack: #01 pc 000000000029ea80 /vendor/lib64/egl/libGLESv2_angle.so (egl::GlobalMutexHelper::lock(int)+596) #02 pc 000000000029c59c /vendor/lib64/egl/libGLESv2_angle.so (EGL_GetError+32) #04 pc 0000000000062368 /system/lib64/libEGL.so (eglQueryString+20) #05 pc 0000000000508fec /data/local/debug/vulkan/libVkLayer_GLES_RenderDoc.so #20 pc 0000000000016690 /system/lib64/libvulkan.so (vulkan::api::EnumerateInstanceLayerProperties(unsigned int*, VkLayerProperties*)+40) #21 pc 00000000005aa030 /vendor/lib64/egl/libGLESv2_angle.so (rx::RendererVk::initialize(rx::DisplayVk*, egl::Display*, char const*, char const*)+292) #26 pc 000000000029c7e8 /vendor/lib64/egl/libGLESv2_angle.so (EGL_Initialize+192) Additionally, recursive mutex will partially solve Android SurfaceTexture deadlock (angleproject:4354). Some performance numbers for 1000'000 `eglGetError()` calls. Mutex Time (ms.) Android S906B egl::GetGlobalMutex()(std::recursive_mutex) 41.4 (Default) GlobalMutex (std::recursive_mutex) 39.1 (Recursive) GlobalMutex (std::mutex) 34.9 (Debug) GlobalMutex (std::mutex) 34.7 (Default) GlobalMutex (std::mutex) 34.4 Windows egl::GetGlobalMutex()(std::recursive_mutex) 20.5 (Default) GlobalMutex (std::recursive_mutex) 20.0 (Recursive) GlobalMutex (std::mutex) 21.9 (Debug) GlobalMutex (std::mutex) 20.5 (Default) GlobalMutex (std::mutex) 19.9 Note: Recursive GlobalMutex enabled only for Android Vulkan by default. Original fix: https://chromium-review.googlesource.com/c/angle/angle/+/2029218 Bug: angleproject:8101 Bug: angleproject:4354 Test: angle_unittests --gtest_filter=GlobalMutexTest.* Change-Id: I9e9d9b5c598ad1177ffa147ea690bd955946a712 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4401940 Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov e2baaff8 2023-04-06T00:11:23 Prevent recursive GlobalMutex locking by ANGLE itself. Instead of adding `ANGLE_SCOPED_GLOBAL_LOCK()` for `glEGLImage*` GLES APIs, this CL uses new `SCOPED_GLOBAL_AND_SHARE_CONTEXT_LOCK()` macro in place of `SCOPED_SHARE_CONTEXT_LOCK()`. This will remove dependency on recursive mutex for ANGLE itself. Recursive mutex is still required for Android Vulkan or in specific cases when using layer libraries. Bug: chromium:1383195 Change-Id: I0c379c45c046b0f5e5dd3ea64a45d33b0ad3ee43 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4404777 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Chris Dalton ef20f191 2023-03-29T14:05:04 Make the PLS allow list more permissive Allow ClipControlEXT, FlushMappedBufferRange, Gen*, PolygonOffset*, ProvokingVertexANGLE, and KHR_debug commands. Allow caps DEPTH_CLAMP_EXT, CLIP_DISTANCE[0..7]_EXT. Ban indexed caps besides BLEND, SCISSOR_TEST, SCISSOR_TEST_EXCLUSIVE_NV. Clarify that the index restrictions on indexed caps only apply to BLEND. Bug: chromium:1421437 Change-Id: Ibdb0acaebfa992ad37c928481d5ecb10496f22e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4382502 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app>
Shahbaz Youssefi 3b57e999 2023-04-17T15:38:47 Scope global lock in entry points This change is a no-op. It's in preparation for adding calls at the end of the entry point after the lock is unlocked. Bug: angleproject:8127 Change-Id: I4cd79ff8e5f20f87f36040afbd1ed9f16406d519 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4436589 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Igor Nazarov be3d7e6b 2023-03-30T14:35:18 Remove redundant g_SurfaceMutex. This mutex become redundant after recent CL: https://chromium.googlesource.com/angle/angle/+/23ad4fa2be35aed303cbb8c2d632a04714354ef0 Don't hold global surface lock during AcquireNextImage Every place in the code where `ANGLE_SCOPED_GLOBAL_SURFACE_LOCK()` is used also uses `ANGLE_SCOPED_GLOBAL_LOCK()`. Bug: angleproject:6851 Change-Id: I464b6ca74743c9ee9fa23caad216f0e26c480655 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4385293 Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Igor Nazarov ec307af4 2023-03-30T14:17:52 Fix bug in DeallocateGlobalMutex(). Bug: angleproject:6851 Change-Id: Ie5dd32220a38a9b7a9a18ff830a4ee7b7c02b9c3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4381863 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com>
Chris Dalton a491bbe3 2023-03-18T19:05:08 Add PLS utilities for interrupting a rendering pass Adds two more simple commands to ANGLE_shader_pixel_local_storage that allow WebGL and the command buffer to interrupt rendering passes without having to either (1) make expensive queries, or (2) track lots of complex state for validation that they are not currently equipped to track. Bug: chromium:1421437 Change-Id: I80eaef3ae6b0b4bbbecb9cd2268ac90b43675d1c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4355032 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Mark Lobodzinski 23ad4fa2 2023-03-10T11:56:00 Don't hold global surface lock during AcquireNextImage On Android, the global surface lock must be released before calls to vkAcquireNextImageKHR, though GetSurfaceIfValid must remain inside the surface lock. Bug: b/268091451 Test: Mini-game puzzles in 'Fishdom' app, available in play store Change-Id: Ia9c96de52a367b4537a42cee83e2372322fbdfbc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4316610 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mark Łobodziński <mark@lunarg.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: mohan maiya <m.maiya@samsung.com>
Chris Dalton b468e4dd 2023-03-08T14:21:47 Add back "non-robust" PLS queries Chrome doesn't have a codegen template for queries that model the "robust" signature, so support both types. Specify that the robust variants are only supported if ANGLE_robust_client_memory is supported, so Chrome and other implementations don't have to support them. Bug: chromium:1421437 Change-Id: Icc69b69ce9ce0a2cfad0dbeed1f3b29bcfa92d20 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4321867 Commit-Queue: Chris Dalton <chris@rive.app> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 52ba6071 2023-03-06T00:00:00 Add EXT_texture_filter_minmax stubs Bug: angleproject:8072 Change-Id: Idfc2f2ff0eff7b0f6c131c37aeb53fb04019257d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4315865 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Chris Dalton a65f6a9d 2023-03-07T16:11:44 Make PLS queries robust There's no reason not to mirror the ANGLE_robust_client_memory API here. Bug: chromium:1421437 Change-Id: Ifb8b1a9675abe2ceb35272dc905f3c38f29dceda Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4317485 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app>
Alexey Knyazev 1174582a 2023-03-06T00:00:00 GL: Implement EXT_clip_control The extension is trivially exposed if the current context supports it. * Added packed clip control enums * Removed unused state query code * Aligned symbol names with the specs Bug: angleproject:8066 Change-Id: I9d106f39800658ecc75f4525ee93cb534dc49f9e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4306770 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev a2efea13 2023-03-01T00:00:00 Add ANGLE_stencil_texturing This extension allows texturing of the stencil component of a packed depth stencil texture on OpenGL ES 3.0 contexts. Trivially exposed on backends that support OpenGL ES 3.1, which requires this feature. Adjusted the tests to check for the new extension string instead of the context version. Bug: angleproject:8051 Change-Id: I4d833acbc72e7374bde91d4c861598a0fdaf9b90 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4295312 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 1ca860ac 2023-02-22T00:00:00 Add extension stubs * GL_EXT_conservative_depth * GL_EXT_depth_clamp * GL_EXT_render_snorm Bug: angleproject:8046 Bug: angleproject:8047 Bug: angleproject:8048 Change-Id: I7deb4f25f76008103c2754747db2d90be880b6ca Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4296803 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev e2cf65ed 2023-02-22T00:00:00 Implement QCOM_render_shared_exponent Fixed: angleproject:8043 Change-Id: Ia76b8e4b60a640180bae77cba523142749051398 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4289140 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Yuly Novikov cba2a0d5 2023-02-16T19:48:30 Keep MemoryBarrier macro defined Macro was originally undefined in crrev.com/c/361291. Undefining it breaks UWP build with newer compilers. Keeping the macro defined doesn't affect libGLESv2 exported symbols, so it looks like there is no need to undefine it. Bug: chromium:1380553 Change-Id: I6476aa015949e5f2639160fac80db39da710bfb7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4262071 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev dd1cf777 2023-02-16T00:00:00 Add EXT_texture_mirror_clamp_to_edge entry points Bug: angleproject:7968 Change-Id: I04b0c5d7b5148fbaca24d77a2c8688ea7a96cb64 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4262073 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Auto-Submit: Alexey Knyazev <lexa.knyazev@gmail.com>
Gert Wollny a52c0a6c 2023-02-06T16:01:27 Capture/Replay: Add and handle new resource type for EGLSync So far calls involving EGLSync were not tracking the actual sync objects, and this may lead to race conditions in multi-threaded and multi-context scenarios. This CL adds the type EGLSyncID and some specialized code handling of egl::Sync to distinguish EGLSync from the already existing GLSync objects in order to track them separately. Bug: angleproject:7911 Change-Id: I91b188a41069bc0620f51c55ee516d23b55bdd38 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4200095 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Sean Risser 0133b6f1 2023-01-20T16:02:27 Add GL_ARM_shader_framebuffer_fetch builtins Bug: b/242419750 Bug: angleproject:7882 Change-Id: I85582ad21e58e448b740789ec88f783c8b95ee01 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4189028 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Sean Risser <srisser@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill fdada9ee 2022-12-13T14:52:53 Re-land: "Make SyncIDs a packed type." This re-land fixes the sync map size tracking. This prepares syncs to use a simple resource map like other types, which will make life easier in the trace interpreter. Bug: angleproject:7775 Change-Id: If2114c51d5b68503890eacbf549182823667fedc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4178012 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 8971a592 2023-01-18T14:35:09 Revert "Make SyncIDs a packed type." This reverts commit 9de913077a5fcc3d2f2e327b56bbe30efe2fde96. Reason for revert: Fails win-trace, somewhat flakily. Original change's description: > Make SyncIDs a packed type. > > This prepares syncs to use a simple resource map like other > types, which will make life easier in the trace interpreter. > > Bug: angleproject:7775 > Change-Id: Ic2867f6133256f5ce2320eb2b322c1059266b201 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4103720 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Cody Northrop <cnorthrop@google.com> Bug: angleproject:7775 Change-Id: I29534b14c973fa34a4cb7457d534cd6156f33cd2 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4178010 Auto-Submit: Jamie Madill <jmadill@chromium.org> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Jamie Madill 9de91307 2022-12-13T14:52:53 Make SyncIDs a packed type. This prepares syncs to use a simple resource map like other types, which will make life easier in the trace interpreter. Bug: angleproject:7775 Change-Id: Ic2867f6133256f5ce2320eb2b322c1059266b201 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4103720 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Alexey Knyazev 9bd37934 2023-01-12T00:00:00 Add EXT_polygon_offset_clamp entry points Bug: angleproject:7957 Change-Id: Ida28b852b1db3e6017b6e91a9424381eb8fe29f2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4169943 Auto-Submit: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 067ace47 2022-12-21T00:00:00 Add ANGLE_clip_cull_distance extension Added an extension spec. Trivially exposed it on GL, Vulkan, and D3D11. Adjusted tests and validation to allow no cull distance support for this extension string. Removed extra built-in variable definitions. Bug: angleproject:7904 Change-Id: Ic60772dfe28132c316eaa29aadc1afd66e3b0fa7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4114290 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Gregg Tavares be9e8e7b 2022-12-14T14:13:39 Add EGL_ANGLE_wait_until_work_scheduled extension We're changing eglReleaseTexImage so it calls flushCommandBuffer(mtl::NoWait) instead of flushCommandBuffer(mtl::WaitUntilScheduled) and then adding an extension to allow us to WaitUntilScheduled. This is because Chrome calls eglReleaseTexImage for every canvas and having it WaitUntilScheduled per call is very slow. So instead we'll call eglWaitUntilWorkScheduledANGLE once which will effectively wait just once. Bug: angleproject:7890 Change-Id: I87bc9f9a1a7f4a0f99d93736cc3083799e76afeb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4109311 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Gregg Tavares <gman@chromium.org>
Elliott Hughes 0f3aaebf 2022-12-14T01:00:42 [PATCH] Add riscv64 support Bug: b/262585507 Change-Id: I7e081c5a1dacbcf1221d7580f33ce504442ebbbc Signed-off-by: Zhang Ye <haocheng.zy@linux.alibaba.com> Signed-off-by: Mao Han <han_mao@linux.alibaba.com> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4104471 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Jamie Madill aaee3c23 2022-11-30T14:24:13 Build and test ANGLE with Vulkan secondary CBs. This will allow us to run tests with both permutations of ANGLE (custom secondaries & Vulkan secondaries) in the same build directory. It will also allow us to run these configs as tests on our infra. This CL adds a few simple test to CI. Bug: angleproject:6811 Change-Id: I053f8cc5bafc2a7ab7d0665da9301f0ba7f8417f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4067806 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Peng Huang 2805e164 2022-11-29T15:16:42 Fix EGLImage related race condition crash Bug: chromium:1383195 Change-Id: Ibd74126f19674dad9425d2c8f5b3a217cfd590e4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4062912 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org>