src/libANGLE/renderer/vulkan/SurfaceVk.cpp


Log

Author Commit Date CI Message
Steven Noonan ac263582 2023-06-19T12:26:44 Vulkan: add workaround for VK_EXT_full_screen_exclusive on AMD On outdated (but recent) AMD drivers, the Windows-only Vulkan extension VK_EXT_full_screen_exclusive appeared to be implicitly enabled and set to VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT mode. Even though ANGLE did not enable or interact with this extension at all, the driver was incorrectly returning VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT error codes on various swapchain operations when the full screen window focus was lost (i.e. alt-tab out and back in). Naturally, ANGLE was not expecting these error codes and did not know how to handle them. Depending on where the errors occurred, ANGLE might crash or retry creating the swapchain repeatedly. Treating the unexpected VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT error code as VK_ERROR_OUT_OF_DATE_KHR/VK_SUBOPTIMAL_KHR was not sufficient, because the driver would repeat the error on every swapchain operation, apparently expecting the error to be handled by a vkAcquireFullScreenExclusiveModeEXT call (even though that would make no sense, since the extension was not enabled). The incorrect driver behavior was reported to AMD and was fixed in recent driver releases. The earliest driver I've tested and know to be working is AMD's Adrenaline driver version 23.5.2 (VkPhysicalDeviceProperties calls this driverVersion 2.0.262/0x800106). The last known bad version was 0x8000e9. The simplest workaround on these older AMD graphics drivers is to explicitly enable the extension, but set it to VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT mode. On newer drivers we do not need to do anything with the extension and can ignore it. Bug: angleproject:8215 Change-Id: I7c58d47a0350f4b0bc1a77f200c1e2f72fcde8d8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4627279 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 86e21fa2 2023-06-12T13:36:21 Vulkan: Refactor angle::Format depth/stencil checks Bug: b/246008627 Change-Id: If0a2992c5bd66adf27c6866aea04e54ba465a522 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4608489 Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Igor Nazarov dbffa5d3 2023-05-30T15:43:45 Vulkan: Update present history logic Keeping old Swapchain's `ImagePresentOperation`s with Fences can lead to multiple "old swapchains" lists. This may cause situations exceeding the `kMaxOldSwapchains` limit. Instead of marking `ImagePresentOperation` as corresponding to an older swapchain, accumulate all present history in the `mOldSwapchains`. Since Fences are only used when VK_EXT_swapchain_maintenance1 is supported, instead of attaching "old swapchains" to the first present operation, they are destroyed when present Fences are signaled in the new `cleanUpOldSwapchains()` method. Also this CL fixes a bug: if (mPresentHistory.empty() || mPresentHistory.back().imageIndex == kInvalidImageIndex) The above condition will always pass when VK_EXT_swapchain_maintenance1 is supported. Bug: angleproject:7847 Change-Id: I1a41944456756b8af740f1903c873823323a2e0b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4505952 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Igor Nazarov 95f57b19 2023-01-17T19:24:04 Vulkan: Fix Shared Present Mode "acquireNextSwapchainImage()" - no need to call "vkAcquireNextImageKHR()" in Shared Present Mode. - proper VkResult processing (VK_SUBOPTIMAL_KHR replaced with VK_SUCCESS). Bug: angleproject:6878 Change-Id: Ib20ae1f5de3a3cc13bfc4ef034076e3402f93d31 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4489464 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Igor Nazarov 552e7468 2023-05-26T18:39:55 Vulkan: Do not use ANI Fence in present semaphore recycling Fences from `vkAcquireNextImageKHR()` has many problems on some Intel drivers, and one of them does not have a workaround. Instead of using ANI Fence, this change will use `swapSerial`, that has execution dependency on ANI semaphore. As result, semaphore recycling will be delayed a little longer, until the Device finises rendering to the image. On practice, this will not significantly affect the total number of allocated semaphores. As a bonus, this change also fixes a bug with Shared Present Mode: Current logic assumes that PE will only signal image's ANI fence after waiting on previous present semaphore with this image. In reality, PE returns same image index and fence that is always signaled. Additionally, ANI call is not required at all. There is no 100% safe solution when not using: VkSwapchainPresentFenceInfoEXT This CL will recycle present semaphores only after next present semaphore is signaled. This not only ensures, that present semaphores are not reused inflight, but also gives time to PE to finish waiting on the semaphore until next present. Bug: angleproject:8155 Bug: angleproject:7847 Change-Id: Ia112190d77ea7e04f8f9755cf56f5387744dc599 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4572426 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Igor Nazarov 53b2db67 2023-05-26T13:34:39 Vulkan: Reset Swapchain Fence before recycling Depending on the Intel GPU hardware and driver version, crash may happen when accessing ANI Fence after Swapchain destruction. This access includes call to: `vkGetFenceStatus()`, `vkWaitForFences()`, `vkResetFences()`, and `vkDestroyFence()`. Resetting Fence before recycling will "detach" it from the Swapchain, allowing safe usage/destruction of the Fence after that Swapchain destruction. For other devices and drivers, this change is harmless. Only difference is that there will be extra reset calls for items that were recycled but never used before (number of such cases extremely low, compared to cases when Fences are reused). Additionally, this change adds `ASSERT(garbageObject.valid())` into the `Recycler<>`. Before this change, it was possible to recycle invalid fence in the `ImagePresentOperation::destroy()` method. Luckily, this happened only in `WindowSurfaceVk::destroy()`, where invalid recycled fence is not used (it is safe to destroy invalid fence). Bug: angleproject:8155 Change-Id: I0adbaf63333536523004a077977eb68cfaccd6f7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4572425 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com>
Igor Nazarov bcccb6c4 2023-05-30T18:21:06 Vulkan: Minor fix in doDeferredAcquireNextImage() method If call `doDeferredAcquireNextImage()` after `prepareSwap()`, the `prepareForAcquireNextSwapchainImage()` method will be called again, and may possible recreate the Swapchain while there is ANI result that needs processing. In the current code the above is not possible (except if call `prepareSwap` directly from the application side). This may be possible in the future, when ANI is deferred until RenderPass end, that may happen in the `flushImpl()` of the `swapImpl()`. This change skips `prepareForAcquireNextSwapchainImage()` if there is ANI result that needs processing. Additionally, `doDeferredAcquireNextImageWithUsableSwapchain()` call in `swapImpl()` replaced with `doDeferredAcquireNextImage()` for simplicity. Possible call sequences after this change: prepareSwap: prepareForAcquireNextSwapchainImage() doDeferredAcquireNextImageWithUsableSwapchain() or prepareSwap: prepareForAcquireNextSwapchainImage() TryAcquireNextImageUnlocked() other API: doDeferredAcquireNextImage(): // skipped - prepareForAcquireNextSwapchainImage() doDeferredAcquireNextImageWithUsableSwapchain() or other API: doDeferredAcquireNextImage(): prepareForAcquireNextSwapchainImage() doDeferredAcquireNextImageWithUsableSwapchain() Bug: angleproject:6851 Bug: angleproject:8133 Change-Id: I4f973c05821fc9e43769cc2621f4467790118f23 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4572424 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Igor Nazarov 7b07818e 2023-05-29T19:46:40 Vulkan: Call resetAcquireNextImageSemaphore() only when required Currently resetAcquireNextImageSemaphore() is called for each swapchain image when swapchain is recreated and when EGLSurface is destroyed. Releasing semaphores in case of swapchain recreation is not necessary, since swapchain should not be recreated while there still image that needs presenting. Call removed to reveal possible bugs, when recreate happens without such present. In case of EGLSurface destruction there may be only one image that has semaphore. Call moved from `destroySwapChainImages()` to `destroy()`. Bug: b/275624771 Change-Id: Ia4ce678f2b73785818150dfb276b19a5f5b7d25f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4567550 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Igor Nazarov da41e7d9 2023-05-29T19:17:48 Vulkan: Account for queueSubmitOneOff() in SurfaceVk::mUse There is a possibility to destroy EGLSurface without waiting for `queueSubmitOneOff()` submission. One possible way to reproduce the problem is to query `EGL_BUFFER_AGE_EXT` without any rendering in the EGL_SINGLE_BUFFER mode. This is a regression from: Reland "Vulkan: SurfaceVk should only wait for GPU work that uses it" https://chromium-review.googlesource.com/c/angle/angle/+/4406891 Test: angle_end2end_tests --gtest_filter=EGLSingleBufferTest.WaitOneOffSubmission* Bug: b/267806287 Change-Id: I9478fcc4fd64b38747cbd80dea51137da9ef5f21 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4567549 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov e24f4519 2023-01-19T02:30:39 Vulkan: Add externalFence into submitCommands() Currently one-off fence in the `queueSubmitOneOff()` is used only in `SyncHelperNativeFence::initializeWithFd()` to submit external fence. Other `queueSubmitOneOff()` calls may use `QueueSerial` instead of a fence. Providing `fence` into `queueSubmitOneOff()` prevents tracking that submission with `QueueSerial`. Therefore using `mUse` to collecting `mFenceWithFd` as garbage will not work as intended. This CL removes `fence` from `queueSubmitOneOff()` and adds optional `externalFence` into `submitCommands()` instead. Providing `externalFence` will cause additional `vkQueueSubmit()` call: - first submission will submit everything as usual except using the `externalFence`. - second, will only submit internal `CommandQueue` fence for `QueueSerial` tracking. As the result of this CL, call to `initializeWithFd()` will always produce two (2) `vkQueueSubmit()` calls. Previously it may be one (1) or two (2) submissions. Future CL will reduce submission count to one (1). If add additional submission into `queueSubmitOneOff()` instead of `submitCommands()`, then maximum number of submissions will be three (3). Bug: angleproject:8117 Change-Id: I6f1ec12682aaab71bfc871e665fec2659df96b26 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4392877 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
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 d6481cdf 2023-04-18T22:36:39 Vulkan: Make eglPrepareSwapBuffersANGLE thread-safe This function now only calls vkAcquireNextImageKHR without any further processing of its results. That is deferred to the following eglSwapBuffers call which does that under the share group lock. The vkAcquireNextImageKHR call, together with the allocation of its related semaphore and fence are protected by a fine-grained lock. mNeedToAcquireNextSwapchainImage is turned atomic to guard against races to call vkAcquireNextImageKHR from multiple contexts. Note that the latter is not currently possible, but will be once calling vkAcquireNextImageKHR is moved to the end of the render pass. Bug: angleproject:6851 Bug: angleproject:8133 Change-Id: If2eeab475b4acf0621fd930c43d9d86a78a9197b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4445495 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov aa1dc5da 2023-05-03T19:36:04 Revert "Vulkan: Simplify present history logic" This reverts commit 1dee7cad284dda0c7c3ca18c10d8b7764353c7b0. Reason for revert: error: SurfaceVk.cpp:784 (destroy): ! Assert failed in destroy (..\..\src\libANGLE\renderer\vulkan\SurfaceVk.cpp:784): fence.getStatus(device) == VK_SUCCESS Example builds: https://ci.chromium.org/ui/p/angle/builders/try/win-test/13341/overview https://ci.chromium.org/ui/p/angle/builders/try/win-test/13345/overview Original change's description: > Vulkan: Simplify present history logic > > Instead of marking `ImagePresentOperation` as corresponding to an older > swapchain, accumulate all present history in the `mOldSwapchains`. > > Keeping old Swapchain's `ImagePresentOperation` with Fences can lead to > multiple "old swapchains" lists. This may cause situations exceeding > the `kMaxOldSwapchains` limit. > > Keeping items with Fences may help cleanup resources faster, but I think > that it is not worth the code complexity. It also should be safe to > recycle Fences at the same time as the Semaphores (when the first image > is recycled). > > Also this CL may fix bug: > if (mPresentHistory.empty() || mPresentHistory.back().imageIndex == kInvalidImageIndex) > The above condition will always pass when using actual present Fences > (VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_FENCE_INFO_EXT). > > Bug: angleproject:7847 > Change-Id: I39d854b03733dcb976c6bd7eb5f848d0cbece5d6 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4481251 > Reviewed-by: Charlie Lao <cclao@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Bug: angleproject:7847 Change-Id: Icf0cf5b12dd1efa682abebd83699b8d87dc07427 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4502778 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov 1dee7cad 2023-01-17T18:01:49 Vulkan: Simplify present history logic Instead of marking `ImagePresentOperation` as corresponding to an older swapchain, accumulate all present history in the `mOldSwapchains`. Keeping old Swapchain's `ImagePresentOperation` with Fences can lead to multiple "old swapchains" lists. This may cause situations exceeding the `kMaxOldSwapchains` limit. Keeping items with Fences may help cleanup resources faster, but I think that it is not worth the code complexity. It also should be safe to recycle Fences at the same time as the Semaphores (when the first image is recycled). Also this CL may fix bug: if (mPresentHistory.empty() || mPresentHistory.back().imageIndex == kInvalidImageIndex) The above condition will always pass when using actual present Fences (VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_FENCE_INFO_EXT). Bug: angleproject:7847 Change-Id: I39d854b03733dcb976c6bd7eb5f848d0cbece5d6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4481251 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Shahbaz Youssefi 5c04f18a 2023-04-24T16:18:24 Vulkan: Remove DisplayVk param from ToEGL It's no longer used Bug: angleproject:3041 Change-Id: I5063152d1598aa5d40d94bbf5c643a1288589037 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4470387 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com>
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>
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>
Charlie Lao b875f47b 2023-04-24T11:11:03 Vulkan: Make mLastSubmittedQueueSerial reflect what it means Right now we always update ContextVk::mLastSubmittedQueueSerial and ContextVk::mLastFlushedQueueSerial when context becomes current, even though it does not make any submission. It was done it this way mainly for simplification (i.e, you will always see both queueSerial's index the same). But this also causes a performance cost when a mLastSubmittedQueueSerial is used to tag a resource. For example, if you insert a EGLSync right after makeCurrent, that EGLSync may get a queue serial number bigger than it should be, which will translate to longer sync wait time. This CL changes these two queue serial to exact what the name suggests, that it will only update if we made a "flush" or "submit" call. Bug: b/277644512 Change-Id: Ibe4c78985a3fe0726836d620202e5276894a8e7c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4458532 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Charlie Lao 663b60b5 2023-04-12T09:51:32 Vulkan: More consistent fix for single buffer ANI semaphore wait Transition into single buffer mode are generating two ANI calls. This CL slightly improves the previous CL (crrev.com/c/4400011)'s handling of ANI semaphore wait for single buffer mode. Instead of catching outstanding ANI semaphore at present time, this CL consumes the semaphore immediately just like layout change Bug: b/275624771 Change-Id: I5418ec47b6bfc77af411c9205e1ae27adeb27976 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4419126 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 9ae918cb 2023-02-03T15:14:00 Reland "Vulkan: SurfaceVk should only wait for GPU work that uses it" This is a reland of commit 5b63e1dc1d5e96018d0ad30582265a612d309f3b The added fix is add contextVk::mLastSubmitQueueSerial into Surface::mUse before calling finish. Original change's description: > Vulkan: SurfaceVk should only wait for GPU work that uses it > > Right now when we destroy swapchain, we call mRenderer->finish() to > finish everything, even though the work is unrelated to this surface. > This CL changes it to only wait for ResourceUse of all images in the > swapChain. > > Bug: b/267806287 > Change-Id: I33d136ad50961fbf5fbb200ff0f89f1dbf23585d > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4220723 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Charlie Lao <cclao@google.com> Bug: b/267806287 Change-Id: I160fd22595fcf292cc53c055e0678befa3b8501b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4406891 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao d58fbf04 2023-04-05T12:32:09 Vulkan: Wait for surface ANI semaphore only if image is used Right now there is a bug that surface's ANI semaphore is added to context when WindowSurfaceVk::getAttachmentRenderTarget get called, which gets called from FramebufferVk::syncState, which is before we end the previous render pass, due to the endRenderpass usually is deferred until next renderPass starts. This caused ANI semaphore gets added to the previous render pass's submission, which does not use surface, and thus a bubble in GPU execution pipeline where the user FBO rendering gets unnecessarily blocked until ANI semaphore is signaled. This lowers GPU utilization and thus GPU frequency gets dropped and frame time increased. This CL stores ANI semaphore to ImageHelper object and when barrier is generated, the ANI semaphore is moved to CommandBuffer. When CommandBuffer gets flushed and submitted, it gets added to the waitSemaphores vector and submitted to vulkan. Since all use of swap chain image must go through barrier code first (you need at least change layout), this ensures ANI semaphore gets waited in exact and robust way. Only the submission that references the swap chain image will be waited. With this CL, professional_baseball_spirits reduces frame time from 3.8 ms to 2.7 ms, achieving parity with native GLES on pixel 7 pro. Bug: b/275624771 Change-Id: Ifa6cacf9e3bc147bfde54eb7def2fca48c50aca0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4400011 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 65ed3050 2023-04-04T11:57:38 Vulkan: Let recordWriteBarrier use CommandBufferHelper This is preparation for next CL. It changes OutsideRenderPassCommandBuffer argument to OutsideRenderPassCommandBufferHelper for recordWriteBarrier() and recordReadBarrier() calls, so that it has access to the helper object (will be used in next CL). It passes CommandsState to executeBarriers() instead of PrimaryCommandBuffer. No actual functionality change is expected. Bug: b/275624771 Change-Id: Ia06a0398a127539b0b642005803a498cb2a9d7f1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4400407 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov 233c128b 2023-01-17T19:21:58 Vulkan: Fix UBs when deleted attachment is used in a RenderPass. Problem: - "RenderbufferVk"/"TextureVk" with "mOwnsImage == false" used as RenderPass attachment. - "RenderbufferVk"/"TextureVk" deleted. - Owning resource is destroyed ("EGLImage" and all siblings / "EGLSurface"). - Crash (UB) may happen when ending RenderPass, flushing or executing commands. Fix adds tracking of "vk::ImageSourceID" value in "vk::RenderPassAttachment" - IDs of objects, that originally provide "vk::ImageHelper" images. This is necessary, because when using EGLImage, there may be multiple "TextureVk" objects with same "vk::ImageHelper", and need to call "finalizeImageLayout()" for the correct attachment. Bug: angleproject:8032 Test: angle_end2end_tests --gtest_filter=ImageTest*DeletedWhileInUse* Test: angle_end2end_tests --gtest_filter=PbufferTest.UseAsFramebufferColorThenDestroy* Change-Id: I50fdd9d6b6a9677adad2262373303b46de1dee4c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4296014 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Roman Lavrov 7ee61366 2023-03-09T16:18:56 Revert "Vulkan: SurfaceVk should only wait for GPU work that uses it" This reverts commit 5b63e1dc1d5e96018d0ad30582265a612d309f3b. Reason for revert: angle_deqp_internal_main_presubmit device lost in android rolls https://anglebug.com/8073 Original change's description: > Vulkan: SurfaceVk should only wait for GPU work that uses it > > Right now when we destroy swapchain, we call mRenderer->finish() to > finish everything, even though the work is unrelated to this surface. > This CL changes it to only wait for ResourceUse of all images in the > swapChain. > > Bug: b/267806287 > Change-Id: I33d136ad50961fbf5fbb200ff0f89f1dbf23585d > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4220723 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Charlie Lao <cclao@google.com> Bug: b/267806287 Bug: angleproject:8073 Change-Id: Id0bfe7be670b7d44ed91e61f2c98a189bd1f214c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4324718 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com>
Igor Nazarov ad7949c6 2023-01-17T19:24:59 Vulkan: Remove "rx::vk::ImageHelper" move constructor. Move constructor was only used in the "rx::SwapchainImage" structure. This CL replaces "image" member with "std::unique_ptr<vk::ImageHelper>". This will remove source of bugs. Bug: angleproject:8052 Change-Id: Ic16f674095233baaa56fbe8a8fb7ef3e323a7331 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4294905 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Charlie Lao 5b63e1dc 2023-02-03T15:14:00 Vulkan: SurfaceVk should only wait for GPU work that uses it Right now when we destroy swapchain, we call mRenderer->finish() to finish everything, even though the work is unrelated to this surface. This CL changes it to only wait for ResourceUse of all images in the swapChain. Bug: b/267806287 Change-Id: I33d136ad50961fbf5fbb200ff0f89f1dbf23585d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4220723 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Igor Nazarov 1365f5b3 2022-09-09T17:19:26 Vulkan: Fix Swapchain Acquire Image Semaphore wait stage flags. There is a screen tearing on G996B with single "glClear(GL_COLOR_BUFFER_BIT)" no scissor in the frame. Fixed by defining "kSwapchainAcquireImageWaitStageFlags" and adding "VK_PIPELINE_STAGE_TRANSFER_BIT" stage flag. Also added "VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT" stage, because first use of the Swapchain Image after Acquire may be in the "glBlitFramebuffer()" command. This fix may slightly affect performance. In such case, a better fix should be implemented (include only stages based on the actual first use). However, this may be not trivial. Additionally, "kSwapchainAcquireImageWaitStageFlags" is used as a source stage mask in the "ImageLayout::Present" pipeline barrier. This is needed in order to build a dependency chain from the Acquire Image Semaphore to the layout transition's first synchronization scope, so that layout transition happens after acquire semaphore is signaled. Reference: https://github.com/KhronosGroup/Vulkan-Docs/wiki/Synchronization-Examples#combined-graphicspresent-queue https://vulkan-tutorial.com/Drawing_a_triangle/Drawing/Rendering_and_presentation Alternative fix of both issues is to define: kSwapchainAcquireImageWaitStageFlags = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT This might potentially delay command buffer execution relative to the Swapchain Acquire Image Semaphore signal operations, but will relax the pipeline barrier. Bug: angleproject:8030 Test: angle_end2end_tests --gtest_also_run_disabled_tests --gtest_filter=EGLSurfaceTest.DISABLED_RandomClearTearing* Change-Id: I29f58862c4b369524b2555dd944e2fb67eebe956 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4271377 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 31684d8c 2023-02-18T11:11:57 Vulkan: Lazily create swapchain image views In compliance with VK_SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT. Bug: angleproject:7878 Big: b/269606195 Change-Id: I917c6888b325f768dbc6384828a6e462792d3c0b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4267510 Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Chris Forbes <chrisforbes@google.com>
Charlie Lao e1dfc00a 2023-02-15T16:21:37 Vulkan: Make waitForPendingPresent drain work in the calling thread Since we are waiting, there is no point to have work done in CommandProcessor's worker thread. It can just wait and drain the task in the calling thread. This is consistent with waitForResourceUseToBeSubmitted. This allows us to remove mutex and condition variable from SwapchainStatus. Bug: b/269524271 Change-Id: I9d7e17c77c879b6957fc3b74aab02f7f5c9db052 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4257252 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com>
Charlie Lao 79bfee1c 2023-02-15T15:33:56 Vulkan: Clean up CommandProcessor::queuePresent Right now queuePresent API returns VkResult in two places, via return value and SwapchainStatus structure. This CL makes it only return via SwapchainStatus::lastPresentResult so that two code path are the same. Bug: b/269524271 Change-Id: I7ab3c2bee08961a10718a2e5daa1c7f03e97e85d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4257927 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
Igor Nazarov a6dba4b4 2023-01-17T19:24:18 Vulkan: Minor fix in "WindowSurfaceVk::hasStagedUpdates()". This CL adds check to prevent checking buffer that is not technically acquired. Also if in the future this function will be called for double buffered surfaces it will not check a previous buffer. Bug: b/237449314 Change-Id: I79f1a2c4cd05a5424e963503891449f310177e93 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4262070 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov ceb49b1c 2023-01-17T19:21:43 Vulkan: Fix crashes when Surface is not current. It is possible to destroy Surface while some resources are still in use (by CPU/GPU): 1. Make Surface current. 2. Draw something. 3. Make other Surface current (same Context). 4. (optional - if test Surface is Window Surface) Draw something. 5. Delete Surface. 6. UnMake the Context from current. 7. Different crashes possible depending on Surface type and what is done in step 2. Bug: angleproject:8017 Test: angle_end2end_tests --gtest_filter="EGLSurfaceTest.DestroyNotCurrent*Surface*" Change-Id: I3102aa237075b301b3222b420415753c83ba192a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4227073 Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Igor Nazarov 0d0e8c37 2023-02-08T17:33:39 Vulkan: Fix mutable render buffer with protected content. Original implementation used Unprotected submission unconditionally. In case of protected content/commands this may cause undefined behavior. New test works OK despite the bug. VVL also did not show error, but should report: VUID-VkSubmitInfo-pNext-04120 If the pNext chain of this structure does not include a VkProtectedSubmitInfo structure with protectedSubmit set to VK_TRUE, then each element of the pCommandBuffers array must be an unprotected command buffer Also from spec: protectedSubmit specifies whether the batch is protected. If protectedSubmit is VK_TRUE, the batch is protected. If protectedSubmit is VK_FALSE, the batch is unprotected. If the VkSubmitInfo::pNext chain does not include this structure, the batch is unprotected. It is a bug in VVL. It ignores check entirely if VkSubmitInfo::pNext chain does not include VkProtectedSubmitInfo structure. Bug: angleproject:3966 Test: angle_end2end_test --gtest_filter="EGLProtectedContentTest.ProtectedContextWithProtectedMutableRenderBufferWindowSurface*" Change-Id: I0e0762e5fdfe19ce6c2184a36d057a95c2c79f00 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4232115 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov 7da34485 2023-01-17T16:17:51 Vulkan: Changed "asyncCommandQueue" Pending Present info logic. Required for future commits. Details: - Fixes possible stale result in "CommandProcessor::mSwapchainStatus" after WindowSurfaceVk destruction. - Fixes possible dead-lock when the old "getLastPresentResult()" method might be called more than once. - New implementation allows waiting multiple times (and multiple threads) for the same Present result. Before commit: 31c4093651079775acf34ea1bb06bdabb4ea4386 Vulkan: Rework present semaphore recycling There was assert in CTS: dEQP-EGL.functional.swap_buffers_with_damage.resize_before_swap.* Assert failed in ~SwapchainCleanupData (../../src/libANGLE/renderer/vulkan/SurfaceVk.cpp:669): swapchain == VK_NULL_HANDLE Because of the stale "CommandProcessor::mSwapchainStatus" and a race-condition as the result. The "Vulkan: Rework present semaphore recycling" did not fix the problem, but rather changed undefined behavior symptom. Bug: None Change-Id: Idf08a29265a43c711941b142001eb4380e2aa2b6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4194184 Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov 8b9bd182 2023-02-08T16:17:10 Vulkan: Refactoring to use ProtectionType enum instead of bool This is a second stage of refactoring that was started here: Vulkan: Minor CommandQueue implementation refactoring. 0210b46d35b51ea04bddafb48ba406a87c39e58e Enumeration renamed: CommandContent -> ProtectionType. Currently interfaces of ContextVk/RendererVk/CommandQueue use "hasProtectedContent" boolean. Internally CommandQueue uses "vk::ProtectionType" enumeration to separate states related to Unprotected/Protected commands. This CL replaces boolean with enumeration for consistency. Bug: angleproject:7995 Change-Id: Ibb98cce661358d464be7c6a8367a1297d7093b1c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4232114 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Igor Nazarov b6cc5754 2023-01-17T16:17:22 Vulkan: Fixed Wait Semaphores problems. This feature fixes 2 problems. 1. Swapchain Image Acquire Semaphore added to wait list AFTER rendering commands: - Make Window Surface current. - Clear Window Surface (Image is Acquired). - Perform rendering to the Window Surface. - Change to other Surface (for example: PbufferSurface) using the same Context. - Unmake Context from current to ensure commands are submitted. - Rendering commands to the Window Surface will be submitted without Acquire Semaphore. 2. Context from other thread may submit command of another Context without proper Wait Semaphores: - Make Window Surface current in the first context. - Clear Window Surface (Image is Acquired). - Perform rendering to the Window Surface. - Call "glBeginQuery()/glEndQuery()" (or other commands) - this will flush command to the Primary Command Buffer without submitting. - In other Thread and Context make some Surface current (for example: PbufferSurface). - Clear that surface with scissor and unmake Context from current to ensure commands are submitted. - Rendering commands to the Window Surface from the first Context will be submitted without Acquire Semaphore. - Problem will happen even if add Wait Semaphore BEFORE writing rendering commands. Bug: angleproject:7995 Test: angle_end2end_tests --gtest_filter="EGLSurfaceTest.WaitSemaphoreAddedAfterCommands*" Test: angle_end2end_tests --gtest_filter="EGLSurfaceTest.CommandsSubmittedWithoutWaitSemaphore*" Change-Id: I28174ff98fdd09b4117962fc0810cfeeb2a4d1f1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4194182 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Kaiyi Li ac0a4a7d 2023-02-03T15:34:32 Add finer memory allocation type ... so that when we hit an OOM we have better understanding on why. Bug: b/266466279 Test: trigger a Vulkan OOM, see detailed allocation logging info Change-Id: I71c1ebd83e18ddb22e7abfd29a785bf4ad6454dc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4219365 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Auto-Submit: Kaiyi Li <kaiyili@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Shahbaz Youssefi 28da0a3e 2022-11-28T14:43:10 Vulkan: Avoid swapchain recreation on present mode change Bug: angleproject:7878 Change-Id: I5a36c206dc8feb640fc684f92c10c26628633601 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4088907 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jeff Vigil <j.vigil@samsung.com>
Charlie Lao b96f3abd 2023-02-03T13:12:29 Vulkan: Make Context::mLastSubmittedSerial to QueueSerial Right now Context::mLastSubmittedSerial and mLastFlushedSerial are all Serial type instead of QueueSerial. Most places we do need QueueSerial. This CL changes them to QueueSerial type. This simplifies and improves code readability. No actual functional change is expected with this CL. Bug: b/267806287 Change-Id: Ib00cae2637ee9ed95e5fc00060c63017b04e26c5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4219944 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi c98a413c 2022-11-28T13:56:10 Vulkan: Use deferred allocation for swapchains when possible Bug: angleproject:7878 Change-Id: I539027f4fabe7a56f05280baee3772bc536791e6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4088906 Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jeff Vigil <j.vigil@samsung.com>
Shahbaz Youssefi ffbb65bc 2022-11-28T13:31:48 Vulkan: Use VK_EXT_swapchain_maintenance1 for present fences Bug: angleproject:7878 Change-Id: Ic3a43c663789a6489cff261848d9ad4a408ca53a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4088905 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com>
Amirali Abdolrashidi f1872822 2022-12-22T17:17:37 Vulkan: Fix imageless framebuffer VVL issue In some tests, including some blink tests, there were cases of VVL messages spamming the output log, even though they did not always cause a failure. Investigation showed that in some cases, the call to EGL_CreateImageKHR() was not setting all the attributes in the ImageHelper object that is used later for an imageless framebuffer, specifically the one created in VkImageImageSiblingVk::initImpl(). * Added the usage flags and view formats in the new image created in VkImageImageSiblingVk. * Added a Vulkan image test to make sure the error is fixed. Bug: b/261473248 Bug: angleproject:7845 Change-Id: I1874b2930e9ce62e5b603cf7acff6fd78b957d5b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4117584 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Charlie Lao 02cc4cd5 2022-12-07T12:03:26 Vulkan: Remove ImageHelper::mImageAndViewGarbage This was introduced in crrev.com/c/3449450. At that time this is necessary, because we can not copy mUse for immediate view garbage collection. Now with recent work, mUse is copyable, we no longer need to accumulate the view garbage. They can be released immediately with a copy of image's mUse. Bug: b/261737134 Change-Id: Ic4393f8c4ee7c0e3be4669a0a557507c909a77ab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4087323 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 2e5ca217 2022-11-18T10:44:49 Vulkan: Let each current context has its own QueueSerial. This CL makes every current context has its own queueSerial. At context creation time or when context becomes current, it allocates a QueueIndex from renderer. When it becomes non-current, it releases QueueIndex for others to reuse. This way we significantly reduces the max number of QueueIndexs for reasonable usage. Each CommandBuffer has its own unique QueueSerial and we use that to determine if a resource is being used by the given CommandBuffer. The QueueSerial for RenderPassCommands is deferred until renderPass starts, and when we generate queueSerial for renderPassCommands, we also reserve a range of serials for outsideRenderPassCommands so that we can do incremental submission of outsideRenderPassCommands without need to close renderPassCommands. In rare situation, if that reserved serials runs out, we also close renderPassCommands to ensure the ordering of serials matches ordering of command buffers. With per current context queue serial, this CL is able to set resource queue serial as it is being used. This CL completely removes usage of ResourceUseList class since it was introduced due to deferred setSerial. This CL also get rid of refCount from ResourceUse since there we no longer add it to a ResourceUseList. With that, we also able to remove SharedResourceUse class since access to ResourceUse itself is now thread safe since we are able to make a copy of it when we add it to GarbageList. Because RenderPassCommands now has its own unique QueueSerial as it encodes command, we can use it to detect if a resource is being used by it or not, thus this CL also removes usage of CommandBufferID. Bug: b/255414841 Change-Id: I36dcbeaa7bc996f04e6c04bf9ad44cd0d630f61a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4038096 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 2ecb3217 2022-11-28T15:24:39 Vulkan: Turn CPU throttling into fail safe CPU throttling is moved back to after queue present instead of before. Doing it before was a mistake, as the app had already recorded the command buffers, there was no point in delaying its submission. Proper throttling would have been moving the wait from after recording commands (before present of frame i+2) to before recording (after present of frame i+1). However, throttling is the responsibility of the app and this change triggers throttling one frame later (after present of frame i+2) as a fail safe. Currently, CPU throttling is relied upon for acquire semaphore recycling. If the two are untangled, CPU throttling can be removed. CPU throttling can also be trivially weakened by increasing kSwapHistorySize (currently 2). Bug: angleproject:7268 Change-Id: Ib7a8be6f8e72c6b8589d4e8b5de7ceaf6a28bb8e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4060454 Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 31c40936 2022-11-25T12:28:27 Vulkan: Rework present semaphore recycling Present semaphores and old swapchains are now associated with a fence for clean up. The fence is the one coming from the _next_ acquire of the same image index. See doc/PresentSemaphores.md for more details. Bug: angleproject:7847 Change-Id: I16891ccf6df7ac39d8b17328aac35afc422eede0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4058286 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Charlie Lao 7dd8478e 2022-11-17T10:11:02 Vulkan: Make ResourceUse::serial an FastVector of Serials In preparation for per context queue serial, this CL makes ResourceUse::serial a FastVector of Serial. Right now we still limited to one serial index so that it still work the same way as before. This CL adds necessary data type and change the function names to reflect that tracking GPU progress needs a ResourceUse object instead of a single Serial number. Bug: b/255414841 Change-Id: Ic60cdf5ec8da45d1821f65a55947f5c553f65737 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4034548 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 1b88c41f 2022-10-31T10:58:09 Vulkan: Remove the disableFifoPresentMode feature Workaround was added for old Intel bots, no longer applicable. Bug: angleproject:3153 Change-Id: Ib248927fbb1be33d8bd89a0c8185761f7f1ed6fa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3993361 Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Amirali Abdolrashidi c19ec948 2022-08-23T10:43:59 Vulkan: Implement imageless framebuffers * Added the attachment image and create info objects to be used for imageless framebuffers created in getFramebuffer(). * New helper class for framebuffers in RenderPassCommandBufferHelper: MaybeImagelessFramebuffer, which includes a framebuffer object, if the framebuffer is imageless, and the image views. This is to make sure that the args for render pass begin info will be correctly set up according to the status of the used framebuffer. * Refactored the collection of attachments in getFramebuffer() into a new function, getAttachmentsAndImagesFromRenderTargets(). It also returns their corresponding ImageHelper* objects used to create the framebuffer (from their image properties). * New struct: RenderTargetInfo; which keeps track of render targets and whether resolve image should be used for the render pass in the form of the enum class RenderTargetImage. * Added a new arg to getFramebuffer(): resolveRenderTargetIn; to use when there is a valid resolveImageViewIn. * Without using the framebuffer cache, we would require to handle the framebuffer destruction by adding it to the garbage instead of releasing it. For example, FramebufferVk::destroy() now adds mCurrentFramebuffer to the garbage. * Added new framebuffer unit tests. * Added tests where two textures with different attributes are bound to the same framebuffer before drawing, one after another. * Added test where a blit occurs from a multisample texture into a non-zero level of a resolve texture, each bound to a separate FBO. * Added a new perf test to compare performance for enabled imageless framebuffers vs disabled. (Credit: cclao) Bug: angleproject:7553 Change-Id: Iacdbd73aaa01cbb0e37abf01ae4892bdfdd4b12f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3827644 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Antonio Caggiano a8a04ce1 2022-08-16T17:59:20 Vulkan: Add supportsPresentation feature Some platforms do not support presentation through any Vulkan queue. In this case we should not transition the color image layout to present. Bug: angleproject:7217 Change-Id: I71cad0e52bc1fdb531de5a34e917a1862a4cf070 Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com> Suggested-by: Sungyong Choi <sywow.choi@samsung.com> Suggested-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3853598 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya ae971cfe 2022-09-07T17:00:17 Vulkan: Expose wide gamut and HDR EGL colorspace extensions Query the underlying Vulkan ICD for the list of supported colorspaces on platforms that support VK_GOOGLE_surfaceless_query extension. Expose corresponding EGL colorspace extensions. Bug: angleproject:7630 Change-Id: If9843ee55100fff5a8cec4ecf2ff27c746c5b205 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3873767 Reviewed-by: Trevor Black <vantablack@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Peng Huang 79aa846e 2022-08-17T13:40:33 Reland "Not recreate Framebuffer for eglMakeCurrent() call" This is a reland of commit bf9c815263455403e587a9d2b0fdb9fb8e964208 Original change's description: > Not recreate Framebuffer for eglMakeCurrent() call > > Right now, in eglMakeCurrent() call, ANGLE always release the > default framebuffer object associated to the current context, > and create a new default framebuffer object for the new current > context. It impacts chrome performance, since chrome call > eglMakeCurrent() a lot. With this CL, the default framebuffer > will be created with gl::Context. When the surface is changed > by eglMakeCurrent() call, ANGLE will detach the previous surface > from the associated framebuffer, and attach the new surface to > the next current context's default framebuffer. > > Bug: chromium:1336126 > Change-Id: Iaa747669250ae250245db383a716b4634df59ea4 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3827751 > Commit-Queue: Peng Huang <penghuang@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> Bug: chromium:1336126 Change-Id: Iade19004a4335ac7bc6ca176a3c14d34afff8c9e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3877405 Auto-Submit: Peng Huang <penghuang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Peng Huang 02e8497f 2022-09-07T01:12:31 Revert "Not recreate Framebuffer for eglMakeCurrent() call" This reverts commit bf9c815263455403e587a9d2b0fdb9fb8e964208. Reason for revert: compile errors https://ci.chromium.org/ui/p/chromium/builders/try/linux-chromeos-rel/1303510/overview Original change's description: > Not recreate Framebuffer for eglMakeCurrent() call > > Right now, in eglMakeCurrent() call, ANGLE always release the > default framebuffer object associated to the current context, > and create a new default framebuffer object for the new current > context. It impacts chrome performance, since chrome call > eglMakeCurrent() a lot. With this CL, the default framebuffer > will be created with gl::Context. When the surface is changed > by eglMakeCurrent() call, ANGLE will detach the previous surface > from the associated framebuffer, and attach the new surface to > the next current context's default framebuffer. > > Bug: chromium:1336126 > Change-Id: Iaa747669250ae250245db383a716b4634df59ea4 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3827751 > Commit-Queue: Peng Huang <penghuang@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> Bug: chromium:1336126 Change-Id: I7c07f62236f57523b29c536c04f9a9de79da2f4b No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3877404 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: Peng Huang <penghuang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Peng Huang bf9c8152 2022-08-17T13:40:33 Not recreate Framebuffer for eglMakeCurrent() call Right now, in eglMakeCurrent() call, ANGLE always release the default framebuffer object associated to the current context, and create a new default framebuffer object for the new current context. It impacts chrome performance, since chrome call eglMakeCurrent() a lot. With this CL, the default framebuffer will be created with gl::Context. When the surface is changed by eglMakeCurrent() call, ANGLE will detach the previous surface from the associated framebuffer, and attach the new surface to the next current context's default framebuffer. Bug: chromium:1336126 Change-Id: Iaa747669250ae250245db383a716b4634df59ea4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3827751 Commit-Queue: Peng Huang <penghuang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi ac19624e 2022-08-26T21:29:53 Vulkan: Handle suboptimal like out-of-date If out-of-date can recreate the swapchain, so can suboptimal. Do so to better support window resizing on desktop. Note that on Android this was already being done. Bug: angleproject:7615 Change-Id: I3d1ce8ca45b002e5382e31fda003f02753a2c94e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3859409 Reviewed-by: Steven Noonan <steven@valvesoftware.com> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya aa2a558e 2022-08-23T09:47:02 Vulkan: Add support for setting timestamp surface attribute On Android the EGL wrapper handles most of the functionality required by EGL_ANDROID_get_frame_timestamps. However if for some reason the swapchain is recreated, the timestamp state would be lost resulting in stuttering. Introduce EGL_ANGLE_timestamp_surface_attribute extension that adds support for toggling the EGL_TIMESTAMPS_ANDROID attribute of a surface. Cache this state and recreate the swapchain accordingly. Bug: angleproject:7489 Test: EGLSurfaceTest.TimestampSurfaceAttribute* Test: dEQP-EGL.functional.get_frame_timestamps* Change-Id: I3660f7137c006d904164d243a682a4ff520eabd8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3753396 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Lingfeng Yang caf2b427 2022-07-01T18:17:30 Vulkan: Add feature to use PASS_THROUGH for EGL_NONE color spaces This is a temporary solution to fix media tests until ANGLE also has the ability to query the "preferred color space" from Surfaces. Bug: b/235995022 Test: Launch Cuttlefish with this change and the feature enabled with aosp/2167231 Test: cts -m CtsMediaCodecTestCases -t android.media.codec.cts.EncodeDecodeTest Test: cts -m CtsMediaCodecTestCases -t android.media.codec.cts.DecodeEditEncodeTest Change-Id: I17d1a2c1701cd1707b34f5bf2f222e9ad57c7a61 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3770291 Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Commit-Queue: Jason Macnak <natsu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Lingfeng Yang <lfy@google.com>
Charlie Lao badfeecd 2022-08-10T14:38:43 Vulkan: Destroy fb1 should not affect fb2 with same attachments If two FBOs has the same attachments. they will share the same VkFramebuffers. Destroy one fbo should not cause trouble for the other fbo. Bug: chromium:1351170 Change-Id: I032da8cc12eb8556c3e325c8fd7a3de9974ae909 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3824302 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
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>
Shahbaz Youssefi 6cd08bc2 2022-06-28T22:04:07 Vulkan: Don't optimize away flush after clear for single buffer Bug: b/237449314 Change-Id: I04421398e2e68541d4713c7e8b80715be68672b2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3733808 Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: mohan maiya <m.maiya@samsung.com>
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>
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>
Charlie Lao 72e457fe 2022-06-03T15:36:01 Vulkan: Promptly destroy cached framebuffer when it becomes invalid When Texture gets respecified, the VkFramebuffer cache created out of it becomes invalid and will never possibly get used. Before this CL, we never clear such invalid framebuffer objects from the cache. This CL keeps a reference to the cache key in each attachment and will immediately destroy the cached VkFramebuffer object when one of the attachment has become invalid. Bug: b/234769934 Change-Id: Ib01f6dffe9211084b1ada340081daf905e3f1bef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3682164 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 0bc70e96 2022-06-10T22:27:04 Vulkan: Rename getShareGroupVk to getShareGroup + other miscellaneous clean up Bug: angleproject:7375 Change-Id: I25690860478a2fd181a67ce2b6cb4d7aac7dbaa7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3700197 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 48b928d9 2022-06-07T16:21:04 Vulkan: Overlay widgets for pipeline cache/hit stats Bug: angleproject:5881 Change-Id: I1893e6b76a5a73ea51b67bc4ee8a5d5dfc54166e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3689604 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Antonio Caggiano 6e258863 2022-05-09T18:45:02 Vulkan: Use packed enum for present modes This will be useful for cases where ANGLE would need a non-Vulkan present mode. Bug: angleproject:7217 Change-Id: I3428ac9fb20788543cb24a0aa5f140e992e94001 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3636057 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Yiwei Zhang e316203a 2022-05-07T21:31:52 Vulkan: add forceContinuousRefreshOnSharedPresent feature Android EGL wrapper filters EGL_FRONT_BUFFER_AUTO_REFRESH_ANDROID, making it impossible for angle to provide an implementation for EGL_ANDROID_front_buffer_auto_refresh. Thus angle currently is only able to choose demand refresh for swapcahin present mode. This change adds a feature to force angle to create the swapchain with continuous refresh mode without affecting angle internal tracking for shared present. This feature will be enabled on integrations without the auto_refresh hint passthrough to angle, as well as before the platform allows angle to implement EGL_ANDROID_front_buffer_auto_refresh on its own. Bug: b/229267970 Test: angle_end2end_tests --gtest_filter="EGLSingleBufferTest*" Test: smooth draw with gpu accelerated low latency stylus in ChromeOS Change-Id: I29d72830d4e3d9fd5cdd44b8e1ce51fd7d9789fa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3633358 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 1d5d09e4 2022-05-04T12:33:34 Vulkan: Prefer MAILBOX over IMMEDIATE present mode When swap interval is 0, either MAILBOX or IMMEDIATE present modes could be chosen. MAILBOX produces no tearing, so this change prefers that. Bug: angleproject:3163 Change-Id: I80b3c5820358b398ddf0eeba546d1ec10bae3d84 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3628018 Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
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>
Shahbaz Youssefi 7d31a47f 2022-04-23T00:19:15 Vulkan: Optimize away eglSwapBuffers for single buffer surfaces For single buffer surfaces, eglSwapBuffers serves two purposes: - Switch to/from single buffer mode - Implicitly issue a glFlush Simultaneously, for single buffer surfaces, glFlush serves three purposes: - Submit the commands - Call queue present (if necessary) - Throttle the CPU In this mode, ContextVk::flush() already redirects to the surface, calling WindowSurfaceVk::swapImpl() which calls back to ContextVk::flushImpl() (to submit the commands), calls queue present and throttles the CPU. If the application calls eglSwapBuffers(), the exact same thing happens (i.e. WindowSurfaceVk::swapImpl() is called to the same effect). Calling swapImpl() leads to an addition of the corresponding submit serial to the "swap history". The CPU throttling code always throttles the CPU to the serial of two swaps ago. Unnecessary calls to eglSwapBuffers() (when there is no command to be flushed) in single buffer mode would thus lead to the CPU throttled to the end of the last submission, effectively turning into a glFinish(). In this change, eglSwapBuffers() in single buffer mode, when not switching to/from this mode, is redirected to glFlush() as it's functionally equivalent. Simultaneously, ContextVk now tracks whether it has any pending commands for submission at all, and skips glFlush() altogether if there are none. Together, this results in the unnecessary eglSwapBuffers() to become no-op. Bug: b/229908040 Change-Id: I0e3b4a8b7eb4f6b0e0ed22260644825fc67dd330 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3603841 Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jeff Vigil 95c1ff52 2022-02-24T08:31:52 EGL: Fix EGL_KHR_mutable_render_buffer Fixes for eglSurfaceAttrib error cases. Improve query for render buffer Add test case to EGLSurfaceTest Test: angle_end2end_test --gtest_filter=EGLSingleBufferTest Bug: angleproject:7134 Change-Id: I4fa568c9530312003dc17111be212bf5b66d97fb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3556088 Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 9d6b3a7e 2022-04-22T21:43:14 Vulkan: Move overlay draw after swap's implicit flush While this introduces a render pass for drawing the overlay, it isolates it from the rest of code associated with the implicit flush on swap and relevant optimizations. This makes the overlay counters more accurate when it comes to said optimizations. Bug: angleproject:7084 Change-Id: I3298612923fe07139891a4252cd2a88de1783ee7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3602839 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 2db718ed 2022-04-21T23:13:02 Vulkan: Skip empty submissions A number of places in ANGLE perform an implicit flush; eglSwapBuffers(), glFenceSync() etc. Sometimes these flushes are unnecessary because there is nothing to submit. Additionally, an application may unnecessarily issue glFlush() with nothing recorded. In this change, empty command buffers are automatically not submitted, optimizing these unnecessary flushes away. Bug: angleproject:7084 Change-Id: Iecb865b6b9ef8045dfecda7b5221874f7031b42e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3600837 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@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>
Shahbaz Youssefi c66de085 2022-04-19T23:56:50 Vulkan: Fix surface invalidate w.r.t shared present mode When in shared present mode (i.e. single-buffer rendering), surface shouldn't be invalidated on (the implicit) swap, because the application is expected to continuously draw to it. Bug: b/229689340 Change-Id: I006a954c558a5da1d9af631797546e4b76f4ff2c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3594801 Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Jeff Vigil <j.vigil@samsung.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill b2a1f0d2 2022-04-14T07:58:32 Track total vs per-frame descriptor set counters. This will give more consistent measurements for descriptor set caches and descriptor set allocations. Bug: angleproject:6776 Change-Id: I584b8807ad19f8393ae54cc1d88b319c8f7f9f39 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3584636 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi fcec6904 2022-04-13T14:18:06 Generate feature variable names from display names The json file now only contains the feature display name. The variable name is automaticaly derived. For consistence with Chromium and other Chromium-based projects, the display name is now always snake_case, and that's what's specified in the json files. This also makes camelCase variable name generation trivial (as opposed to the other way around). Feature overrides now accept both snake_case and camelCase names to ensure compatibility with existing scripts. This is done by removing _ and comparing override names with feature names in lower case. Bug: angleproject:6435 Change-Id: I0b6ed2bbf5c312bc4f4be7b3c7d55dbaca2a9886 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3584630 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi c5271e8e 2022-04-04T23:28:35 Vulkan: Emulate GL_KHR_blend_equation_advanced Based on a change by Brandon Schade <b.schade@samsung.com> In the translator, when advanced blend is enabled, an input attachment is added. Based on the listed advanced blend equations, emulation code is added that performs those equations' functions. The blend equation itself is passed through a driver uniform. Note that the advanced blend extension only allows a single output to use advanced blend, and that should be at location 0. In the Vulkan backend, when advanced blend is used, the driver uniform to select the equation is updated and normal blending is disabled. Bug: angleproject:3586 Change-Id: Icc42e8be238d34fca149087eb9cfe616a7643a6b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3575738 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi a16491d9 2022-04-05T16:47:32 Vulkan: Fix invalidation of non-existing aspects If the app uses a stencil-only attachment but invalidates depth, UNREACHABLE was hit. If the app uses a depth-only attachment but invalidates stencil, ANGLE was proceeding with an attempt to invalidate it (with no side effect). Bug: angleproject:7178 Change-Id: Idc177bdb66b2d0b3b3c2d36f5cadc7b9126a42c4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3573383 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi 607d398e 2022-03-14T16:32:21 Vulkan: Optimize resolve of multisample swapchains * Resolves the multisampled image if the last render pass draws into the default framebuffer. * Added test to check the number of resolves in the optimization subpass (credit: Xinyi He) * Added test to check the number of resolves outside the subpass. * Added disabled test to see if the subpass resolve works. Bug: angleproject:6762 Change-Id: I86a8db3387851ab97d5f7a3d8a0ff26961254c14 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3523062 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Amirali Abdolrashidi ba0eba20 2022-04-01T17:39:58 Remove the TODOs regarding multisample buffer age * Removed the TODOs regarding the buffer age for multisample images. Bug: angleproject:7149 Change-Id: I25100eaef774613e71c5f7afdaed5833c63b6343 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3566228 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Amirali Abdolrashidi cd9e887a 2022-03-31T15:43:17 Vulkan: Add multisample buffer age tests * Added variations of VerifyContent for multisample images. * getBufferAge() now sets age to 0 when the image is multisampled. Bug: angleproject:7149 Change-Id: I11f6fc92f383fba180f118b29c799072ed0eb51c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3563510 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Shahbaz Youssefi 20e7bbb7 2022-03-18T17:03:18 Vulkan: Fix invalidate of attachments with emulated format Some image formats may be emulated such that the emulated format has more channels than the original. ANGLE clears the image once so that these extra channels contain valid values, and carefully ensures they are never modified. For swapchain images with such formats, as they are automatically invalidated at the end of the frame, a workaroud was added to make sure they are re-cleared in the beginning of the next frame. This however doesn't fix the issue of glInvalidateFramebuffer resulting in the contents of attachments with such formats to be discarded (even if the following render pass clears it, the contents are invalid in between). This change instead makes sure invalidate of images with emulated formats that have extra channels are handled appropriately: - On IMR hardware, the invalidate is dropped altogether as it provides little to no benefit. - On TBR hardware, a clear is automatically staged on the invalidated image. The latter replaces the workaround that was added to make the following render pass use loadOp=CLEAR, by adding a clear that's respected regardless of what the future usage is. This change also paves the way for a future change where the invalidate of color attachments is tracked in render passes similarly to how depth/stencil currently is. With this change, the image is no longer in an inconsistent state where its contents are considered invalid, even though some channels are meant to remain valid. Bug: angleproject:6860 Change-Id: Iec5b4854dfbe3a0bf93cd5aa82c19fe116065744 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3536389 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
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>
Jeff Vigil 2bfec1a2 2022-03-03T08:22:11 Vulkan: Add EGL to VULKAN mapping for BT2020 colorspace Bug: angleproject:7072 Change-Id: I8d79a9ddcc9f0a4946c72821da25d0eda884d4cc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3508166 Reviewed-by: mohan maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuxin Hu 1cef917c 2022-03-02T23:50:11 Reland "Remove ImageViewHelper from ResourceUseList" This is a reland of 126e967de3978f0dc4f6cf0fa3f9749366ea39ba Original change's description: > Remove ImageViewHelper from ResourceUseList > > Instead of keeping a dedicated SharedResourceUse mUse for > ImageViewHelper, let ImageViewHelper take ImageHelper.mUse > for lifetime tracking. ImageViewHelper no longer needs to > add its' own mUse in the ResourceUseList through retain() > calls, and this should cut the ResourceUseList size by > almost half. For instance, in the trace aztec_ruins, > the maximum ResourceUseList size before the change is 3643, > and the maximum ResourceUseList size after the change is 1694. > Since ImageViewHelper no longer needs to keep SharedResourceUse > mUse as a class memberWe can remove the inheritance from > Resource class, and make ImageViewHelper simply a NonCopyable class. > Bug: angleproject:6717 > Change-Id: I460e83f5f3c1d6ef9722b9f3c9a5ba9552563cb9 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3449450 > Reviewed-by: Charlie Lao <cclao@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Yuxin Hu <yuxinhu@google.com> Bug: angleproject:6717 Change-Id: I3aa9785d7dcdc8db82847f1586f8cd7d5c838d7c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3501194 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi 8390196a 2022-02-26T02:36:22 Revert "Remove ImageViewHelper from ResourceUseList" This reverts commit 126e967de3978f0dc4f6cf0fa3f9749366ea39ba. Reason for revert: Hits an ASSERT about too much garbage being accumulated. anglebug.com/7063 Original change's description: > Remove ImageViewHelper from ResourceUseList > > Instead of keeping a dedicated SharedResourceUse mUse for > ImageViewHelper, let ImageViewHelper take ImageHelper.mUse > for lifetime tracking. ImageViewHelper no longer needs to > add its' own mUse in the ResourceUseList through retain() > calls, and this should cut the ResourceUseList size by > almost half. For instance, in the trace aztec_ruins, > the maximum ResourceUseList size before the change is 3643, > and the maximum ResourceUseList size after the change is 1694. > Since ImageViewHelper no longer needs to keep SharedResourceUse > mUse as a class memberWe can remove the inheritance from > Resource class, and make ImageViewHelper simply a NonCopyable class. > > Bug: angleproject:6717 > Change-Id: I460e83f5f3c1d6ef9722b9f3c9a5ba9552563cb9 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3449450 > Reviewed-by: Charlie Lao <cclao@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Yuxin Hu <yuxinhu@google.com> Bug: angleproject:6717 Change-Id: Iea3d40458e2cc5be6ab0257ba6df8b82a4eeecda No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3491345 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yuxin Hu 126e967d 2022-02-09T01:46:25 Remove ImageViewHelper from ResourceUseList Instead of keeping a dedicated SharedResourceUse mUse for ImageViewHelper, let ImageViewHelper take ImageHelper.mUse for lifetime tracking. ImageViewHelper no longer needs to add its' own mUse in the ResourceUseList through retain() calls, and this should cut the ResourceUseList size by almost half. For instance, in the trace aztec_ruins, the maximum ResourceUseList size before the change is 3643, and the maximum ResourceUseList size after the change is 1694. Since ImageViewHelper no longer needs to keep SharedResourceUse mUse as a class memberWe can remove the inheritance from Resource class, and make ImageViewHelper simply a NonCopyable class. Bug: angleproject:6717 Change-Id: I460e83f5f3c1d6ef9722b9f3c9a5ba9552563cb9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3449450 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi a0d558f0 2022-02-16T12:23:29 Vulkan: Fix D/S invalidation for MSAA EGL configs Bug: angleproject:7007 Change-Id: I165ce16e8fdd388ae13aa2e3d05901199706ee24 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3469221 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 5f3f13f6 2022-02-15T13:39:57 Vulkan: Invalidate D/S for multisampled EGL configs too Regardless of whether the EGL config is MSAA, depth/stencil should be invalidated at the end of the last render pass. Originally, optimizeRenderPassForPresent was gated on !MSAA because it was only affecting the layout of the color attachment. Bug: angleproject:7007 Change-Id: I7cd5497a9da6eeb168c3b55b91f2ff6f5674adb6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3465498 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 038adcae 2022-02-08T16:46:40 Vulkan: Render the overlay in the graphics pipeline Bug: angleproject:6976 Change-Id: I388d429f0726b4d6a1c4ecd446ead93579a14a1b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3448643 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Antonio Caggiano ac20272f 2022-01-19T17:13:50 Vulkan: Fix present region rectangles EGL rectangles are specified relative to the bottom-left of the surface, while Vulkan framebuffer space puts the origin on the top-left corner. Bug: angleproject:6933 Change-Id: Ia57eea8601ee724c0a82eb718d831de6b7566472 Reviewed-by: Constantine Shablya <constantine.shablya@collabora.com> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3423770 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Cody Northrop 7d7cca47 2022-01-17T18:00:25 Vulkan: Update default FBO when fetch in use If the fetch mode of the default framebuffer changes, lazily create and use a new set of framebuffers (one per swapchain image) that are setup for fetch (i.e. have a matching renderpass). Test: FramebufferFetchES31.DefaultFramebufferTest Test: FramebufferFetchES31.DefaultFramebufferMixedProgramsTest Bug: angleproject:6893 Change-Id: Iff2b73d7c34b9b8ca9429c3f24aa700c2746cc81 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3401933 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Jeff Vigil e03f1753 2022-01-06T09:48:12 EGL: mutable_render_buffer deferredFlush fix When in SINGLE_BUFFER mode, need to get around deferredFlush and call Swapbuffers to force update This must do status check for OUT_OF_DATE. Bug: angleproject:6878 Change-Id: I34b7381f6799879bf6f6d490aba02feffc5c3748 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3373739 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Brandon Schade <b.schade@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jeff Vigil d6dd0cb5 2021-09-21T15:26:13 EGL: EGL_KHR_lock_surface3 backend Add vulkan implementation Add test: EGLLockSurface3Test Test: angle_end2end_test --gtest_filter=EGLLockSurface3Test Bug: angleproject:6062 Change-Id: Id5bfe37895b550392d11e9e9cc1262c1f0288c42 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3174323 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Cody Northrop b5360798 2022-01-14T12:45:14 Vulkan: Support fetching from default FBO If GL_EXT_shader_framebuffer_fetch is enabled, specify framebuffer attachments as having VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT. Add new test FramebufferFetchES31.DefaultFramebufferTest which exercises the behavior. Also limit exposure of either framebuffer fetch extension to be Android only due to swapchain images requiring INPUT_ATTACHMENT. Test: FramebufferFetchES31.DefaultFramebufferTest Bug: angleproject:6893 Change-Id: I227e36a9844e2301f0fe0602f4e4d905874b32e3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3389791 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Amirali Abdolrashidi 9b1a6d8a 2022-01-06T10:38:25 Vulkan: Invalidate depth/stencil unconditionally * Moved depth/stencil content invalidation during swapImpl() to doDeferredAcquireNextImage(), so it can be done regardless of whether render pass optimization is done. Bug: angleproject:6861 Change-Id: I47fab18afe5b178bf55c2df3df712c40118aff1f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3370583 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
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>
Shahbaz Youssefi acd8fc76 2021-12-16T01:05:02 Vulkan: Distinguish RP and outside-RP command buffer types What goes inside and outside a render pass command buffer is largely mutually exclusive. Moreover, the size and frequency of allocations is different between the two. This change distinguishes the C++ types used for inside and outside render pass command buffers: - The type now documents which command buffer a function is able to receive. - `isRenderPass` flag passing, checking and asserting is largely removed. - A follow up change experiments with using different (Vulkan vs ANGLE) secondary command buffers for inside and outside RP command buffers. - A future change could specialize the pool behaviors per command buffer type. Bug: angleproject:6811 Change-Id: Ia4bc669d26ac7e94e8a0dfb9b361666c82f42cc3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3344373 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>