src/libANGLE/renderer/vulkan/RendererVk.cpp


Log

Author Commit Date CI Message
Yuly Novikov 6188c0a6 2023-10-23T16:47:10 Unsuppress VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912 VUID removed in http://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/5941 Bug: chromium:1420265 Change-Id: I8e3b9462df5e250c97c6bff02635cd28fec2a4e4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4967241 Auto-Submit: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Roman Lavrov <romanl@google.com>
Charlie Lao d2de7451 2023-10-19T14:10:44 Vulkan: Fix VK_android_external_format_resolve VVL error part 5 Fix assertion in RendererVk::getFormatFeatureBits(). When formatID is external format, we can not use vkGetPhysicalDeviceFormatProperties to get the formatFeature (since VkFormat is undefined). To fix this, we keep the formatFetaure that returned from AHB in the ExternalYuvFormatInfo and use that in getFormatFeatureBits() if it is external format. This also fixes the VVL error VUID-VkImageCreateInfo-pNext-02396: The Vulkan spec states: If the pNext chain includes a VkExternalFormatANDROID structure whose externalFormat member is not 0, flags must not include VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT Bug: b/223456677 Change-Id: I625c2bf4fe534fa206918b16772ac3ac7c6fa79a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4956117 Reviewed-by: Chris Forbes <chrisforbes@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao fce367c9 2023-10-18T11:36:59 Vulkan: Fix VK_android_external_format_resolve VVL error part 2 VUID-VkFramebufferCreateInfo-flags-03201 The Vulkan spec states: If flags includes VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, the usage member of any element of the pAttachmentImageInfos member of a VkFramebufferAttachmentsCreateInfo structure included in the pNext chain that refers to an attachment used as a color attachment or resolve attachment by renderPass must include VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT. The bug here is that when we create VkImage for AHB for rendering, we specify mUsage as Sample. This CL adds COLOR_ATTACHMENT if it supports resolve. This CL also adds VkAndroidHardwareBufferFormatProperties2ANDROID format query for debug logging. VUID-VkImageViewCreateInfo-usage-08931 is temporary added to skip list due to ARM driver bug. The bufferFormatProperties returned does include VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT. Will remove once driver is fixed. Bug: b/223456677 Change-Id: Ibccf5f19975654fd94b00ae10e15ac986f7866dd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4952962 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Chris Forbes <chrisforbes@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Solti 05c5cef0 2023-10-17T21:16:52 Manual roll vulkan-deps from 68a0a794aa0a to 92b29883afea (1 revision) Manual roll requested by solti@google.com https://chromium.googlesource.com/vulkan-deps.git/+log/68a0a794aa0a..92b29883afea Changed dependencies: * vulkan-validation-layers: https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-ValidationLayers.git/+log/7ef2b9a6bb..deb215c083 If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/vulkan-deps-angle-autoroll Please CC angle-team@google.com,solti@google.com on the revert to ensure that a human is aware of the problem. To file a bug in ANGLE: https://bugs.chromium.org/p/angleproject/issues/entry To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md Bug: b/306178740 Tbr: solti@google.com Change-Id: I1060b8e021e28e70ca11305dc60a8fa8462e1eff Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4950550 Commit-Queue: Solti Ho <solti@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Yuxin Hu cfc40d2b 2023-07-19T17:47:13 Vulkan: Adjust clear color precision for GL_RGB5_A1 FBO When clear color has more precision than the framebuffer format can hold, dithering is automatically applied on some hardware. This issue causes below dEQP tests to fail when the FBO color attachment format is RGB5_A1: KHR-GLES31.core.draw_buffers_indexed.color_masks KHR-GLES32.core.draw_buffers_indexed.color_masks Adjust the clear color precision for RGB5_A1 format to workaround the issue. We can remove this workaround once the vulkan driver fixes the auto-dithering problem. Bug: b/292282210 Change-Id: Ic3ffebd2d20c8782612619a60d1ec2cc6d613c22 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4937472 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi cc61dded 2023-10-17T13:21:14 Vulkan: Remove fixed VU suppressions Bug: angleproject:2866 Bug: angleproject:4928 Bug: angleproject:5027 Bug: angleproject:7843 Bug: angleproject:8076 Bug: b/175584609 Change-Id: I1a3ccdc92be73874e7599961bae2a0e8c7497b1a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4947653 Commit-Queue: Charlie Lao <cclao@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Yiwei Zhang 0be59b3d 2023-10-17T17:31:05 Vulkan: disable warmUpPipelineCacheAtLink for Venus The same cache miss is seen on MESA ANV and MESA RADV drivers. Together with already disabled ARM drivers, we'd disable for Venus as a whole for monolithic pipelines. This won't affect later Venus GPL enablement on supported host drivers like ANV and RADV. Bug: b/299532942 Test: affected title is semi-playable Change-Id: Iaec0d43b15b64b6b74dfa68021f8a5f2fe6cca8d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4948694 Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com> Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Charlie Lao 58ffa778 2023-10-11T09:41:23 Vulkan: Implement YUV_TARGET use VK_ANDROID_external_format_resolve This implements EXT_YUV_TARGET using VK_ANDROID_external_format_resolve extension. This CL is based on Chris Forbes's CL on android gerrit. Bug: b/223456677 Change-Id: Ieb6970a0787b0c2a72a76b208695a678d2c79e80 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4857459 Reviewed-by: Chris Forbes <chrisforbes@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 57fcee54 2023-10-11T14:48:53 Vulkan: Add feature flag for externalFormatResolve This CL adds supportsExternalFormatResolve feature flag and enable the vulkan extension if existed. This CL is split from Chris Forbes's CL on android gerrit. Bug: b/223456677 Change-Id: I731f35dc629c12c7290c6ed24ff54967e2e4eab7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4932592 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Chris Forbes <chrisforbes@google.com>
Charlie Lao 90dd58a2 2023-10-04T11:54:22 Vulkan: Reduce mGarbageMutex lock contention Right now mGarbageMutex is used to control access to mSharedGarbage, mPendingSubmissionGarbage, mSuballocationGarbage, mPendingSubmissionSuballocationGarbage and mOrphanedBufferBlocks. Some times garbage clean up does take a bit longer time, especially on some VM platforms. This some times causes lock contention between main render thread and background garbage clean up thread, which defeats the benefit of having garbage clean up in the background thread. This CL utilizes angle::FixedQueue for garbage list so that enqueue and dequeue can be concurrent, which avoids this lock contention. Bug: b/302739073 Change-Id: I44b2b0e7f9f5ef438266fa277b24a2cb1606e689 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4899299 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Hailin Zhang <hailinzhang@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 2608c622 2023-10-06T13:32:49 Vulkan: Refactor SharedGarbageList into templated class This CL mostly involves non-functional changes to prepare for next CL. No behavior change is expected. This CL wraps the garbage list into its own templated class which maintains std::queue and tracks number bytes in the queue etc. This CL also renames SharedBufferSuballocationGarbageList to BufferSuballocationGarbageList to reduce verbosity a bit. This CL deleted GarbageAndQueueSerial and GarbageQueue since they are no longer being used. This renames vk::GarbageList to vk::GarbageObjects to reduce name confusion with SharedGarbageList. Bug: b/302739073 Change-Id: I7370c147847ffe69ad8aa3b48251d8b5762f97f9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4919816 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Hailin Zhang <hailinzhang@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi adb17c80 2023-10-06T10:39:17 Vulkan: Copy 3D<->2DArray images with vkCmdBlitImage anyway Despite the validation error, do the copy with vkCmdBlitImage anyway. Drivers seem to work correctly, and the validation restrictions seem unintentional. Bug: angleproject:7291 Change-Id: Ie7a0ecfe559be44738da3eada281ea97424b38ab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4916359 Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yiwei Zhang 3d75b794 2023-10-04T11:10:34 Vulkan: enable preferSubmitAtFBOBoundary for Virtio-GPU Venus Now we see perf gain for the concerning title Asphalt 9 with ANGLE-on-Venus even for low end devices. So enable this by default for Venus since it mitigates 3DMark Sling Shot Physics score regression. Bug: b/302230555 Test: top app affected by the feature and 3DMark Change-Id: I2e115e022eb085a3dc693378fe2f0a960890b7d5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4911958 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Roman Lavrov f8f98477 2023-10-04T12:54:06 Suppress VUID-VkRenderPassBeginInfo-renderPass-00904 Getting a lot of these, for example: dEQP-GLES31.functional.blend_equation_advanced.basic.multiply Bug: b/303441816 Change-Id: I78bf5c0e34bb65f349c71f324ea1c71ae8b416e3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4911799 Reviewed-by: Cody Northrop <cnorthrop@google.com> Auto-Submit: Roman Lavrov <romanl@google.com>
Roman Lavrov 276e0c78 2023-10-04T12:42:23 Also suppress VUID-VkGraphicsPipelineCreateInfo-pStages-00739 dEQP-GLES31.functional.primitive_bounding_box.points.* are hitting this one Bug: b/303219657 Change-Id: I26ae20ce6feeb84019488689667fa66fb7ca2925 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4911798 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Roman Lavrov <romanl@google.com>
Roman Lavrov 43abae13 2023-10-04T10:49:44 Suppress VUID-VkGraphicsPipelineCreateInfo-pStages-00738 Bug: b/303219657 Change-Id: Ibc23ccc700b15c351b2d7ab644bd8fc28bc07dcf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4911795 Auto-Submit: Roman Lavrov <romanl@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com>
Shahbaz Youssefi ffb32380 2023-10-02T16:01:37 Vulkan: Fix device creation on multi-queue devices When multiple eligible queue families are exposed by the device, ANGLE defers devices creation until a surface is made current, at which point it selects a queue family that supports presentation to that surface. This path was largely untested and was broken: - Some post-device-creation initialization was not deferred until the device was actually created - Some cap calculation depended on the chosen queue family index - Query of device capabilities was done too late, such that ANGLE could not correctly determine the level of support for ES versions. Bug: angleproject:8300 Change-Id: I2a35396d1fd08ed26d217dff07d10e9a9c1ac55f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4907895 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com>
Amirali Abdolrashidi 75409184 2023-10-03T18:57:42 Revert "Add VMA version to logcat" This reverts commit 92218933df79a4427b9bd29d0b7af892108e410e. Reason for revert: VMA 3.0 usage is confirmed. Log can be removed. Original change's description: > Add VMA version to logcat > > This is a temporary CL. It will be used to confirm that Android > uses VMA 3.0 with ANGLE as the default driver. > > * Added the VMA version log when the renderer is being initialized. > > Bug: b/295208838 > Change-Id: I054a4e0e080aa5d06533bd7785eea608e14bba39 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4868086 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> > Reviewed-by: Charlie Lao <cclao@google.com> Bug: b/295208838 Change-Id: If1b9883c02c78121ff72601b650ac04aef685527 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4909899 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Amirali Abdolrashidi 5ab344be 2023-09-28T17:26:29 Remove old VUIDs after renaming Some of the VUIDs were renamed in a recent VVL roll. The new VUIDs for those that were skipped were also added to the list in a prior fix CL. After the related VVL change and the fix also rolled into Chromium, the old VUIDs can be safely removed from the skip list. * Removed the following VUIDs from the skip list * VUID-VkBufferViewCreateInfo-buffer-00934 * VUID-VkPipelineInputAssemblyStateCreateInfo-topology-00428 Bug: angleproject:8358 Change-Id: I63474cb36408637be8a60def9add1f77c48e9c93 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4903984 Reviewed-by: Roman Lavrov <romanl@google.com> Auto-Submit: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Roman Lavrov <romanl@google.com>
angle-autoroll 621bee25 2023-09-27T22:07:24 Manual roll vulkan-deps from b8fa58ef74a9 to 89aea904c65f (61 revisions) Manual roll requested by abdolrashidi@google.com * Updated the skipped VVL messages in accordance with the following vulkan-deps roll: Vulkan-ValidationLayers to 9fe2f727 https://chromium.googlesource.com/vulkan-deps.git/+log/b8fa58ef74a9..89aea904c65f Changed dependencies: * glslang: https://chromium.googlesource.com/external/github.com/KhronosGroup/glslang.git/+log/4c57db1595..2bfacdac91 * spirv-cross: https://chromium.googlesource.com/external/github.com/KhronosGroup/SPIRV-Cross.git/+log/5e963d62fa..6e1fb9b09e * spirv-headers: https://chromium.googlesource.com/external/github.com/KhronosGroup/SPIRV-Headers.git/+log/fc7d246276..79743b899f * spirv-tools: https://chromium.googlesource.com/external/github.com/KhronosGroup/SPIRV-Tools.git/+log/a40483d313..48c97c1311 * vulkan-headers: https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-Headers.git/+log/4f51aac14f..df60f03168 * vulkan-loader: https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-Loader.git/+log/9dc0e31574..f352069ad3 * vulkan-tools: https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-Tools.git/+log/1ecbed6db3..576f3286e1 * vulkan-utility-libraries: https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-Utility-Libraries.git/+log/6774c9b24b..8486ee700e * vulkan-validation-layers: https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-ValidationLayers.git/+log/c26ff51102..1b8b09b3ab If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/vulkan-deps-angle-autoroll Please CC abdolrashidi@google.com,angle-team@google.com on the revert to ensure that a human is aware of the problem. To file a bug in ANGLE: https://bugs.chromium.org/p/angleproject/issues/entry To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md Bug: angleproject:8358 Tbr: abdolrashidi@google.com Change-Id: I7927abe872fbb1d25523b06cc205b13ef2a887f3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4898000 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang 7cacb537 2023-09-26T11:27:49 Limit the uncompressed data size when decompressing blobs. If the data in the blob cache is invalid for any reason, ANGLE will take the last 32 bits of it an interpret it as a size for decompressing the blob. Add some reasonal upper bounds on the decompressed data size so that if the data is invalid it will simply fail decompression instead of allocating giant buffers. Bug: chromium:1485277 Change-Id: Ifb807f5ea836b692f37734b20789f5daefcca5c9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4887599 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 97a48912 2023-09-26T10:31:58 Turn is-link-thread-safe feature into a positive condition Chrome's --disable-gpu-driver-bug-workarounds currently sets every feature to false, which breaks the GL backend. Bug: angleproject:8297 Change-Id: I284d0699e356d7c1a362eb992cdc0d052f9ea7c2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4887598 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yuxin Hu 9fc3baf5 2023-07-26T10:29:13 Add the missing GraphicsPipelineDesc legacy dither bit update When the app calls glEnable(GL_DITHER) or glDisable(GL_DITHER), we need to update the legacy dither bit of the renderpass that belongs to ContextVk::mGraphicsPipelineDesc. If not, there is a change that the graphics pipeline will be created with a renderpass that has outdated legacy dither bit. This results the dither being applied to the render results incorrectly: e.g. the app calls glDisable(GL_DITHER), but the render results have dithering applied. Bug: b/286921997 Bug: b/292282210 Bug: b/293349058 Bug: b/284462263 Change-Id: Ie24b95898526c9021be6e3cb7620e4050f9faaaf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4722446 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Cody Northrop c8e16b07 2023-09-18T12:00:57 Vulkan: Ignore VVL errors from GOOGLE extension We're seeing VUID-VkSamplerCreateInfo-pNext-pNext fire when rolling vulkan-deps. It is complaining about an unknown VkStructureType (1000264000) The type is implemented by VK_GOOGLE_sampler_filtering_precision, which is a private extension. We can ignore this VVL error. Bug: angleproject:8349 Change-Id: Ie424458873192b668371d8215dadf9788479f8dd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4874597 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi a1f52f1b 2023-09-07T14:44:24 Vulkan: Flush pending image garbage more often * Added a counter to the context object to keep track of the size of the pending image garbage: mEstimatedPendingImageGarbageSize. * Modified hasExcessPendingGarbage() to use the sum of the size of the image and and suballocation garbage. * RendererVk::calculatePendingGarbageSizeLimit() provides the limit. * Currently the limit is based on the available heap sizes. It will use a fraction of the largest memory heap size. * The portion is currently kGarbageSizeLimitCoefficient = 0.2f. * Unskipped the test "TextureDataInLoopManyTimes", which was failing on Android devices. Bug: b/280304441 Change-Id: Ibcced1d118ea8a1f347028b62d29cfbd9e38e8c0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4851252 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Amirali Abdolrashidi 27896999 2023-08-16T16:44:22 Vulkan: Flush pending suballoc garbage more often * Added a counter to the renderer object to keep track of the pending suballocation garbage. * mPendingSuballocationGarbageSizeInBytes * Once it surpasses a limit (mPendingSuballocationGarbageSizeLimit), it will flush the context so the pending garbages can be freed. * Currently the limit is based on the available heap sizes. It will use a fraction of the largest memory heap size. * The portion is currently kGarbageSizeLimitCoefficient = 0.2f. * At the end of the render pass, it is checked if the limit has been reached. If so, context flush will occur. Bug: b/280304441 Change-Id: I08e6028cfe20059ece2b2e4e971ece897544cd6d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4787950 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Shahbaz Youssefi d62db89e 2023-09-18T13:30:54 Vulkan: Disable VK_EXT_host_image_copy on Fuchsia An old version of VVL is used, causing incorrect failures. Bug: angleproject:8341 Change-Id: I0fc605616671343a49fed6ff02ecd67eea672dca Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4873440 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi b2e6a196 2023-09-11T15:27:20 Vulkan: Use VK_EXT_host_image_copy for texture uploads Of all the scenarios where host image copy may be useful, this is likely the most common case. There are numerous conditions for when the copy may be done on the host: - The image format must support it, - It must be unused by the GPU, - It must not have any pending updates (this can potentially be mitigated if needed), and - It must be in a host-copyable layout. However, many texture uploads are done: - To compressed formats, where support is highly likely, - On init, where: - the image is never previously used, - the image has no previous uploads - the image is in the UNDEFINED layout which satisfies the conditions above. As a result of this change, when the upload is done on the host, creation of a temp buffer is avoided which greatly reduces memory pressure (specially during app loading which is when most texture data is uploaded) and may even improve performance (due to avoiding a double copy). Testing the first 3 frames of the following traces with a SwiftShader implementation shows the amount of buffer allocated for staged uploads changed as such: - Black Desert: 185MB -> 65MB - Genshin Impact: 125MB -> 12MB - Asphalt 9: 138MB -> 0MB Bug: angleproject:8341 Change-Id: Id71dcc4a7a0f8b67960d2d283fe9d19ce7429a03 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4856676 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi 92218933 2023-09-15T10:33:49 Add VMA version to logcat This is a temporary CL. It will be used to confirm that Android uses VMA 3.0 with ANGLE as the default driver. * Added the VMA version log when the renderer is being initialized. Bug: b/295208838 Change-Id: I054a4e0e080aa5d06533bd7785eea608e14bba39 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4868086 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Yuxin Hu ffd6ec26 2023-09-07T15:39:19 Reland "Make egl surface uncurrent when being destroyed" This relands commit 497440cdcb7d2ee59bca612dd07fc13cf09a6a57. This is to workaround errors when app does below behaviors: 1) while there is a context still bound to the current rendering thread and the surface, call eglDestroySurface() 2) create a new surface eglCreateWindowSurface() 3) call eglMakeCurrent() with the surface created in step 2) 4) does work on the new surface The old surface won't be destroyed in step 1) because it was still bound by the context of the current rendering thread. When creating new surface on step 2), some hardware will return error code EGL_BAD_ALLOC, because the old egl surface is still associated with the native window. To workaround, when destroying surface, if the surface is still bound by the context of the current rendering thread, release the context and surface by passing EGL_NO_CONTEXT and EGL_NO_SURFACE to eglMakeCurrent(). The workaround is controlled by a frontend feature uncurrentEglSurfaceUponSurfaceDestroy. This feature is only enabled on vulkan backends. Bug: b/292285899 Change-Id: Id4c47f1b20e0f90d1013a68893fd70e917c030e2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4867066 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi b4852ef9 2023-02-08T14:18:06 Vulkan: Drop support for Vulkan 1.0 Bug: angleproject:7959 Change-Id: Ib673679ea1a503af22b37092dbff1ee1fd34fba6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4233092 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com>
Yuxin Hu 8a7ad933 2023-09-13T15:11:46 Revert "Make egl surface uncurrent when being destroyed" This reverts commit 497440cdcb7d2ee59bca612dd07fc13cf09a6a57. Reason for revert: this caused chromium webview tests failures: https://chromium-review.googlesource.com/c/chromium/src/+/4860891. Original change's description: > Make egl surface uncurrent when being destroyed > > This is to workaround errors when app does below behaviors: > > 1) while there is a context still bound to the current > rendering thread and the surface, call eglDestroySurface() > 2) create a new surface eglCreateWindowSurface() > 3) call eglMakeCurrent() with the surface created in step 2) > 4) does work on the new surface > > The old surface won't be destroyed in step 1) because > it was still bound by the context of the current rendering > thread. When creating new surface on step 2), some hardware > will return error code EGL_BAD_ALLOC, because the old egl > surface is still associated with the native window. > > To workaround, when destroying surface, if the surface > is still bound by the context of the current rendering > thread, release the context and surface by passing > EGL_NO_CONTEXT and EGL_NO_SURFACE to eglMakeCurrent(). > > The workaround is controlled by a frontend feature > uncurrentEglSurfaceUponSurfaceDestroy. This feature > is only enabled on vulkan and gl backends. > > Bug: b/292285899 > Change-Id: I872d2e116ba6860f58d1176f011a5ef7c5a5af4e > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4851255 > Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> > Reviewed-by: Charlie Lao <cclao@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Yuxin Hu <yuxinhu@google.com> Bug: b/292285899 Change-Id: I760054d856294e6691e79e165fd73ce9e560621f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4862958 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Yuxin Hu 497440cd 2023-09-07T15:39:19 Make egl surface uncurrent when being destroyed This is to workaround errors when app does below behaviors: 1) while there is a context still bound to the current rendering thread and the surface, call eglDestroySurface() 2) create a new surface eglCreateWindowSurface() 3) call eglMakeCurrent() with the surface created in step 2) 4) does work on the new surface The old surface won't be destroyed in step 1) because it was still bound by the context of the current rendering thread. When creating new surface on step 2), some hardware will return error code EGL_BAD_ALLOC, because the old egl surface is still associated with the native window. To workaround, when destroying surface, if the surface is still bound by the context of the current rendering thread, release the context and surface by passing EGL_NO_CONTEXT and EGL_NO_SURFACE to eglMakeCurrent(). The workaround is controlled by a frontend feature uncurrentEglSurfaceUponSurfaceDestroy. This feature is only enabled on vulkan and gl backends. Bug: b/292285899 Change-Id: I872d2e116ba6860f58d1176f011a5ef7c5a5af4e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4851255 Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Amirali Abdolrashidi e7418836 2023-08-16T14:25:52 Vulkan: Add context flushing as OOM fallback * As a new fallback for out-of-memory errors, if an allocation results in device OOM, the context is flushed and the allocation is retried. * Functions related to buffer/image allocations now return a VkResult value instead of angle::Result, which will be bubbled up to a higher level for safer handling. * The OOM is no longer handled at the level where the allocation happens, but is moved up to the context. * Added two functions to ContextVk for allocating memory for images and buffer suballocations, which also include the fallback options. * initBufferAllocation(): Uses BufferHelper::initSuballocation() * initImageAllocation(): Uses ImageHelper::initMemory() * Moved initNonZeroMemory() out of the following functions: * BufferHelper::initSuballocation() * Moved to ContextVk::initBufferAllocation(). * ImageHelper::initMemory() * Moved to ContextVk::initImageAllocation(). * Also moved to new function: ImageHelper::initMemoryAndNonZeroFillIfNeeded(). This function replaced the rest of initMemory() usages outside initImageAllocation(). * New macros for memory allocation * VK_RESULT_TRY() * If the output of the command inside it is not VK_SUCCESS, it will return with the error result from the command. * VK_RESULT_CHECK() * If the output of the command inside it is not VK_SUCCESS, it will return with the input error. * Added a test in which allocation would fail due to too much pending garbage without the fix on some platforms. The test ends once there has been a submission. * New suite: UniformBufferMemoryTest * Added a similar test for flushing texture-related pending garbage. * New suite: Texture2DMemoryTestES3 Bug: b/280304441 Change-Id: I60248ce39eae80b5a8ffe4723d8a1c5641087f23 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4787949 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi b185c3ea 2023-09-11T12:28:43 Vulkan: Add host-image-copy usage to images when optimal The change currently doesn't actually copy on host, but prepares the image for it. Bug: angleproject:8341 Change-Id: I4458712dca46ef9872020e158a3f902e94f5eb93 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4856146 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi e234c182 2023-09-08T16:19:29 Add features for VK_EXT_host_image_copy Bug: angleproject:8341 Change-Id: Id076e6c9e040f3c19a1eb221f6099ac11d4d091a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4852280 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yuly Novikov e691a4ed 2023-09-04T15:35:39 Delete obsolete VUID VUID-VkGraphicsPipelineCreateInfo-topology-08890 was renamed to VUID-VkGraphicsPipelineCreateInfo-topology-08773 Bug: angleproject:8237 Change-Id: Icb3f3f28664d0beac31f2541d90d5dbbada9a3b6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4840195 Auto-Submit: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
angle-autoroll 1192e5e8 2023-08-31T15:03:53 Manual roll vulkan-deps from a446c6320b6b to 988fe1c529b0 (28 revisions) Suppress new VUIDs: VUID-VkGraphicsPipelineCreateInfo-topology-08773 VUID-VkDescriptorImageInfo-imageView-07796 Manual roll requested by ynovikov@google.com https://chromium.googlesource.com/vulkan-deps.git/+log/a446c6320b6b..988fe1c529b0 Changed dependencies: * spirv-tools: https://chromium.googlesource.com/external/github.com/KhronosGroup/SPIRV-Tools.git/+log/b6893ccdfb..9b923f7cc3 * vulkan-tools: https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-Tools.git/+log/6087a58444..389110e460 * vulkan-validation-layers: https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-ValidationLayers.git/+log/b2f5094203..70be16c58d If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/vulkan-deps-angle-autoroll Please CC angle-team@google.com,ynovikov@google.com on the revert to ensure that a human is aware of the problem. To file a bug in ANGLE: https://bugs.chromium.org/p/angleproject/issues/entry To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md Bug: angleproject:8318, angleproject:8237, angleproject:8334 Change-Id: I4b868b67b0c8158179fee61018933104c4ed55d3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4832731 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Shahbaz Youssefi 571b4cdb 2023-08-14T16:55:28 Vulkan: Move pipeline/desc-set layout creation to link job The pipeline and desc-set layout caches are consequently made thread-safe. The reference counter on the layouts are also made atomic. With this change, practically all of the link in the Vulkan backend is moved to the link job. Bug: angleproject:8297 Change-Id: Iba694ece5fc5510d34cce2c34441ae08ca5bb646 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4774787 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi cb1c5ca4 2023-08-22T10:13:17 Manual roll vulkan-deps from aa121378c102 to 2cb515574109 (9 revisions) Includes an adjustment to syncval message format. https://chromium.googlesource.com/vulkan-deps.git/+log/aa121378c102..2cb515574109 Changed dependencies: * glslang: https://chromium.googlesource.com/external/github.com/KhronosGroup/glslang.git/+log/c5117b328a..db8719ae07 * spirv-tools: https://chromium.googlesource.com/external/github.com/KhronosGroup/SPIRV-Tools.git/+log/bfc94f63a7..714966003d * vulkan-tools: https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-Tools.git/+log/300d9bf6b3..b441f434a0 * vulkan-validation-layers: https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-ValidationLayers.git/+log/d1ff40512a..ebab3bc86c If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/vulkan-deps-angle-autoroll Please CC angle-team@google.com,syoussefi@google.com on the revert to ensure that a human is aware of the problem. To file a bug in ANGLE: https://bugs.chromium.org/p/angleproject/issues/entry To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md Bug: None Change-Id: I94f05554452f1c8b97a1426fb4b61ac1a1fa4b1a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4802525 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com>
Amirali Abdolrashidi f11c972b 2023-08-04T15:06:39 Update requiredFlags use for VMA image allocations For the OOM fallbacks, we currently remove bits from the required bits when device memory allocation is no longer possible. In doing so, allocating on the device has become a strong preference rather than a requirement. Therefore, we change this method a bit in this CL. * Removed the device-local bit from the required flags when calling allocateAndBindMemory(). * preferredFlags is now used in lieu of requiredFlags initially within allocateAndBindMemory() to signal to the VMA to prioritize allocating on the device. If it fails, we use requiredFlags for the fallback. Bug: b/280304441 Change-Id: Id47a224cd74dacd3fb12d4fbfd815d8cefc016c4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4753758 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Steven Noonan ffe81dd3 2023-08-03T14:53:32 Vulkan: allow opt-in to MSRTT emulation via overrides The existing enableMultisampledRenderToTexture feature combines conditions for device feature support and the policy decision of whether to allow MSRTT emulation. This change splits it into two features, allowing application developers to control the policy condition for the emulation path without impacting the device capability checks. Bug: angleproject:8291 Change-Id: Ic1525c878906b10df777c582e44b931028aae928 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4749525 Auto-Submit: Steven Noonan <steven@uplinklabs.net> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Steven Noonan 833f7f69 2023-08-09T10:49:51 Vulkan: improve XFB feature dependency checks Some features need to account for the possible override of supportsTransformFeedbackExtension == false. Since we now frontload the overrides, we also can remove the explicit overrides for the dependent features in TransformFeedbackTest. Bug: angleproject:8291 Change-Id: I0ec54dc0fce440ef3e7bfe9987d0ea19fb9dafaa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4763096 Auto-Submit: Steven Noonan <steven@uplinklabs.net> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Steven Noonan f395f34b 2023-08-03T13:58:43 features: frontload feature overrides This allows us to have features that depend on the state of other features more reliably. For example, let's say you have two features: ANGLE_FEATURE_CONDITION(&mFeatures, allowX, (benefitsFromX || isSpecificHardware) && !isBadHardware); ANGLE_FEATURE_CONDITION(&mFeatures, supportsX, hardware.featureXSupported && mFeatures.allowX.enabled); Before this change, if you overrode allowX, the override would be applied too late for the supportsX test. This also helps with disabling dependent features via overrides. For example, if you disable "supportsRenderpass2", it will also disable features depending on it, such as "supportsDepthStencilResolve" and "supportsFragmentShadingRate". By frontloading the feature overrides, we can have cross-dependencies between "feature supported on this platform" and "allow this feature by policy". Bug: angleproject:8291 Change-Id: Id6da2c89428fa896d677fe8d5a41369277a21b31 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4749524 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Steven Noonan <steven@uplinklabs.net> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Steven Noonan fa3ecccb 2023-08-09T10:48:36 Vulkan: make fragment shading rate depend on renderpass2 The extension depends on renderpass2 and will raise a VVL failure if it's not available and enabled. Note that this doesn't yet work as intended if you only override supportsRenderpass2=false. A subsequent commit will fix this. Bug: angleproject:8291 Change-Id: I6843b342909fb9000ebdcea80e006670c865f858 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4763095 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Steven Noonan <steven@uplinklabs.net> Commit-Queue: Steven Noonan <steven@uplinklabs.net> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi 4963febf 2023-08-02T16:52:52 Vulkan: Remove type indices with host-visible bit Currently, the memory type index for VMA image allocations are selected and returned by the API. However, it could potentially choose a type index with more flags than required or preferred, and ignore the index with exactly the flags we want. For example, it could pick a type index with the host-visible property flag, even if is unnecessary and a type index with a device-local flag would suffice. Using memoryTypeBits during the allocation allows us to filter the unwanted type indices out and use the other indices initially. * Added a new function to RendererVk.cpp to try to remove the memory type indices with the host-visible bit for VMA image allocations if they should be device-local. * GetMemoryTypeBitsExcludingHostVisible() * It also removes the indices with the protected bit if it is not required. * If the allocation is unsuccessful, the fallback resets the field for memoryTypeBits, allowing all available type indices to be used for the allocation. * Added memory type index to the pending allocation log during OOM. Bug: b/294085818 Change-Id: Icc1b218df075170a6baa7ec57c837ed59cd4fa96 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4743604 Reviewed-by: Kaiyi Li <kaiyili@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Cody Northrop 0abd6f54 2023-07-27T10:48:38 Vulkan: Enable dynamic state on working Android drivers Fixes are flowing out in different channels and versions, so add a bit of Pixel specific logic. Test: angle_trace_tests, deqp Bug: b/287318431, b/285196249, b/286224923, b/285124778 Change-Id: Ifc73e2a42d1d060a83a2fb83bcf8bb999f0990b5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4726502 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Roman Lavrov 35605ca7 2023-07-28T14:01:32 VVL VUID-VkDescriptorImageInfo-imageView update https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-ValidationLayers.git/+/b6c0e88b9fab7e9a93f8c5391ebb26de38d9b9bc the case that we hit as VUID-VkDescriptorImageInfo-imageView-06711 is now VUID-VkDescriptorImageInfo-descriptorType-06713 Bug: angleproject:7865 Change-Id: Ib2981b49890491719df5b474aad2a7b4e597793a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4727624 Commit-Queue: Solti Ho <solti@google.com> Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Solti Ho <solti@google.com> Auto-Submit: Roman Lavrov <romanl@google.com>
Roman Lavrov c319f34c 2023-07-28T12:30:18 Add VUID-vkCmdDraw-None VUID-vkCmdDrawIndexed-None VUIDs 08753 is now renamed to 09003 https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/6215 as it's being split into multiple cases Bug: angleproject:8242 Change-Id: I64aa75736fdb6ca9664da39f642e64f9f674b696 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4727623 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com> Auto-Submit: Roman Lavrov <romanl@google.com>
Yuxin Hu a0977311 2023-07-25T12:18:30 Disable the usage of VK_EXT_legacy_dithering Disable the usage of extension VK_EXT_legacy_dithering on ARM until the bugs in this extension is addressed. Bug: b/293136916 Bug: b/292282210 Change-Id: I1a548a2f6c44a78f8c66f706588a9985326217cf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4718306 Reviewed-by: Solti Ho <solti@google.com> Commit-Queue: Solti Ho <solti@google.com> Reviewed-by: Kaiyi Li <kaiyili@google.com>
Hailin zhang 4cae3b09 2023-06-02T23:52:15 Vulkan: disable pipline cache serialization In old NV drivers, Vulkan pipeline cache will only generate one single huge cache for one process shared by all graphics piplines in the same process, which can be huge. This is temp solution for nvidia driver cache issue. after driver version 520. nvidia fix the cache issue. this might affect second running performance. Bug: b/258207403 Change-Id: I3ea3e9196ad18fb1cec16c931eb744300d6cfdb9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4713207 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Phan Quang Minh 5eb30562 2023-07-17T07:23:03 Reland "Vulkan: Remove platform restriction of EGL_ANDROID_native_fence_sync" Instead of enabling it on all non-Mac platforms, this time enable it only on Linux-kernel based platforms (Linux, ChromeOS, Android). This should avoid interfering with Fuchsia. Original change description: > Remove platform restriction of EGL_ANDROID_native_fence_sync > extension except for Mac OS. > > Bug: angleproject:7834 > Change-Id: I116f44d8baca9cdcdd90013ca173b04461d06ae1 > Signed-off-by: Sungyong Choi <sywow.choi@samsung.com> > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4027707 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: mohan maiya <m.maiya@samsung.com> > Commit-Queue: mohan maiya <m.maiya@samsung.com> Bug: angleproject:7834 Change-Id: Ida89100e8c30c3a2df5a0a8d6d0c9b7e7ce3e412 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4687427 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Roman Lavrov c0f2f71e 2023-06-27T16:00:09 Use VK_EXT_legacy_dithering when available instead of emulation Yields improvement in gpu power: http://b/284462263#comment45 Bug: b/284462263 Change-Id: I5bfd115557b6baac17c05639118feaebf19c5cd4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4652590 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com>
Yuly Novikov 35c077b1 2023-07-14T13:22:24 Remove obsolete VUID suppressions 02859 was renamed to 08608 and 06538 was renamed to 08753 in https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/6008/commits/0cc78b9c282aa3e97316e739b88641a5d45f9463 Bug: angleproject:8242, angleproject:8119, angleproject:7105 Change-Id: Icde11d7c5b598bfb617d899daa795d3e19c8a178 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4687419 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Yiwei Zhang 79ebd10a 2023-07-13T23:23:27 Vulkan: disable explicitlyCastMediumpFloatTo16Bit for Venus Workaround for platforms shipping Venus until vk-gl-cts issue 4554 gets resolved. Bug: b/290425152 Test: CtsSkQPTestCases org.skia.skqp.SkQPRunner#gles_gradient_many_stops Change-Id: Ia05d905a9b56264164ed3325e4966dd2976b1fe9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4684548 Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org> Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Phan Quang Minh 4cab5e94 2023-07-12T10:04:10 Vulkan: Enable timeline semaphores if supported by device This is needed for a similar change in Chromium to function with `--enable-features=VulkanFromANGLE`. Bug: angleproject:8253 Change-Id: I422964ea010c650439dd4797ee8ba7b533f26a87 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4675807 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 3cc3327c 2023-07-07T10:29:45 Vulkan: limit preferCPUForBufferSubData flag to mali job manager This feature flag was introduced with testing on pixel 6 pro with aliexpress trace. The GPU has a job manager does the scheduling and transfer workload was put in the same job queue as geometry work which causing unnecessary bubble in the pipeline. This problem does not exist on newer GPU architecture where it has a command stream front end that transfer has its own dedicated queue. As test result on pixel 7 devices indicates, this feature flag shows no difference on pixel 7with aliexpress trace, and has negative perf impact with gangstar_vegas trace. This CL limits the feature flag to ARM's job manager based GPU. This improves gangstar_vegas frame time from 8.4576ms to 4.6370ms on pixel 7 pro. Bug: b/289436017 Change-Id: I604fb1e26d0a99bcf8f4c2574ced360c31ac712d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4671326 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
angle-autoroll cb5cd76d 2023-07-03T15:54:58 Manual roll vulkan-deps from 2b2cba62bfea to e21365bc9170 (38 revisions) Manual roll requested by ynovikov@google.com Suppress new VUIDs: "VUID-vkCmdDrawIndexed-None-08608", "VUID-vkCmdDraw-None-08753", "VUID-vkCmdDrawIndexed-None-08753", https://chromium.googlesource.com/vulkan-deps.git/+log/2b2cba62bfea..e21365bc9170 Changed dependencies: * glslang: https://chromium.googlesource.com/external/github.com/KhronosGroup/glslang.git/+log/9575e33186..3ebb72cc74 * spirv-cross: https://chromium.googlesource.com/external/github.com/KhronosGroup/SPIRV-Cross.git/+log/2d3a152081..b8e742c91b * spirv-tools: https://chromium.googlesource.com/external/github.com/KhronosGroup/SPIRV-Tools.git/+log/310a67020a..58459c2b1a * vulkan-headers: https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-Headers.git/+log/b6a29e5ca8..ad5f8ee975 * vulkan-loader: https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-Loader.git/+log/a1d9d485ce..dce85674e2 * vulkan-tools: https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-Tools.git/+log/247c806c93..2e5260d44c * vulkan-validation-layers: https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-ValidationLayers.git/+log/926ffb1f41..4400858043 If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/vulkan-deps-angle-autoroll Please CC angle-team@google.com,ianelliott@google.com,ynovikov@google.com on the revert to ensure that a human is aware of the problem. To file a bug in ANGLE: https://bugs.chromium.org/p/angleproject/issues/entry To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md Bug: angleproject:8242 Change-Id: I475146b418565e633043f6b57cb07baedcff02ba Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4662877 Commit-Queue: Ian Elliott <ianelliott@google.com> Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
Ian Elliott db3537aa 2023-07-03T15:56:42 Vulkan: Suppress VVL "VUID-vkCmdDraw-None-08608" Bug: angleproject:8242 Change-Id: Ia446cfc370ad6ade4967644416dee9e18aaaa0d3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4664612 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Cody Northrop 77c4b677 2023-06-28T08:23:23 Vulkan: Suppress PointSize VVL error Bug: angleproject:8237 Bug: angleproject:2796 Bug: b/288961771 Change-Id: I7e4b364225c61fd72091e9d84d45eb71a02a5597 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4653398 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Cody Northrop <cnorthrop@google.com>
Steven Noonan f150cf10 2023-06-23T02:56:09 Vulkan: minor pipeline cache chunk key hash bugfix The hash key was not correctly streaming the chunk index into the key string -- "chunkIndex" here is a uint8_t, which the ostream incorrectly identified as a character rather than byte. So the "std::hex" modifier didn't have any effect and chunkIndex 0 had a truncated key. Bug: angleproject:8231 Change-Id: Icb4977b658214979e08f66fcb98217259d4799ee Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4639493 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Steven Noonan 113f847b 2023-06-26T12:07:52 centralize basic OS/platform detection functions We had multiple different places that defined these, and with varying naming schemes. Centralize them to be defined in platform_helpers.h. Also renaming the IsApple(uint32_t) functions to IsAppleGPU(uint32_t) to avoid ambiguous meaning: "IsApple" should mean "is Apple-vended OS" while "IsAppleGPU" should mean "is Apple GPU vendor ID". Bug: angleproject:8229 Change-Id: If4e3fc5ac1b5b8ad416663950a1b2ee912ccad99 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4647291 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Steven Noonan <steven@uplinklabs.net> Auto-Submit: Steven Noonan <steven@uplinklabs.net> Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Steven Noonan 42c3a9fe 2023-06-23T03:53:09 Vulkan: support creating context with MoltenVK on macOS The Vulkan loader somewhat recently introduced a requirement that clients must opt-in to using portability implementations of Vulkan (such as MoltenVK). Since there is no native Vulkan driver for macOS (and therefore no alternative), unconditionally enable the portability enumeration extension there. Bug: angleproject:8229 Change-Id: I24f0f24e25abd277855ed9ac4de370cfb47d3266 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4639495 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Steven Noonan <steven@uplinklabs.net> Reviewed-by: Charlie Lao <cclao@google.com> Auto-Submit: Steven Noonan <steven@uplinklabs.net>
Amirali Abdolrashidi 5f9548c3 2023-05-19T11:51:04 Vulkan: Free the garbage memory before realloc Currently image allocations fall back to system memory in case of a device OOM. However, in some cases, it is also possible to gain some memory by freeing garbage memory from the device. This allows us to keep the allocation on the device memory. * Updated the image allocation fallback, so we will try cleaning the garbage memory through the renderer before retrying the allocation. * finishOneCommandBatchAndCleanup() in RendererVk, which will call a similar function in its CommandQueue. It will be called until there are no more in-flight submissions. * The existing finishOneCommandBatchAndCleanup() in CommandQueue has been renamed to finishOneCommandBatchAndCleanupImpl(). * Updated the flags used for VMA image allocations. If any device memory is freed after garbage cleanup to make enough space for the new allocation, it will take precedence over the system memory. * Added unit tests in which a new image allocation could happen on the device after freeing the garbage memory. * They use a 2D texture and a 2D texture array for garbage. Bug: b/280304441 Change-Id: Ia5e605e180833b44af8c77550ab1b0b8ba21724e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4547941 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Steven Noonan 131acc31 2023-06-23T04:12:09 Vulkan: fix blob caching of initial pipeline cache When creating a new pipeline cache and the blob cache doesn't have a matching one we can load, we unintentionally skipped serializing it to the blob cache until the pipeline cache state changed later on. Bug: angleproject:8230 Change-Id: If86d1bd169a63da9f9a394284a754bccb7d52e20 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4639496 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Steven Noonan ac4f52c4 2023-06-22T01:47:33 Vulkan: release all resources on RendererVk destroy The most important part of this is unloading the libvulkan handle. We open the handle in ::initialize but we were previously only unloading it in ::~RendererVk[1]. Since a DisplayVk (and RendererVk) are not destructed in between context creations, this meant that the libvulkan library handle reference count only increased, never decreased. [1] Which, incidentally, never gets invoked, ever. We create Display instances and they live forever in a static structure and we only ::initialize/::terminate them. Bug: angleproject:8225 Change-Id: I03da9b19f0c4ae3b5efacd07880aadb7ee77ebf5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4636882 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Steven Noonan ac263582 2023-06-19T12:26:44 Vulkan: add workaround for VK_EXT_full_screen_exclusive on AMD On outdated (but recent) AMD drivers, the Windows-only Vulkan extension VK_EXT_full_screen_exclusive appeared to be implicitly enabled and set to VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT mode. Even though ANGLE did not enable or interact with this extension at all, the driver was incorrectly returning VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT error codes on various swapchain operations when the full screen window focus was lost (i.e. alt-tab out and back in). Naturally, ANGLE was not expecting these error codes and did not know how to handle them. Depending on where the errors occurred, ANGLE might crash or retry creating the swapchain repeatedly. Treating the unexpected VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT error code as VK_ERROR_OUT_OF_DATE_KHR/VK_SUBOPTIMAL_KHR was not sufficient, because the driver would repeat the error on every swapchain operation, apparently expecting the error to be handled by a vkAcquireFullScreenExclusiveModeEXT call (even though that would make no sense, since the extension was not enabled). The incorrect driver behavior was reported to AMD and was fixed in recent driver releases. The earliest driver I've tested and know to be working is AMD's Adrenaline driver version 23.5.2 (VkPhysicalDeviceProperties calls this driverVersion 2.0.262/0x800106). The last known bad version was 0x8000e9. The simplest workaround on these older AMD graphics drivers is to explicitly enable the extension, but set it to VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT mode. On newer drivers we do not need to do anything with the extension and can ignore it. Bug: angleproject:8215 Change-Id: I7c58d47a0350f4b0bc1a77f200c1e2f72fcde8d8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4627279 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Steven Noonan 15156b1d 2023-06-19T11:58:20 Vulkan: disable graphics_pipeline_library on old NVIDIA drivers On drivers before R530, there are some transient visual glitches in rendering when using VK_EXT_graphics_pipeline_library. Basically you might see correct renders for a few frames, very incorrect renders for about 10-20 frames, and then it would render correctly from then on. This problem went away either at R530 or slightly after. This change sets the minimum version to R531, which is the first version I observed behaving correctly. Bug: angleproject:8218 Change-Id: I7af4f74c1469ecf2306dec0cab9062eff2ec5f2c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4627277 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Steven Noonan 2e0b369d 2023-06-19T12:05:24 Vulkan: copy drawIndirectFirstInstance from physical device features Not doing so results in VVL errors (you need the GPU-assisted validation preset enabled to see this error): [ VUID-VkDrawIndexedIndirectCommand-firstInstance-00554 ] The drawIndirectFirstInstance feature is not enabled, but the firstInstance member of the VkDrawIndexedIndirectCommand structure at index 1 is not zero The Vulkan spec states: If the drawIndirectFirstInstance feature is not enabled, firstInstance must be 0 Bug: angleproject:8220 Change-Id: Ia43036584b85e4a7d9c3fcaf793be94b965f708f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4627278 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Steven Noonan 152e0d16 2023-06-19T14:44:09 Vulkan: detect Apple GPU as being a tile-based renderer This helps systems running MoltenVK on Apple Silicon. Bug: angleproject:8221 Change-Id: I28ce9b3dc153fb420429641776767fb71734685a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4627276 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Yuxin Hu 5a5f21f4 2023-06-14T14:05:41 Disable supportsExtendedDynamicState on ARM There are multiple issues with dynamic states on ARM. Previously we have disabled individual dynamic state that had issues, but it turns out some dynamic states need to be enabled/disabled together for tests traces to work correctly. Disabling the supportsExtendedDynamicState until all the issues are addressed. Bug: b/287318431 Bug: b/285196249 Bug: b/286224923 Change-Id: If2f039b8392898e1e42b5da6b1277e82818a1b1a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4615995 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi ef582ba3 2023-06-13T00:22:34 Vulkan: Suppress vertex attribute divisor VUID ... to unblock the roller. Need to investigate if the failure is real. Bug: angleproject:8203 Change-Id: I958de60188a67e519d7d3b27c52b9ea260d36d80 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4610083 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Roman Lavrov <romanl@google.com>
Cody Northrop 4384e49c 2023-06-12T08:20:03 Vulkan: Disable some dynamic states on ARM Bug: b/286224923 Bug: b/285196249 Bug: b/285124778 Change-Id: Ia19a278581d6586a2e1efcc46987925dcc9ccd3e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4608501 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Yuxin Hu 6433724c 2023-06-02T23:51:30 Revert "Enable usePrimitiveRestartEnableDynamicState on ARM driver 43" This reverts commit 0ea8e55a6f0667c2bb189d95987833231cdb22b2. Reason for revert: http://b/285543622 Original change's description: > Enable usePrimitiveRestartEnableDynamicState on ARM driver 43 > > The dynamic state bug is fixed in ARM 43. > Venus has backported the driver fix, therefore we > also enable primitiveRestartEnable dynamic state > on venus. > > Bug: b/275210062 > Bug: b/282621541 > Change-Id: I5debd5146386f7e245610fb71c84e4a48b04e85b > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4581051 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Yuxin Hu <yuxinhu@google.com> > Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Bug: b/275210062 Bug: b/282621541 Change-Id: I529669f82fdb6ceb53e6740c9737cd061cbaf450 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4585317 Commit-Queue: Yuxin Hu <yuxinhu@google.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Yuxin Hu 0ea8e55a 2023-06-01T10:25:44 Enable usePrimitiveRestartEnableDynamicState on ARM driver 43 The dynamic state bug is fixed in ARM 43. Venus has backported the driver fix, therefore we also enable primitiveRestartEnable dynamic state on venus. Bug: b/275210062 Bug: b/282621541 Change-Id: I5debd5146386f7e245610fb71c84e4a48b04e85b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4581051 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Amirali Abdolrashidi c80fc88a 2023-05-18T17:38:25 Vulkan: Add version to pipeline cache header * Added version as a field in the pipeline cache header. It is set by the value of kPipelineCacheVersion. * kPipelineCacheVersion must be incremented in case of any changes to the cache header or data structure. * This makes it easier to detect whether a change in the data is coming from the header/data change or from data corruption. If the version in the cache line matches kPipelineCacheVersion, some values in the header must meet certain conditions. Otherwise, it will result in a crash due to data corruption. Bug: b/246683126 Change-Id: Iaf1a2e1111cf47602dba947516ad8998d96dc943 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4546263 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi b0e9bbd7 2023-05-31T14:23:40 Vulkan: Split features for dynamic state When a driver bug with dynamic state is encountered, it is hard to debug which dynamic state exactly is causing an issue, due to the current granularity of disabling all entire state from an extension. With this change, every dynamic state gets its own ANGLE feature, and can be toggled as necessary. Disabling the supportsExtendedDynamicState* features implicitly disables all dependent features. Bug: b/285124778 Bug: b/275210062 Bug: fuchsia:107106 Bug: angleproject:5906 Change-Id: Ic291279872df2d0eb58618ff364ab118bdcc4a9f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4577553 Reviewed-by: Cody Northrop <cnorthrop@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Yuxin Hu dfb2bab0 2023-05-25T15:08:19 Apply Aliased Decorators To Image DataTypes Bug: b/274478912 Bug: b/266235549 Change-Id: I2cd272a1e7481a8803be63efe0be11c61560b23e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4568287 Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Roman Lavrov eaa53279 2023-05-30T14:37:03 Add mDitheringFeatures to mEnabledFeatures Missed in https://crrev.com/c/4567572 Also adds mSwapchainMaintenance1Features, which was missing in the same place, and I was using that as a reference in the CL above. Bug: b/284462263 Change-Id: I225cbd40d35eb09ea6220a6669574e19ce6cce83 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4574570 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Roman Lavrov ff110417 2023-04-21T15:16:03 Vulkan: Emulate RGB32 uniform texel buffers when unsupported Applies to: GL_RGB32F, GL_RGB32I, GL_RGB32UI When VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT is specified for these formats by the Vulkan driver, behavior is the same as before. When it is not speficied: previously ANGLE wouldn't enable GL_EXT_texture_buffer unless exposeNonConformantExtensionsAndVersions was enabled; now ANGLE always enables it and does the RGB->RGBA conversion (GPU) under the hood and tracks buffer content updates using the paths added for tracking this for Vertex Arrays. Bug: b/278585075 Bug: angleproject:8128 Change-Id: I4605719bf3f51c5a10c1a35ecae767833dcd45d7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4456498 Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Roman Lavrov 16b9a16a 2023-05-26T14:45:15 Add supports_legacy_dithering feature VK_EXT_legacy_dithering => VkPhysicalDeviceLegacyDitheringFeaturesEXT.legacyDithering => supportsLegacyDithering Now getting enabled=true on Android master. Bug: b/284462263 Change-Id: Ibf43184c78d9847044b10413d2050b653e452c9b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4567572 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Yuxin Hu 6f2128a5 2023-05-25T10:45:08 Disable stencil write mask workaround on latest ARM The bug has been fixed in ARM r43. Bug: b/279715714 Bug: angleproject:7556 Change-Id: I01f08459ab90fed4eb1d57194cea3805d7868c18 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4566953 Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Alexey Knyazev 33e38862 2023-05-24T00:00:00 Vulkan: Limit clampFragDepth workaround to affected drivers Bug: angleproject:3970 Change-Id: I708591d86b8f2cb10d0cbdc7c14518fda45ac626 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4562134 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 934a25bc 2023-05-22T00:00:00 Vulkan: Implement EXT_depth_clamp Bug: angleproject:8047 Change-Id: I73244f5dcd6eeeb1889214ee3a611e4ecabbfe7e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4558744 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Amirali Abdolrashidi ac4649ef 2023-05-17T12:50:59 Vulkan: Update last CRC check for pipeline cache * In GetAndDecompressPipelineCacheVk(), a mismatch in the final CRC check before decompression is now fatal. If the expected CRC is non-zero, the cache header data will be logged before crashing. The only exception is when the expected CRC is 0, in which case there will only be a warning about the CRC mismatch. Bug: b/246683126 Change-Id: Ic2eb882bcc692b2a8f026cc90a0185a29d48f382 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4545957 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 7abc5248 2023-05-19T00:00:00 Vulkan: Enable VK_EXT_depth_clamp_zero_one Replaced the 'depth_clamping' workaround with the dedicated extension or explicit fragment depth clamping. Fixed: angleproject:3970 Bug: angleproject:8077 Change-Id: Ia7666fcb3e0e949922c13a3fd11b818cbc5a8e26 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4545084 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi b76166d0 2023-05-18T09:57:25 Vulkan: Separate image and sampler 2D view of 3D features The sampler feature is used to determine if EGL_KHR_gl_texture_3D_image can be exposed. The image feature is used to support base GLES 3.1 storage images. Bug: b/274478146 Change-Id: Ifb283633078ace7ee65f8aafe756d0a02b727bd7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4545005 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 80dd54f9 2023-05-17T22:16:59 Vulkan: Enable VK_EXT_image_2d_view_of_3d and set flag Based on a change by Yiwei Zhang <zzyiwei@chromium.org> Enabling the extension was missed from https://chromium-review.googlesource.com/c/angle/angle/+/3648586, and some implementations do rely on the feature enablement (e.g. RADV). This also fixes the VVL violations on satisfied implementations. Additionally, the VK_IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT flag is always set on 3D images when this extension is supported; it is needed for both sampled and storage images, not just storage images. Bug: b/274478146 Change-Id: Ibc210275e2d39ac0c54d1ae4c2451a5402360972 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4544762 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Amirali Abdolrashidi cda716b3 2023-05-12T15:43:35 Expand numChunks to 16 bits in cache header On some devices, the number of chunks for the pipeline cache header might exceed the 8-bit limit. * numChunks and chunkIndex are expanded to 16 bits. * Padding added for the alignment of CacheDataHeader. * Updated the assert checks for numChunks and chunkIndex. Bug: b/246683126 Change-Id: I40a4224e845dc5bc6e415ec5f15b16f60f7923af Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4528541 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi 8539177c 2023-05-12T15:27:03 Vulkan: Change pipeline cache header into class Currently the pipeline cache header is represented by a single value of type uint64_t. This prevents us from expanding the header if needed, for example if there is a need to increase the size of any of the data already included, such as numChunks, or add new data to the header. * Added the class CacheDataHeader to RendererVk.cpp, which is comprised of various elements of fixed size. * Replaced the uint64_t with CacheDataHeader. memcpy() is used for data transfer. * The order of the values is based on LSB, similar to the order in the original uint64_t. * Removed kBlobHeaderSize, replaced with sizeof(CacheDataHeader). * In GetAndDecompressPipelineCacheVk(), replaced the assert for chunk index 0 with a warning regarding unexpected values and the function returning without success. The assert was removed since in the case of expanding the chunk index beyond 8 bits, a non-zero value could be decoded. * numChunks and uncompressed data size are also checked to make sure they are non-zero before continuing the decompression. Otherwise, the function would return with no success. Bug: b/246683126 Change-Id: I4caaaef28c3e9ab2a7ca22f89962c11705577be5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4528540 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Amirali Abdolrashidi 6f959e07 2023-04-28T16:00:11 Vulkan: Add non-device memory option for VMA image * Updated the required flags for allocateAndBindMemory() to no longer include VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, though still preferred. This allows VMA to allocate from another memory type if the device is out of memory. * Added a debug message to indicate when allocated memory for VMA image does not have all the preferred property flags. * Also added a warning in the case of memory allocation fallback. * Added a perf counter to keep track of image allocation fallbacks from the device memory. * deviceMemoryImageAllocationFallbacks * Added a test to make sure that VMA images can still be allocated from other memory types even if device memory is unavailable. * VulkanImageTest.AllocateVMAImageWhenDeviceOOM Bug: b/280304441 Change-Id: Ic452c18ded25345cdb7e271442372b99aede045e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4493483 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Amirali Abdolrashidi 560ba1c6 2023-05-13T01:42:21 Revert "Suppress VUID-vkCmdDrawIndexed-None-0784x" This reverts commit aa6291aa43aa34ed5eb68c6b7faaba94ce08ef74. Reason for revert: The roller was successful. The issue seems to have been fixed. Original change's description: > Suppress VUID-vkCmdDrawIndexed-None-0784x > > * Suppressed the following VVLs > * VUID-vkCmdDrawIndexed-None-07840 > * VUID-vkCmdDrawIndexed-None-07841 > * VUID-vkCmdDrawIndexed-None-07843 > * VUID-vkCmdDrawIndexed-None-07844 > * VUID-vkCmdDrawIndexed-None-07845 > * VUID-vkCmdDrawIndexed-None-07847 > * VUID-vkCmdDrawIndexed-None-07848 > > Bug: angleproject:8159 > Change-Id: Id516d0a8e677b00b3f46a456d07386c5fd91d6dc > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4514440 > Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> > Auto-Submit: Amirali Abdolrashidi <abdolrashidi@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bug: angleproject:8159 Change-Id: I00d45397cf72facfc60674563f95e81df80cc7c2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4529339 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Amirali Abdolrashidi 17dbf435 2023-05-13T01:11:19 Revert "Suppress more of VUID-vkCmdDraw-None-0784x" This reverts commit c441206103b14f68fc5cfa9434f4058429a714dd. Reason for revert: The roller was successful. The issue seems to have been fixed. Original change's description: > Suppress more of VUID-vkCmdDraw-None-0784x > > * Suppressed the following VVLs > * VUID-vkCmdDrawIndexed-None-07840 > * VUID-vkCmdDrawIndexed-None-07841 > * VUID-vkCmdDrawIndexed-None-07843 > * VUID-vkCmdDrawIndexed-None-07847 > > Bug: angleproject:8151 > Bug: angleproject:8159 > Change-Id: I7fe36cfa34b8157af0be7f0c35779185a6b341aa > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4514442 > Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> > Auto-Submit: Amirali Abdolrashidi <abdolrashidi@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Bug: angleproject:8151 Bug: angleproject:8159 Change-Id: I41082df93a55c4eec46ad7d0d048a8159472a7d2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4528542 Auto-Submit: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cody Northrop ad01f53c 2023-05-11T09:44:13 Vulkan: Add additional nullptr check in ShouldReportDebugMessage Some platforms are using the callback for non-VVL messages, and we just need an additional nullptr check for pMessageIdName when deciding whether to print it. Test: Trace tests on S23 with VVL enabled Bug: angleproject:8163 Change-Id: Id76903e01be859f6ae7a6d253ed32ae54cd682ec Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4522466 Auto-Submit: Cody Northrop <cnorthrop@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Hailin Zhang 8b9440b6 2023-05-01T15:31:01 Vulkan: add option to control pipeline cache data compression. Bug: b/258207403 Change-Id: I487b1cadbacfa2f7ee889a8f58278307a126a391 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4497248 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Hailin Zhang <hailinzhang@google.com>
Cody Northrop 3d455fe4 2023-05-03T15:35:47 Android: Galaxy S23 support This CL: * Adds detection of the device * Adds end2end test support * end2end test expectations for Vulkan backend * Works around driver issue with vkCmdSetLogicOpEXT Test: angle_end2end_tests, angle_trace_tests Bug: b/277717225, b/281128706 Bug: angleproject:8157 Change-Id: If6caa5b2ba0b9d7f94e1be0841bcff2ea1c34d89 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4509693 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Amirali Abdolrashidi c4412061 2023-05-08T18:46:10 Suppress more of VUID-vkCmdDraw-None-0784x * Suppressed the following VVLs * VUID-vkCmdDrawIndexed-None-07840 * VUID-vkCmdDrawIndexed-None-07841 * VUID-vkCmdDrawIndexed-None-07843 * VUID-vkCmdDrawIndexed-None-07847 Bug: angleproject:8151 Bug: angleproject:8159 Change-Id: I7fe36cfa34b8157af0be7f0c35779185a6b341aa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4514442 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Auto-Submit: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi aa6291aa 2023-05-08T15:49:15 Suppress VUID-vkCmdDrawIndexed-None-0784x * Suppressed the following VVLs * VUID-vkCmdDrawIndexed-None-07840 * VUID-vkCmdDrawIndexed-None-07841 * VUID-vkCmdDrawIndexed-None-07843 * VUID-vkCmdDrawIndexed-None-07844 * VUID-vkCmdDrawIndexed-None-07845 * VUID-vkCmdDrawIndexed-None-07847 * VUID-vkCmdDrawIndexed-None-07848 Bug: angleproject:8159 Change-Id: Id516d0a8e677b00b3f46a456d07386c5fd91d6dc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4514440 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Auto-Submit: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov 903d9fdf 2023-01-19T15:37:45 Vulkan: Implement ExternalFence for use in SyncHelperNativeFence `ExternalFence` allows concurrent usage in `CommandQueue` and `SyncHelperNativeFence` classes eliminating need of additional `vkQueueSubmit()` call. Waiting in `CommandQueue` on `QueueSerial` or `ResourceUse` will ensure corresponding state of the native FD (because `CommandQueue` will wait on the same FD instead of some other fence). After this change there will be only single `vkQueueSubmit()` call from the `SyncHelperNativeFence::initializeWithFd()` method. This CL and the follow-up is sufficient to fix the bugs below. Bug: angleproject:8115 Bug: angleproject:8117 Test: angle_end2end_tests --gtest_filter=EGLSyncTest.AndroidNativeFence_ExternalFenceWaitVVLBug* Change-Id: Ic562ecc71a95203454a1dc438589a13bcf3bff7f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4392879 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov e24f4519 2023-01-19T02:30:39 Vulkan: Add externalFence into submitCommands() Currently one-off fence in the `queueSubmitOneOff()` is used only in `SyncHelperNativeFence::initializeWithFd()` to submit external fence. Other `queueSubmitOneOff()` calls may use `QueueSerial` instead of a fence. Providing `fence` into `queueSubmitOneOff()` prevents tracking that submission with `QueueSerial`. Therefore using `mUse` to collecting `mFenceWithFd` as garbage will not work as intended. This CL removes `fence` from `queueSubmitOneOff()` and adds optional `externalFence` into `submitCommands()` instead. Providing `externalFence` will cause additional `vkQueueSubmit()` call: - first submission will submit everything as usual except using the `externalFence`. - second, will only submit internal `CommandQueue` fence for `QueueSerial` tracking. As the result of this CL, call to `initializeWithFd()` will always produce two (2) `vkQueueSubmit()` calls. Previously it may be one (1) or two (2) submissions. Future CL will reduce submission count to one (1). If add additional submission into `queueSubmitOneOff()` instead of `submitCommands()`, then maximum number of submissions will be three (3). Bug: angleproject:8117 Change-Id: I6f1ec12682aaab71bfc871e665fec2659df96b26 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4392877 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>