src/libANGLE/renderer/vulkan/RendererVk.cpp


Log

Author Commit Date CI Message
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>
Amirali Abdolrashidi cd171d2e 2023-03-28T14:58:57 Vulkan: Enable async pipeline cache compression * Enabled the feature after adding more header data, including original cache size, chunk index, and CRC. Bug: b/246683126 Change-Id: Idef85f0a6f9e0072fcb800aedb6b720cc88c46b2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4378720 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 2fec8ae8 2023-05-02T15:53:29 Vulkan: Handle inactive render pass in draw-based clear For simplicity, if a render pass is open for the current framebuffer but is not active, a new one is started in UtilsVk::clearFramebuffer. A future optimization could decide to reactive the render pass instead, but needs to check for whether that's possible (with a condition similar to what's found in ContextVk::handleDirtyGraphicsRenderPass) Bug: chromium:1440764 Change-Id: I727d4ecefc2bc0a1a9e399b8851c4cc830d20879 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4499765 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Cody Northrop 533cf9a4 2023-05-02T22:39:09 Vulkan: Suppress new VUID-vkCmdDraw-None VVL errors Test: angle_trace_tests --gtest_filter="*slingshot_test2*" Bug: angleproject:8151 Change-Id: Ifc26a57fe92b57c30f253f5bb491a1ac3932f2f1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4500928 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi a73e546c 2023-04-14T13:40:19 Vulkan: Add pending memory size for VMA images * Added implementation for vma::FindMemoryTypeIndexForImageInfo(). * Add pending memory allocation tracking for VMA images using the memory requirement from getMemoryRequirements() and the memory type index from the function above. Bug: b/218891184 Change-Id: I1c3d3a8f5f36eb57bd7a5a059aa3bf713b819831 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4428535 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Cody Northrop dcc37e31 2023-05-02T13:22:18 Vulkan: Restore stencil write mask workaround for ARM Still has issues on latest drivers. Test: angle_trace_tests --gtest_filter="*pokemon_go*" Bug: b/279715714 Bug: angleproject:7556 Change-Id: I4d46cdc2b86da374413f97e45858e18022e0cc7b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4499032 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev b052a5bf 2023-03-31T00:00:00 Vulkan: Implement polygon mode extensions * NV_polygon_mode * ANGLE_polygon_mode Bug: angleproject:1791 Bug: angleproject:8132 Change-Id: I2beffdad0c1569546020b78a9c6d9b8ea87c2100 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4498687 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Shahbaz Youssefi 1fc399c6 2023-05-01T22:29:35 Vulkan: Adjust VVL suppression after VU consolidation Bug: angleproject:8119 Change-Id: I42746d399841591e78114cb26c2e377e255e791e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4492542 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Yuxin Hu 2ee97f91 2023-04-27T15:43:03 Unconditionally enable append_aliased_memory_decorations_to_ssbo After the discussion with Khronos group on how to handle aliased ssbo in GL driver: https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/4321 https://gitlab.khronos.org/opengl/API/-/issues/183 it is the correct behavior to append aliased memory qualifier to SSBOs, if restrict memory qualifier is not specified. Unconditonally enable this feature for all hardware. Bug: b/266235549 Change-Id: I20c811710bb10f0de39de5707adab0262a46d296 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4485008 Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Amirali Abdolrashidi f9a700ee 2023-04-27T14:15:56 Disable mutable texture upload for discrete GPUs A local case was observed for the trace "vainglory" on Linux, where it fails due to OOM on one of the memory heaps. * mutableMipmapTextureUpload is now disabled when discrete GPUs are used in order to migitate OOM for VRAM. * After this change, the heap usage for "vainglory" drops from ~3,794,862,080 to ~1,126,891,520. Bug: b/278600575 Change-Id: Ie09d0037ffaf28640c4e36c5fff5d329c3a3f9cc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4458269 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao b875f47b 2023-04-24T11:11:03 Vulkan: Make mLastSubmittedQueueSerial reflect what it means Right now we always update ContextVk::mLastSubmittedQueueSerial and ContextVk::mLastFlushedQueueSerial when context becomes current, even though it does not make any submission. It was done it this way mainly for simplification (i.e, you will always see both queueSerial's index the same). But this also causes a performance cost when a mLastSubmittedQueueSerial is used to tag a resource. For example, if you insert a EGLSync right after makeCurrent, that EGLSync may get a queue serial number bigger than it should be, which will translate to longer sync wait time. This CL changes these two queue serial to exact what the name suggests, that it will only update if we made a "flush" or "submit" call. Bug: b/277644512 Change-Id: Ibe4c78985a3fe0726836d620202e5276894a8e7c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4458532 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi f4febc9c 2023-04-25T10:16:47 Vulkan: Remove generic syncval suppression about storage buffers Bug: angleproject:7125 Change-Id: I3778e82c90f9d546f4e3948894060af0173b7b84 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4471628 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi 13935469 2023-04-25T09:58:42 Vulkan: Fix access mask of generateMipmap's blit Bug: angleproject:8143 Bug: angleproject:7125 Change-Id: I6e5b6cd1f445c2c41d4b78aeb368e30cc4c5354b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4475444 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Amirali Abdolrashidi b58ef53a 2023-04-14T14:27:12 Vulkan: Add size limit for VMA image suballocation * Added kImageSizeThresholdForDedicatedMemoryAllocation, currently set to 4MB. Any image larger than this will have its own dedicated device memory handle via the following flag: * VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT Bug: b/218891184 Change-Id: I00318188bf929cf6949d441e5048e9e9640fe5ca Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4428536 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Yuly Novikov db33a246 2023-04-21T13:17:07 Remove obsolete VUID suppression Renamed in https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/5645 Bug: angleproject:8119 Change-Id: I578ee8cf538112f974ac0a3a7b80d37947993f5b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4459181 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Yuly Novikov <ynovikov@chromium.org>
Amirali Abdolrashidi 285baade 2023-04-20T14:47:30 Move CRC check to before cache decompression * Moved the CRC check to before the decompression is performed. * Removed the asserts related to CRC, since if it is enabled, an app is run, and then it is disabled, running the same app can trigger the assert. * Changed the FATAL() CRC logs to WARN() for now. Bug: b/246683126 Change-Id: Ie4c33079b06766904649346d498234c6fc1a3415 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4455550 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Yuly Novikov 60dd588e 2023-04-21T12:05:42 Revert "Temporarily restore obsolete VUID suppressions" This reverts commit d0148f12bc1226a045b1b28e1a4be89e5012ef12. Reason for revert: VVL rolled into Chromium crrev.com/c/4454789 Original change's description: > Temporarily restore obsolete VUID suppressions > > To roll ANGLE into Chromium, which still has old VVL. > > Bug: angleproject:8119 > Change-Id: Ic0b53f8a965de5f11b5a143be2a9a05f57304547 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4428872 > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Auto-Submit: Yuly Novikov <ynovikov@chromium.org> Bug: angleproject:8119 Change-Id: If0befdae7b69b8a4dba998f06cd022ee69d8734b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4454401 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
angle-autoroll 7d813e4e 2023-04-19T12:34:56 Roll vulkan-deps from c8e5e8c4c60b to 9403c35f9956 (31 revisions) https://chromium.googlesource.com/vulkan-deps.git/+log/c8e5e8c4c60b..9403c35f9956 Suppress new VUIDs: "VUID-vkCmdDraw-None-02859", "VUID-vkCmdDrawIndexed-None-02859", "VUID-vkCmdDrawIndexed-None-07835", "VUID-vkCmdDrawIndexedIndirect-None-02859", "VUID-vkCmdDrawIndirect-None-02859", "VUID-VkGraphicsPipelineCreateInfo-Input-08733", Changed dependencies: * spirv-tools: https://chromium.googlesource.com/external/github.com/KhronosGroup/SPIRV-Tools.git/+log/f449fb4ad9..25ad5e19f1 * vulkan-loader: https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-Loader.git/+log/8c8619df2d..f035e57c17 * vulkan-tools: https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-Tools.git/+log/4e17c284d6..db7475424c * vulkan-validation-layers: https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-ValidationLayers.git/+log/7b50c36e7a..50c2f9e71a 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,jonahr@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:8119 Change-Id: I8cb9bd3b593f24af130d9239c35fb119ed6bb41b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4446977 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Yuxin Hu 6deca89e 2023-03-22T22:33:40 Add Spirv Instruction to explicitly cast mediump float to 16 bit If the GLSL shader code expects the comparison between two mediump float values returning true, but the SpirV compiler treats one of them as 32-bit, and treats the other one as 16-bit, the comparison would return false instead. The SpirV compiler may not automatically cast the mediump float values to 16 bits, because it may utilize the RelaxedPrecision decoration to keep a mediump float as 32-bit, so that the compiler can avoid the type cast from 32-bit highp to 16-bit mediump. This change adds an additional OpQuantizeToF16 SpirV instruction to explicitly cast mediump float scalar or mediump float vector to 16 bit, if they are assigned with a highp float value. This ensures that if the GLSL shader code ever compares two meiump float values, the SpirV shader compiler is not accidentally comparing a 16 bit with a 32 bit float value. This fixe the deqp test failure on Pixel 6 and Pixel 7: dEQP-GLES2.functional.shaders.algorithm.rgb_to_hsl_vertex. Bug: b/274859104 Bug: b/274408172 Change-Id: Ifd996cea14c0f77f45ae90f38c8e53cf5035139f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4400404 Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Amirali Abdolrashidi a7bd3f53 2023-03-31T16:57:35 Fix the retrace issue for VMA image suballocation After adding the VMA image suballocation feature, VVL errors were seen when using the retracing script for some traces, causing failure. After analysis, it was seen that the functionality of the allocation differs from the original method when it comes to non-zero memory allocation. * In allocateAndBindMemory(), the memory property flags from the allocated memory are returned to be used for non-zero memory feature usage. * Added mapMemoryAndInitWithNonZeroValue() to ImageMemorySuballocator, which is used when allocateNonZeroMemory is enabled and the allocated memory is host-visible. * Merged the following into ImageHelper::initializeNonZeroMemory(): * mapMemoryAndInitWithNonZeroValue() * InitMappableDeviceMemory(); used when VMA image suballocation is disabled. * Moved onMemoryAlloc() inside allocateAndBindMemory(). Test: retrace_restricted_traces.py Bug: b/277618656 Bug: angleproject:8058 Change-Id: If411a073e900c1c034d40a99e3fffefe30c82548 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4391403 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Yuly Novikov d0148f12 2023-04-15T11:44:06 Temporarily restore obsolete VUID suppressions To roll ANGLE into Chromium, which still has old VVL. Bug: angleproject:8119 Change-Id: Ic0b53f8a965de5f11b5a143be2a9a05f57304547 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4428872 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Yuly Novikov <ynovikov@chromium.org>
angle-autoroll 82f1cee0 2023-04-13T15:28:17 Manual roll vulkan-deps from ec231c69caa6 to c8e5e8c4c60b (60 revisions) Suppress new VUIDs: VUID-VkGraphicsPipelineCreateInfo-Input-07905 UNASSIGNED-CoreValidation-Shader-InterfaceTypeMismatch Unsuppress obsolete VUIDs: UNASSIGNED-CoreValidation-Shader-InputNotProduced UNASSIGNED-CoreValidation-Shader-InterfaceTypeMismatch https://chromium.googlesource.com/vulkan-deps.git/+log/ec231c69caa6..c8e5e8c4c60b Changed dependencies: * glslang: https://chromium.googlesource.com/external/github.com/KhronosGroup/glslang.git/+log/77f7cdfb1e..68f073b195 * spirv-cross: https://chromium.googlesource.com/external/github.com/KhronosGroup/SPIRV-Cross.git/+log/3327924add..fc9bee27f4 * spirv-headers: https://chromium.googlesource.com/external/github.com/KhronosGroup/SPIRV-Headers.git/+log/29ba249312..cfbe4feef2 * spirv-tools: https://chromium.googlesource.com/external/github.com/KhronosGroup/SPIRV-Tools.git/+log/ac335c7634..f449fb4ad9 * vulkan-headers: https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-Headers.git/+log/63af1cf1ee..95a13d7b71 * vulkan-loader: https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-Loader.git/+log/c3eb97de22..8c8619df2d * vulkan-tools: https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-Tools.git/+log/4ad4313da0..4e17c284d6 * vulkan-validation-layers: https://chromium.googlesource.com/external/github.com/KhronosGroup/Vulkan-ValidationLayers.git/+log/21078b582d..7b50c36e7a 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:8119, angleproject:4883, angleproject:6442 Change-Id: I8d4d0c16ccde26e3455580349bc18fe6a76c2874 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4423456 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Yiwei Zhang 28edde6f 2023-04-13T20:20:33 Vulkan: enable enableCompressingPipelineCacheInThreadPool for venus Try again with aosp/2451163. Bug: b/246683126 Change-Id: Idb66cfbace29349ddf5ed6a96146433098384689 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4426749 Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi c26011b8 2023-04-11T15:16:29 Vulkan: Make advanced blend alpha div workaround permanent This workaround turned out to affect pretty much every driver, and numerous GL implementations were found to work around it similarly to ANGLE. It seems like this workaround may only be necessary for colorburn and colordodge, but for now ANGLE applies it to all modes. Bug: b/274528004 Bug: b/277777623 Change-Id: Id555c981a9775f949a3022b7e92c755accea7cea Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4416158 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 9ae918cb 2023-02-03T15:14:00 Reland "Vulkan: SurfaceVk should only wait for GPU work that uses it" This is a reland of commit 5b63e1dc1d5e96018d0ad30582265a612d309f3b The added fix is add contextVk::mLastSubmitQueueSerial into Surface::mUse before calling finish. Original change's description: > Vulkan: SurfaceVk should only wait for GPU work that uses it > > Right now when we destroy swapchain, we call mRenderer->finish() to > finish everything, even though the work is unrelated to this surface. > This CL changes it to only wait for ResourceUse of all images in the > swapChain. > > Bug: b/267806287 > Change-Id: I33d136ad50961fbf5fbb200ff0f89f1dbf23585d > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4220723 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Charlie Lao <cclao@google.com> Bug: b/267806287 Change-Id: I160fd22595fcf292cc53c055e0678befa3b8501b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4406891 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Yiwei Zhang fd0ced8b 2023-03-31T15:07:00 Vulkan: remove isVenus from ARM driver version check There're other ARM workarounds no longer needed by Venus atop ARM mali ddk r40p0 and above, so we choose to forward host ARM driver version in Venus: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22242 Bug: b/277833839 Test: workaround enabled with latest venus Change-Id: Ic52d4fe9f3f7e8a6f87aa275e702c99668f5824f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4391232 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com> Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao d58fbf04 2023-04-05T12:32:09 Vulkan: Wait for surface ANI semaphore only if image is used Right now there is a bug that surface's ANI semaphore is added to context when WindowSurfaceVk::getAttachmentRenderTarget get called, which gets called from FramebufferVk::syncState, which is before we end the previous render pass, due to the endRenderpass usually is deferred until next renderPass starts. This caused ANI semaphore gets added to the previous render pass's submission, which does not use surface, and thus a bubble in GPU execution pipeline where the user FBO rendering gets unnecessarily blocked until ANI semaphore is signaled. This lowers GPU utilization and thus GPU frequency gets dropped and frame time increased. This CL stores ANI semaphore to ImageHelper object and when barrier is generated, the ANI semaphore is moved to CommandBuffer. When CommandBuffer gets flushed and submitted, it gets added to the waitSemaphores vector and submitted to vulkan. Since all use of swap chain image must go through barrier code first (you need at least change layout), this ensures ANI semaphore gets waited in exact and robust way. Only the submission that references the swap chain image will be waited. With this CL, professional_baseball_spirits reduces frame time from 3.8 ms to 2.7 ms, achieving parity with native GLES on pixel 7 pro. Bug: b/275624771 Change-Id: Ifa6cacf9e3bc147bfde54eb7def2fca48c50aca0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4400011 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Yiwei Zhang 854264e3 2023-04-11T06:18:44 Vulkan: enable precisionSafeDivision for venus ..otherwise the legacy org.skia.skqp.SkQPRunner#gles_xfermodes2 SkQP cts will fail across our host Vulkan implementations: mali, anv, radv, tu. Btw, radv has been lucky due to the existing isAMD condition satisfied. Bug: b/274528004 Change-Id: I39debe4e58d8afff0671809ac19cf9be8637f73e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4413212 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi 23ec0620 2023-03-23T09:51:53 Vulkan: Add more data to blob cache header This is to potentially increase blob cache robustness against collisions and partially modified data. This CL adds 7 bytes per chunk (8 bytes in total). During decompression, the data will be checked in order to determine if the cache data can be used. * Added chunk index to the header. (1 byte) * Added CRC16 of the compressed data to the header. (2 bytes) * Added the original (uncompressed) data size to the header. (4 bytes) * Moved kBlobHeaderSize to the anonymous namespace. * Added the following GN flag to enable CRC calculation for the cache. * angle_enable_crc_for_pipeline_cache (only available in debug mode) * Corresponds to kEnableCRCForPipelineCache. * When it is false, the CRC is set to 0. Bug: b/246683126 Change-Id: I9aaf9cda52e0af07a2e1c2d0c39aca407e515701 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4378717 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 3aea3cfd 2023-04-03T16:38:29 Vulkan: Workaround depth bias constant factor on ANV Bug: b/249380591 Change-Id: Iaeda7faf5eb40e0e2086674d3e63bf5bc9911ab4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4392893 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yuxin Hu 29abd5a2 2023-03-06T11:35:45 Explicitly Add Aliased Memory Decoration in SpirV In GLSL, aliased memory qualifier is implicitly available, unless we explicitly specify the memory is restrict: https://www.khronos.org/opengl/wiki/Type_Qualifier_(GLSL)#Memory_qualifiers. However, in SpirV, aliased memory qualifier has to be explicitly specified: https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#AliasingSection This change adds the aliased memory decorations to SSBO if the GLSL does not specify the restrict memory qualifier. This is a temporary workaround to fix the deqp test failures on some android devices. Eventually we would like to waive this test for ANGLE due to alised memory in Vulkan does not suppose to affect SSBOs that have different set/binding, please refer to this Khronos ticket for more details: https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/4321 Bug: b/266235549 Change-Id: Ic7afc417a5d421664b60e0413a011314787e14e7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4312130 Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 97897d92 2023-03-27T16:02:57 Vulkan: Work around driver bug with dynamic primitive restart This CL forces the state to be static on buggy drivers. Bug: b/275210062 Change-Id: Ia3391ecb19c3c9d19c05a83e11da8c718513a4e2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4374104 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@google.com>
Igor Nazarov 85735eb4 2023-03-17T19:56:23 Vulkan: Enable async features for Secondary Command Buffers. Since, all known problems with Secondary Command Buffers and async features are fixed, it should be safe to allow enabling these features for testing. Locally, this CL passes custom build dEQP tests (EGL/GLES2/3/3.1) with asyncCommandQueue and Vulkan Secondary Command buffers enabled. Tests were executed on S906B that uses ANGLE as the system GLES driver. Bug: angleproject:6811 Bug: angleproject:6100 Change-Id: Id3ef6df56f0a3bd1986f2e6047f01e6eac165fc6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4350270 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Amirali Abdolrashidi f2c5ce4e 2023-03-16T17:44:56 Re-enable mutable texture upload for one context It was observed that in some apps, mutable textures are uploaded in a context, but that context's outside RP command buffer is not flushed at all, resulting in invalid (noise) or incorrect textures. * Added isEligibleForMutableTextureFlush() to be used to determine whether onMutableTextureUpload() should be called. * Restricted the use of mutable texture upload to single-context share groups. * When the number of contexts becomes greater than one, the original context's outside render pass command buffer is flushed. * Added related tests. * Added a test to make sure that textures can be uploaded in one thread, and used for draw calls in another, with the help of a sync object. * Added a test to make sure that textures can be uploaded in the main thread, and used in a new thread. * Added a test in which a new context is created after mutable mipmap textures are defined. Bug: b/264143971 Change-Id: I66c0d8b04d39bb7244e5752aac0e46a0192f012e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4349156 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov 7d1a401b 2023-01-17T18:45:55 Vulkan: Fix freeing not completed Secondary Command Buffers. Problem: - Protected Context flushes its commands to the Protected Primary Command Buffer; - Unprotected Context flushes its commands to the Unprotected Primary Command Buffer; - Context with different "egl::ContextPriority" may flush commands into different Primary Command Buffers. - Secondary Command Buffers from all Contexts end-up in the single "CommandBufferRecycler::mSecondaryCommandBuffersToReset" list; - One of the Contexts submits its Primary Command Buffer, and attaches current "mSecondaryCommandBuffersToReset" list to the "CommandBatch"; - Secondary Command Buffers of other Contexts may be collected and later freed by "SecondaryCommandPool" without submitting/completion corresponding Primary Command Buffers. Fix: - Moving "mSecondaryCommandBuffersToReset" to the new "SecondaryCommandBufferCollector" class. - Separate "SecondaryCommandBufferCollector" instance is stored in the "CommandQueue" for each current Primary Command Buffer. Additionally fixes "asyncCommandQueue" related problem: "releaseCommandBuffersToReset()" may get outdated results if flush is not yet executed in the "asyncCommandQueue" thread. Bug: angleproject:6100 Change-Id: I7df161ac1f999fb34d4eccaebb603c58ecb1ac11 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4334579 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Igor Nazarov 9b6368cc 2023-03-14T14:48:30 Vulkan: Fix freeing Secondary Command Buffers from wrong thread. Problem: - Secondary Command Buffers are freed in the "CommandQueue" class. - This may happen from any Context thread that calls "checkCompletedCommands()" or "finish<*>()" methods. - As the result, one Command Buffer may be freed from one thread, while other Command Buffer from the same "VkCommandPool" is allocated/reset/recorded in the other thread. Vulkan spec demands external "VkCommandPool" synchronization for any modifications (begin/end/reset/free/cmd) on its "VkCommandBuffer"s. Fix: - Added new "rx::vk::SecondaryCommandPool" class that replaces the "rx::vk::CommandPool" wrapper. - This class has "collect()" method for storing "VkCommandBuffer"s. Collected buffers are freed from the correct thread on the next "allocate()" call. This CL only fixes the problem, keeping Secondary Command Buffer memory management as is (allocate/free single buffer without reuse). In the future CLs this behavior may be changed (reuse buffers, reset/free entire pools). Bug: angleproject:6100 Change-Id: If938416c4df4fe55f0cfb418b6759721ac53098b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4334577 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov 29f80eda 2023-03-15T14:59:26 Vulkan: Hot fix crash when using Invalid VkSemaphore Object. Problem started after the commit: b194c21ad30145ca15153a93425a37a8211df373 Vulkan: Enforce ContextPriority in ShareGroup and with EGLImage Happens only with enabled "asyncCommandQueue" feature: - "RendererVk::submitPriorityDependency()" creates "Vk::Semaphore" object on the stack. - Then submits this Semaphore with "queueSubmitWaitSemaphore()" method. - "vk::Semaphore" passed to the "CommandProcessor"s "enqueueSubmitOneOffCommands()" method where stored in the "CommandProcessorTask". - Stack "vk::Semaphore" object garbage collected by the "RendererVk" and then destroyed. - "CommandProcessorTask" now points to the invalid memory. This CL changes usage of "vk::Semaphore" and "vk::Fence" pointers in the "CommandProcessor.h" classes to Vulkan Handles. This will make API consistent, fix this problem, and avoid similar problems in the future. Issue discovered while testing ANGLE as a system driver on S906B with "asyncCommandQueue" enabled. Several system processes crashed with VVL: VUID-VkSubmitInfo-pWaitSemaphores-parameter(ERROR / SPEC):msgNum: -1328048864 - Validation Error: [ VUID-VkSubmitInfo-pWaitSemaphores-parameter ] Object 0: handle = 0xb4000078c1aab430, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xb0d79520 | Invalid VkSemaphore Object 0xb400007831740b98. The Vulkan spec states: If waitSemaphoreCount is not 0, pWaitSemaphores must be a valid pointer to an array of waitSemaphoreCount valid VkSemaphore handles (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkSubmitInfo-pWaitSemaphores-parameter) Bug: angleproject:8039 Change-Id: I8818288b9783b5c5a7970bf82ec721452ae57471 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4339758 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Yiwei Zhang 12aefbc0 2023-03-16T04:43:38 Vulkan: add MESA Virtio-GPU Venus driver feature conditions Bug: b/267576238 Change-Id: I5f0c479b23cd3465ca7560966bb4d98edf4c40df Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4342819 Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov 4edccb15 2023-01-17T16:17:35 Vulkan: Fixed Context Priority mixing problems. Problem details: - Each "egl::ContextPriority" may have separate "VkQueue". - "CommandQueue" only has two "PrimaryCommandBuffer"s for normal and protected content. - Commands from multiple "ContextVk" may be written to a single "PrimaryCommandBuffer". - That "PrimaryCommandBuffer" may be randomly submitted to different "VkQueue"s. - As the result - Commands from a single "ContextVk" may be submitted to multiple "VkQueue"s. Fix details: - Created separate "PrimaryCommandBuffer" (lazily allocated) for each "egl::ContextPriority". - Commands with different priorities can't be mixed in a single "PrimaryCommandBuffer". - Therefore - Commands from a single "ContextVk" will be submitted to a single "VkQueue". - No difference for applications that use single "egl::ContextPriority" for all Contexts. Notes: Another problem when resource is used in multiple Contexts with different "VkQueue" (Priority). One solution is to use Semaphores. Another is to enfore same Priority for all Contexts in a Share Group and Default Priority when using EGLImage. This solution was submitted in the previous CL: Vulkan: Enforce ContextPriority in ShareGroup and with EGLImage Below test fails on G996B without this CL. Bug: angleproject:8039 Test: angle_end2end_tests --gtest_filter=MultithreadingTestES3.ContextPriorityMixing* Change-Id: Iaa57826ca55956944f922813fcfac42f1a764dbb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4194183 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov cd901cdd 2023-03-03T17:04:27 Vulkan: Add and use rx::vk::ReleasableResource class. This is a follow up for CL: Vulkan: Enforce ContextPriority in ShareGroup and with EGLImage Bug: angleproject:8039 Change-Id: I9e654557d4a1ce9aee4b04f1211eeb6ae3f0e482 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4306721 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Igor Nazarov b194c21a 2023-02-24T15:41:00 Vulkan: Enforce ContextPriority in ShareGroup and with EGLImage This CL enforces single Context Priority for all Contexts in a Share Group. This is necessary until Vulkan Semaphores will be used to automatically synchronize Resource access between Contexts. Contexts Priority updated when new Contexts is added to the Share Group. New Priority will be the highest among all ever existed Contexts (except if Priority is locked). When Contexts Priority changes, all flushed commands are submitted to the old VkQueue and semaphore is inserted into the new VkQueue. Currently opened RenderPasses and commands will not be flushed. When EGLImage is used in a Context, all Contexts in that Share Group locked (forever) to the Default Priority (Medium). This is done to simplify the implementation and because of the current limitations (lack of mutex protection across Context Share Groups). Notes: - the EGL_CONTEXT_PRIORITY_LEVEL_IMG will report initial priority. - below tests fail on G996B without this CL. Bug: angleproject:8039 Test: angle_end2end_tests --gtest_filter=MultithreadingTestES3.RenderThenSampleDifferentContextPriority* Test: angle_end2end_tests --gtest_filter=MultithreadingTestES3.RenderThenSampleInNewContextWithDifferentPriority* Test: angle_end2end_tests --gtest_filter=MultithreadingTestES3.RenderThenSampleDifferentContextPriorityUsingEGLImage* Change-Id: Ia6a2f0084d39168a58fd7ec33edc90ece9cead05 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4289750 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Roman Lavrov 63a60225 2023-03-09T12:36:57 Ignore VUID-VkGraphicsPipelineCreateInfo-None-06573. Occurring in certain trace tests after vulkan-deps update. Bug: angleproject:8076 Change-Id: I267ff7ff5a41cdcfec44b11893877120d02a89ce Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4324721 Commit-Queue: Roman Lavrov <romanl@google.com> Auto-Submit: Roman Lavrov <romanl@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Roman Lavrov 7ee61366 2023-03-09T16:18:56 Revert "Vulkan: SurfaceVk should only wait for GPU work that uses it" This reverts commit 5b63e1dc1d5e96018d0ad30582265a612d309f3b. Reason for revert: angle_deqp_internal_main_presubmit device lost in android rolls https://anglebug.com/8073 Original change's description: > Vulkan: SurfaceVk should only wait for GPU work that uses it > > Right now when we destroy swapchain, we call mRenderer->finish() to > finish everything, even though the work is unrelated to this surface. > This CL changes it to only wait for ResourceUse of all images in the > swapChain. > > Bug: b/267806287 > Change-Id: I33d136ad50961fbf5fbb200ff0f89f1dbf23585d > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4220723 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Charlie Lao <cclao@google.com> Bug: b/267806287 Bug: angleproject:8073 Change-Id: Id0bfe7be670b7d44ed91e61f2c98a189bd1f214c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4324718 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com>
Amirali Abdolrashidi b0d99f72 2023-02-22T13:48:16 Move the memory tracking classes to new files * Moved the classes, functions, and constants related to memory tracking to MemoryTracking.h and MemoryTracking.cpp. Main classes include the following: * MemoryAllocationTracker * MemoryReport * MemoryAllocationType * MemoryAllocationInfo * MemoryLogSeverity * New static function added in RendererVk to get the Vulkan object type name (GetVulkanObjectTypeName()). Bug: b/262029018 Change-Id: I619001e3c24114c4fe7bf024498338bce146fced Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4284639 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov ac8513fa 2023-03-03T16:10:32 Vulkan: Add and use ScopedQueueSerialIndex helper class. This is a follow up for CL: eb0475c05425d94a4516b708c1c9075e3bc423a7 Vulkan: Cleanup RendererVk::allocateQueueSerialIndex method. Made private "allocateQueueSerialIndex(SerialIndex *)" method and renamed to "allocateQueueSerialIndexImpl" to limit incorrect API usage. Bug: b/267806287 Change-Id: I4d1a9875d454c29f930a5e844161d2a10dc2675b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4306720 Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Roman Lavrov 5331491b 2023-03-06T17:26:30 SYNC-HAZARD-READ-AFTER-WRITE: VkNonDispatchableHandle on x86 Also link to the new bug. Bug: angleproject:8054 Change-Id: I2421d625f64a2530768ea35497a45091a0317025 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4312523 Auto-Submit: Roman Lavrov <romanl@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Roman Lavrov <romanl@google.com>
Charlie Lao 5b63e1dc 2023-02-03T15:14:00 Vulkan: SurfaceVk should only wait for GPU work that uses it Right now when we destroy swapchain, we call mRenderer->finish() to finish everything, even though the work is unrelated to this surface. This CL changes it to only wait for ResourceUse of all images in the swapChain. Bug: b/267806287 Change-Id: I33d136ad50961fbf5fbb200ff0f89f1dbf23585d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4220723 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Roman Lavrov 569a881f 2023-03-06T16:43:18 Make SYNC-HAZARD-READ-AFTER-WRITE case less specific. SYNC_VERTEX_SHADER_SHADER_STORAGE_READ added in https://crrev.com/c/4306772 Different prior_usage in TransformFeedbackTest Bug: angleproject:8054 Change-Id: Ia79fc0edd52dff49255906158a5621d4860d7df5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4313319 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com>
Igor Nazarov 4f87f4e9 2023-03-03T13:19:09 Vulkan: Add useResetCommandBufferBitForSecondaryPools feature. Currently ANGLE does not use "vkResetCommandBuffer()" on Vulkan Secondary Command Buffers. Instead it uses "vkFreeCommandBuffers()" and "vkAllocateCommandBuffers". According to spec, "VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT" is required only for command buffer reset operations. However, some ARM drivers may not free memory in "vkFreeCommandBuffers()" without this flag. Bug: angleproject:8059 Change-Id: Ibfe45bca345dc48484b625c450369d30805cec77 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4306722 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Igor Nazarov 0eea2893 2023-03-03T18:55:21 Vulkan: Use *_POOL_CREATE_TRANSIENT_BIT in OneOffCommandPool Bug: angleproject:8061 Change-Id: Ib1f851e83e681ee369cac8da0ff52cd3951c5749 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4306724 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com>
Roman Lavrov 390fa116 2023-03-06T10:51:24 Suppress another SYNC-HAZARD-READ-AFTER-WRITE case. Starts at: https://github.com/KhronosGroup/Vulkan-ValidationLayers/commit/dd401219bdb982046bb235160c29643c597d6f16 --gtest_filter='MemoryBarrierBufferTest.TransformFeedbackBitWriteThenCapture/ES3_1_Vulkan_SwiftShader*' Bug: angleproject:8054 Change-Id: Ie57665a757c6664a29d351d43fbad9e4743b57f9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4306772 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov fee173f9 2023-01-17T18:45:41 Vulkan: Fix freeing Command Buffers with wrong Pool. Problem: - Multiple Contexts flushes it's commands to the Primary Command buffer; - Secondary Command Buffers from all Contexts end-up in the single "CommandBufferRecycler::mSecondaryCommandBuffersToReset" list; - One of the Contexts submits all these commands, and attaches it's "VkCommandPool" to the "CommandBatch". - This "VkCommandPool" will be used to free "VkCommandBuffer"s from all Contexts and pools. Fix: - Attaching "VkCommandPool" to each "VulkanSecondaryCommandBuffer" instance. - "vkFreeCommandBuffers()" is called from the new "VulkanSecondaryCommandBuffer::free()" method. Bug: angleproject:6100 Change-Id: Ic4d66d8b0f71e5ff06047004ed21428d6dce385b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4300870 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Amirali Abdolrashidi 3aa64876 2023-03-06T04:17:57 Revert "Vulkan: Attempt to fix the tsan complain regarding volk." This reverts commit 62e5870452e1e2d4a55ee1307ada27b101d89dbf. Reason for revert: Suspected to be causing the win-trace bot flakiness (https://anglebug.com/8063) Original change's description: > Vulkan: Attempt to fix the tsan complain regarding volk. > > In certain cases, I am seeing volk function pointer been set while it is > still being accessed. See > https://chromium-swarm.appspot.com/task?id=60b37aa811f8b410. My guess it > is related to some tests configs that end up with RendererVk gets > initialized while other instance is still running. This is attempt to > fix the tsan complain by only load volk function pointer if needed. > > Bug: angleproject:8055 > Change-Id: I5dcc62876bf93a250080de1f8e1b97d2b7570ab8 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4300072 > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> > Commit-Queue: Charlie Lao <cclao@google.com> Bug: angleproject:8055 Change-Id: Ie9fe707113656bcc803aacbf9559671564944b69 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4309928 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Alexey Knyazev 3fed0866 2023-02-22T00:00:00 Implement EXT_texture_mirror_clamp_to_edge Support GL_MIRROR_CLAMP_TO_EDGE_EXT address mode when native support is available. Adjusted validation, sorted switch cases by target enums order. Added new TextureMirrorClampToEdge* end2end tests. Drive-by: fixed texture address computation for integer formats with GL_MIRRORED_REPEAT on D3D11. Fixed: angleproject:7968 Change-Id: Iaf29c8b4b32a7630c2a871f832d171f4bc4e2672 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4289137 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Charlie Lao 31bd0c58 2023-03-01T10:52:30 Vulkan: Do immediate cleanup after finishOneCommandBatch This is follow up for crrev.com/c/4244823. This adds postSubmitCheck in RendererVk::queueSubmitOneOff(). It adds immediate clean up in finishOneCommandBatch and renamed to finishOneCommandBatchAndCleanup. Bug: b/255411748 Change-Id: I1d3dbd7dfe9642f4bc77b17552281a4c7b6c2d69 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4300098 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Charlie Lao 62e58704 2023-03-01T14:46:54 Vulkan: Attempt to fix the tsan complain regarding volk. In certain cases, I am seeing volk function pointer been set while it is still being accessed. See https://chromium-swarm.appspot.com/task?id=60b37aa811f8b410. My guess it is related to some tests configs that end up with RendererVk gets initialized while other instance is still running. This is attempt to fix the tsan complain by only load volk function pointer if needed. Bug: angleproject:8055 Change-Id: I5dcc62876bf93a250080de1f8e1b97d2b7570ab8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4300072 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Igor Nazarov eb0475c0 2023-02-23T22:59:14 Vulkan: Cleanup RendererVk::allocateQueueSerialIndex method. Currently this method makes 2 distinct tasks: - allocates QueueSerialIndex. - gets LastSubmittedSerial. In case of "queueSubmitOneOff()" (and future uses) "LastSubmittedSerial" is not necessary. This produces extra work and makes code more complex. This CL makes two separate functions: angle::Result allocateQueueSerialIndex(SerialIndex *indexOut); angle::Result allocateQueueSerialIndex(QueueSerial *queueSerialOut); The "queueSubmitOneOff()" was simplified. Additionally, fixed possible SerialIndex leak if method fails before "releaseQueueSerialIndex()". Bug: b/267806287 Change-Id: I1dfb91b9f409aa17e8f1de222f7b01345109e6d3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4289749 Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com>
Charlie Lao e180ed5e 2023-02-27T14:40:10 Vulkan: Apply postSubmitCheck to async submission code path postSubmitCheck is doing CPU throttling if we accumulate excessive amount of garbage. There is no good reason this should not apply in async submission. This CL moves the call so that it applies to both cases. Bug: b/255411748 Change-Id: Ib36344dfe9e6f1c0120734302c0d4083073e004c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4295366 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Charlie Lao e88b061c 2023-02-17T13:36:24 Vulkan: Follow up fix and enable asyncCommandBufferReset flag This CL makes any follow up fix for crrev.com/c/4244823 and enables asyncCommandBufferReset feature flag. It changes CommandQueue::checkCompletedCommands only do the check and update mLastCompletedSerials. It makes async command processor thread always call checkCompletedCommands if mNeedCommandsAndGarbageCleanup is true so that we can clean up more garbages. This CL also makes garbage clean up always done in async thread even if asyncCommandBufferReset is disabled. Bug: b/255411748 Change-Id: I1d63aa9f1f565d81780a39c29b919da3dd5a68be Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4264175 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Charlie Lao <cclao@google.com>
Charlie Lao 6d282d62 2023-02-08T16:51:07 Vulkan: Move retireFinishedCommands/garbageCleanup to worker thread This CL separate out the logic of mLastCompletedQueueSerial update and retireFinishedCommands and garbage clean up into different functions. At submission, previously we are always check fence and update mLastCompletedQueueSerials and calling reset on finished commands and do garbage clean up. With this CL, we only do the fence check and update mLastCompletedQueueSerials. Then it request worker thread to do the command buffer reset and garbage cleanup. We uses the CommandProcessor's thread for the reset and cleanup, since async submission path needs to handle this clean up anyway. This CL also added a new feature flag asyncCommandBufferReset and it is disabled right now. This will be enabled in the follow up CL. Bug: b/255411748 Change-Id: I6da558f8d4c962eb038e2378ccc76c464101cde2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4244823 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Charlie Lao <cclao@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Yuly Novikov dd6d8302 2023-02-28T14:24:43 Suppress VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912 New VUID added in https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/5277 Bug: chromium:1420265 Change-Id: I139815fdfd90439c5a2ea79e467a60ba54ecbc0e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4296799 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Roman Lavrov <romanl@google.com>
Amirali Abdolrashidi 2c7447e2 2023-01-19T16:17:39 Always keep track of memory allocation counts * Memory allocation counts are now tracked at all times, similar to allocation sizes. * Changed the per-heap allocation trackers from vectors to arrays of atomic variables. * Added asserts to the getter functions related to memory allocation. * mMemoryAllocationMutex is now used for enabled debug layers only. * Added memory type index in allocation and deallocation debug logs. * Capitalized static functions regarding memory allocation in RendererVk.cpp. Bug: b/262029018 Bug: b/266466279 Change-Id: Idb740048f934f3d725240c78c978341697895f6c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4182550 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Amirali Abdolrashidi 3a7904e1 2023-01-25T23:56:56 Vulkan: Use VMA suballocation for images There is a maximum limit for device memory object allocation. On some platforms, there can be an error regarding too many object allocations when 4096 device memory handles have been allocated. Suballocation can help mitigate this issue. In this CL, some images will be allocated using VMA API calls, which use suballocation. * Added a new feature (useVmaForImageSuballocation). * Added VMA allocation for ImageHelper, which is used in initMemory(). * Suballocation is used for VMA image allocation. * If enabled, mVmaAllocation will be initialized in the ImageHelper object (instead of mDeviceMemory). * It is currently used for all platforms. * Minor change to the name of an arg in CreateBuffer() declaration. * Added test to make sure we can allocate at least 4096 images on supported platforms (8000 in the test). * Skipped the test "NonZeroBaseEmulatedClear" when run on Linux/Intel if this feature is enabled (due to output color mismatch). * Skipped several tests for capture/replay on Windows. Bug: b/218891184 Change-Id: Ibf80c9c8c485b301da7d23b5ba4bcbb1a8e3194f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4191202 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Shahbaz Youssefi 31684d8c 2023-02-18T11:11:57 Vulkan: Lazily create swapchain image views In compliance with VK_SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT. Bug: angleproject:7878 Big: b/269606195 Change-Id: I917c6888b325f768dbc6384828a6e462792d3c0b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4267510 Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Chris Forbes <chrisforbes@google.com>
Shahbaz Youssefi 7d8e2778 2023-02-13T10:04:08 Vulkan: Remove usage of VK_EXT_external_memory_host This extension is no longer used by ANGLE Bug: angleproject:7959 Change-Id: If6c0e89e63b8b06fd03f7b6a0b083a18bada34fe Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4244599 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao e1dfc00a 2023-02-15T16:21:37 Vulkan: Make waitForPendingPresent drain work in the calling thread Since we are waiting, there is no point to have work done in CommandProcessor's worker thread. It can just wait and drain the task in the calling thread. This is consistent with waitForResourceUseToBeSubmitted. This allows us to remove mutex and condition variable from SwapchainStatus. Bug: b/269524271 Change-Id: I9d7e17c77c879b6957fc3b74aab02f7f5c9db052 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4257252 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com>
Charlie Lao 79bfee1c 2023-02-15T15:33:56 Vulkan: Clean up CommandProcessor::queuePresent Right now queuePresent API returns VkResult in two places, via return value and SwapchainStatus structure. This CL makes it only return via SwapchainStatus::lastPresentResult so that two code path are the same. Bug: b/269524271 Change-Id: I7ab3c2bee08961a10718a2e5daa1c7f03e97e85d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4257927 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
Charlie Lao c402ea1c 2023-02-15T12:01:38 Vulkan: Rename hasUnfinishedUse to hasResourceUseFinished Most usage of hasUnfinishedUse is for !hasUnfinishedUse, and there was feedback that negative API is not preferred. This CL changes it to positive API name. Similarly renamed hasUnsubmittedUse to hasResourceUseSubmitted. Bug: b/267348918 Change-Id: Idb10b0f998ec50116ffb6aada19a98a516e87824 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4257105 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 5dba27e0 2023-02-15T10:24:38 Vulkan: CommandProcessor API name clean up This CL is mechanical change only and limited to CommandProcessor class. This CL renames submitCommands to enqueueSubmitCommands, queueSubmitOneOff to enqueueSubmitOneOffCommand, queuePresent to enqueuePresent, flushWaitSemaphores to enqueueFlushWaitSemaphores, flushOutsideRPCommands to enqueueFlushOutsideRPCommands, flushRenderPassCommands to enqueueFlushRenderPassCommands. This CL also renames CommandProcessor::mLastSubmittedSerial to mLastEnqueuedSerials, and getLastSubmittedSerial to getLastEnqueuedSerial, hasUnsubmittedUse to hasResourceUseEnqueued (opposite meaning). Bug: b/267348918 Change-Id: I611889815f5824837dc6e0f547e3cddc595d447b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4255809 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Solti b4116fea 2023-02-17T16:14:27 Disable supportsSwapchainMaintenance1 feature on Android Temporarily disable upportsSwapchainMaintenance1 feature on Android devices to unblock the ANGLE-To-Android roller, while the auto-roller failure investigation is taking place. Bug: b/269606195 Change-Id: I8a122b04996c9f0f02cbaaedcba5c6fb0615e5e3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4264812 Commit-Queue: Solti Ho <solti@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi 5c2a6010 2023-02-13T16:32:58 Vulkan: Fix loading instance extension entry points This change makes sure instance extension entry points are loaded right after the instance is. Previously, this was done after all features are initialized, including device features, but the code that decides the device features was using the instance entry points. Bug: angleproject:7959 Change-Id: I6869f40261eec7a3146c9e0e05b3fc139bc9223a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4247097 Commit-Queue: Ian Elliott <ianelliott@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>