src/libANGLE/Surface.cpp


Log

Author Commit Date CI Message
Yuly Novikov 9c7ad319 2024-11-27T13:43:10 Revert "Delay EGLQueryContext render buffer change" This reverts commit 233d9ee5c3525cc8290b3af52385ed59973438b4. Reason for revert: ASSERT triggered on Linux NVIDIA 535.183.01 https://ci.chromium.org/ui/p/angle/builders/ci/linux-exp-test/1469/overview Original change's description: > Delay EGLQueryContext render buffer change > > According to the EGL spec, EGL_RENDER_BUFFER of a context > should change after eglSwapBuffers is called if > eglSurfaceAttrib changes. Refine ANGLE implemnetation > to delay the render buffer change. > > Bug: angleproject:375528202 > Change-Id: Ida7736a09e3a83223a529dbfad48e0f952f91a38 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5982241 > Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Bug: angleproject:375528202 Change-Id: I08fc76b1b764e57639e2c0708cb155d392f82f22 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6055417 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Yuxiang Qian 233d9ee5 2024-10-24T18:24:14 Delay EGLQueryContext render buffer change According to the EGL spec, EGL_RENDER_BUFFER of a context should change after eglSwapBuffers is called if eglSurfaceAttrib changes. Refine ANGLE implemnetation to delay the render buffer change. Bug: angleproject:375528202 Change-Id: Ida7736a09e3a83223a529dbfad48e0f952f91a38 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5982241 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Hailin Zhang 8c12874c 2024-09-12T11:26:29 vulkan: add double buffer swapchain for fifo mode. Double buffer swapchain usually drop the performance. But at B* the default fps cap for silver device still at 30fps. This change is for reduce latency. Bug: b/311022968 Change-Id: Ida4044f439bbe3f235d53f5d1d2f945533cbb094 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5858255 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen b8e56d5d 2023-11-20T15:41:44 Fix an assert when overwriting TexImage binding Fix an assert when overwriting a image binding with multiple eglBindTexImage calls on the same texture. Bug: angleproject:8521 Change-Id: Ie7247017fd73c523b889278ec19a09ecf0683692 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5272912 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 3886af6e 2023-01-16T15:17:40 Vulkan: Generalize AHB optimization prohibitions ... to all external images. Bug: angleproject:7962 Change-Id: Ib8e090b995330b651865953057869adb4d14c83b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4169559 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Mohan Maiya 90b6d511 2023-01-13T10:06:12 Vulkan: Add support for AHB usage FRONT_BUFFER flag AHB usage flags have been updated to include front buffer usage. AHBs tagged with this flag need to be handled similar to single-buffered window surfaces especially w.r.t glFlush semantics. Account for the new usage flag when deferring flushes. Bug: angleproject:7956 Test: Android VTS GraphicsFrontBufferTests.* Change-Id: I79440d8447ac569c3d785de191815d2d2f3f069f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4167063 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Jamie Madill 0d203aef 2022-10-16T10:08:01 EGL: Add ID types for egl::Surface and egl::Image. This is in preparation for using resource maps for Context, Surface and EGLImage. The map change will make it much easier to work with the trace fixture. It will also have a small benefit in safety as we will longer be casting raw pointers for these types. As these objects are used in a lot of places, and simplified C can't handle unordered_map, it's necessary to index the maps by simple packed IDs in capture/replay code. Bug: angleproject:7758 Change-Id: Ib1d19622a4f2a6f0458cc28f5bbe30bb9f349b98 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3957163 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7c4dc253 2022-10-12T08:38:46 Capture/Replay: Clean up EGL capture. This switches the EGL capture types to ANGLE-casted pointers since that's what we receive in the capture layer. Note that even if the capture layer were used as a pure layer, not an EGL implementation, we'd still have these types for state tracking. This also prefixes each EGL class in the entry points with the egl namespace for consistency and for simplifying the ParamType code. Required changing to non-const gl::Context * in a few places. Also changes the gSurfaceMap to be indexed by the raw pointer value, which cleans up the code somewhat. Bug: angleproject:4035 Change-Id: Id800c1ba25e5819ac7ea1df8aab806bc393fe192 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3949910 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Charlie Lao 81554b66 2022-07-27T16:53:03 Vulkan: Reduce Framebuffer dirtyBits for swapchain only changes For window system framebuffer, the change to it is very limited. Most time it is only swapchain image changes. Right now we are also setting depth/stencil buffer dirty and processing layer count update and color mask and blending update when only color image changed. This CL avoids setting depth/stencil dirty bit for swap chain image changes. It also avoids color mask and blending update (they still gets updated for draw buffer change or draw franmebuffer binding changes). Bug: b/240475351 Change-Id: I0697a38d5939187244d67f01c0bc53fc28e11664 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3789471 Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Auto-Submit: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya d50b2276 2022-06-21T12:05:28 Reland "Vulkan: Support EGL_ANDROID_front_buffer_auto_refresh" This is a reland of commit ef60d38ecf12d6663e9ecccacbff9803b1fba7c6 There are no fixes as the revert itself was a speculative one Original change's description: > Vulkan: Support EGL_ANDROID_front_buffer_auto_refresh > > Cache value of EGL_FRONT_BUFFER_AUTO_REFRESH_ANDROID attribute > and set swapchain present mode accordingly when recreating > swapchain in single buffer mode. > > Bug: angleproject:7224 > Tests: EGLAndroidAutoRefreshTest.Basic* > Change-Id: I2dbb92ce5c3fa047e0b02ea9011725311f346027 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3707570 > Reviewed-by: Ian Elliott <ianelliott@google.com> > Commit-Queue: mohan maiya <m.maiya@samsung.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Bug: angleproject:7224 Bug: angleproject:7465 Change-Id: Ia876ea17169c0f1b3afdb7753570e0b1aca985f5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3733521 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Gert Wollny ce4e11d3 2022-06-17T12:21:01 libANGLE: Add a unique ID to the Surface This is needed when capturing Pbuffer calls. Bug: angleproject:4964 Change-Id: Id9f35683bf887f08f916de69bbab8c414e5e8872 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3711740 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Yuly Novikov 46ddcc44 2022-06-27T14:53:31 Revert "Vulkan: Support EGL_ANDROID_front_buffer_auto_refresh" This reverts commit ef60d38ecf12d6663e9ecccacbff9803b1fba7c6. Reason for revert: crashes in end2end tests on Win Intel Vulkan Original change's description: > Vulkan: Support EGL_ANDROID_front_buffer_auto_refresh > > Cache value of EGL_FRONT_BUFFER_AUTO_REFRESH_ANDROID attribute > and set swapchain present mode accordingly when recreating > swapchain in single buffer mode. > > Bug: angleproject:7224 > Tests: EGLAndroidAutoRefreshTest.Basic* > Change-Id: I2dbb92ce5c3fa047e0b02ea9011725311f346027 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3707570 > Reviewed-by: Ian Elliott <ianelliott@google.com> > Commit-Queue: mohan maiya <m.maiya@samsung.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Bug: angleproject:7224, angleproject:7465 Change-Id: Ia48a31124c8e0a3e4bcd4b7dc6f62b0782b42d97 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3726099 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Mohan Maiya ef60d38e 2022-06-21T12:05:28 Vulkan: Support EGL_ANDROID_front_buffer_auto_refresh Cache value of EGL_FRONT_BUFFER_AUTO_REFRESH_ANDROID attribute and set swapchain present mode accordingly when recreating swapchain in single buffer mode. Bug: angleproject:7224 Tests: EGLAndroidAutoRefreshTest.Basic* Change-Id: I2dbb92ce5c3fa047e0b02ea9011725311f346027 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3707570 Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Yuxin Hu 4c5e9d47 2022-06-21T17:12:56 Do not defer clear if FBO attachment is AHB image When application uses Android Hardware Buffer (AHB) image as the Framebuffer Object (FBO) attachment, it is possible the app doesn't call glReadPixels to fetch the FBO color. In this case deferred clears will not be flushed when the app reads the FBO pixel color, and the app will read the old FBO color. This CL fixes the issue by flushing the glClear calls immediately when any of the FBO color attachments is AHB image. Bug: b/236394768 Bug: angleproject:7458 Change-Id: I9151ab57750007c4ac18af39c3fa4abe752ede5e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3715851 Reviewed-by: Lingfeng Yang <lfy@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Jeff Vigil 6c248691 2022-04-21T10:10:03 Enable SINGLE_BUFFER with eglCreateWindowSurface Enable core EGL feature for Vulkan using: VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR Test: angle_end2end_test --gtest_filter=EGLSingleBufferTest Bug: angleproject:7224 Change-Id: I3e85f932471f7b3c97bbc5c2f5314f25eb9b2867 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3610975 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen 15895160 2022-04-05T15:43:52 Avoid leaking gl::Framebuffers in gl::Context Fix by holding framebuffer via UniqueFramebufferPointer. Removes redundant functions from gl::Surface. Replaces UniqueObjectPointerBase with unique_ptr. The use-case needs default initialization, move assign and operator bool. With these implemented, UniqueObjectPointerBase would have been an imitation of unique_ptr. Patch by David Kilzer <ddkilzer@apple.com> Bug: angleproject:6920 Change-Id: Id0c8fda95f62caa54c89d0a70684e386804db094 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3568382 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Jamie Madill 2dd13ebb 2022-04-21T11:25:00 Track Surface color & depth/stencil init separately. This clears up some trace testing confusion due when robust resource init is enabled, and the app clears color but not depth on the default surface. Bug: angleproject:7221 Change-Id: Id97871aec32ad831b663aaa9116e04b582ab5a36 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3600375 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Mohan Maiya 5aaa402c 2022-03-30T06:13:02 Fix Surface use-after-free bug In Display::destroyContext we would incorrectly destroy current surfaces while trying to makeCurrent the context to be destroyed. Introduce ScopedSurfaceRef, mirroring ScopedContextRef, to keep the surfaces alive while destroying the context. Bug: angleproject:7141 Test: EGLSurfaceTest.SurfaceUseAfterFreeBug* Change-Id: Ie9b3d7841e5ee561d96c13bfee9c7c87b40cc39d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3561354 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Constantine Shablya e74d0e81 2022-02-11T18:05:12 Vulkan: Implement EGL_KHR_partial_update This change provides a trivial implementation of partial update that does nothing, making apps that want this extension happy. A possible efficient Vulkan implementation would use the damage set to narrow down render area, but it appears to only be useful for only some TBDR hardware. Bug: angleproject:6960 Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com> Change-Id: Ic553ac9590c336093f1bf25a6521574622599bf6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3427640 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Auto-Submit: Constantine Shablya <constantine.shablya@collabora.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Lingfeng Yang 926b43e7 2022-01-06T13:31:54 Reland: Frontend: separate lock in swap prep Swapchain-based backends like Vulkan might block a lot in vkAcquireNextImageKHR, which is bad for overall fast progress if we also hold the global EGL lock there. This CL starts to split the global EGL lock. We release the EGL lock when performing vkAcquireNextImageKHR, and only maintain a lock for surfaces. This is done via a new custom entry point, EGL_PrepareSwapBuffers, so that we can control how the global lock is used throughout the entire call. Bug: angleproject:6851 Change-Id: I095cd8b3bdbb13c842cab0a46148e2122582cdfd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3373426 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Lingfeng Yang <lfy@google.com>
Jamie Madill 9d668d6c 2022-01-07T18:18:23 Revert "Frontend: separate lock in swap prep" This reverts commit 40c5cb255c0a07bdab574aa076ee603e7d791ab3. Reason for revert: Regression in TSAN caused by this CL: https://ci.chromium.org/ui/p/angle/builders/ci/linux-tsan-test/352/overview Original change's description: > Frontend: separate lock in swap prep > > Swapchain-based backends like Vulkan might block a lot in > vkAcquireNextImageKHR, which is bad for overall fast progress if we also > hold the global EGL lock there. > > This CL starts to split the global EGL lock. We release the EGL lock > when performing vkAcquireNextImageKHR, and only maintain a lock for > surfaces. > > Bug: angleproject:6851 > Change-Id: I329d5c4c579718a4980c4261590f77099ce1400e > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3361249 > Reviewed-by: Charlie Lao <cclao@google.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Lingfeng Yang <lfy@google.com> Bug: angleproject:6851 Change-Id: Ie03b784021f7b8b5c1ef95a911ef7da4029abd46 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3373165 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Lingfeng Yang 40c5cb25 2022-01-06T13:31:54 Frontend: separate lock in swap prep Swapchain-based backends like Vulkan might block a lot in vkAcquireNextImageKHR, which is bad for overall fast progress if we also hold the global EGL lock there. This CL starts to split the global EGL lock. We release the EGL lock when performing vkAcquireNextImageKHR, and only maintain a lock for surfaces. Bug: angleproject:6851 Change-Id: I329d5c4c579718a4980c4261590f77099ce1400e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3361249 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Lingfeng Yang <lfy@google.com>
Amirali Abdolrashidi 05a44dd2 2021-11-29T12:16:58 Vulkan: Set content undefined on eglSwapBuffers * Invalidate the swap buffer content if the swap behavior is EGL_BUFFER_DESTROYED. * In that event, WindowSurfaceVk::getBufferAge() sets `age` to 0 and returns with no errors. * Unit tests in EGLBufferAgeTest.cpp updated to reflect this. * Minor cleanup in the test file. Bug: angleproject:6363 Change-Id: Ibab7ccb99c1be149588e6aad16bcc2d6dd989295 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3307776 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Jeff Vigil 8b60855b 2021-09-15T15:16:10 EGL: implement EGL_KHR_mutable_render_buffer Pass render buffer mode change to WindowSurfaceVk. On mode change trigger OUT_OF_DATE. Then in CreateSwapchain, if new mode, set the Presentation mode and the Image count. OffscreenSurfaceVk ignores mode change. Add MUTABLE_RENDER_BUFFER_BIT to GenerateDefaultConfig. Test: dEQP-EGL.functional.mutable_render_buffer.* Bug: angleproject:3966 Change-Id: I7b59708514bcda10f8d45ce5f9528aa840fcccfa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3171822 Commit-Queue: Brandon Schade <b.schade@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jeff Vigil 5eb86d4a 2021-09-21T15:17:04 EGL: EGL_KHR_lock_surface3 frontend Add queries to get locked buffer attributes Add validation for LockSurface, QuerySurface Bug: angleproject:6062 Change-Id: I4919bef2a17d3505cccad08f7c4f8a3ca5d7e4e6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3174322 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang ad8e4d99 2021-09-28T11:48:46 Remove EGL_ANGLE_flexible_surface_compatibility This extension has been superseded by EGL_KHR_no_config_context. Bug: chromium:1253930 Change-Id: Ie299c34baa84e9f47c73ddb5a0636536bf510d72 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3190612 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill d2d1f41f 2021-08-16T08:05:55 Add EGL extension to create window with a swap interval set. On Vulkan this allows creating a window once without needing to recreate the swapChain after we specify the swap interval. Also adds a simple regression test and EGL enum assertion printing formatting. Bug: angleproject:5133 Change-Id: I72af124cb0e8f7cddfa810988a9862c0f36a0e46 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3097806 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jeff Vigil d2b659f9 2021-03-25T15:40:58 EGL: implement EGL_EXT_protected_content Context Add Validation check to Contexts and Surfaces Add Vulkan protected memory features and properties Add protected member to Surfaces and Contexts Implement hasProtectedContent in Vulkan Add QueueFamily helper, extent DeviceQueueMap Protected Swapchains always on for Android Add EGLProtectedContentTest Test: angle_end2end_test --gtest_filter=EGLProtectedContentTest Bug: angleproject:3965 Change-Id: I9352b1e594f71bb4e89cee7137a468940d186b1b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2800413 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 8c1cbc5a 2021-07-16T14:01:53 Implement EGL_KHR_mutable_render_buffer in the front-end. Note that we do not currently expose any mutable configs. Bug: b/192352791 Change-Id: Ib97f7889fedd91d09ef32dc7e7494ea4476cd7bd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3035583 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Gert Wollny b6009f64 2021-06-17T14:53:03 Capture/Replay: Add feature for robust resource init Query the feature when creating the display and the context, and pass the flag to the created context and also to durfaces. With that we create surfaces that will be marked "MayNeedInit" and are initialized if the resource is cleared or invalidated. Bug: angleproject:6041 Change-Id: I292f2e3f931736a18db93695441407e17d2265b6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2976656 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jeff Vigil 22fc9523 2021-02-03T15:32:48 EGL: implement EGL_EXT_buffer_age Add extension flag. Add Validation check to surface query. Enable extension for vulkan. Modify AcquireNextImage to ++frame count and tag images with frame number. Buffer age is the difference between current frame count and the tagged frame number on the buffer. getBuffeAge may need to trigger AcquireNextImage to be current. Pass through egl extension and query. Add EGLBufferAgeTest Test: angle_end2end_test --gtest_filter=EGLBufferAgeTest Test: angle_deqp_egl_tests --deqp-case=dEQP-EGL.functional.buffer_age.* Bug: angleproject:3529 Change-Id: I0cb94be1c3e85d6f33e82a6a1ccdc9731b6a7f23 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2684724 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jonah Ryan-Davis 937bc82b 2020-12-17T17:57:50 Revert "GLX: Expose EGL_ANGLE_window_fixed_size" This reverts commit fa9b803e078fb833143df7a2b3f88c8694fa8f2f. Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=1157748 Original change's description: > GLX: Expose EGL_ANGLE_window_fixed_size > > Right now the GLX backend checks for resize on every SwapBuffers > call. If EGL_ANGLE_window_fixed_size is used, it will only resize > when signaled by Chrome. > > Bug: chromium:1132827 > Change-Id: Ia4ddbbbf6dcf13f46ad564208eccc517de8be33c > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2572886 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> TBR=syoussefi@chromium.org,jonahr@google.com,jmadill@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: chromium:1132827 Change-Id: I1110c5dd5d806b3c6c59308d4865f0d3aa57fc3f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2595197 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Xiaoxuan Liu 108b759e 2020-12-04T15:15:49 EGL: Update EGL headers/xml The new EGL headers introduced 'EGL_NO_X11' which we could use for ANGLE vulkan display/headless backend. Changes in CL: 1. Updated include/EGL/egl*.h and scripts/egl.xml based on latest EGL repo: https://github.com/KhronosGroup/EGL-Registry Note: local modifications to the file were preserved in eglext.h, search keyword 'eglext_angle.h' for detail 2. run scripts to update entry_points/loader scripts/generate_entry_points.py scripts/generate_loader.py scripts/run_code_generation.py 3. Update ANGLE code on API 'eglSwapBuffersWithDamage' 4. Format with 'git cl format' Bug: angleproject:5260 Change-Id: I70ed0dccecf0426929ef8b4775605554d66c5724 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2576314 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jonah Ryan-Davis fa9b803e 2020-12-03T17:53:12 GLX: Expose EGL_ANGLE_window_fixed_size Right now the GLX backend checks for resize on every SwapBuffers call. If EGL_ANGLE_window_fixed_size is used, it will only resize when signaled by Chrome. Bug: chromium:1132827 Change-Id: Ia4ddbbbf6dcf13f46ad564208eccc517de8be33c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2572886 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Paul Thomson db679caf 2020-11-25T21:08:46 Capture/Replay: track swapWithDamage Frames were captured in Surface::swap, but not in Surface::swapWithDamage. Adds the same callback in Surface::swapWithDamage and Surface::swapWithFrameToken. Bug: b/174256233 Change-Id: I3425fa2b9ae388f62f616dd2c9444797358ba148 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2560726 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang feafc888 2020-11-24T14:06:09 GL: Treat RGBA+HALF_FLOAT IOSurfaces as sized formats. ANGLE_iosurface_client_buffer imports IOSufraces with GL_RGBA + GL_HALF_FLOAT which isn't a valid GLES internalFormat + type combination so sampling from this format fails. We cannot easily update the spec on this format because it is also implemented by SwiftShader so manually adjust the format to sized RGBA16F. Bug: chromium:1148599 Change-Id: I3f24bbdcd08003eaae26e8391e5edca7a51f6888 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2558950 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 5b419533 2020-11-03T13:33:44 GL: Implement EXT_YUV_target Add test coverage of YUV format sampling as RGB or directly as YUV and rendering as YUV using layout(yuv). Initializing YUV AHardwareBuffers requires Android API 29 so ANGLE must be compiled with: android32_ndk_api_level = 29 android64_ndk_api_level = 29 The following tests can still run with Android API 26 because they don't need to initialize the buffer: ImageTestES3.ClearYUVAHB ImageTestES3.YUVValidation Bug: angleproject:4852 Bug: b/172649538 Change-Id: I4fe9afb2a68fb827dc5a5732b213b5eb60d585ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2517562 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 97843bda 2020-10-30T17:03:36 Vulkan: Fix EGL Surface robust init. The error here was related to using a single cache variable for the robust init setting for all the surfaces in a DisplayVk. Fix this by passing down the robust init setting from the SurfaceVk to image init. Bug: angleproject:5274 Change-Id: I9bc9c20990268d1d5166411fb53f8f2593fd1971 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2510694 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Ian Elliott 6eb7756d 2020-08-07T17:41:39 Vulkan: tell ContextVk when swapchain is re-created For an app that only draws to the swapchain, if the swapchain is recreated with a different rotation (as done by the ANGLE perf tests when switching from Angry Birds 2 to Candy Crush), ContextVk is not informed, and so the new rotation is ignored. Use the subject-observer pattern to set the appropriate dirty bits. Test: run_angle_perftests --gtest_filter=TracePerfTest.Run/vulkan_angry*:*vulkan_candy* --verbose --local-output Bug: angleproject:4910 Bug: b/163126746 Change-Id: Ib5303e9c4095db1b3e736911f483589e40a73d0c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2341768 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Manh Nguyen dce37b7d 2020-06-21T22:27:06 Serialize framebuffers + compare contexts for CaptureReplayTests Adds to frame capture the ability to serialize a frame's pre-swap GL state and store it in the binary data file Adds to CaptureReplayTests the ability to compare its serialized GL state with the serialized state pulled from the binary data file Adds a serialization module that serializes framebuffers' GL states and the contents of their color attachments Adds checks to automation script so that it would skips tests that do not produce the expected trace files Adds exception handling to automation script so that it will not crash when a replay build crashes Bug: angleproject:4779 Change-Id: I40a02e018073749e79f0ddbfd3d4065745548f46 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2258295 Commit-Queue: Manh Nguyen <nguyenmh@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Geoff Lang 4e6f6545 2020-04-16T16:31:24 GLX: Support X11 pixmaps Add support for creating EGL pixmaps from X11 pixmaps using GLX. Pixmaps are needed for various external APIs such as VAAPI. Add support for EGL_NOK_texture_from_pixmap to allow binding pixmaps to textures. BUG=angleproject:4560 Change-Id: I4a6d3ad7e87151ff5317bbdaaf093ac1b46daf5f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2153805 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Sunny Sachanandani 4b225c70 2020-05-06T15:38:12 Add texture offset attributess for D3D texture pbuffer surfaces Add EGL_TEXTURE_OFFSET_X_ANGLE and EGL_TEXTURE_OFFSET_Y_ANGLE attributes to EGL_ANGLE_d3d_texture_client_buffer which are used to specify offsets used for rendering into the pbuffer surface backed by a D3D11 texture. Rendering with the correct offset is needed when Chrome gets a texture and offset from an external source e.g. when calling BeginDraw() on IDCompositionSurface. Bug: angleproject:2997 Change-Id: I363f739f3f05c38720f385e34c91e98fc6a622a0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2186176 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Ian Elliott 718ae508 2020-04-28T08:42:07 Vulkan: Always query EGL_WIDTH and EGL_HEIGHT This fixes the failures of the dEQP EGL resize tests on Android. Those tests don't actually resize the window (which would allow the tests to pass), but do change internal Android Surface values that vkGetPhysicalDeviceSurfaceCapabilitiesKHR queries. Therefore, by freshly querying these values the test passes. Bug: b/153329980 Change-Id: Ie966f221bfaa14988c1503c7f5503f0b21476bcb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2165639 Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Jamie Madill 1fc354fa 2020-04-22T11:49:00 Re-land: "Vulkan: Forward RenderBuffer/Surface dirty messages." Re-land fixes ASSERT on Android GLES. Previously we were only forwarding Texture staging changes to the Framebuffer for re-sync. We could miss out on clears that were staged in Surfaces and Renderbuffer attachments. Complete the chain by making the SurfaceVk and RenderbufferVk forward notifications from the VkImage. Bug: angleproject:4517 Change-Id: I91d31213b115a58546b574caa574eebbb098266c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2159294 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 623d0443 2020-04-21T15:15:03 Revert "Vulkan: Forward RenderBuffer/Surface dirty messages." This reverts commit 3fb33ade6ec8f286797bff5645304df580b1a963. Reason for revert: Causing WebGL test failures on GLES/ANGLE/Android. Bug: chromium:1072739 Original change's description: > Vulkan: Forward RenderBuffer/Surface dirty messages. > > Previously we were only forwarding Texture staging changes to the > Framebuffer for re-sync. We could miss out on clears that were staged > in Surfaces and Renderbuffer attachments. Complete the chain by making > the SurfaceVk and RenderbufferVk forward notifications from the > VkImage. > > Bug: angleproject:4517 > Change-Id: I15f36c225517e915f656d0c2464a99631ef9f945 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2150699 > Reviewed-by: Cody Northrop <cnorthrop@google.com> > Commit-Queue: Jamie Madill <jmadill@chromium.org> TBR=cnorthrop@google.com,timvp@google.com,jmadill@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: angleproject:4517 Change-Id: I4fd4d79dc11da0ba86065d3a80975de4c791a2a0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2159288 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3fb33ade 2020-04-09T15:27:12 Vulkan: Forward RenderBuffer/Surface dirty messages. Previously we were only forwarding Texture staging changes to the Framebuffer for re-sync. We could miss out on clears that were staged in Surfaces and Renderbuffer attachments. Complete the chain by making the SurfaceVk and RenderbufferVk forward notifications from the VkImage. Bug: angleproject:4517 Change-Id: I15f36c225517e915f656d0c2464a99631ef9f945 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2150699 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis 1a1a1427 2020-01-23T13:57:21 Expose eglGetMscRateCHROMIUM from EGL_CHROMIUM_sync_control When ANGLE is using the GL backend on GLX, we can expose eglGetMscRateCHROMIUM via glXGetMscRateOML. Otherwise, this function should return false. Bug: chromium:1042393 Change-Id: Id9b308c2217e07ee9860e2869be0e23b7a0c7411 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2017048 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Mohan Maiya 942d9152 2019-12-23T15:31:52 EGL: Add support for EGL_KHR_gl_colorspace extension If the Vulkan backend supports VK_EXT_swapchain_colorspace extension, enable the option for applications to create surfaces with non-linear formats. Not all formats have non-linear versions and is platform specific. Tests: dEQP-EGL.functional.wide_color.* angle_deqp_egl_tests --use-angle=vulkan --deqp-gl-context-type=egl --deqp-case=dEQP-EGL.functional.wide_color.* Bug: angleproject:2514 Change-Id: I441ee797cceef92c84473bfa18605c4fd8180de1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1951963 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jonah Ryan-Davis a829c0b9 2019-11-14T16:49:02 Expose EGL_CHROMIUM_sync_control via GLX_OML_sync_control On GLX, we can expose the EGL_CHROMIUM_sync_control extension by forwarding to GLX_OML_sync_control when it's available. This will help with accurate vsync times for Chrome Bug: 1020252 Change-Id: I9b1e8cf0f8b1a548cc7cc7202fac2d0cdb01d74d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1918104 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill c898ec1a 2019-11-04T15:20:18 Add EGL GGP extensions. This CL adds two new extensions: * EGL_ANGLE_ggp_stream_descriptor: Introduces a new attribute to CreateWindowSurface. Allows the app to pass in a stream descriptor to VkCreateSurfaceKHR. Mirrors VK_GGP_stream_descriptor_surface. * EGL_ANGLE_swap_with_frame_token: Introduces a new function 'eglSwapBuffersWithFrameTokenANGLE'. This allows the app to pass a GGP frame token down to vkQueuePresentKHR. Mirrors VK_GGP_frame_token. Bug: angleproject:4078 Change-Id: I4313ac4c264e68999905049f661bc64b44f72fab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1897315 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi 050b124d 2019-06-30T03:26:18 Reland "Vulkan: Debug overlay" This is a reland of e54d0f90d1a165404236fd7abd1b05ddd041a686 This was reverted due to a build failure as a result of a missing virtual destructor in the widget base class. Original change's description: > Vulkan: Debug overlay > > A debug overlay system for the Vulkan backend designed with efficiency > and runtime configurability in mind. Overlay widgets are of two > fundamental types: > > - Text widgets: A single line of text with small, medium or large font. > - Graph widgets: A bar graph of data. > > Built on these, various overlay widget types are defined that gather > statistics. Five such types are defined with one widget per type as > example: > > - Count: A widget that counts something. VulkanValidationMessageCount > is an overlay widget of this type that shows the number of validation > messages received from the validation layers. > - Text: A generic text. VulkanLastValidationMessage is an overlay > widget of this type that shows the last validation message. > - PerSecond: A value that gets reset every second automatically. FPS is > an overlay widget of this type that simply gets incremented on every > swap(). > - RunningGraph: A graph of last N values. VulkanCommandGraphSize is an > overlay of this type. On every vkQueueSubmit, the number of nodes in > the command graph is accumulated. On every present(), the value is > taken as the number of nodes for the whole duration of the frame. > - RunningHistogram: A histogram of last N values. Input values are in > the [0, 1] range and they are ranked to N buckets for histogram > calculation. VulkanSecondaryCommandBufferPoolWaste is an overlay > widget of this type. On vkQueueSubmit, the memory waste from command > buffer pool allocations is recorded in the histogram. > > Overlay font is placed in libANGLE/overlay/ which gen_overlay_fonts.py > processes to create an array of bits, which is processed at runtime to > create the actual font image (an image with 3 layers). > > The overlay widget layout is defined in overlay_widgets.json which > gen_overlay_widgets.py processes to generate an array of widgetss, each > of its respective type, and sets their properties, such as color and > bounding box. The json file allows widgets to align against other > widgets as well as against the framebuffer edges. > > Two compute shaders are implemented to efficiently render the UI: > > - OverlayCull: This shader creates a bitset of Text and Graph widgets > whose bounding boxes intersect a corresponding subgroup processed by > OverlayDraw. This is done only when the enabled overlay widgets are > changed (a feature that is not yet implemented) or the surface is > resized. > - OverlayDraw: Using the bitsets generated by OverlayCull, values that > are uniform for each workgroup (set to be equal to hardware subgroup > size), this shader loops over enabled widgets that can possibly > intersect the pixel being processed and renders and blends in texts > and graphs. This is done once per frame on present(). > > Currently, to enable overlay widgets an environment variable is used. > For example: > > $ export ANGLE_OVERLAY=FPS:VulkanSecondaryCommandBufferPoolWaste > $ ./hello_triangle --use-angle=vulkan > > Possible future work: > > - On Android, add settings in developer options and enable widgets based > on those. > - Spawn a small server in ANGLE and write an application that sends > enable/disable commands remotely. > - Implement overlay for other backends. > > Bug: angleproject:3757 > Change-Id: If9c6974d1935c18f460ec569e79b41188bd7afcc > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1729440 > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> Bug: angleproject:3757 Change-Id: I47915d88b37b6f882c686c2de13fca309a10b572 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1780897 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Corentin Wallez fc58af47 2019-09-02T07:46:44 Revert "Vulkan: Debug overlay" This reverts commit e54d0f90d1a165404236fd7abd1b05ddd041a686. Reason for revert: causes compile failure on Linux CFI bot. Sample build: https://ci.chromium.org/p/chromium/builders/ci/Linux%20CFI/14810 Sample log: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8903575125463586160/+/steps/compile/0/stdout?format=raw Original change's description: > Vulkan: Debug overlay > > A debug overlay system for the Vulkan backend designed with efficiency > and runtime configurability in mind. Overlay widgets are of two > fundamental types: > > - Text widgets: A single line of text with small, medium or large font. > - Graph widgets: A bar graph of data. > > Built on these, various overlay widget types are defined that gather > statistics. Five such types are defined with one widget per type as > example: > > - Count: A widget that counts something. VulkanValidationMessageCount > is an overlay widget of this type that shows the number of validation > messages received from the validation layers. > - Text: A generic text. VulkanLastValidationMessage is an overlay > widget of this type that shows the last validation message. > - PerSecond: A value that gets reset every second automatically. FPS is > an overlay widget of this type that simply gets incremented on every > swap(). > - RunningGraph: A graph of last N values. VulkanCommandGraphSize is an > overlay of this type. On every vkQueueSubmit, the number of nodes in > the command graph is accumulated. On every present(), the value is > taken as the number of nodes for the whole duration of the frame. > - RunningHistogram: A histogram of last N values. Input values are in > the [0, 1] range and they are ranked to N buckets for histogram > calculation. VulkanSecondaryCommandBufferPoolWaste is an overlay > widget of this type. On vkQueueSubmit, the memory waste from command > buffer pool allocations is recorded in the histogram. > > Overlay font is placed in libANGLE/overlay/ which gen_overlay_fonts.py > processes to create an array of bits, which is processed at runtime to > create the actual font image (an image with 3 layers). > > The overlay widget layout is defined in overlay_widgets.json which > gen_overlay_widgets.py processes to generate an array of widgetss, each > of its respective type, and sets their properties, such as color and > bounding box. The json file allows widgets to align against other > widgets as well as against the framebuffer edges. > > Two compute shaders are implemented to efficiently render the UI: > > - OverlayCull: This shader creates a bitset of Text and Graph widgets > whose bounding boxes intersect a corresponding subgroup processed by > OverlayDraw. This is done only when the enabled overlay widgets are > changed (a feature that is not yet implemented) or the surface is > resized. > - OverlayDraw: Using the bitsets generated by OverlayCull, values that > are uniform for each workgroup (set to be equal to hardware subgroup > size), this shader loops over enabled widgets that can possibly > intersect the pixel being processed and renders and blends in texts > and graphs. This is done once per frame on present(). > > Currently, to enable overlay widgets an environment variable is used. > For example: > > $ export ANGLE_OVERLAY=FPS:VulkanSecondaryCommandBufferPoolWaste > $ ./hello_triangle --use-angle=vulkan > > Possible future work: > > - On Android, add settings in developer options and enable widgets based > on those. > - Spawn a small server in ANGLE and write an application that sends > enable/disable commands remotely. > - Implement overlay for other backends. > > Bug: angleproject:3757 > Change-Id: If9c6974d1935c18f460ec569e79b41188bd7afcc > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1729440 > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=geofflang@chromium.org,syoussefi@chromium.org,jmadill@chromium.org Bug: angleproject:3757 Change-Id: Ib08e2e7b1a9449ca097673acb11655df5d2bbf31 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1778862 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Shahbaz Youssefi e54d0f90 2019-06-30T03:26:18 Vulkan: Debug overlay A debug overlay system for the Vulkan backend designed with efficiency and runtime configurability in mind. Overlay widgets are of two fundamental types: - Text widgets: A single line of text with small, medium or large font. - Graph widgets: A bar graph of data. Built on these, various overlay widget types are defined that gather statistics. Five such types are defined with one widget per type as example: - Count: A widget that counts something. VulkanValidationMessageCount is an overlay widget of this type that shows the number of validation messages received from the validation layers. - Text: A generic text. VulkanLastValidationMessage is an overlay widget of this type that shows the last validation message. - PerSecond: A value that gets reset every second automatically. FPS is an overlay widget of this type that simply gets incremented on every swap(). - RunningGraph: A graph of last N values. VulkanCommandGraphSize is an overlay of this type. On every vkQueueSubmit, the number of nodes in the command graph is accumulated. On every present(), the value is taken as the number of nodes for the whole duration of the frame. - RunningHistogram: A histogram of last N values. Input values are in the [0, 1] range and they are ranked to N buckets for histogram calculation. VulkanSecondaryCommandBufferPoolWaste is an overlay widget of this type. On vkQueueSubmit, the memory waste from command buffer pool allocations is recorded in the histogram. Overlay font is placed in libANGLE/overlay/ which gen_overlay_fonts.py processes to create an array of bits, which is processed at runtime to create the actual font image (an image with 3 layers). The overlay widget layout is defined in overlay_widgets.json which gen_overlay_widgets.py processes to generate an array of widgetss, each of its respective type, and sets their properties, such as color and bounding box. The json file allows widgets to align against other widgets as well as against the framebuffer edges. Two compute shaders are implemented to efficiently render the UI: - OverlayCull: This shader creates a bitset of Text and Graph widgets whose bounding boxes intersect a corresponding subgroup processed by OverlayDraw. This is done only when the enabled overlay widgets are changed (a feature that is not yet implemented) or the surface is resized. - OverlayDraw: Using the bitsets generated by OverlayCull, values that are uniform for each workgroup (set to be equal to hardware subgroup size), this shader loops over enabled widgets that can possibly intersect the pixel being processed and renders and blends in texts and graphs. This is done once per frame on present(). Currently, to enable overlay widgets an environment variable is used. For example: $ export ANGLE_OVERLAY=FPS:VulkanSecondaryCommandBufferPoolWaste $ ./hello_triangle --use-angle=vulkan Possible future work: - On Android, add settings in developer options and enable widgets based on those. - Spawn a small server in ANGLE and write an application that sends enable/disable commands remotely. - Implement overlay for other backends. Bug: angleproject:3757 Change-Id: If9c6974d1935c18f460ec569e79b41188bd7afcc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1729440 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tim Van Patten 56ba54cc 2019-08-08T13:03:34 Support separate read and draw surfaces in eglMakeCurrent Update ANGLE's default framebuffer implementation to support reading and writing to different surfaces within the same framebuffer. Bug: angleproject:2620 Test: EGLSurfaceTest[3] Change-Id: I4b1ea04ca87a751f80cf190bf3adec148fc4fce3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1744746 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill be74c47d 2019-08-13T13:54:15 Capture/Replay: Also capture on postSubBuffer. Necessary to capture from Chrome. Bug: angleproject:3611 Change-Id: Ia9330e0c273e65adaa4171020d0aebb05e100260 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1752013 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
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 eb1b1646 2019-07-30T17:22:17 Capture/Replay: Fix capture-enabled libs build. Adds a build option to use the capture libraries in the default output location for libGLESv2. With |angle_with_capture_by_default| enabled, libGLESv2 will have capture enabled and the non-capture libGLESv2 is built as libGLESv2_no_capture. Also moves the FrameCapture to be owned by gl::Context. Rearranges the code a bit so that we don't require a separate version of libANGLE for capture. Also implements a read pixels entry point parameter. Bug: angleproject:3611 Change-Id: Ic528e43e4779f794c8b6d0bf35410166dacc81b1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1719064 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 612b7417 2019-07-05T11:13:30 Capture/Replay: Add frame capture to cpp files. Capture is implemented mostly via code auto-generation. The capture requires a bit of custom logic for each captured pointer parameter. We handle this by using auto-generation to lay out the base template for each GL call and then custom logic that uses ANGLE's internals to know how much data to capture at which point. Client array pointers are captured before each draw call. Currently only GLES capture is supported. We write out cpp files and an optional data file accompanying each cpp. For small data chunks we inline them in the cpp files. For bigger chunks like texture data we pack them into the data file. Mid-execution capture is not yet supported. Configuring the capture is currently only available by modifying the cpp sources. Both of these features will be implemented in the future. Bug: angleproject:3611 Change-Id: If6d5dac2f7bf363129d42ea9198162aef0d3a4ec Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1671904 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3ea463bf 2019-06-19T14:21:33 Move event tracer back into common. Requires that we update the TRACE_EVENT macros to accept a platform as an argument. The refactor isn't complete. In order to finish we'd need to ensure we have the Display's PlatformMethods available at all sites. Unblocks adding trace events directly in the perf tests. Bug: angleproject:1892 Bug: angleproject:3117 Change-Id: Iee0ca086ccfe23acab3fc186fb042f018711a94c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1664794 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 124f78c2 2019-06-18T11:48:24 Remove gl::Context parameter from Observer functions. It was only used in exactly one instance in VertexArray. Instead we can cache a bool and avoid needing to pass it around. Will make signaling dirty easier in the Vulkan back-end. Bug: angleproject:3539 Change-Id: Ia570aec051a24a5280df49edc4345c54022b46ec Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1663838 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e4faae21 2019-05-10T08:27:00 Rename state change notification messages. This makes the style use CamelCase instead of ALL_CAPS. It also cleans up some of the naming. It also changes some uses of the messages in some of the objects to hopefully be more consistent. See the comments added to the enum SubjectMessage in Observer.h for more details. Bug: angleproject:3427 Change-Id: I6dff4f6d335ecf1a27e48df65743b1490bd3025a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1600411 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 0f4d72e6 2019-05-06T10:27:34 Add makeCurrent and unMakeCurrent to SurfaceImpl. SurfaceGL had these methods already so they are just moving up the inheritance hierarchy. This ends up simplifying some state tracking we had in our surface implementations. BUG=angleproject:2464 Change-Id: I480588ca8470d9ef507f95e0c0297fe126b3abfb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1595434 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi a254fa28 2019-04-09T14:25:59 Rename getCurrentDisplay to getDisplay There is always only one display that can be associated with a context, so get*Current*Display is confusing. Bug: None Change-Id: Iff3a9fc5ad1154b046bb30d7f46a468802ba7fcc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1558958 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill ab2bfa81 2019-01-15T19:06:47 Enable Chromium clang style plugin for libANGLE. This fixes a few style warnings: * auto should not deduce to raw pointer type * inlined virtual methods are not allowed * non-trivial constructors and destructors should be explicit * inlined non-trivial constructors should not be in-class * missing override keywords Bug: angleproject:3069 Change-Id: I3b3e55683691da3ebf6da06a5d3c729c71b6ee53 Reviewed-on: https://chromium-review.googlesource.com/c/1407640 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 7c985f5c 2018-11-29T18:16:17 Make angle::Result an enum. This moves away from a class type to a value type. This should improve performance when using angle::Result as a return value. Previously the generated code would return a pointer instead of a value. Improves performance in the most targeted microbenchmark by 10%. In more realistic scanarios it will have a smaller improvement. Also simplifies the class implementation and usage. Includes some unrelated code generation changes. Bug: angleproject:2491 Change-Id: Ifcf86870bf1c00a2f73c39ea6e4f05ca705050aa Reviewed-on: https://chromium-review.googlesource.com/c/1356139 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 66f0d2c1 2018-11-30T15:25:36 Make Framebuffer attachments angle::Subjects. Now that there's storage change notifications in the GL front-end we no longer need to give the back-end access to the angle::Subject. The Texture object is a special case where it has mirrored dirty bits. To keep the gl::Texture class notified of when the Impl has dirty bits we make the TextureImpl class an angle::Subject that is observed by the gl::Texture class. This will enable further dirty bits improvements. Bug: angleproject:2966 Change-Id: Id22da0926f51ff4679e58af3e62903f4d7948915 Reviewed-on: https://chromium-review.googlesource.com/c/1347670 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4f6592fa 2018-11-27T16:37:45 Remove gl::Error. Removes several TODOs. Only egl::Error remains. Also slightly decreases binary size. Bug: angleproject:2491 Change-Id: I3a9d1c22eb0884ca9e37362463fddd0083faf826 Reviewed-on: https://chromium-review.googlesource.com/c/1337462 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill b980c563 2018-11-27T11:34:27 Reformat all cpp and h files. This applies git cl format --full to all ANGLE sources. Bug: angleproject:2986 Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f Reviewed-on: https://chromium-review.googlesource.com/c/1351367 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 6ba22ee1 2018-10-26T16:15:40 GL: Implement EGL_ANDROID_get_frame_timestamps. BUG=angleproject:2936 Change-Id: I758d797d185b2de330cce3401bfeef76c7df590e Reviewed-on: https://chromium-review.googlesource.com/c/1302836 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 4024e217 2018-10-17T14:53:29 perftests: Record trace events to JSON file. This allows us to view the timeline of events in the trace event browser. We can extend this to do GPU timestamp queries and analyze when work is actually in flight. The trace is enabled in standalone ANGLE only using the flag --enable-trace with angle_perftests. You can also optionally specify the trace output file with --trace-file <blah>. The default file is ANGLETrace.json. Bug: angleproject:2781 Change-Id: I871f28545d9bf18220b55aaf69e9554dcb4c834d Reviewed-on: https://chromium-review.googlesource.com/c/1259763 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Yuly Novikov 2eb54074 2018-08-22T16:41:26 Fix EGLImage pixel format validation This fixes the scenario when EGLImage source and target have different types. For example, a texture is created with unsigned format using glTexImage2D, it is used as a source of EGLImage with eglCreateImageKHR, and then the EGLImage is used to create a renderbuffer target with glEGLImageTargetRenderbufferStorageOES. OES_EGL_image doesn't specify what should happen in this case, but GL implementations (Nexus 5X) seem to allow using this renderbuffer in glFramebufferRenderbuffer and the resulting framebuffer is complete. Thus, in this case, instead of checking whether the renderbuffer format can be used in glFramebufferRenderbuffer, we need to check whether the original texture can be used in glFramebufferTexture2D. Similarly in reverse direction. Also, for the case of source renderbuffer and target texture, presume that glEGLImageTargetTexture2DOES will succeed regardless of renderbuffer format. 1. Add isRenderable and isTexturable checks to egl::Image class, and perform different checks depending on source type. 2. Add isRenderable check to FramebufferAttachment and delegate EGLImage attachments check to egl::Image. 3. Use these checks in validation of EGLImageTargetTexture2D, EGLImageTargetRenderbufferStorage and when checking attachment completeness Bug: angleproject:2567 Change-Id: I8e9f4a2930a4075a4d8464f62582c6825270187e Reviewed-on: https://chromium-review.googlesource.com/1192585 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
LRN 03d132eb 2018-07-14T13:31:35 Support EGL_(WIDTH|HEIGHT) in eglSurfaceAttrib(), fixed resize Setting EGL_WIDTH or EGL_HEIGHT results in mFixedWidth and mFixedHeight changing their values. Whenever the swap chain is tested for needing a resize, surfaces with mFixedSize are treated as if they should be resized to mFixedWidth and mFixedHeight from their current size. This way fixed-size surfaces can be resized - it's enough to do a couple of eglSurfaceAttrib() calls and then either let ANGLE check surface for needing a resize in due course, or force that by calling eglWaitNative(). BUG=angleproject:2725 Change-Id: I2932d8ecd5a2f10500e4aa8583a169aa09bf01bb Reviewed-on: https://chromium-review.googlesource.com/1139055 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill e62489f3 2018-07-16T19:12:33 Surface: Use ref count for bindTexImage. This frees up one more use of ProxyContext. It will also keep the bound surface alive until it is unbound from a Texture. Two usages of the proxy context remains. * DisplayD3D::restoreLostDevice. * Display::destroyImage. Bug: angleproject:2714 Change-Id: Ied72c6ebe060d7fc1743b3313e162d540fcbfe02 Reviewed-on: https://chromium-review.googlesource.com/1137878 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill e8cc4a64 2018-07-09T09:18:49 Surface: Don't use a BindingPointer for BindTexImage. The BindingPointer pattern isn't necessary. Every time we delete a Texture we call ReleaseTexImage internally. There shouldn't be any time that we keep an orphaned Texture is Surface. This cleans up one place where we were using the ProxyContext. Bug: angleproject:2714 Change-Id: I3b0fd2125d02ea7545922ec6da7f487451bed871 Reviewed-on: https://chromium-review.googlesource.com/1128925 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Geoff Lang 75359664 2018-04-11T01:42:27 Implement EGL_KHR_debug. BUG=angleproject:1618 Change-Id: I790944b49badc910b6c72266469fcb8e86ac4252 Reviewed-on: https://chromium-review.googlesource.com/1019387 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jiawei Shao a8802477 2018-05-28T11:17:47 ES31: Implement FramebufferTextureEXT on OpenGL back-ends This patch intends to implement FramebufferTextureEXT on OpenGL back-ends. 1. Support layered framebuffer attachments. 2. Add new framebuffer completeness rules on layered framebuffer attachments. 3. Support FRAMEBUFFER_ATTACHMENT_LAYERED_EXT as a valid <pname> parameter of GetFramebufferAttachmentParameteriv. Note that for an entire level of a cube map: 1. It has no TextureTarget because TEXTURE_CUBE is not a valid target for TexImage*D. 2. It corresponds to 6 ImageDescs (that represents its faces) in class Texture, so when the cube map is cube complete, we return the ImageDesc of its first face, meanwhile we do not allow querying ImageDesc if it is not cube complete. BUG=angleproject:1941 TEST=angle_end2end_tests dEQP-GLES31.functional.geometry_shading.query.framebuffer_attachment_layers dEQP-GLES31.functional.geometry_shading.query.framebuffer_incomplete_layer_targets dEQP-GLES31.functional.geometry_shading.layered.* dEQP-GLES31.functional.geometry_shading.instanced.invocation_per_layer_* dEQP-GLES31.functional.geometry_shading.instanced.multiple_layers_per_invocation_* Change-Id: I44393b513ec8f1a682fd1c47d3eaa6f3b3fae877 Reviewed-on: https://chromium-review.googlesource.com/1075811 Commit-Queue: Jiawei Shao <jiawei.shao@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang e1a057e8 2018-06-07T15:09:00 Fully format some files. Change-Id: Id6ea245849696d4c6d7eabc6860c0ac424dd8013 Reviewed-on: https://chromium-review.googlesource.com/1091309 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang bf7b95db 2018-05-01T16:48:21 Create a default framebuffer per surface/context pair on MakeCurrent. Sharing a gl::Framebuffer object between multiple contexts causes problems if contexts are not virtualized because the native framebuffer objects are not shared between these contexts. The FramebufferImpl created should be the glue that binds a specific context to a specific surface. Update the SurfaceImpl implementations to re-create the framebuffer object before passing it to FramebufferGL. No backing resources will be re-created. BUG=angleproject:2464 Change-Id: Id0b13a221c22b71517b25cb5b1ef2392ad2ecdd6 Reviewed-on: https://chromium-review.googlesource.com/1039985 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 1da46774 2018-05-14T14:30:30 Add support for EGL_ANDROID_presentation_time. BUG=angleproject:2506 Change-Id: I46b3c6ac7f259eabfdd8ea5799da6ef563ff81ee Reviewed-on: https://chromium-review.googlesource.com/1057997 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang 2cb7f974 2018-05-07T13:49:13 GL: Refactor TextureGL to not hold renderer objects. BUG=angleproject:2464 Change-Id: I24b07557d90988369bc8b7e4b2fe3a500ab7bc36 Reviewed-on: https://chromium-review.googlesource.com/1048115 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang ce07f967 2018-05-09T11:27:06 Merge the Framebuffer onDestroy and onDestroyDefault methods. Pass the proxy context to the onDestroyDefault call. BUG=angleproject:2464 Change-Id: I47f869d623e238ca3680c962387ba9359e7d3844 Reviewed-on: https://chromium-review.googlesource.com/1052220 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang ccafa62c 2018-05-02T13:07:53 Pass a context pointer to SurfaceImpl::[bind|release]TexImage. BUG=angleproject:2464 Change-Id: I59fd38c626f7076b4065f25601de3e53c1a446ad Reviewed-on: https://chromium-review.googlesource.com/1040051 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 8ceea819 2018-04-10T03:07:13 Refactor packed enum generation to support EGL enums. Convert the very simple EGL texture type enum. BUG=angleproject:1618 Change-Id: Ieea382a282a8f2544f2982627e8445e6e5cea826 Reviewed-on: https://chromium-review.googlesource.com/1019386 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill d7518622 2018-03-27T09:44:31 Buffer11: Refactor Subject/Observer pattern. Instead of having a direct/static observer distinction, add two messages for 'Contents Changed' and 'Storage Changed'. This makes Buffer11 itself the subject with two different message handling cases in the onSubjectStateChange methods. Bug: angleproject:2389 Change-Id: I645cd4b7cc7ce51cb7f48a01c7fc72939cbe89fe Reviewed-on: https://chromium-review.googlesource.com/957940 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 888081d5 2018-02-27T00:24:46 D3D11: Refactor dependent Framebuffer state changes. Previously, when a state change would cause a Texture to recreate its storage specific to D3D11, we would use a dependent notification from RenderTarget11 to Framebuffer11 to re-check internal dirty bits. In this new method, we instead set dirty bits on the gl::Frambuffer directly. This also means we use fewer internal objects for these notifications, because we share the same structures between the D3D11 back-end notifications and the top-level notifications we use for Robust init and Framebuffer completeness. This also allows us to get rid of one "if" that we check on every draw call in D3D11. This also introduces a dirty bits guard concept - a shadow set of dirty bits that is checked in dependent state changes to ensure that extra bits aren't set inside syncState. This also implements Framebuffer dirty bits for the D3D9 back-end. This has the side effect of cleaning up the "null colorbuffer" D3D9 workaround. Bug: angleproject:2372 Change-Id: Ie346d39030f4f6df583d735685b0babea4e745a8 Reviewed-on: https://chromium-review.googlesource.com/936691 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill d444255a 2018-02-27T22:03:47 Refactor signal utils into Observer pattern. These types were over-generalized. All use cases featured arrays of resources attached to single parent resources. The channel ID is sufficient to identify the child resource in the parent, and having variadic template arguments wasn't necessary. Futhermore we can rename these types to use the common Observer pattern. This should make them more readable to new developers. Also update some classes to inherit from Subject instead of having a member Subject. This cleans up the code in a few places. This should lead to a simpler refactor to allow dependent dirty bits notifications in the Vulkan back-end. In the following patch the signal_utils files will be renamed. They are not renamed in this patch to ensure git history is preserved. Bug: angleproject:2372 Change-Id: I17a3f2c8d92afd4bb3cba2d378c3a2e8a6d7fb11 Reviewed-on: https://chromium-review.googlesource.com/936690 Reviewed-by: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang 8170eab7 2017-09-21T13:59:04 D3D: Implement robust resource init for Surfaces. BUG=angleproject:2107 BUG=angleproject:2317 Change-Id: I22260e1093dc6c09e4627c62a95ca4088c99e951 Reviewed-on: https://chromium-review.googlesource.com/678480 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 61773640 2018-02-09T10:12:21 Skip PostSubBuffer calls that have zero size. BUG=810411 Change-Id: I8770b69fe4ab8a8f9bacd141c89e7f83f67f15fb Reviewed-on: https://chromium-review.googlesource.com/911589 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Olli Etuaho ceffd20c 2018-01-08T16:39:45 Set colorspace of D3D pbuffers according to DXGI format When a EGL pbuffer is created based on a D3D SRGB texture using EGL_ANGLE_d3d_texture_client_buffer, SRGB conversions are performed as if it was an SRGB surface. The value of EGL_GL_COLORSPACE now reflects that correctly. If the pbuffer is bound to a texture and used as a framebuffer attachment, querying GL_FRAMEBUFFER_COLOR_ATTACHMENT also reflects that correctly. The behavior is the same on both the D3D backend, where there is no native interop involved, and on the GL backend using WGL_NV_DX_interop(2). There are a few limitations on the GL backend that relies on native interop: 1. SRGB conversion for textures created this way can't be disabled using the GL_FRAMEBUFFER_SRGB_EXT toggle that's exposed in ANGLE through EXT_sRGB_write_control. This is now documented in the EGL_ANGLE_d3d_texture_client_buffer spec. On the D3D backend this is not a problem since EXT_sRGB_write_control is not supported either way. 2. Creating a pbuffer out of a D3D11 texture with the format DXGI_FORMAT_B8G8R8A8_UNORM_SRGB does not work, even though it was listed as one of the supported formats in the EGL_ANGLE_d3d_texture_client_buffer spec. It's now mentioned that support for this format is optional. BUG=angleproject:2300 TEST=angle_white_box_tests Change-Id: I70ee0646680805e4469291a5b2ce59e92fda009e Reviewed-on: https://chromium-review.googlesource.com/866743 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Corentin Wallez 9db70de8 2017-07-04T18:28:42 Reland: Implement EGL_ANGLE_iosurface_client_buffer Includes a fix for creating pbuffers with <buftype> EGL_D3D_TEXTURE with EGL_WIDTH and EGL_HEIGHT attributes. BUG=angleproject:1649 TBR=geofflang@chromium.org Change-Id: Id2974b8fab02c3218febfac708b9b034e65cbc53 Reviewed-on: https://chromium-review.googlesource.com/823248 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 7f5c3eb7 2017-12-12T14:54:17 Revert "Implement EGL_ANGLE_iosurface_client_buffer" This reverts commit c7abc08034a30a41748eefc5b628a76d4e2daa8a. Reason for revert: Might have broken Chromium Win10 composition due to validation changes. Original change's description: > Implement EGL_ANGLE_iosurface_client_buffer > > BUG=angleproject:1649 > > Change-Id: I1e72c31d7c9497ad14039a8d3fb97317ab193cb2 > Reviewed-on: https://chromium-review.googlesource.com/559107 > Reviewed-by: Corentin Wallez <cwallez@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Corentin Wallez <cwallez@chromium.org> TBR=geofflang@chromium.org,cwallez@chromium.org Change-Id: I605b710b6d76056d6276b09822cd6ddca277bfd0 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:1649 Reviewed-on: https://chromium-review.googlesource.com/822172 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez c7abc080 2017-07-04T18:28:42 Implement EGL_ANGLE_iosurface_client_buffer BUG=angleproject:1649 Change-Id: I1e72c31d7c9497ad14039a8d3fb97317ab193cb2 Reviewed-on: https://chromium-review.googlesource.com/559107 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Jamie Madill acf2f3ad 2017-11-21T19:22:44 Apply Chromium style fixes. This addresses several minor code quality issues that are validated in Chromium, but not yet applied to ANGLE: * constructors and destructors must be defined out-of-line * auto is not allowed for simple pointer types * use override everywhere instead of virtual * virtual functions must also be defined out-of-line Slightly reduces binary size for me (~2k on Win, 150k on Linux). Bug: angleproject:1569 Change-Id: I073ca3365188caf5f29fb28d9eb207903c1843e6 Reviewed-on: https://chromium-review.googlesource.com/779959 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang b433e872 2017-10-05T14:01:47 Change robust resource init into a context creation attribute. Enabled support on OpenGL even through the extension is not fully implemented so that testing with Chromium/Passthrough commmand decoder is still possible. BUG=angleproject:1635 Change-Id: Ia417b1779aace1eae19514325701a79cd33f4ef3 Reviewed-on: https://chromium-review.googlesource.com/678479 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang e159717d 2017-10-05T12:02:30 Filter EGL attributes before passing them to the native driver. Adding extensions that are not native driver extensions would cause surface creation to fail. BUG=angleproject:1635 Change-Id: I2f683ee0560e463aa06f3ba92d0bf3f3d8c8927d Reviewed-on: https://chromium-review.googlesource.com/701602 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill c1abf917 2017-10-03T15:08:33 Fix leaking objects with UniqueObjectPointer. BUG=angleproject:2170 Change-Id: Ie0473022c153c4b70f350cab0c208dd3a0670c40 Reviewed-on: https://chromium-review.googlesource.com/691374 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 05b35b21 2017-10-03T09:01:44 D3D11: Lazy robust resource init. This patch moves the robust resource init logic to the GL front-end. Instead of initializing texture resources immediately on creation in D3D11, it defers the clear until before a draw call in some cases, or skips the update if we can determine if a texture (or other resource) has been fully initialized. Currently lazy init is only implemented for Textures, Renderbuffers, and Surfaces. Various places where lazy resource init is triggered: * Framebuffer operations (Draw, Blit, CopyTexImage, Clear, ReadPixels) * Texture operations (SubImage, GenerateMipmap, CopyTexImage) Some efficiency gains remain to be implemented, such as when a SubImage call fills the entire object. Similarly for Blit, and a few other operations. In these cases we can skip lazy init as an optimization. Edge cases with EGLImage are mostly untested. BUG=angleproject:2107 Change-Id: I2bf3a69b1eae0d4feeb5b17daca23451f1037be8 Reviewed-on: https://chromium-review.googlesource.com/576058 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 40ac783b 2017-07-26T14:38:46 Implement remaining eglQuerySurface and eglSurfaceAttrib enums. BUG=angleproject:2075 Change-Id: I3b500fe80512e7a3e3a9ae9a9724015952c9cbc8 Reviewed-on: https://chromium-review.googlesource.com/587299 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 4928b7ca 2017-06-20T12:57:39 Proliferate gl::Context everywhere. This gives the D3D back-end access to the GL state almost anywhere. This uses the onDestroy hook for Textures to push errors up from destructors, although they still don't quite make it to the Context. There are places, such as in EGL object (Context/Surface) destruction, where we end up calling through to GL implementation internals without having access to a gl::Context. We handle this via a proxy Context to a Display, basically a null context, that has access to impl-side state like the Renderer pointer if necessary. It does not have access to the normal GL state. Also Pass gl::Context to RefCountObject::release(). Since we're using destroy() methods now, we should not ever call the destructor directly. BUG=angleproject:1156 Change-Id: Ie4c32ad6bf6caaff0289901f30b5c6bafa2ce259 Reviewed-on: https://chromium-review.googlesource.com/529707 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 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>