src/libANGLE/renderer/vulkan/ContextVk.cpp


Log

Author Commit Date CI Message
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>
Eddie Hatfield 707323c1 2022-06-21T18:53:05 Miscellaneous C++17 refactoring Bug: angleproject:6747 Change-Id: I792ba74e03145ff6c3cc97d4bff6327ab275a2c7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3719001 Commit-Queue: Eddie Hatfield <eddiehatfield@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi e50351cb 2022-06-10T22:28:58 Vulkan: Don't close render pass on framebuffer fetch For applications that use framebuffer fetch in the same RP as non-fetch programs, we can save some extra RenderPasses by always creating our RP objects with input attachments enabled. This works almost identically except for needing to use the images in a "GENERAL" layout instead of "COLOR_ATTACHMENT_OPTIMAL". According to partners it is possible to achieve performance parity even with GENERAL layout. To remove any potential negative impacts of using the GENERAL layout, the context enters this always-framebuffer-fetch mode only and as soon as a framebuffer fetch program is created. Applications that don't use framebuffer fetch are thus unaffected. This eliminates 20 render passes in the Genshin Impact trace (out of about 58). On a Pixel 6 the resulting benchmark score speeds up by ~25%. For Real Racing 3, the speed up is ~30%. Based on change by jmadill@chromium.org Bug: angleproject:7375 Change-Id: Ib6c73e95d06229f8545d502b388ee2a55a582323 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3697308 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Faye Zhang 714f680f 2022-06-08T16:19:20 Implement GL_EXT_base_instance * Added the validation functions for DrawElementsInstancedBaseVertexBaseInstance(), DrawElementsInstancedBaseInstance(), and DrawArraysInstancedBaseInstance() according to the specs. * Added generic implementation for glDrawElementsInstancedBaseInstance() that can be called by back-ends. * Added flags for back-ends so they can enable the extension. * Added tests for DrawElementsInstancedBaseVertexBaseInstance(), glDrawElementsInstancedBaseInstance(), and DrawArraysInstancedBaseInstance(). * Disabled ES3_D3D11__DynamicDraw tests due to angleproject:7441 bug. Bug: angleproject:6983 Bug: angleproject:7441 Change-Id: Ia664b01c87bc64c05e29adec23a8f80792eaa037 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3697206 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Faye Zhang <ffz@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.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>
Shahbaz Youssefi 3dfc8004 2022-06-08T14:24:48 Vulkan: Optimize sync followed by swap Previously, inserting a sync object immediately caused a submission. That was done in https://chromium-review.googlesource.com/c/angle/angle/+/3200274 to be able to wait until the sync object is signaled without having to wait for whatever is recorded after it until a flush naturally happens. Some applications issue a glFenceSync right before eglSwapBuffers. The submission incurred by glFenceSync disallowed the optimizations that eglSwapBuffers would have done, leading to performance degradations. This could have been avoided if glFenceSync was issued right after eglSwapBuffers, but that's not the case with a number of applications. In this change, when a fence is inserted: - For EGL sync objects, a submission is issued regardless - For GL sync objects, a submission is issued if there is no render pass open - For GL sync objects, the submission is deferred if there is an open render pass. This is done by marking the render pass closed, and flagging the context as having a deferred flash. If the context that issued the fence sync issues another draw call, the render pass is naturally closed and the submission is performed. If the context that issued the fence sync causes a submission, it would have a chance to modify the render pass before doing so. For example, it could apply swapchain optimizations before swapping, or add a resolve attachment for blit. If the context that issued the fence sync doesn't cause a submission before another context tries to access it (get status, wait, etc), the other context will flush its render pass and cause a submission on its behalf. This is possible because the deferral of submission is done only for GL sync objects, and those are only accessible by other contexts in the same share group. Bug: angleproject:7379 Change-Id: I3dd1c1bfd575206d730dd9ee2e33ba2254318521 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3695520 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi da9390d6 2022-06-08T22:38:18 Vulkan: Fix the VulkanRenderPassBufferCount overlay widget This widget was declared as a histogram, but used as a graph. The graph's add() interface is made hidden in histograms to avoid such mistakes in the future. Bug: angleproject:4950 Change-Id: I95a1b6badbe27b870273589271b13c454c8a4e56 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3697438 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@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>
Shahbaz Youssefi 4ea62009 2022-06-07T15:35:51 Vulkan: Prefer driver uniforms over spec consts On hardware that's not seeing any benefit from specialization constants, this change switches to using driver uniforms to reduce the number of pipelines created. Bug: angleproject:7406 Bug: b/173636783 Change-Id: Ic1ea1b389b0b27169427643f811370943195f331 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3692270 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi ce3c0fe9 2022-06-06T12:09:45 Vulkan: Make depth-correction uniform controlled This change makes sure SPIR-V transformations are not required for depth correction, having the number of potential pipelines. Bug: angleproject:5881 Change-Id: If3f66b34bdd1127ae588cbc822ea7cf01fa8621f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3691801 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Charlie Lao d655ad29 2022-05-31T14:20:16 Vulkan: Add tests for FramebufferCache growth bugs When texture attached to FBO gets respecified, we shouldn't keep growing FramebufferCache. When texture attached to fbo get glTexParameteri(GL_TEXTURE_SWIZZLE_R) call with the same value, we should also not destroy/recreate framebuffers (in fact should not recreate VkImageView). We ran into this usage pattern on surfaceflinger. When texture attached to fbo get glTexParameteri(GL_TEXTURE_SWIZZLE_R) call with different value, we should also not destroy/recreate framebuffers (in fact should not recreate VkImageView). We ran into this usage pattern on surfaceflinger. Bug: b/234769934 Bug: b/234602034 Change-Id: I9fc881486f95cc3da843f50fa0a8cdcbfd4fc625 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3681081 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: 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>
Shahbaz Youssefi e04314fd 2022-05-30T01:09:31 Vulkan: Include state in pipeline graph dump Each program generates a group of nodes. The group's description is the common state among all nodes. Each node contains the diff with the shared state. Arrows between nodes indicate the GraphicsPipelineTransitionBits that have caused the transition. State that is 0 is not output for brevity. Bug: angleproject:6565 Change-Id: I7b6a95efcee63f1d7d368d8e062c5c1d221fb8b9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3673829 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi b0d75fb5 2022-05-31T16:55:23 Vulkan: Use 64-bit counters Some upcoming counters don't fit in 32 bits. Bug: angleproject:5881 Change-Id: I2de8a603cabdb5f7417c29d5f37a50899485d6d3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3679488 Commit-Queue: Charlie Lao <cclao@google.com> Auto-Submit: 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 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>
Shahbaz Youssefi 2df17a12 2022-05-25T16:18:37 Vulkan: Pack driver uniforms Previously 5 vec4s were used for driver uniforms + 2 vec4s if specialization constants couldn't be supported. The driver uniforms are rearranged and packed such that only 2 vec4s are normally used, which include fallback for specialization constants as well. In the future, most of the specialization constants may turn into uniforms, and this change prepares for that. Additional uniforms are used (3 vec4s) only if common extensions are missing; transform feedback and bresenham lines. This change makes it more practical for driver uniforms to be turned into push constants. Additionally, these uniforms could potentially be loaded and cached at the beginning of the shader for more efficient memory access. On Pixel6, with this change, the traces show no difference in wall time. On most traces, CPU time shows up to ~7% improvement. Bug: angleproject:7366 Change-Id: I0f47f863955af06a19c69d1f1d7c45b97d95476e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3668151 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 98c2e169 2022-05-20T16:17:49 Vulkan: Reduce pre-rotation spec const to bool The specialization constant now only dictates whether x and y should be swapped. The complete 8 possible states of rotation and y-flip are achieved by using this swap in combination with a driver uniform for x and y flip. Swapping is still a specialization constant to avoid degrading performance of dFdx/dFdy which otherwise would need both to be evaluated instead of one. On platforms which don't support pre-rotation, the specialization constant will never change and driver uniforms entirely govern y-flip. On platforms that do support pre-rotation, only two variations of the pipeline are needed. Bug: angleproject:7366 Change-Id: I73f84e89fa9349d2098fa5b21573aee57d93a30c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3663151 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Lingfeng Yang <lfy@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Amirali Abdolrashidi fea19567 2022-05-17T17:44:06 Vulkan: Remove removeEarlyFragmentTestsOpt flag * Removed removeEarlyFragmentTestsOptimization and the related SPIRV transformation and variables. * Removed mUsesEarlyFragmentTestsOptimization. * Removed SH_EARLY_FRAGMENT_TESTS_OPTIMIZATION. * Merged updateUsesEarlyFragmentTestsOptimization() into updateFragmentInoutRange(). Bug: angleproject:7347 Change-Id: I7299bd4e8ab5363e5cf06eb48419d4f469106e12 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3648217 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Mohan Maiya 84a0b462 2022-05-20T15:51:11 Vulkan: Bug fix in GL_QCOM_shading_rate A default value of _1x1 for mShadingRate interacts badly with sample shading state on some vendors. Instead set the default to Undefined and return early in such cases. Bug: angleproject:7172 Change-Id: If0a280090e6611817d2f5d75929ef2b654ddb186 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3658245 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Shahbaz Youssefi 11e9c835 2022-05-22T23:52:35 Vulkan: Dump graphics pipeline cache graph Bug: angleproject:6565 Change-Id: Ica8fdc40ece3e1c66fae8a4f8f70a3d33374fdb8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3656639 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>
Shahbaz Youssefi e4a517c9 2022-05-17T23:58:23 Vulkan: Rearrange GraphicsPipelineDesc to reduce footprint Bits for VK_EXT_extended_dynamic_state2 are moved to the end of the desc. Some bits are also rearranged and some paddings removed for a total of 4 bytes of reduction in desc size. Bug: angleproject:7328 Change-Id: I48f20408a8a2cb7bce0d8e2d0d2ccd8a121f7894 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3652747 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi 688553c0 2022-05-16T23:27:29 Vulkan: Dynamic state for primitive restart enable Bug: angleproject:5906 Change-Id: Ida2cbe904604c638fd3a8ab498d49584dfd9c860 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3651593 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 3b78e0d5 2022-05-16T23:13:57 Vulkan: Dynamic state for depth bias enable Bug: angleproject:5906 Change-Id: I679a764e0a9ef74cc8a58f9061b42c0aaef56df2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3651592 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 7c83a363 2022-05-16T22:22:44 Vulkan: Dynamic state for rasterizer discard enable Interaction with primitives generated query are tested by those tests added in https://chromium-review.googlesource.com/c/angle/angle/+/2976181 Bug: angleproject:5906 Change-Id: I0ab9f54995504be770a93bf13337a5ffe20bf7eb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3651582 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 58fd3157 2022-05-12T00:01:19 Vulkan: Dynamic state for vertex stride Bug: angleproject:5906 Change-Id: I73b7e004fc25bf3777982736412adc1ca57504b9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3644856 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Steven Noonan 6ae0c321 2022-05-15T18:18:47 Vulkan: clamp dynamic line width to supported values On my Apple M1, MoltenVK reports wide lines are not supported. Trying to use vkCmdSetLineWidth with any value other than 1.0f will cause MoltenVK to throw an exception and stop accepting render commands. I originally tried making this a change in the frontend Context class, by clamping the value to the supported line width range. But that approach failed the WebGL conformance tests, because queries of of GL_LINE_WIDTH must match the value specified by glLineWidth. OpenGL ES docs state: The line width specified by glLineWidth is always returned when GL_LINE_WIDTH is queried. Clamping and rounding have no effect on the specified value. Bug: angleproject:7317 Change-Id: I7a3c3454e1483f9124fd70b7e9f2138bd717e1de Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3654264 Auto-Submit: Steven Noonan <steven@valvesoftware.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi 8701f53a 2022-05-17T13:54:53 Vulkan: Fix clear value for incomplete MS textures * Added initializeContentsWithBlack() for the cases we wish to use opaque black. * Added stageResourceClearWithFormat(), which also takes an initial clear value. stageRobustResourceClearWithFormat() is included as a special case. Bug: angleproject:7151 Change-Id: I32d7a9af53b51499fe46d6e397301744dbf3c236 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3652995 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 891a4682 2022-05-12T22:32:07 Vulkan: Dynamic state for stencil test/op Bug: angleproject:5906 Change-Id: I436c6c238a15e54919a74d2a697d1f114bb3eaf9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3647207 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 66dcca5e 2022-05-12T11:14:27 Vulkan: Dynamic state for depth test/write/op Bug: angleproject:5906 Change-Id: Ie48a0780406c6dbbdd47639f2e185dc854879140 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3646429 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Peng Huang bedb3075 2022-05-16T09:46:11 Do not call RendererVK::handleDeviceLost() for device lost RendererVK::handleDeviceLost() need to hold the mCommandQueueMutex for releasing some resources. For some cases, Locking mCommandQueueMutex may cause deadlock, because the same lock has been acquired by the same thread. Fix the problem by not calling RendererVK::handleDeviceLost() for device lost. It is OK, because RendererVK::onDestroy() will call handleDeviceLost() if the device is lost already. Bug: chromium:1273643 Change-Id: Iaaa77bdf429b703363d4155323b91baf5947d95e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3644641 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 48b1f07b 2022-05-11T15:20:24 Vulkan: Dynamic state for front face Bug: angleproject:5906 Change-Id: I649b9d2ab10daac6831f0ecb23f8211d3963c8c1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3643098 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi 4e5da2d2 2022-05-11T13:58:07 Vulkan: Dynamic state for cull mode Bug: angleproject:5906 Change-Id: I3d7b888e7999d4892ff71d636ea16a2edcf7a27f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3642800 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 4b95ac7d 2022-05-12T11:29:11 Vulkan: Don't invalidate pipeline on dynamic state change Bug: angleproject:5906 Change-Id: I3a959dc5b1f62869ff77d62dce82555d00bd18e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3646427 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Peng Huang 81c84292 2022-05-13T14:44:45 Do not do cleanup for Vulkan device lost When vulkan device lost happens caused by some gl calls, the GL calls may hold a lock in RendererVk. And ANGLE will try to cleanup resources in RendererVk. Those cleanup needs to hold the same lock as well. Since the lock is not recursive lock, acquiring the same lock again will cause deadlock. Fix the problem by not cleanup resources for device lost. It should be fine, all resource should be released when client destroy the lost context. Bug: chromium:1273643 Change-Id: I93ab0c966c8e9f3579b4e6742503d8588f16ebb9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3645497 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 21ad9b3c 2022-04-07T09:57:26 Vulkan: Add generic descriptors for DS cache. With the new design, the descriptor set cache keys include all identifying information needed to reconstruct the update descriptor sets calls except the specific resource handles. The places for the resource handles are held by serials intead. When we miss the cache, we no longer need a second step to then construct the update calls, and can build the update calls directly from the key structures in combination with a list of resource handles. Bug: angleproject:6776 Change-Id: If1660a557585a75e9aa2560d6a38c56b62f555c8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3484981 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill d8d396db 2022-04-07T09:57:25 Vulkan: Add shared descriptor set caches. This allows programs with the same sets of descriptors to share descriptor sets. Currently there is no cache eviction. This CL adds a new "Meta" class to manage the descriptor set caches. Each shared descriptor pool is unique to a descriptor set layout. The descriptor set cache is moved into the pool class. Now every instance of a descriptor pool in ANGLE has easy access to a descriptor set cache as well. Bug: angleproject:6776 Change-Id: I06982e0349f5a87e4578e769fa356ce8e7ab49f0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3424660 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 73cb1e6e 2022-05-11T12:53:46 Vulkan: Tag dynamic dirty bits with DYNAMIC Bug: angleproject:5906 Change-Id: Ia4294827f4c9f590448b791756ba7e95a90c8c09 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3642799 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 4ffab3bf 2022-05-10T16:17:54 Vulkan: Dynamic state for stencil reference Bug: angleproject:5906 Change-Id: I1aaf54208b173ca58ff1afd2900eca7ee78726cf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3638990 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Min Zhang 3d55cf0c 2021-12-30T11:27:26 Vulkan: Optimize the vkImage layout when used as GL_image If one vkImage has been used as GL_image in compute shader and as a GL_texture in fragment shader, no dependencies are needed for the fragment shader and other pre-fragment graphics shaders, like vertex/tess/geom. If we only assign the vkImage layout as writable when running GL executables that have Image Textures, we can specify more precise read-only barriers when running read-only GL executables. Bug: angleproject:6862 Change-Id: Iff37fdce13fea637751899253e535bf3f6663200 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3366014 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 1d8227da 2022-05-10T16:00:39 Vulkan: Dynamic state for stencil write mask Bug: angleproject:5906 Change-Id: I74adf56ec0b7b251ab3c5204b68b062d5fbc91eb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3638989 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi c3def6fa 2022-05-10T14:28:04 Vulkan: Dynamic state for stencil compare mask Bug: angleproject:5906 Change-Id: Ie581c6e9fe15c90c7a6d0c7c246dd5b1b30b6507 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3638988 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi dcaa18b9 2022-05-10T12:27:15 Vulkan: Dynamic state for blend color Bug: angleproject:5906 Change-Id: If450e0d84410069126027142414586181fd5f0de Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3638986 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 536d6f57 2022-05-10T11:44:58 Vulkan: Dynamic state for depth bias Bug: angleproject:5906 Change-Id: I8fd7e3262fddf3aec855afdd3e4c1b9801040da1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3638983 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 780f1a41 2022-05-10T00:30:35 Vulkan: Dynamic state for line width Bug: angleproject:5906 Change-Id: Iacf9c14d9d255c8048c71c725173e4764bcfe166 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3634733 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi 464f30f4 2022-05-09T16:33:08 Vulkan: Refactor UtilsVk dynamic state handling Dynamic state dirty bit handling is centralized in UtilsVk to reduce the risk of errors as more dynamic state is taken into account. Bug: angleproject:5906 Change-Id: Ib33554ff36f9249129a8f1650047dd987fe81982 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3634731 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 31321cb7 2022-05-09T16:17:25 Vulkan: Remove suppressions and workarounds for old AMD/Windows The old AMD/Windows bots are decomissioned. This change removes suppressions and workarounds that were added for that bot. Bug: angleproject:2463 Bug: angleproject:2809 Bug: angleproject:2847 Bug: angleproject:3243 Bug: angleproject:4720 Bug: angleproject:6123 Bug: angleproject:6652 Bug: angleproject:7144 Bug: angleproject:7227 Bug: chromium:1224996 Change-Id: I333ed6d76dfa2916b713ccb49127deceb5b1b551 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3634728 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao d075dfe2 2022-05-03T16:25:26 Vulkan: Reduce kMaxBufferToImageCopySize to 64M Bug: b/230538246 Change-Id: Id2ef9c35f74fb6f526744903402562f9354bfcdb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3625834 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 51dc3c3e 2022-05-02T18:11:26 Vulkan: Force prune when there are lots of suballocations destroyed If there are a lot of suballocations destroyed, there is bigger chance that some buffers become empty and we might able to trim down excessive empty buffers. This CL tracks the suballocations destroyed at each cleanupGarbage call and use that information to force immediate pruneEmptyBuffers call. Bug: b/230538246 Change-Id: Icca2ea731639545c635c09d58a8606d67405e1a6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3620981 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 5113ae8e 2022-04-29T22:42:59 Vulkan: Explicitly enable per-sample shading if `sample` used The Vulkan spec is not explicit about the `Sample` decoration implicitly enabling per-sample shading. While this is being corrected in the spec, the ARM Vulkan driver does not have this implicit behavior. A workaround is added such that the usage of the `sample` qualifier is reported, and used to explicitly enable per-sample shading through the API. Bug: angleproject:6876 Change-Id: Idb8345aacdcfa45cb37fefcd30aa5405168d21e3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3615738 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Amirali Abdolrashidi 3e05b93a 2022-04-12T19:39:19 Vulkan: MSAA swapchain resolve based on renderArea * Updated the MSAA resolve subpass so it can only be performed if the render pass is covering the entire area (e.g., not scissored). * Added test to make sure that the subpass resolve does not occur when the render pass does not cover the entire area. Bug: angleproject:6762 Bug: angleproject:7196 Change-Id: Iac3ab4b655dfeb7bff1348cc5e289a77a4dc0b83 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3584942 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Charlie Lao 1ef90012 2022-04-26T16:25:58 Vulkan: Remove API access for mTotalBufferToImageCopySizen Don't expose mTotalBufferToImageCopySize via API if it is unnecessary, for better encapsulation. Bug: angleproject:6354 Change-Id: If69a5a78cc40d54feee6f3474aef6292d60b89c5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3609016 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Charlie Lao <cclao@google.com> 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>
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 4aae5815 2022-04-22T13:21:03 Vulkan: Overlay widgets for submission statistics Bug: angleproject:7084 Change-Id: I68e69bda43862f9f2711c25a28dbe4745c19a45c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3602832 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 02b96848 2022-04-21T16:32:31 Vulkan: Add support for GL_QCOM_shading_rate Layer GL_QCOM_shading_rate over VK_KHR_fragment_shading_rate Test: ShadingRateQcomTest* Bug: angleproject:7172 Change-Id: I3f040dbfad3906facd4349937fed2ce9a464b824 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3599874 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Alexey Knyazev 62ca6449 2022-04-13T09:36:40 Reland "Fix BlendStateExt::mMaxColorMask initialization" This is a reland of commit 50d008a7efcab80f34eb742148d05389b2ed247e Besides fixing the BlendStateExt color mask initialization bug, the following changes were made: * All fields were made private with accessor functions. * A new assertion was added that ensures 64-bit storage for factors and equations. This allowed dropping one redundant mask. * Two new helper functions were added. * BlendStateExt::mMaxDrawBuffers was renamed to mDrawBufferCount. * The BlendStateExt class is now aligned to 8 bytes with an assertion. * Expanded test coverage. Also fixed incorrect usage of BlendStateExt fields in: * StateManagerGL::syncBlendFromNativeContext * StateManagerGL::restoreBlendNativeContext Original change's description: > Fix BlendStateExt::mMaxColorMask initialization > > This variable should not have its unused bits set. > > To avoid confusion with other masks of the same class, > the variable was renamed to mAllColorMask. > > Bug: angleproject:7200 > Change-Id: I72542d49ff8da3dbb8d61c5034ce37c1e8fcc6e1 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3581990 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Bug: angleproject:7200 Change-Id: I87a5fe0f9dfbbf5e525b9120f772aa9adb39ce5f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3593234 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Jamie Madill 2d6e42fc 2022-04-22T14:04:21 Update Program Pipeline TODOs. Bug: angleproject:3570 Bug: angleproject:7232 Change-Id: I0923e6b232b80ee26cb4c5788232c25a545ff87a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3600916 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Auto-Submit: Jamie Madill <jmadill@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>
Amirali Abdolrashidi b07a1156 2022-04-13T10:48:10 Split Context ResourceUseList to RP Commandbuffers * Finished splitting resourceUseList from ContextVk into that from each command buffer, mostly in UtilsVk.cpp. * Removed mResourceUseList from ContextVk. Bug: angleproject:7103 Change-Id: I6344f8144a38b13d7e5f599b2e935f0f92b22f98 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3585882 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Amirali Abdolrashidi 37c53684 2022-04-05T15:03:14 Split Context ResourceUseList to RP Commandbuffers * Split the resource use lists retained in context between the render pass command buffer and the outside render pass command buffer, mostly in vk_helper.cpp and ContextVk.cpp. Bug: angleproject:7103 Change-Id: Ib696bdec2c545cd7df9ae4ab86c54a294041d908 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3573581 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> 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 ff8a9f6a 2022-04-14T15:15:16 Vulkan: Renaming "ShaderBuffers" to "ShaderResources". This will match the functionality as we expand the descriptor set cache to non-buffer resources. Bug: angleproject:6776 Change-Id: I5597d074beea7d3b464802a2db9bcc2fcf84ca6b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3583359 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@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>
Charlie Lao 5014ce66 2022-04-18T18:05:20 Vulkan: Add orphaned list for non-empty BufferBlocks. In the fix for chromium:1299211, we added a new pool in the RendererVk and pick which pool to use at the getDefaultBufferPool() call. This CL fixes the original problem differently. In this CL we still uses the ShareGroup's pool. When display global texture is enabled, we orphan the non-empty buffer blocks into renderer and check and destroyed from garbage collection code. This way we still only deal with one buffer pool and all logic is mostly in context destroy code path, which I believe is a better solution. Bug: b/223428306 Change-Id: Ib465a11f7e3656df09cc891416ff57f086a8184b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3573390 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao cfc92ebf 2022-04-18T18:16:24 Vulkan: Encapsulate ShareGroup::mContexts Instead of return mContexts, this add addContext/removeContext API and changed getContexts to const function. No functional change expected, but clean up only. Bug: b/223428306 Change-Id: I020c4bc781f58352089980c9d8ff22bcb183dbe6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3590970 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi 5f7db775 2022-04-11T11:35:32 Vulkan: updateUniforms when commandbuffer is valid In order to change the resource use list from contextVk into that from one of its command buffers, we have to ensure the render pass command buffer is valid before potentially using its resource use list. * Added the dirty bit `DIRTY_BIT_UNIFORMS`. * Moved updateUniforms() and related functions in setupDraw() to the dirty bit handler where we have ensured that the render pass command buffer is valid. * Moved updateUniforms() and related functions in setupDispatch() to the dirty bit handler. Bug: angleproject:7103 Change-Id: I5435d16df543aa5a4c4be2b82586cb557ab53738 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3582979 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
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>
Jamie Madill 4b381f41 2022-04-08T09:20:45 Vulkan: Fix descriptorSet perf counter values. Some counters were getting reset in multiple places, which could result in queries returning zero counts. Fix this by consolidating per-frame counter resets. Also updates how we compute cache hit/miss counters. This results in correct and consistent counts for cache accesses. Also includes a fix to not update the overlay when there are no enabled widgets. Also does away with some of the object- specific perf counters that were made to track descriptor set allocations. Bug: angleproject:6776 Change-Id: I769c715986defc50f0cfd0d997c338d34174e9f0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3573389 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Amirali Abdolrashidi 3cea7fcc 2022-03-16T16:33:43 Split Context ResourceUseList to RP Commandbuffers * Added mResourceUseList to each command buffer helper in an effort to move mResourceUseList away from ContextVk. * submitFrameImpl() renamed to submitCommands() * Moved the functions acquireResourceUseList() and onRenderPassFinished() in submitCommands() to the submitFrame functions calling it. Bug: angleproject:7103 Change-Id: I2487d5b86ea0a4d504f283aa7128501651317fe0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3531368 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
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>
Charlie Lao fe28a429 2022-03-30T15:34:49 Vulkan: Create buffer for vertex array if robust enabled If robust access is enabled (i.e., chrome), we want to ensure vulkan driver never access beyond that OpenGL buffer boundary. But with suballocation from BufferPool, we are using the same VkBuffer for all suballocations from the same BufferBlock. this combined with the fact that there is no size information in the vkCmdBindVertexBuffers, it means vulkan driver can not properly ensure vertex access not go beyond the subrange. It can only guarantee not access beyond the entire VkBuffer size. This CL creates a dedicated vkBuffer object and bind it to the suballocation of the vkDeviceMemory so that vulkan driver will see the exact range of the subrange instead of entire buffer. Since we may allocated more memory than actual requested size and the extra paddings are not zero filled , user size is used to create this vkBuffer. This is only enabled when robust access is enabled. This CL also ported webgl conformance test out-of-bounds-index-buffers.html and out-of-bounds-array-buffers.html to end2end test. Bug: chromium:1310038 Change-Id: I3499ae600028149b1039082e5011232b3e4e5e80 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3553940 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 041c4c6d 2022-03-25T16:30:03 Vulkan: Track color attachment usage like D/S in render pass That is in preparation for optimizing mid-render-pass clears, which requires an answer to the following query: "has this color image been read from / written to so far in the render pass?" With this change, a future CL will also be able to optimize color attachment invalidates, which currently break the render pass unconditionally, the same way depth/stencil is optimized. Bug: angleproject:5048 Change-Id: I3d3ee40d8444e6861c06340d5d52b17f5ee895b4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3542989 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Lingfeng Yang <lfy@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 3f331fae 2022-03-22T15:23:38 Vulkan: Dirty bits for depth/stencil access and feedback loop In preparation for doing the same for color, the depth/stencil render pass access and feedback loop modes are now updated with ContextVk dirty bits. This change also fixes clear after read-only depth/stencil feedback loop. The render pass wasn't broken in that case. Bug: angleproject:5048 Change-Id: I40f9b49593f9e6f35f42408e41c9d6267edb375e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3542988 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yuxin Hu cdd97fb8 2022-03-24T17:41:30 Reland "Vulkan: Fix invalid access with display texture share group." This is a reland of 1099b5ef2279cfe1988a39c8e011aada59c650f1. Original change's description: > Vulkan: Fix invalid access with display texture share group. > Create bufferpool that owns by RendererVk. > If we are using EGL_ANGLE_display_texture_share_group > extension, use the bufferpool owned RendererVk, > otherwise, use the bufferpool owned by EGL::ShareGroup. > The bufferpool lifetime will remain consistent with > texture lifetime. > Bug: chromium:1299211 > Change-Id: Ie4e87cea1dfd20dabab24e2afed6ddd92e469888 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3531155 > Reviewed-by: Charlie Lao <cclao@google.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Geoff Lang <geofflang@chromium.org> Bug: chromium:1299211 Change-Id: I4b8f5bcb30297f2c5f24e02404fd96011f9d843b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3550038 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shrek Shao 73ec28af 2022-03-23T21:13:45 Revert "Vulkan: Fix invalid access with display texture share group." This reverts commit 1099b5ef2279cfe1988a39c8e011aada59c650f1. Reason for revert: suspect culprit of 1309304 Original change's description: > Vulkan: Fix invalid access with display texture share group. > > Create bufferpool that owns by RendererVk. > If we are using EGL_ANGLE_display_texture_share_group > extension, use the bufferpool owned RendererVk, > otherwise, use the bufferpool owned by EGL::ShareGroup. > The bufferpool lifetime will remain consistent with > texture lifetime. > > Bug: chromium:1299211 > Change-Id: Ie4e87cea1dfd20dabab24e2afed6ddd92e469888 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3531155 > Reviewed-by: Charlie Lao <cclao@google.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Geoff Lang <geofflang@chromium.org> Bug: chromium:1299211, 1309304 Change-Id: Ibdc119ef6bb52352858114d72a0f1c0edcd4da5e No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3546288 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Shrek Shao <shrekshao@google.com> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Yuxin Hu 1099b5ef 2022-03-17T17:20:44 Vulkan: Fix invalid access with display texture share group. Create bufferpool that owns by RendererVk. If we are using EGL_ANGLE_display_texture_share_group extension, use the bufferpool owned RendererVk, otherwise, use the bufferpool owned by EGL::ShareGroup. The bufferpool lifetime will remain consistent with texture lifetime. Bug: chromium:1299211 Change-Id: Ie4e87cea1dfd20dabab24e2afed6ddd92e469888 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3531155 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Amirali Abdolrashidi 730c1271 2022-01-07T13:41:08 Vulkan: Submit queue more often for texture data Outside command buffers should be flushed more often in order to prevent the texture data accumulation just before the first render pass when they are referenced. * Added a tracker next to copyBufferToImage() for texture size (in ContextVk). When its value passes kMaxBufferToImageCopySize, the outside command buffer operations should be submitted and the tracker would be reset. Currently, the threshold value is set to 1 << 28 = 256M. * Added a variation of submitFrame() to be used in outside command buffer submission. The main difference is that it copies mResourceUseList into GetShareGroupVk() rather than move it. * Refactored the two functions into submitFrameImpl(). * Added a helper function to submit the outside command buffer. * Added explicit copy functions for ResourceUseList and SharedResourceUse. The counter in the copied object is incremented by 1. * Added a test to make sure submitting the outside command buffer does not break the render pass. Bug: angleproject:6354 Change-Id: Ia1d4f857fcbd06934609c94622ccbf675b3b1c72 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3379231 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Jamie Madill e8ee847d 2022-02-23T12:25:39 Vulkan: Add UpdateDescriptorSetsBuilder. This helper class encapsulates the vkUpdateDescriptorSets caching. As part of the refactor, we switch passing a ContextVk to passing a vk::Context with some mutable variables. This helps encapsulate ContextVk. Since we use the perf counters in many places, this CL moves the perf counters to vk::Context, so we can access them everywhere. Refactoring change only. Bug: angleproject:6776 Change-Id: Id529962b2f425bece6f9b3bd0cd1698c692e58cb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3484980 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 98bb4f32 2022-02-23T16:51:32 Vulkan: Implement advanced blend through extension This change exposes GL_KHR_blend_equation_advanced if VK_EXT_blend_operation_advanced is supported. No emulation is yet implemented. Bug: angleproject:3586 Change-Id: Ie7a442c22e028e3aa45ccef52db320e205664d49 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3487951 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 349636a0 2022-03-15T09:39:36 Vulkan: Update mCurrentElementArrayBuffersync based on dirty bit The previous fix crrev.com/c/3513553 has run into corner case that requires more follow up change crrev.com/c/3522565. But with that, there is report that now we are hitting assertion in handleDirtyGraphicsIndexBuffer(). This becomes a bit fragile This new fix relies on the DIRTY_BIT_INDEX_BUFFER dirty bit and should be more reliable as long as the dirty bit is set properly (if not, then we have other bug that it won't even send down vulkan command to bind the correct element buffer). We could further optimize the code path and create a fast path for most common usages in the future. Bug: chromium:1299261 Change-Id: Ifa8f86d431798c9ca4c128ed71a3e9e0a3537ccb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3526021 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao e9d9d933 2022-03-14T09:33:28 Vulkan: Fix another corner case of mCurrentElementArrayBuffer mCurrentElementArrayBuffer is vertex array state. But it gets modified with different draw call parameters. When this changes, we always re-calculate mCurrentElementArrayBuffer. And we have added updateCurrentElementArrayBuffer call at various places where we need to reset mCurrentElementArrayBuffer to back to what bound to vertex array. There is still one more places missing such call, that when a different vertex array is been bound, the new vertex array may still have mCurrentElementArrayBuffer set to the special array for LineLoop. We need to reset it upon it gets bound. This CL also adds a new test case DrawElementsTest.LineLoopTriangles from Steven Noonan. Bug: angleproject:6955 Change-Id: Ida95062b071d25be26e59f886bfe3d61e6886c5c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3522565 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao b97aab3f 2022-03-09T17:36:24 Vulkan: resync mCurrentElementArrayBuffer when out of lineloop When glDrawElements is called with GL_UNSIGNED_BYTE type or LineLoop mode, we will internally allocate an element buffer and copy data to it. But when we switch out of that mode, we must re-sync mCurrentElementArrayBuffer to what it should be based on VertexArray buffer binding. This CL fix the bug that we were previously not updating it and end up using the wrong element buffer. Also added three tests: DrawWithSameBufferButDifferentTypes: that uses GL_UNSIGNED_BYTE data and GL_UNSIGNED_SHORT data in the same buffer and switch between these two data types without incurring buffer change. DrawWithSameBufferButDifferentModes: draw line mode followed by triangle without the same element buffer. DrawArraysLineLoopFollowedByDrawElementsTriangle: draw line mode with glDrawArrays and then followed by DrawElements. Bug: chromium:1299261 Change-Id: I5c471117d300e9fac9127a9d8fa66d48ac312f03 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3513553 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Jamie Madill a956162c 2022-03-01T13:05:29 Vulkan: Expose performance counters via extension. This CL rewrites the Vulkan perf counters test to work in the angle_end2end_test suite using the newly exposed AMD extension. Note that we implement only a subset of the extension. Instead of generating monitors and starting/stopping them we simply read back all performance counter data at once using the special montior value "0". The CL also enables these tests on SwiftShader. Bug: angleproject:4918 Change-Id: I5d8f6eecb1ccff448657cbdb65b51a225dfb90c0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3497538 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Mohan Maiya f9ade9fb 2022-02-18T15:08:54 Vulkan: Add feature to create pipeline during glLinkProgram Creating the pipeline will trigger the compilation of shaders to byte code thus warming up Vulkan shader caches. Typically most apps call into glLinkPrograms during app loadtime and the goal is to improve cache hit rate and reduce CPU workload during game play. Bug: angleproject:7046 Test: ProgramBinary*CreatePipelineDuringLink* Change-Id: I71351d45a9aa84e220ca38503735e94cff1dcf98 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3478354 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
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>
Jamie Madill ef17f38a 2022-03-01T10:15:26 Vulkan: Add overlay widget for cache key size. Bug: angleproject:6776 Change-Id: I35ab18bc5919129b2decf58d541499f771140e47 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3472754 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Charlie Lao b72718d2 2022-02-22T16:18:45 Vulkan: Fix the data race for mUse from two threads A data race of mUse object between two threads can occur with the following sequences: 1) You use the buffer in the context, it adds into mResourceUseList 2) You release the buffer. Now it goes into mGarbageList, even though it is still in the mResourceUseList. Now this mUse object has references from two lists, the mGarbageList and mResourceUseList, and they do not use the same mutex lock. This means the race could happen and corrupt the mUse data. The same thing could happen with ImageHelper object as well. This quick fix also grabs mGrabageMutex while processing mResourceUseList. This CL creates a new garbage list to hold garbage that has not been submitted to vulkan. And this list will only accessed from submission thread and with mGarbageMutex lock held. The advantage of this is that mSharedGarbage will only have objects that already submitted, which means it is in FIFO order so that we can break out the loop as soon as we see an uncompleted garbage. This bug was exposed by MultithreadingTest.MultiContextClear/ES3_Vulkan_SwiftShader on linux-tsan-test Bug: angleproject:7045 Change-Id: I264c970579aaa53373a61ff067fa0e21eb410ae6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3482158 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Charlie Lao <cclao@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 d3ded9aa 2022-02-22T23:02:59 Vulkan: Make Overlay init lazy So it's not done when overlay is not in use. Bug: angleproject:7051 Change-Id: Iae2ba20cf8c0825dc5f321e5b31dd278cd892066 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3481310 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao f996d4d8 2022-02-16T09:27:04 Vulkan: Fix DynamicBuffer cache reuse. There is a regression bug that the DynamicBuffer's BufferHelper's size is no longer the size of entire buffer block's size, but the size of suballocation. This caused buffer reuse logic to screw up since it relies on the size to make the decision to keep or free the mFreeBufferList. This CL fixes this bug by using the buffer block's size. This CL also removes DynamicBufferPolicy since it is not used any more since most of DynamicBuffer usages that triggered that DynamicBufferPolicy implementation have been switched to BufferPool. The remaining DynamicBuffer usage is only for attributes and uniforms which are generally small and per context. Bug: angleproject:6980 Change-Id: I9e013cbd67dd74f5e7fc5bb7d9c9696bd1f69965 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3469714 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Jamie Madill 8ade4c2f 2022-02-16T13:14:54 Vulkan: Add overlay and stats for descriptor set caches. This adds more overlay widgets for different metrics of descriptor sets, including for uniforms and for all sets. Bug: angleproject:6776 Change-Id: If1a053bd711454227e7ccbdb01202a712a5f9787 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3469228 Reviewed-by: Charlie Lao <cclao@google.com> Auto-Submit: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 8d966f7d 2022-02-08T11:05:09 Vulkan: Simplify SubAllocation data types. We no longer need to bootstrap on the wrapper classes because we use a separate garbage list. This simplifies the code for the allocation tracking considerably. Also we remove a few mutable accessor to fortify our OOP design. (Credit to Jamie since it is splited from his CL) Bug: angleproject:6980 Change-Id: I2025ec4d141531273e824bb586957a38efc30be1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3469715 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Charlie Lao 38723c28 2022-02-15T16:29:36 Vulkan: Allocate space for default attrib only if it is enabled When context's default attributes is dirty, we allocate space for the default attribute, regardless it is enabled or not. Then we call into VertexArrayVk::updateDefaultAttrib() which only update its state if the attribute is enabled. This causes a use-after-free scenario that if it is disabled, the vertex array may have a pointer to the buffer that is now becomes inflight which may gets deleted when DynamicBuffer code think the size no longer matches etc. Bug: chromium:1296467 Change-Id: Ib9ec8e60ebdb326f9bbfb215b3711c37631fce4b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3466776 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>