src/libANGLE/renderer/vulkan/vk_helpers.cpp


Log

Author Commit Date CI Message
Igor Nazarov 764cdbad 2023-01-25T18:25:57 Vulkan: Add missing mutex lock into resetCommandBuffer(). Regression after the commit: 77d19e39794cc2de28f33a714f27af5a7de128ae Vulkan: Add ThreadSafeCommandQueue class Bug: b/261106868 Change-Id: I083b1bdc42a1382d32ab9087c92adbb963ff7d1e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4300869 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Igor Nazarov <i.nazarov@samsung.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>
Amirali Abdolrashidi 3a7904e1 2023-01-25T23:56:56 Vulkan: Use VMA suballocation for images There is a maximum limit for device memory object allocation. On some platforms, there can be an error regarding too many object allocations when 4096 device memory handles have been allocated. Suballocation can help mitigate this issue. In this CL, some images will be allocated using VMA API calls, which use suballocation. * Added a new feature (useVmaForImageSuballocation). * Added VMA allocation for ImageHelper, which is used in initMemory(). * Suballocation is used for VMA image allocation. * If enabled, mVmaAllocation will be initialized in the ImageHelper object (instead of mDeviceMemory). * It is currently used for all platforms. * Minor change to the name of an arg in CreateBuffer() declaration. * Added test to make sure we can allocate at least 4096 images on supported platforms (8000 in the test). * Skipped the test "NonZeroBaseEmulatedClear" when run on Linux/Intel if this feature is enabled (due to output color mismatch). * Skipped several tests for capture/replay on Windows. Bug: b/218891184 Change-Id: Ibf80c9c8c485b301da7d23b5ba4bcbb1a8e3194f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4191202 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Igor Nazarov 9a4a9f3f 2023-02-16T17:33:52 Revert "Fix dEQP-EGL.functional.mutable_render_buffer#basic" This PARTIALLY reverts commit: 629da7fc9cd4886dd87f07a069c259551e892936. Fix dEQP-EGL.functional.mutable_render_buffer#basic From the reverted CL: This CL also addresses similar issue in some other rx::vk::ImageLayout items in kImageMemoryBarrierData. These were unnecessary changes that may harm performance: - adding BOTTOM_OF_PIPE for source stage when transition from LAYOUT_UNDEFINED may add unnecessary GPU bubble. - Transition to LAYOUT_PRESENT_SRC_KHR does not require barrier. All writes will be automatically made visible for Presentation Engine. Execution dependency satisfied by VkSemaphore. - Transition from LAYOUT_PRESENT_SRC_KHR is RAR/WAR. Execution dependency satisfied by VkSemaphore. - Some layouts may not be a destination so BOTTOM_OF_PIPE is OK. Bug: b/264420030 Change-Id: I8b57b1636e1f5cf5b647003adf1502bd3286c5a3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4262067 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com>
Charlie Lao c402ea1c 2023-02-15T12:01:38 Vulkan: Rename hasUnfinishedUse to hasResourceUseFinished Most usage of hasUnfinishedUse is for !hasUnfinishedUse, and there was feedback that negative API is not preferred. This CL changes it to positive API name. Similarly renamed hasUnsubmittedUse to hasResourceUseSubmitted. Bug: b/267348918 Change-Id: Idb10b0f998ec50116ffb6aada19a98a516e87824 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4257105 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov 8cac53cd 2023-01-17T19:22:57 Vulkan: Fix incorrect "SharedPresent" barrier. Previous fix swapped top/bottom barriers: 629da7fc9cd4886dd87f07a069c259551e892936 Fix dEQP-EGL.functional.mutable_render_buffer#basic Above fix is only partial, because it only includes execution dependency without memory barriers (top/bottom stages has no memory access). Fixed by forcing all possible stages for "SharedPresent" images. Better solution requires creating specific versions of "ImageLayout::SharedPresent". Added new test that skips "glFlush()" before "glReadPixels()". Performing flush executes present and may "fix" the barrier problem. New test fails on "Samsung Galaxy S22+ S906B" Bug: b/264420030 Test: angle_end2end_tests --gtest_filter="EGLSingleBufferTest.SharedPresentBarrier*" Change-Id: Icbb50900d99e42d2e9482cd6109981bbc460348a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4262068 Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Yuxin Hu 629da7fc 2023-01-26T12:25:04 Fix dEQP-EGL.functional.mutable_render_buffer#basic These are vulkan commands submitted between glClear() and glReadPixels() when the EGL_RENDER_BUFFER is EGL_SINGLE_BUFFER (ImageLayour is SharedPresent): ``` vkCmdClearColorImage() vkCmdPipelineBarrier: ( VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,//srcStageMask VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,//dstStageMask VK_ACCESS_MEMORY_WRITE_BIT,//srcAccessMask VK_ACCESS_MEMORY_WRITE_BIT|VK_ACCESS_MEMORY_READ_BIT//dstAccessMask ) vkCmdCopyImageToBuffer() ``` This means that operations at the bottom of pipeline in vkCmdCopyImageToBuffer() need to wait for operations at the top of pipeline in vmCmdClearColorImage(), which translates to vkCmdCopyImageToBuffer() does not have to wait for vkCmdClearColorImage() to finish. Even the dstAccessMask ensures that vkCmdCopyImageToBuffer() will invalidate cache before copying image, it is possible that it will retrieve the old Framebuffer color attachment data as the vkCmdClearColorImage() has not finished. This CL fixes the bug by making the srcStageMask to be VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT and the dstStageMask to be VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, when the ImageLayout is SharedPresent. This ensures that vkCmdCopyImageToBuffer() waits for vkCmdClearColorImage() to finish. This CL also addresses similar issue in some other rx::vk::ImageLayout items in kImageMemoryBarrierData. Bug: b/264420030 Change-Id: If47ab071afaf96e396357cb0f50131339fa58509 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4198476 Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
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>
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>
Igor Nazarov a88d9f03 2023-02-07T02:37:53 Vulkan: Refactoring in RenderPassCommandBufferHelper. This is a follow-up refactoring after CL: cae00d9bba91bd6857d71c07b853dba8485e2ab8 Vulkan: Cleanup shared ring buffer cmd alloc feature. "mCurrentSubpass" naming is a bit confusing. When custom Vulkan secondary command buffers are used, "mCurrentSubpass" is always "0". This is because custom command buffers allows storing multiple subpasses. This CL renames this member into "mCurrentSubpassCommandBufferIndex", to clearly state that it is refer to command buffer index of a current subpass. Custom command buffers will always use single buffer ("0"), while Vulkan secondary command buffers will have a buffer per subpass. Bug: b/256666069 Change-Id: I6777e3ca4ee57513e1c36f05f8d223eb086b095a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4227072 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Igor Nazarov ef056a06 2023-01-20T14:15:48 Vulkan: Use SubmitPolicy::AllowDeferred whenever possible. Using of SubmitPolicy::EnsureSubmitted is not necessary, because there are finishQueueSerial() call immediately after that. Changing to AllowDeferred avoids extra waiting call (NO-OP) and saves some CPU cycles. Bug: angleproject:8001 Change-Id: Id618253a4b59d006975044eb437ac60468199a98 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4194187 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov fa0681d1 2023-01-17T17:43:48 Vulkan: Per Context Serial cleanup. Comment in the "OutsideRenderPassCommandBufferHelper::reset()" is misleading. New "mQueueSerial" is always generated after "RendererVk::flushOutsideRPCommands()". This change removes comment and invalidates "mQueueSerial" to catch possible errors. Call "generateOutsideRenderPassCommandsQueueSerial()" in the "ContextVk::flushImpl()" only when needed. This call is necessary only with empty submission with only "signalSemaphore" and NO OutsideRP commands are written inside the "flushImpl()" (mIsAnyHostVisibleBufferWritten or mGpuEventsEnabled). Bug: b/267806287 Change-Id: Ibc547f97a6b38f70ad3d5901eca7b659b93014c0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4218363 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Igor Nazarov cae00d9b 2023-01-17T18:44:48 Vulkan: Cleanup shared ring buffer cmd alloc feature. Changes: - Simplified "SharedCommandBlockPool" interface. Removed "ptrOut" and "usesCommandHeaderSizeForOffsetOut" parameters, because "headerOut" has exactly the same value. - Refactoring of "SharedCommandBlockPool" classes. Some public methods made private, inline, or moved into ".cpp". - Replace some getters with more specific/restrictive methods: - "RingBufferAllocatorBuffer::getStorageSize()" -> "isEmpty()" - "CommandBufferHelperCommon::getAllocator()" -> "hasAllocatorLinks()" - Added extra ASSERT()s. - fixed typo "kMinRingBufferAllocatio(r)Capacity" - other minor modifications. Bug: angleproject:6401 Bug: b/256666069 Change-Id: I8f5c1c928bac5f8ecdfce7d411834f7ea39d11ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4218364 Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 17931e23 2023-01-27T00:00:00 Fix stencil and depth/stencil data uploads Multiple changes were made to depth and stencil load functions, removing redundant code and fixing issues. Failures were caused by incorrect assumptions about component locations in combined formats. * D32_FLOAT_S8X24_UINT has the same layout as GL_FLOAT_32_UNSIGNED_INT_24_8_REV * D24_UNORM_S8_UINT has stencil data in its MSBs, while GL_UNSIGNED_INT_24_8 puts it in LSBs. Bugfixes * Added LoadD24S8ToS8D24 that swaps D24 and S8 components * Added LoadS8ToS8X24 for stencil-only uploads on D3D * Replaced LoadD24S8ToD32F with LoadD32ToD32F * Fixed D and S extraction in LoadD24S8ToD32FS8X24 * Fixed stencil load and store in LoadD32FS8X24ToS8D24 and LoadD32FS8X24ToD32FS8X24 * Fixed S8_UINT subresource updates in Vulkan * Fixed D24_UNORM_S8_UINT subresource updates from GL_FLOAT_32_UNSIGNED_INT_24_8_REV data in Vulkan Cleanup * Renamed LoadUNorm16To32F to LoadD16ToD32F * Removed LoadUNorm32To32F, replaced it with LoadD32ToD32F * Renamed LoadR32ToR24G8 to LoadD32ToX8D24 * Renamed LoadD32FS8X24ToD24S8 to LoadD32FS8X24ToS8D24 * Removed unused LoadG8R24ToR24G8 * Removed Metal-specific LoadS8D24S8ToD32FX24S8, made use of the fixed LoadD24S8ToD32FS8X24 instead * Simplifed LoadD24S8ToD32F Added Texture2DTestES3.TexImageWithStencilData. Fixed: chromium:1408004 Fixed: angleproject:5317 Change-Id: I231345353aa4a7cebe46ded8458ac80de2c59e01 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4203427 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Charlie Lao 9a72a98e 2023-01-19T13:17:42 Vulkan: Fix the VVL error for shaderRead to shaderRead barrier When we use image from fragment shader read to vertex shader read, we detect the case (same layout with only shader stage change) and just merge the barrier into one. But that can only done if these two usages are for the same render pass. If it is different render pass, then you still have to issue a new barrier. Previously there is no way to detect that the barrier was issued for which render pass. With the fix in crrev.com/cl/4136948, we now know which render pass issued the last barrier. With that we are able to limit the shader stage consolidation only if they are for the same render pass, thus fixing the VVL errors. Bug: angleproject:6663 Change-Id: I3d884336e8cf1f3cf16fc3e5a3423357ae2ed3c1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4182542 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 77d19e39 2023-01-11T14:03:18 Vulkan: Add ThreadSafeCommandQueue class This is preparation CL for the next few CLs. Instead of having RendererVk owns mCommandQueueMutex and takes lock before calling CommandQueue APIs, this CL creates a ThreadSafeCommandQueue wrapper class that wraps CommandQueue class' public APIs with a mMutex. Right now this is purely a mechanical change, expecting no real functional or behavior differences. But in the future CLs, we are going to implement some APIs without holding lock while doing the wait. This also conceptually cleaner that a mutex lock should protect data not methods. Because of this, this CL also adds OneOffCommandPool class to wrap around all oneoff command buffers with its own lock. The same change also applied to CommandProcessor class by adding a ThreadSafeCommandProcessor class (this will be removed in later CLs). This CL also removes CommandQueueInterface base class and made all these virtual functions no longer virtual, thus reduces the overhead associate with calling virtual functions. Bug: b/261106868 Change-Id: Ifdc0085cef7f00d840b4ef3fa602172fed3c0fb1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4156637 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Amirali Abdolrashidi 48e40ef6 2023-01-06T13:35:21 Add per-heap memory allocation trackers * For each member of MemoryAllocationType, we now have a per-heap counter to keep track of the allocation size in each available heap. * mActivePerHeapMemoryAllocationsSize * mActivePerHeapMemoryAllocationsCount (debug mode only) * Added the memory type index to onMemoryAlloc() and onMemoryDealloc() as an input. It can then be used to determine the used memory heap index for that allocation using the memory properties defined in the renderer. * checkForCurrentMemoryAllocations() will now log the heap index of the current memory allocations in debug mode and during an OOM crash. * logPendingMemoryAllocation() will now log the heap index of the pending allocation during an OOM crash. * Renamed constexpr values used for tracking for more consistency. * kTrackMemoryAllocation -> kTrackMemoryAllocationSizes * kDebugMemoryAllocationLogs -> kTrackMemoryAllocationDebug Bug: b/262029018 Change-Id: I178a3556b3107edc0c72c6b23ea2f2d6b12da947 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4149431 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Ivan Neulander <ineula@google.com>
Charlie Lao 410d8ba5 2022-12-21T13:27:00 Vulkan: Cleanup ContextVk::hasStartedRenderPass APIs ContextVk has a few hasStartedRenderPass APIs which interpret "start" inconsistently. A RenderPassCommands' life should be notStarted, started, requestEnd, and end (which is equivalent to notStarted). When someone calls onRenderPassFinished on a started renderpass, it does not immediate endRenderPass, but it will set DIRTY_BIT_RENDER_PASS dirty bit so that next draw call will trigger endRenderPass and start a new renderPass. We do not have a name for this state, which adds some confusion. This CL renames the stage between start and onRenderPassFinished to be "active" renderpass, when you have mRenderPassCommandBuffer pointer being valid and you can actively adding draw commands into the renderPass. For this purpose, I haves renamed hasStartedRenderPass to hasActiveRenderPass. This CL also simplifies hasStartedRenderPass implementation to only check mRenderPassCommandBuffer and turned mRenderPassCommands.started as assertion. This CL also changes hasStartedRenderPassWithQueueSerial to actually check mRenderPassCommands.started instead of being "active", so that name reflects what it is actually checking. This CL also changed hasStartedRenderPassWithCommands to hasActiveRenderPassWithCommands to make name and implementation consistent. One added benefit of this is that after this CL we now allow load/store optimization on a started but inactive renderPass as well (for example glInvalidateFramebuffer call after glFenceSync call, or invalidate after FBO blit as demonstrated by MultisampleResolveTest.ResolveD32FSamples tests). Bug: angleproject:7903 Bug: angleproject:7551 Change-Id: I8c8ec4c0d54b9ad0a9e373108dfce6b151c8fe0e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4119693 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@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 26e28089 2023-01-04T15:15:46 Vulkan: Improve RPCommandHelper::isImageWithLayoutTransition() RenderPassCommandBufferHelper::isImageWithLayoutTransition() was added in crrev.com/c/3366014 to detect if there is a barrier inserted for the renderPass. If yes, we have to endRenderPass before compute shader, since compute dispatch goes into outsideRenderPassCommands, which writes into primary command buffer before renderPassCommands. Otherwise the compute dispatch will be using the image before the actual layout transition occurs, which is wrong. But to detect if the image has a layout/barrier transition in the renderPass, it maintains an angle::FlatUnorderedSet. With recent change for per active context queue serial, we can use the queue serial to detect this. This CL adds a queueSerial for image layout/barrier change and compares it with RenderPassCommands' queueSerial to decide if the renderPass has a layout/barrier for the image. This CL also did some minor clean ups: Removed unused API ContextVk::getActiveImages(). Removed writtenByCommandBuffer() check in CommandBufferHelperCommon::bufferWrite() before calling setWriteQueueSerial, since the check is more expensive than set. Added setQueueSerial call in OutsideRenderPassCommandBufferHelper::imageWrite to be consistent with imageRead. (This might be fixing a bug here). Replaces a few retainResource(image) to image->setQueueSerial for consistency. Bug: b/264472911 Change-Id: I74badd6b8a35f86640e42d330a1a709ccfb961c3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4136948 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 2662f28f 2022-12-30T17:26:22 Vulkan: Fix imageRead from RP and outsideRP simultaneously When a texture is been sampled from both fragment shader and compute shader, you will have the same VkImageLayout. We will not try to end renderPass, which means you end up running into similar situations with OutsideRenderPassCommandBufferHelper::bufferRead where an image is already read accessed by a started renderPass and now read accessed by an outsideRenderPassCommands. Since renderPass has greater queueSerial, we should not tag it with outsideRenderPassCommands' queueSerial. This CL also adds two tests, one for color texture and another for depth texture (which is car_chase uses). Both exposes the same bug. Bug: angleproject:7916 Change-Id: I840ca8947caeb7a96c4c9ccb7c9eca2476837c9c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4133548 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 6c41793f 2022-12-20T15:20:50 Vulkan: Use read/write depth/stencil layouts This allows an application to have depth in read-only feedback loop while stencil is being written to for example. Bug: angleproject:7899 Bug: b/192477489 Change-Id: Ic2e11d32da7c7e3a7f3cd86dbafc5c56a0dbbfd7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4116730 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 295f6830 2022-12-21T10:56:03 Vulkan: bufferRead should accommodate deferred endRenderPass ContextVk::onSyncObjectInit() will request end of current renderPass but deferred (in this case, mRenderPassCommandBuffer is nullptr but mRenderPassCommands->started() still returns true). The next draw call will actually end current renderPass and starts a new renderPass. But if next call is glCopyBufferSubData, it will not actually trigger endRenderPass. This CL modifies OutsideRenderPassCommandBufferHelper::bufferRead logic to accommodate this deferred endRenderPass scenario by checking mRenderPassCommands->started() instead of hasStartedRenderPass so that the answer to "if this buffer been used by current renderPass or not" will return correct result. Bug: angleproject:7903 Change-Id: Ie5c9977ccf083e7d355a2cd8fd08e9077049ee9a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4119692 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 626b10c1 2022-12-20T20:22:19 Vulkan: Add read/write depth/stencil layouts This CL only adds the layouts in the list, but does not use them. The layouts are renamed for consistency in this change. Bug: angleproject:7899 Bug: b/192477489 Change-Id: I47986c7252d32626e9f26c6670c0a4e3496fe0c8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4116736 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 301ed545 2022-12-20T20:16:22 Vulkan: Pass context to layout getters In preparation for a change that optionally uses read/write depth/stencil layouts. Context is used to test for the supportsMixedReadWriteDepthStencilLayouts feature to know whether those layouts are supported or that a fallback must be chosen. Bug: angleproject:7899 Bug: b/192477489 Change-Id: I1453dc9d060453a3806ad0f261b94368fe01fb29 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4116735 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 5c8c0347 2022-12-15T15:46:38 Vulkan: Remove ContextVk::retainResource and retainImage() Clean up some retain* APIs. retainImge and retainReadOnlyResource and retainResource are doing exact same thing, they are consolidated into just retainResource. ContextVk::retainResource is removed since mUse can now safely copied from DescriptorSetHelperPool object which tracks mUse. Bug: b/262047600 Change-Id: I56ea08696e870826bd94ccb79dd621f35923bc6a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4114500 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 376d309c 2022-12-15T09:43:00 Vulkan: Remove unnecessary usesBuffer() check There are places that we call setQueueSerial after usesBuffer() check. This was useful when we had the ResourceList where it is more expensive to set serial. But now setQueueSerial is cheap (actually is cheaper than usesBuffer check), so there is no need to do this check any more. This CL removes the check to further reduce the CPU overhead. Because of this, mUsedBufferCount will not be accurate, so this CL also removes the tracking of mUsedBufferCount (was only for informational purpose anyway). This CL also removes commandBufferQueueSerial.valid() check in Resource::usedByCommandBuffer() and turns it into assertion. Some places in contextVk will ensure we only call it on started renderpass so that other places that calls usedByCommandBuffer will not need to eat the if check. Bug: b/262047600 Change-Id: I6b8004b6aa5b567fa94c0eb56801054f818838b1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4112145 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao cd367796 2022-12-12T15:10:09 Vulkan: Add assert to ensure never setQueueSerial backwards This CL add an assertion in ResourceUse::SetQueueSerial to ensure that we never set a serial smaller than what it already has. If that happens, we could potentially destroy it while GPU still accessing it. With this assertion, it exposed a bug that when a buffer is read accessed by a renderpassCommands and then read accessed by outsideRenderPassCommands, we were incorrectly setting the queueSerial with outsideRP's serial, overwriting the queueSerial already set by renderPassCommands. To fix this, this CL detects this case and keeps the queueSerial set by renderPassCommands. Bug: b/262047600 Change-Id: I51b17ab4a93bccd0d0b079784af96cef9d79f16f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4099804 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 77c95de4 2022-11-16T21:12:28 Vulkan: Threaded monolithic pipeline creation With this change, once a pipeline is created out of libraries, a task is scheduled (if necessary) to asynchronously create a corresponding monolithic pipeline. Once the task is complete, the linked pipeline handle is replaced by the monolithic one, gaining back any performance that might have been lost due to the use of libraries. Bug: angleproject:7369 Change-Id: I525fb1e09f8bedc61b9dbef19f9cce7026ff9c53 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4031151 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Charlie Lao 89cd8583 2022-12-12T11:23:59 Vulkan: Clean up Resource class Resource::retainCommands() API name no longer make sense. This CL removes retainCommands and retainReadOnly and retainReadWrite APIs and replaced with setQueueSerial and setWriteQueueSerial call directly. This CL also merges some of single inline functions to minimize the file, sine the class is small anyway. Bug: b/262048658 Change-Id: I9d16b82c79b27f3285311393601705a4ee7f6d8a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4098005 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Charlie Lao f3ebb2ca 2022-12-08T17:02:12 Vulkan: Better mUse tracking for DynamicallyGrowingPool<Pool> This is used only from DynamicallyGrowingPool<Pool>::onEntryFreed to set the its tracking QueueSerial. There is better way to do this now with per context serial. We can simply merge the QueryHelper's mUse into the pool instead of setting pool's use to the current queueSerial. The benefit of doing that is to possibly allow pool gets reuse/freed earlier (i.e., more accurate tracking). This CL switches it to more accurate tracking and removes mCurrentSerial from Context. This CL also removes unused DynamicSemaphorePool class. Bug: b/262054987 Change-Id: Iac3e2495cc0e3623ba63e9da7f32ad6e9c223467 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4089847 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Amirali Abdolrashidi 684ff60b 2022-06-21T10:52:31 Vulkan: Add shared ring buffer cmd alloc feature * Added RingBufferAllocator.cpp with implementation. * Main classes: * RingBufferAllocator (fast allocation with bulk deallocation) * SharedRingBufferAllocator (wrapper to help with shared use and multiple threads) * Implemented "angle_enable_vulkan_shared_ring_buffer_cmd_alloc" feature. (Disabled by default) * Details (from the original CL) * The angle::PoolAllocator replaced with angle::RingBufferAllocator. * Before, there was separate angle::PoolAllocator per each CommandBufferHelper. Now, a single angle::RingBufferAllocator is shared between multiple CommandBufferHelper objects. * Commands data from multiple CommandBufferHelpers is tightly packed without fragmentation. * Significantly less memory overhead, observed with enabled async queue. * Moved the parts of the code related to the allocators into the classes in the new AllocatorHelperPool and AllocatorHelperRing files for better management. The allocator can be switched by changing the following BUILD flag: `angle_enable_vulkan_shared_ring_buffer_cmd_alloc` * It is connected to the following macro: ANGLE_ENABLE_VULKAN_SHARED_RING_BUFFER_CMD_ALLOC * The two main allocator classes in each file are aliased as: * SecondaryCommandBlockAllocator (in CommandBufferHelper objects) * SecondaryCommandBlockPool (in SecondaryCommandBuffer) * Also added placeholder functions for VulkanSecondaryCommandBuffer. * Added descriptions regarding the two allocators. * renderer/vulkan/doc/Allocators.md Credit: Original CL authored by Igor Nazarov <i.nazarov@samsung.com> Bug: angleproject:6401 Bug: b/256666069 Change-Id: I0f24793eef6334bf4ff8e327b9665338807dad37 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3715968 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Charlie Lao f8980c98 2022-12-08T11:51:42 Vulkan: Make ReadWriteResource subclass from Resource To simplify the code slightly. The main reason for this is that the two class variables of ReadWriteResource totally does not make sense: mReadOnlyUse actually manes any usage, read or write. mReadWriteUse actually means write usage. Since Resource class's mUse means any access, subclass ReadWriteResource from Resource class makes more sense since mUse means exact same thing in both classes. This CL also changes ReadQriteResource::mReadWriteUse to mWriteUse. Bug: b/262048658 Change-Id: I0e3172a70b8cb6a6481045c46690b69fbfe9523c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4089983 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 6830b7d3 2022-11-23T11:51:28 Vulkan: Use finishQueueSerial for queueSubmitOneOff Right now for oneoff submission we are creating a fence and pass in the fence and then wait for fence outside the normal wait code path. This creates a problem that the command buffer and garbage clean up code does not gets run and may end up hitting assertion. This might be necessary before because complication with ResourceList. With recent work that removes ResourceList, this can be much simpler now. This CL removes the fence creation and wait in the oneoff submission code path (except the external fence) and switch to finishQueueSerial call. Bug: b/255414841 Change-Id: I2b16c187becbda9c2397685c7212abac994e8dc2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4053261 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 1219f55a 2022-12-07T16:19:37 Vulkan: Remove Resource::isCurrentlyInUse Due to header file include order, this function can not directly made inline. This CL removes the function and replace it with renderer->getUnfinishedUse() to reduce one extra function call of one line function. Bug: b/262048658 Change-Id: Ied33b63d0ec88336a5ce42cf7726f16b2b883b86 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4089623 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
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>
Shahbaz Youssefi 1193b664 2022-10-11T01:00:40 Vulkan: Use VK_EXT_pipeline_protected_access This extension allows pipelines to be restricted to protected or unprotected command buffers only. Bug: angleproject:7714 Change-Id: Id07be4c2ffd7ca19b8b4a2a869828bc11e89e467 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3943535 Reviewed-by: Charlie Lao <cclao@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Charlie Lao 8181c056 2022-11-22T15:34:48 Vulkan: Remove RenderPassSerial RenderPassSerial was introduced to uniquely identify a RenderPassCommands. With the work of per current context queue serial, now every started RenderPassCommands already have a unique QueueSerial. This CL removes RenderPassSerial and use renderPass's queueSerial instead. Bug: b/255414841 Change-Id: Id0a87319a9132cdb74aba195f1f05aa31454592b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4049966 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Amirali Abdolrashidi 58d7ace2 2022-11-22T16:08:07 Vulkan: Add memory allocation log support in debug * Added a memory tracker to the renderer object to keep track of the memory allocations and deallocations in more detail. * This feature is used for debugging only. * To enable it, set angle_enable_memory_alloc_logging=true in GN args (added in renderer/vulkan/BUILD). * It is related to ANGLE_ENABLE_MEMORY_ALLOC_LOGGING in the code. * The tracker are updated in the memory allocation tracking functions if the feature is enabled. (The counter is always updated, even if the feature is disabled.) * At the end of a RendererVk object, it checks for and logs any remaining allocated memory from MemoryAllocationType members. * The data is stored in the map object "mMemoryAllocationTracker". The key used for it is currently of type angle::BacktraceInfo. * If angle_enable_unwind_backtrace_support is disabled, or not on Android, the key is an empty object. * MemoryAllocInfoMapKey is used as a key to access the allocation information. Bug: b/242641395 Change-Id: If701a4bdea2f8738a830ee47e0c7c5cdacf95b87 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4050103 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
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>
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>
Amirali Abdolrashidi b2f55ec3 2022-11-14T16:07:19 Vulkan: Add memory allocation/deallocation counter * Added a counter to the renderer object to keep track of the memory allocations and deallocations per allocation type. * The counters are updated with the functions onMemoryAlloc() and onMemoryDealloc(), which can be added next to the allocation or deallocation point. * Currently used for buffer memory and image memory. * Removed some of the redundant arguments from vk_helper and suballocation functions. Bug: b/242641395 Change-Id: I58b38f619df7bef0ba5fa3373a8db5aed0ef142c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4014164 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 8378032e 2022-11-15T11:47:55 Vulkan: Remove get API for mLastCompletedQueueSerial In preparation for per context queue serial, this CL makes mLastSubmittedQueueSerial and mLastCompletedQueueSerial private to CommandQueue. Before this CL, we have a get function to return the last submitted serial and last completed serial and passing these serials around. This works because the serial is a single uint64_t number. With per context queue serial, this will be an array of serials and there is potential risk associated with access it from different threads. This CL makes these serials private to CommandQueue and when you want to know if GPU is completed with resource, you ask RendererVk/CommandQueue directly. This way we can ensure they have thread safe access in the CommandQueue (no lock is necessary, but all access will be restricted to one class). Bug: b/255414841 Change-Id: Ica565decce4a80588e0b447e179a2b634b55d7c3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4021676 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 71d28a9b 2022-11-02T13:19:20 Vulkan: Remove unused ShaderAndSerial The serial in the ShaderAndSerial is unused. This CL removed ShaderAndSerial and replaced with ShaderModule directly. Bug: b/257116399 Change-Id: I50d42af7818a12888309a80423531d75135e0bfd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3998747 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi adde4265 2022-10-19T23:33:48 Vulkan: Separate pipeline cache query and insertion In preparation for VK_EXT_graphics_pipeline_library usage, the query and insertion functions of the graphics pipeline cache are separated. This will allow the implementation using VK_EXT_graphics_pipeline_library to query the monolithic pipeline cache, and if a pipeline is not found, create it through the pipeline library caches. Bug: angleproject:7369 Change-Id: Iebf7669ae3ea95e180646198c4861cc59d67e580 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3963854 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Sungyong Choi c6390143 2022-10-12T09:57:55 Vulkan: Make compatible with GCC Resolves below warnings occurred with GCC build. 1) deperecated-copy Overriding an assignment operator without a copy constructor caused the deprecated-copy warnings. 2) unused-function 3) parenthesis Warnings occurred due to missing parenthesis around some logical expressions, add them to quiet the warnings. 4) unused variable 5) 'maybe-unused' attribute ignored Introduces 'ANGLE_MAYBE_UNUSED_PRIVATE_FIELD' macro to avoid 'attribute ignored' warning which is only occurred with GCC because GCC doesn't warn about 'unused non static data member' whereas Clang has Wno-unused-private-field. Signed-off-by: Sungyong Choi <sywow.choi@samsung.com> Bug: angleproject:7764 Change-Id: I8e7410a5ed8cb9b8f8b3202073d779fea63d6b75 Reviewed-by: Jeff Vigil <j.vigil@samsung.com> Reviewed-by: Mohan Maiya <m.maiya@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3963830 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 025504b9 2022-10-17T17:03:03 Pass worker pools to image load functions In preparation for the ASTC decoder using threaded decoding. Bug: b/250688943 Change-Id: I70d669bcb57b900dbb633304182e174aec362203 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3961339 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Greg Schlomoff <gregschlom@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi fbd7d5fa 2022-10-17T17:20:09 Move thread pool classes to common/ In preparation for access by image_util files. Bug: b/250688943 Change-Id: I24777269a5071eae9a60f939635d01ed7246461f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3961454 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi b521be4c 2022-10-14T23:09:26 Vulkan: Decouple shader-set from pipeline caches In preparation for VK_EXT_graphics_pipeline_library, where different pipeline caches (for the complete pipelines and the shaders subset partial pipelines) may create pipelines from the same shader set, the pipeline caches are pulled out of ShaderProgramHelper. In an upcoming change, ProgramExecutableVk will have more than one GraphicsPipelineCache instance, both creating pipelines through the same ShaderProgramHelper. The pipeline creation methods in ShaderProgramHelper are now const. This means a thread would be able to create pipelines using an object of this class while the main thread creates other pipelines using the same object, but in a different pipeline cache. Bug: angleproject:7369 Change-Id: Ib8a76dedf1105ba9dfcad9e972157c92ba18e349 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3956944 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 1119dfbd 2022-10-03T16:47:29 Vulkan: disable supportsHostQueryReset feature if func is null This is try to clean up a old fix for chromium security bug chromium:1273344 that in some bots we are seeing supportsHostQueryReset feature enabled but vkResetQueryPoolEXT pointer is null. We fixed that in crrev.com/c/3313382 that added a check of vkResetQueryPoolEXT AND supportsHostQueryReset feature flag. This CL disables the feature flag if vkResetQueryPoolEXT pointer is null so that other places we only need to check feature flag. Bug: b/250706693 Change-Id: I2d9f9726f081e21a37bbb0bb205003c390f2d32c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3929236 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
Shahbaz Youssefi 135022e4 2022-10-11T00:03:11 Vulkan: Create robust pipelines based on context state Previously, pipelines were made robust based on whether any context in the share group has so far been made robust. This means that pipelines created on non-robust contexts would still be compiled as robust. Inefficiency aside, this was buggy because robustness was not part of the pipeline cache key, so if a pipeline was created as non-robust first, then recreated in a robust context, it would reuse the non-robust variant. With VK_EXT_pipeline_protected_access, a similar situation arises for context protected-ness. However, it is incorrect in that case to create pipelines as protected unnecessarily. This change makes pipeline robustness a part of the pipeline cache key, in preparation for protectedness to be added similarly. Compute programs may now generate multiple pipelines as a result too. Bug: angleproject:7629 Change-Id: Ie95f10eff878f8c8b221c1018da44385c7aad15e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3943534 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
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>
Shahbaz Youssefi 13195f8a 2022-10-05T11:17:35 Vulkan: Fix missing input attachment usage on MSRTT When combined with advanced blend (or framebuffer fetch for that matter), MSRTT attachments could be used as input attachments. This change fixes the missing usage bit. Bug: angleproject:7739 Change-Id: I2190e4a6e534e120357dd68189fb9de07b6c54fa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3936444 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Shahbaz Youssefi 7d10d160 2022-09-29T23:31:40 Vulkan: Fix VK_EXT_pipeline_robustness vs compute Robustness was not specified for compute. Bug: angleproject:5845 Change-Id: I3f3b1e90cc4e965ff4cfcd569587caa952e5eaa2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3924871 Reviewed-by: Alexis Hétu <sugoi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 1d73bad5 2022-10-01T22:50:48 Vulkan: Fix reclear of rendered-to depth/stencil An optimization drops re-clears of images to the same value. When a render pass does: - clear - render - store the "cleared" status of the image was removed because at the end of the render pass, the image no longer has the cleared value. However, this was mistakenly only done for color, but should have been done for depth and stencil as well. Bug: b/239430388 Change-Id: Ib99e0df460eaa82ce87b593276abd9b07f0a8375 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3931972 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Hailin Zhang 836cc5e2 2022-09-09T22:06:22 Vulkan: add etc to bc compute transcoding. use compute shader to transcode etc format to bc format. Bug: b/243398683 Change-Id: Idbd0820a2df8d92fe690055dae2933bc559e9bfd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3888501 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Hailin Zhang <hailinzhang@google.com>
Amirali Abdolrashidi b9cd542e 2022-09-15T17:31:35 Vulkan: Use serial to check which FBO has open RP In preparation for the scenario where an imageless framebuffer is shared, checking whether the started render pass belongs to a certain framebuffer is tweaked to use a serial-based method instead of checking the framebuffer handle. * Added the last render pass serial to ContextVk, which increments every time a render pass begins. The serial is also stored in the FramebufferVk object invoking it. * Added the type RenderPassSerial for this purpose. * Serials are generated through a serial factory in ContextVk. * Updated hasStartedRenderPassWithSerial() to match the serials instead of the handles. * Removed the getFramebuffer() calls from FramebufferVk and UtilsVk that are now unused. Bug: angleproject:7553 Change-Id: Id60dcbf7973558d35e55ff4af4c71e50c6853bba Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3897970 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@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>
Charlie Lao 18f90857 2022-09-09T11:28:00 Vulkan: Use DontCare if attachment is invalidated If an attachment is invalidated, there is no need to preserve the old content. NONE means old content is still preserved, DontCare means discard old content. In this case we do want to discard instead of preserve old content. Bug: b/243711628 Change-Id: I242ac86db6993574b5627d61f7185d155beec0ba Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3888938 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Charlie Lao <cclao@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Mohan Maiya a2f00721 2022-06-19T15:17:22 Vulkan: Extend bounding box when pruning updates Add support for extending the bounding box when there are updates that enclose the current bounding box. Bug: angleproject:4691 Bug: angleproject:7389 Test: Texture2DArrayTestES3.TextureArrayPruneSupersededUpdates* Change-Id: Ie7e3cc28f17213361b1be407dbb2d984865fe6bd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3712897 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Ian Elliott 9aeb6311 2022-08-29T10:50:01 Revert "Extra buffer logging/checking on Android Cuttlefish" This reverts commit 5cb05e0482ed1a2c4048f76c1a7fd444849410d8. The root cause was found, and this extra logging/checking is no longer needed. Bug: b/236098131 Bug: b/245339714 Change-Id: Ibefbeec30be974788789650f2dc86696a6eba11a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3862408 Auto-Submit: Ian Elliott <ianelliott@google.com> Reviewed-by: Jason Macnak <natsu@google.com> Commit-Queue: Jason Macnak <natsu@google.com>
Charlie Lao d9f5b2f8 2022-08-31T13:00:00 Vulkan: Dont skip texture upload if only color space differs sRGB color space does not affect actual data storage, it only affects Image data interpretation. We should still allow data copy if the only format difference is sRGB bit. Bug: b/205995945 Change-Id: Id72b9aae626ee0d1863cde17388f1c1e82f321f8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3864050 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Hailin Zhang 553b1334 2022-07-28T23:33:28 Vulkan: fix default msaa framebuffer resolve issue. Bug: b/239217726 Change-Id: I826aad7495814e0a178a586c4cfd5943278cddac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3793304 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Charlie Lao dc77621b 2022-07-29T16:46:40 Vulkan: Fix RefCountedDescriptorPoolHelper leak DynamicDescriptorPool::mDescriptorPools really owns the pool, make it std::unique_ptr instead of plain c++ pointer to automatic handle object destruction. Bug: chromium:1346946 Change-Id: Iec2fff920d624cd983d314086cc08832c6c61984 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3795008 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 5db09e9b 2022-07-21T10:45:12 Vulkan: Try allocate from existing DescriptorPool before create new When we allocate a new descriptorSet, right now we only look at current bound pool or the last pool, or allocate a new pool. We never look at the other pools for the possibility of allocation. This is likely due to we never free descriptorSet in the past. With the recent CLs, we now release invalid descriptorSets when texture or buffer gets deleted or re-specified. This opens up opportunity to allocate from other existing pools before allocating a new pool. This CL changes the allocation logic to add the pass to iterate over existing pools for allocation before allocating a new pool, thus reducing the number of descriptorSetPools. This CL also consolidates DynamicDescriptorPool::getOrAllocateDescriptorSet()'s actual descriptorSet allocation logic with DynamicDescriptorPool::allocateDescriptorSet(). This CL also moves mEmptyDescriptorSets from ProgramExecutableVk to DynamicDescriptorPool so that we will only have one empty descriporSet per pool instead of per program. Bug: b/235523746 Change-Id: I012346acce17f785ee6683ec55fdf21be00ea1a0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3780847 Reviewed-by: Yuxin Hu <yuxinhu@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 be708446 2022-07-25T15:24:52 Vulkan: Remove the bindEmptyForUnusedDescriptorSets workaround Only applied to older Qualcomm-based phones. Bug: angleproject:2727 Change-Id: I37a611e2ff79d898eff9401467407543f3c690b8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3785290 Reviewed-by: Charlie Lao <cclao@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Charlie Lao 00e48c13 2022-07-20T17:35:01 Vulkan: Destroy DescriptorPoolHelper when its unused. DynamicDescriptorPool keeps an array of DescriptorPoolHelpers. Right now we only grow this array of pools, we never shrink the pool count. This is partly due to we never release descriptorSet. But in the past few CLs, we now release invalid descriptorSet when texture/buffer gets deleted or re-specified. This means we could now have a pool with no valid descriptorSets. This CL adds the ability to actually release the pool when all of its descriptorSets has been released, thus reduce the pool count when a lot of textures have been deleted. Bug: b/235523746 Change-Id: I2d5047269154cc8ece8305408f08f2ad7c9dd8a6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3780845 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Lingfeng Yang 6c418f8c 2022-07-07T14:28:06 Vulkan: __samplerExternal2DY2YEXT-aware TextureVk This CL adds the ability for TextureVk to return an ImageView that is created with a VkSamplerYcbcrConversion object that uses an identity conversion model. This allows direct sampling of YUV values without RGB conversion, which is needed for __samplerExternal2DY2YEXT. Bug: b/223456677 Change-Id: Ie1d4e12375b7808a1f060747bc2d74baeda3fdea Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3751889 Commit-Queue: Lingfeng Yang <lfy@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 53d40aed 2022-07-15T15:03:25 Vulkan: Destroy descriptorSet cache when BufferHelper destroyed For atomic counter buffers or other cases, dynamic descriptor is not been used. Right now when such buffer is destroyed, the cache is still lingers around. With this CL, when a new cache entry has been created, we record the cache entry in the BufferHelper. When BufferHelper is destroyed, we also immediately destroy the cache entry since the cache will no longer reused. Bug: b/237686097 Change-Id: I26eee96318fbc003e65318c0b8263dc61092f350 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3764044 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Charlie Lao c7459a46 2022-07-15T09:55:03 Vulkan: Destroy descriptorSet cache when BufferBlock destroyed When a new cache entry has been created, we record the cache entry in the BufferBlock. When BufferBlock is destroyed, we also immediately destroy the cache entry since the cache will no longer reused. This CL also removes DescriptorCacheResult from various APIs since it is now redundant with newSharedCacheKey argument. Bug: b/237686097 Change-Id: I14fa8906fdbe7d9226c8e8ecddef2beb05fbaa5c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3756694 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Auto-Submit: Charlie Lao <cclao@google.com>
Lubosz Sarnecki 45e5cf01 2022-06-03T14:29:23 Vulkan: Implement ASTC emulation. Implement ASTC emulation using the astc-encoder library. Add copy_image tests to deqp_gles31_test_expectations for desktop cards. Add emulatedAstc limitation. Don't expose emulated ASTC from WebGL contexts. Introduce ANGLE_HAS_ASTCENC define to check for build availability. Only build on angle_standalone configurations. DEPS: Add astc-encoder. image_util: Decode ASTC to RGBA. TracePerfTest: Skip car_chase and genshin_impact on NVIDIA. Bug: angleproject:7415 Change-Id: Ib2f3fd3f710164a2ecd5d5edf780227031bbfb84 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3697999 Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Charlie Lao e25137c0 2022-06-29T09:57:50 Vulkan: Move DescriptorSet cache to DynamicDescriptorPool DynamicDescriptorPool has an array of DescriptorPoolHelper. Right now mDescriptorSetCache is stored in DescriptorPoolHelper. This means when you search cache for the match, you have to iterate over the array of DescriptorPoolHelper to decide to make conclusion if there is a match or not. Each hash map search means compute hash and do key comparison. I think this was done this way because of we used to not able to evict cache when we decide to reuse DescriptorSetPoolHelper object (when we call pool->init). But with recent changes of SharedDescriptorSetCacheKey, we are able to evict specific cache entries. This CL moves mDescriptorSetCache to DynamicDescriptorPool so that cache look up can be cheaper. This also made CacheStats simpler as well. With Gfxbench gl_driver2_off and cpu clock locked, this CL improves score by 2.16% (from 4019 before CL to 4105 after CL). See bug for detailed data. Bug: b/237686097 Change-Id: Ia6fa7a6b725974e0150bc21cdf0140d9198c8332 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3735736 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Constantine Shablya b47603e0 2022-06-14T05:47:54 Implement GL_NV_read_depth_stencil The implementation will perform two readPixels calls, once for each aspect, and then interleave and pack the result. Bug: angleproject:4688 Change-Id: I46390df893de50b93e855e9333ffab567215a2bb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3702686 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com> Auto-Submit: Constantine Shablya <constantine.shablya@collabora.com>
Ian Elliott d88f7906 2022-07-01T12:57:09 Extra buffer logging/checking on Android Cuttlefish This adds a feature that will be enabled on Android Cuttlefish systems, to catch a rare crash. Test: Visual inspection of logcat output Bug: b/236098131 Change-Id: Ie35d7e017f69b36da9caf3e47c31fcc71846caed Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3726963 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Charlie Lao a1f8049a 2022-07-06T13:12:20 Vulkan: Remove VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT Some virtual machine drivers have performance cost with VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT. This CL keeps the individually freed descriptorSet in the pool and try to reuse rather than free it. This CL also removes descriptorSetCount from some API since it always allocate one at a time. Bug: b/237848471 Change-Id: I029d651101fa1050770eba9e733a166e56a69684 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3749797 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 81a69da6 2022-06-30T09:56:54 Vulkan: min/mag filters follow chroma filter value The Vulkan spec states that for those formats lacking support for VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT the min and mag filter must be equal to the sampler YCbCr conversion's chroma filter. Having the min/mag filters follow the chroma filter leads to simpler and more efficient code. Also update getPreferredFilterForYUV function to return existing filter value when preferLinearFilterForYUV feature is disabled. Bug: angleproject:7382 Bug: angleproject:7392 Tests: Texture2DTestES3YUV.TexStorage2DYuvFilterModes* Tests: ImageTestES3.SourceYUVAHBTargetExternalYUVSampleLinearFiltering/ES3_Vulkan Change-Id: I550ef8feede1dc6c3a0d8e32f790113e90ef7a4b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3739582 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Charlie Lao 723cc880 2022-06-10T17:55:54 Reland "Reland "Vulkan: Destroy DescriptorSet cache when it becomes invalid"" This is a reland of commit 551a26aeedbfd971d6199c8eddb433a4f4ff871c Original change's description: > Reland "Vulkan: Destroy DescriptorSet cache when it becomes invalid" > > This is a reland of commit 0779ccbcd427dcb00e53afa6385fb4e8e2377993 with > the fix for angleproject:7466. When DescriptorPoolhelper gets > release/destroyed, we ensure all sharedCacheKeys are destroyed. > > Original change's description: > > Vulkan: Destroy DescriptorSet cache when it becomes invalid > > > > When a new texture descriptorSet is allocated, we store one reference of > > the cache key in ProgramExecutableVk and all TextureVks that it > > associated with. When any of the TextureVk is destroyed or its view > > destroyed, we immediately erase the descriptorSet from the cache and > > track GPU progress and free the descriptorSet when it's GPU completed. > > That way we delete the dead descriptorSet that will for sure never been > > reused ASAP so that its space is avialable for reuse. > > > > Bug: b/235523746 > > Change-Id: Ib1b9662a254eea5a3f410dc6d5d89fca6727a647 > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3700226 > > Reviewed-by: Lingfeng Yang <lfy@google.com> > > Commit-Queue: Charlie Lao <cclao@google.com> > > Reviewed-by: Ian Elliott <ianelliott@google.com> > > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > > Bug: b/235523746 > Bug: angleproject:7466 > Change-Id: I4413bec27ea0ca830010e2ca15036c2e667141c0 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3726964 > Reviewed-by: Ian Elliott <ianelliott@google.com> > Commit-Queue: Charlie Lao <cclao@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bug: b/235523746 Bug: angleproject:7466 Change-Id: I6b88b884841c5dbc625ee7e0c52c45af09dec199 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3741027 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com>
Ian Elliott 4b745c2b 2022-07-01T01:25:36 Revert "Reland "Vulkan: Destroy DescriptorSet cache when it becomes invalid"" This reverts commit 551a26aeedbfd971d6199c8eddb433a4f4ff871c. Reason for revert: Blink test failures at: https://ci.chromium.org/ui/p/chromium/builders/ci/WebKit%20Linux%20MSAN/15546/overview Original change's description: > Reland "Vulkan: Destroy DescriptorSet cache when it becomes invalid" > > This is a reland of commit 0779ccbcd427dcb00e53afa6385fb4e8e2377993 with > the fix for angleproject:7466. When DescriptorPoolhelper gets > release/destroyed, we ensure all sharedCacheKeys are destroyed. > > Original change's description: > > Vulkan: Destroy DescriptorSet cache when it becomes invalid > > > > When a new texture descriptorSet is allocated, we store one reference of > > the cache key in ProgramExecutableVk and all TextureVks that it > > associated with. When any of the TextureVk is destroyed or its view > > destroyed, we immediately erase the descriptorSet from the cache and > > track GPU progress and free the descriptorSet when it's GPU completed. > > That way we delete the dead descriptorSet that will for sure never been > > reused ASAP so that its space is avialable for reuse. > > > > Bug: b/235523746 > > Change-Id: Ib1b9662a254eea5a3f410dc6d5d89fca6727a647 > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3700226 > > Reviewed-by: Lingfeng Yang <lfy@google.com> > > Commit-Queue: Charlie Lao <cclao@google.com> > > Reviewed-by: Ian Elliott <ianelliott@google.com> > > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > > Bug: b/235523746 > Bug: angleproject:7466 > Change-Id: I4413bec27ea0ca830010e2ca15036c2e667141c0 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3726964 > Reviewed-by: Ian Elliott <ianelliott@google.com> > Commit-Queue: Charlie Lao <cclao@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bug: b/235523746 Bug: angleproject:7466 Change-Id: Icdde2752c462b7ebbb51d46fd35ce749b5caf377 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3739585 Reviewed-by: Ian Elliott <ianelliott@google.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: Ian Elliott <ianelliott@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Charlie Lao 551a26ae 2022-06-10T17:55:54 Reland "Vulkan: Destroy DescriptorSet cache when it becomes invalid" This is a reland of commit 0779ccbcd427dcb00e53afa6385fb4e8e2377993 with the fix for angleproject:7466. When DescriptorPoolhelper gets release/destroyed, we ensure all sharedCacheKeys are destroyed. Original change's description: > Vulkan: Destroy DescriptorSet cache when it becomes invalid > > When a new texture descriptorSet is allocated, we store one reference of > the cache key in ProgramExecutableVk and all TextureVks that it > associated with. When any of the TextureVk is destroyed or its view > destroyed, we immediately erase the descriptorSet from the cache and > track GPU progress and free the descriptorSet when it's GPU completed. > That way we delete the dead descriptorSet that will for sure never been > reused ASAP so that its space is avialable for reuse. > > Bug: b/235523746 > Change-Id: Ib1b9662a254eea5a3f410dc6d5d89fca6727a647 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3700226 > Reviewed-by: Lingfeng Yang <lfy@google.com> > Commit-Queue: Charlie Lao <cclao@google.com> > Reviewed-by: Ian Elliott <ianelliott@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bug: b/235523746 Bug: angleproject:7466 Change-Id: I4413bec27ea0ca830010e2ca15036c2e667141c0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3726964 Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jose Dapena Paz 1dc3385a 2022-06-27T18:13:33 libstdc++: move FramebufferHelper to cache utils vk_helper.h includes vk_cache_utils.h. FramebufferHelper was declared in vk_helper.h. And FramebufferCache, in vk_cache_utils.h, requires FramebufferHelper for its payload hashmap. This was solved with a forward declaration. But, with std::pair definition in libstdc++ this is not enough. Bug: chromium:957519 Change-Id: I32e3e247c3c8bef8b52806aa2601e4012e6aa79e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3727671 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yuly Novikov f8690429 2022-06-27T13:50:44 Revert "Vulkan: Destroy DescriptorSet cache when it becomes invalid" This reverts commit 0779ccbcd427dcb00e53afa6385fb4e8e2377993. Reason for revert: crashes in blink_web_tests on linux-rel https://ci.chromium.org/ui/p/chromium/builders/try/linux-rel/1051045/overview Original change's description: > Vulkan: Destroy DescriptorSet cache when it becomes invalid > > When a new texture descriptorSet is allocated, we store one reference of > the cache key in ProgramExecutableVk and all TextureVks that it > associated with. When any of the TextureVk is destroyed or its view > destroyed, we immediately erase the descriptorSet from the cache and > track GPU progress and free the descriptorSet when it's GPU completed. > That way we delete the dead descriptorSet that will for sure never been > reused ASAP so that its space is avialable for reuse. > > Bug: b/235523746 > Change-Id: Ib1b9662a254eea5a3f410dc6d5d89fca6727a647 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3700226 > Reviewed-by: Lingfeng Yang <lfy@google.com> > Commit-Queue: Charlie Lao <cclao@google.com> > Reviewed-by: Ian Elliott <ianelliott@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bug: b/235523746, angleproject:7466 Change-Id: I7e5067de2f2add08af1f9804cc2e952238b2e942 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3726097 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Eddie Hatfield 91976352 2022-06-21T15:41:02 Use C++17 attributes instead of custom macros Bug: angleproject:6747 Change-Id: Iad6c7cd8a18d028e01da49b647c5d01af11e0522 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3718999 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 0779ccbc 2022-06-10T17:55:54 Vulkan: Destroy DescriptorSet cache when it becomes invalid When a new texture descriptorSet is allocated, we store one reference of the cache key in ProgramExecutableVk and all TextureVks that it associated with. When any of the TextureVk is destroyed or its view destroyed, we immediately erase the descriptorSet from the cache and track GPU progress and free the descriptorSet when it's GPU completed. That way we delete the dead descriptorSet that will for sure never been reused ASAP so that its space is avialable for reuse. Bug: b/235523746 Change-Id: Ib1b9662a254eea5a3f410dc6d5d89fca6727a647 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3700226 Reviewed-by: Lingfeng Yang <lfy@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 878bbfaa 2022-06-17T11:48:14 Vulkan: Account for 2DArray textures during robust resource init Correctly handle layer count and depth when the texture type is 2Darray. Vulkan requires depth of 1 for 2Darray textures. This also reverts commit c59a22e587e63cbe9942a7f0b78681ee25084cc4. Bug: angleproject:3189 Bug: angleproject:4691 Bug: angleproject:7389 Bug: angleproject:7438 Test: DXT1CompressedTextureTestES3.CompressedTexSubImage3DValidationPerSlice*Vulkan Change-Id: Ifb3b9cabd4786dcced750e3c2db90e350d455098 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3712220 Reviewed-by: Lingfeng Yang <lfy@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
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>
Mohan Maiya 8a8b9665 2022-06-08T14:54:37 Vulkan: Prune superseded staged updates in a texture Add support for pruning superseded staged updates from a client buffer to the texture. If the staged update count or the cumulative staged updates' size exceeds a threshold we check for superseded updates and prune the list. Bug: angleproject:4691 Bug: angleproject:7389 Test: Texture2DTest.InterleavedSupersedingTextureUpdates* Texture2DTest.ManySupersedingTextureUpdates* Change-Id: I4b84f13fa20004a3dc68baa552a0af656d92c0a1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3691092 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Yuxin Hu 5fbb0417 2022-05-26T15:05:52 Vulkan: Handling VK_EXT_load_store_op_none on ARM There is a bug on at least one ARM device when either depth or stencil load op is none. Add a temporary work around to avoid this case for ARM driver until angleproject:7370 is addressed. Also add a test to reproduce the deqp test failures with simiplied draw calls. Bug: angleproject:7370 Bug: angleproject:7351 Change-Id: I74ac49a75f85b1e006ed3b1d77f234f63d314ae0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3671696 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Dan Field 4b9eb4ba 2022-06-03T09:22:41 Optionally support vulkan_memory_allocator 3.x Incompatible API is guarded behind a new define, ANGLE_VMA_VERSION. This allows a soft migration for Chromium and Fuchsia, while allowing clients like Flutter to roll to a new version that is compatible with its revision of Skia. Bug: chromium:1332566 Change-Id: I68cafde13e50445aa8eea2f18203143659a1c627 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3688835 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Dan Field <dnfield@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Amirali Abdolrashidi 3b988fef 2022-06-01T10:54:03 Vulkan: Remove enableLineRasterEmulation * Removed the Bresenham line raster emulation specialization constant, along with related variables and functions. Bug: angleproject:7366 Change-Id: If17c8ce9b459ad801bae8e887e5674bd9a3ff2bf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3680860 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi a9516865 2022-06-01T22:48:04 Vulkan: Output cache look up feedback in pipeline graph Bug: angleproject:6565 Change-Id: I12bb9ab5756860de9ba26d6b4a9429a78b65df39 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3686029 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 53ec886e 2022-05-30T16:49:11 Vulkan: Externally synchronize the pipeline cache In preparation for a future change that requires this as it may perform pipeline cache merges during creation of pipelines. Bug: angleproject:5881 Change-Id: Ic7921b781aa773ae23b60a0bb6fa2111b1fc401e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3679479 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Brandon Schade eb282de0 2022-05-20T18:36:46 Vulkan: Add feature to use VK_FILTER_LINEAR for YUVConversionInfo VK_FILTER_NEAREST is default for chromaFilter in ConversionInfo. Add feature to allow VK_FILTER_LINEAR to be used instead. This feature controls the quality when sampling YUV images. Bug: angleproject:7382 Change-Id: I3f67d7620d94b5b33c42754adfef84b97c798637 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3684351 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Trevor Black <vantablack@google.com> Reviewed-by: mohan maiya <m.maiya@samsung.com> Commit-Queue: Brandon Schade <b.schade@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Faye Zhang 32a0ee92 2022-05-31T10:51:06 Code Cleanup In validationES.cpp, the framebuffer is required to have 0 depth bits (to conform to OpenGL ES 3.2 specifications). That is, ImageHelper::copyImageDataToBuffer() will not be called on a buffer with combined depth and stencil format. Replacing the lines relating to testing combined depth and stencil format ImageHelper::copyImageDataToBuffer() with an assert. Bug: angleproject:6856 Change-Id: I911500910b2065eb21c72d7f2d8ff481f4afa304 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3680862 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Faye Zhang <ffz@google.com>
Shahbaz Youssefi 28b4c378 2022-05-27T15:45:59 Vulkan: Pipeline creation feedback in perf counters Bug: angleproject:5881 Change-Id: I42917cab3c97abb50a14035972a96728dcb990b9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3672851 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Jamie Madill da30caec 2022-05-26T13:35:24 Vulkan: Switch resource tracking. CommandBufferHelpers now determine if a Resource is busy by looking at the "ResourceCommandBuffers" list in each ResourceUse. This reduces CPU overhead in the Aztec Ruins trace by up to 3%. Bug: angleproject:5664 Change-Id: I8d927af7f39db38c98d746ca4cc01f343d0df2e8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3668836 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 1ce69722 2022-05-18T13:05:22 Vulkan: Track used command buffers in ResourceUse. The list of command buffers to ResourceUse will replace tracking resources in a CommandBufferHelper. Currently the two tracking methods live side-by-side, and the old method will be removed in a future CL. Bug: angleproject:5664 Change-Id: Ia04d77e72c508e10b549db8c8dd5f0472e4edc83 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3656069 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9f4b9c65 2022-05-18T14:39:18 Vulkan: Refactor command buffer retain calls. This removes "getResourceUseList" from the command buffers, and instead we pass around the command buffer helpers. Since future CLs will change the way we track resources, this provides for a more stable interface for tracking. Bug: angleproject:5664 Change-Id: I7118788570eaa3c0ddb6d5ef523e050ad7be00ad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3645814 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 23f213d1 2022-05-26T23:43:44 Vulkan: Make drawable size uniform As a specialization constant, it's impossible to predict the value the drawable size may take, which in turn makes it impossible to warm up the Vulkan pipeline cache at link time. Bug: angleproject:7366 Change-Id: Ia3d1860a4fcb8e3078fdcb8d02a2e0cd173ea028 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3671976 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> 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>