src


Log

Author Commit Date CI Message
Jean-Francois Thibert ceaec322 2024-05-24T11:25:08 Vulkan: use depth stencil bits to check AHB are renderable This resolves an incomplete attachment failure for AHB imported depth buffers. Bug: angleproject:342603523 Change-Id: I16ca0d1bfdab8d542ecf26e5a4e8510171960610 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5570617 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov 9b7d8d6a 2024-05-20T20:39:50 Vulkan: Fix AtomicRefCounted threading issue The `AtomicRefCounted::getAndReleaseRef()` is used to decrement the reference counter and to destroy the object if there are no more uses. Decrement operation must use acquire-release memory ordering, in order to guarantee that all accesses from other threads happened before last thread checks that counter is "1" and destroys the object. Added comments to `releaseRef()` and `isReferenced()`, that these methods do not provide any synchronization, and can not be used to achieve same affect as `getAndReleaseRef()`. Relaxed ordering is kept for performance reasons. Bug: angleproject:8601 Change-Id: I8e5654416383e9490c23bc02fda9664216a81076 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5573394 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Bruno BELANYI d3d96a37 2024-05-24T14:43:12 Add 'angle_always_log_info' option This allows outputting `INFO`-level logs and up, without having to trudge through the mountain of output that gets enabled by `angle_enable_trace`. Bug: angleproject:343190307 Change-Id: I88d4f0b48951f1c7cbdda4fce8ce309a25f43e3c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5569092 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Roman Lavrov a3057eed 2024-05-27T14:48:51 Vulkan: DIRTY_BIT_DESCRIPTOR_SETS in handleDirtyUniformsImpl For consistency between graphics and compute handling Bug: angleproject:7103 Change-Id: If6db0739d2f75d9e8e77bf88a05466e56d165a0a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5574006 Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 71e0038c 2024-05-27T14:50:09 Vulkan: Remove SwiftShader+AsyncCommandQueue tests The AsyncCommandQueue feature is not shipping anywhere, especially not with SwiftShader. Besides, the tests already run Vulkan+AsyncCommandQueue tests. Additionally, SwiftShader still gets exposure to this feature together with the EnableParallelCompileAndLink feature. Bug: angleproject:40644897 Change-Id: I34f0f76ef598f757d3af365777ebb91149b95be3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5574007 Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov 7c5d2b81 2024-05-21T16:22:53 Vulkan: Add WarmUpTaskCommon::mExecutableVk initialization Change is only for safety, because uninitialized member is not used in the current code. Bug: angleproject:8601 Change-Id: I65fa912119bc9c33a6248c5616388bde4d33b223 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5573393 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Le Hoang Quyen 8db2d61a 2024-05-14T00:39:47 Metal: properly handle base/max level for immutable textures. Previously, we treat every texture the same as a non-immutable texture. Every texture has a native mtl::Texture containing mipmap levels from base GL level to max GL level. And base GL level would be mapped to level 0 of the native texture. However, this is not correct for immutable textures, pbuffer or EGLImage bound textures. Such textures have mipmaps pre-allocated either via glTexStorage calls or externally. Base and max GL levels don't affect their allocated mipmap levels, only limit the levels a shader can sample. For example, a texture has 8 levels allocated via glTexStorage. Its base level is set 1, and max level is set to 2. Shaders will only be able to sample from level 1 to level 2 of this texture. However, it's valid to attach level 0 or level > 2 of this texture to an FBO. This CL addresses this bug by separating internal mtl::Texture into two main objects: - A native storage will contain the actual mipmap levels of the texture. FBO attachment or data uploads can refer to a level in this object. - A view of the native storage from base GL level to max GL level. This view will be used in shader sampling and mipmap generations. Bug: angleproject:6447 Bug: angleproject:8355 Bug: b/42265945 Change-Id: I186b69f02e9e40c75830ffe4b48bd5a3c8d49cf2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5531392 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Quyen Le <lehoangquyen@chromium.org> Auto-Submit: Quyen Le <lehoangquyen@chromium.org>
Scott Marcy b793888a 2024-05-09T11:40:18 Deeply nested switch statements -> ambiguous error Improve the error reported (and potentially avoid a stack overflow crash) when parsing deeply nested `switch` statements. Limits the total number of nested switch and/or iterator statements to `mMaxStatementDepth` (defaults to 256). Bug: angleproject:8645 Change-Id: Iba4795db15c3859d172df8366bc7de3125c2d472 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5527630 Auto-Submit: Scott M <mscott@apple.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Alexey Knyazev 59adc191 2024-05-23T00:00:00 Metal: Ensure valid vertex buffer layout stride Metal Validation causes runtime failures if the sum of the vertex buffer binding offset and the related vertex layout stride is greater than the buffer's length. Fixed: angleproject:342350849 Change-Id: I531f092c6130b37cb8b0b89b20804a222160ceb7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5565528 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Quyen Le <lehoangquyen@chromium.org>
Alexey Knyazev 6cf3c96d 2024-05-23T00:00:00 Metal: Handle empty vertex buffers Use the current attribute value when the bound array buffer has no data to avoid Metal Validation errors. Drive-by: do not emit empty client data upload commands. Fixed: angleproject:40050025 Change-Id: I813725322c52bc16ca432f617a40fe7cee24dd6d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5569091 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Quyen Le <lehoangquyen@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Yuxin Hu ad46d67d 2024-05-24T10:19:00 Suppress failing newly added deqp test on S22 Bug: angleproject:341780527 Change-Id: I274493f2b820b9ff007e93cfe41d04af5f3c5e09 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5568654 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Yuly Novikov f3c52204 2024-05-24T16:46:01 Skip antutu_refinery on Linux Intel and AMD Bug: angleproject:342545097 Change-Id: Id4cec570256dbfa13fc406ef31d4e714950f66d8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5570937 Auto-Submit: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Alexey Knyazev 9742351b 2024-05-23T00:00:00 Move ConversionWithNoVertices to WebGL tests Reliably passing the test requires either extra validation or backend support. Bug: angleproject:342419059 Change-Id: Ifd861f292b5d8f0eb63280a182842343078b7e0c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5569094 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi dc470fa1 2024-05-24T12:10:34 HLSL: Initialize uninitialized storage-image-related data Bug: chromium:342464439 Change-Id: I5664177ecd99fbae419bc00a17c0864e43f06776 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5570599 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Yuly Novikov f0cdb3af 2024-05-24T15:14:49 Skip StateChangeTestES3.RasterizerDiscard on Win Intel Bug: angleproject:342557702 Change-Id: Ifd79939f53efdc99ed8ec3784c737da87a13e5e1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5569093 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Auto-Submit: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Alexey Knyazev 6f82959d 2024-05-23T00:00:00 Move OutOfBoundsByteAttribute to WebGL tests Reliably passing the test requires either extra validation or backend support. Bug: angleproject:342419059 Fixed: angleproject:42265239 Change-Id: I29d3fff67a1d15941f18143d30bcb2c940f4e135 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5569089 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 066cde8b 2024-05-23T00:00:00 Move DynamicVertexArrayOffsetOutOfBounds to WebGL tests Reliably passing the test requires either extra validation or backend support. Bug: angleproject:342419059 Change-Id: I0d167a08208888479b7fe17a0343c10667862454 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5565529 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 7b0d26bb 2024-05-23T15:46:34 Vulkan: Disable VkEvent for images due to perf regressions Bug: angleproject:336844257 Change-Id: I5732455a48f449f402dc114e019d1dc91142b59e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5565223 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 98402f33 2024-05-23T10:23:29 Vulkan: Explicitly set SPIR-V version Bug: angleproject:342316794 Change-Id: Ide73e3d8b167a932338419cb9da3ea358058ebeb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5564203 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 0d772ebe 2024-05-21T16:41:41 Vulkan: Cleanup releaseToExternal/acquireFromExternal API This CL addresses some feedback from the earlier CLs. Bug: b/337135577 Change-Id: I90c26a9374254af69bf00eb6580ce9580b71ca5a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5561465 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 3bc4e17f 2024-05-22T16:15:23 Vulkan: Pack familyIndex and queueIndex into single uint16_t Practically these are very small number. So we really don't need a uint32_t for each index. The only trick is that even though these indices are uint32_t, some of predefined values are ~1u/~2u which does not fit uint8_t. In this CL, int8_t is used so that all these values are properly downsized and expanded by compiler without branch. Bug: b/337135577 Change-Id: I45ac8ea14c4d7a6f65cb012df70013050f725583 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5560510 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
ericali 44d98861 2024-05-17T23:55:13 Assertion under IdGen::createNewName. Remove code that tries to workaround double underscores symbols name that would be introduced if user defined symbols contain underscore prefix or suffix. To avoid unexpected clashes case like '_Data' and 'Data'. Bug: b/341206126 Change-Id: I59e72e59bf483c84f5e33a21f7737f82c31c6896 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5545479 Auto-Submit: Erica Li <lerica@apple.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Geoff Lang ccd9a43b 2024-05-22T11:15:39 Split EGL_ANGLE_device_d3d into D3D9 and D3D11 versions. Add EGL_ANGLE_device_d3d9 and EGL_ANGLE_device_d3d11 which make it possible to know what type of device can be queried ahead of time without generating EGL errors. Refactor the DeviceD3D class into Device9 and Device11. Remove the getType method now that it's not needed for internal validation. Keep EGL_ANGLE_device_d3d for backwards compatibility. Bug: angleproject:342096132 Change-Id: Ib950abad58e46a5be269891ea7afd0cb8534cbe8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5559163 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Charlie Lao 602c0edf 2024-04-25T15:08:32 Vulkan: Enable VkEvent for Image barriers This CL actually enables using VkEvent for image barriers. One problem with event is that syncVal is super slow when event is used (it actually slow with VkCmdSetEvent call). which causes a few tests (KHR-GLES3.copy_tex_image_conversions.forbidden.renderbuffer_cubemap_* and asphalt_9) to timeout. These tests did not show signicant overhead with event with VVL disabled, which means the timeout is due to VVL overhead. For now I am disabling syncVal when event is used for image barrier. Since layers are configured before feature bits, a helper function ShouldUseEventForImageBarrier() is introduced to have a central logic enable/disable event. Right ow it just returns true. If we need to disable for a given GPU, we need to pass in proper arguments here while setting up the layers (not sure what exactly will be but will decide when situation comes up). Bug: b/336844257 Change-Id: Iffff8a895e7c767660d327ce9b9e90e6ae0652df Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5492739 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao d27c0f95 2024-05-21T16:27:08 Vulkan: Fix UNASSIGNED-SubmitValidation-WaitEvents-WrongQueue Before this CL, when eventBarrier is used for images, we may see UNASSIGNED-SubmitValidation-WaitEvents-WrongQueue VVL error. What happens is that when context is created with medium priority and image is used, we created VkEvent that was set on medium priority VkQueue. Later on when a new context with higher priority is added to the share group, we upgrade all contexts to high priority and all subsequent commands will be submitted to high priority VkQueue. Now if the image is used and we call VkCmdWaitEvent, we end up waiting on new VkQueue for an event that was set on the old VkQueue. This violates the vulkan spec. With all previous prepartion CLs, now Context and ImageHelper all keeps track of which DeviceQueueIndex it was last used. We can just check the DeviceQueueIndex and fallback to pipelineBarrier if they has changed. When pipelineBarrier is used, the event will be released, and subsequent event will be created on new queue. So this fallback should only occur once for the ImageHelper objects that was experiencing the queue switch. ImageHelper::barrierImpl already checking DeviceQueueIndex changes, so this will automatically works for VkEvent. This CL only needs to add the support for ImageHelper::updateLayoutAndQueue. Bug: b/336844257 Change-Id: Ia3f1caee4f3c8e98dc858d387e93d3b2d6eb8053 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5556443 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Charlie Lao 1a9a703b 2024-05-21T11:14:40 Vulkan: Add DeviceQueueIndex to Context/BufferHelper/ImageHelper This CL adds a utility class DeviceQueueIndex, which encapsulates queueFamilyIndex and the queueIndex into one integer value so that we can pass around to barrier function. vk::Context and BufferHelper and ImageHelper class now keeps mCurrentDeviceQueueIndex instead of mCurrentQueueFamilyIndex. For All contexts by default it gets the default queue from renderer (which is always the one corresponding to Medium priority). For ContextVk, when priority changes it update mCurrentDeviceQueueIndex to match new context priority. Bug: b/337135577 Change-Id: I62cc483cfdb3e974d38db074e671c57299300074 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5555903 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao b22cce5f 2024-05-21T10:55:27 Vulkan: Remove Renderer::getDeviceQueueIndex Renderer::getDeviceQueueIndex() returns queueFamilyIndex. There is a function that already returns mCurrentQueueFamilyIndex, so this function is now removed. This CL also renames ImageHelper::isQueueChangeNeccesary to isQueueFamilyChangeNeccesary Bug: b/337135577 Change-Id: I3cd9ded1414d1389e162aaa5399c231a987f871e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5553067 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 9d124c35 2024-05-21T10:36:27 Vulkan: Store QueueIndex in DeviceQueueMap VkGetDeviceQueue call takes two indices: queueFamilyIndex and queueIndex. Right now DeviceQueueMap only stores queueFamilyIndex. This CL also stores queueIndex in the DeviceQueueMap. In later CL, we are going to expose this queueIndex to vk::Context and vk::ImageHelper along with queueFamilyIndex. In order to do it in a cleaner way, this CL mostly involves cleanup. Previously DeviceQueueMap is a subclass of angle::PackedEnumMap. In this CL, DeviceQueueMap has mQueueAndIndices data member that maps priority to devicePriority/queueIndex/VkQueue. Previously DeviceQueueMap was created in Renderer::createDeviceAndQueue() and then passed to CommandQueue::init(), which copies to mQueueMap. This CL removes the copy. It now calls mQueueMap.initialize() directly from CommandQueue::init(). This CL also cleans up relationship between QueueFamily and DeviceQueueMap. Before this CL, QueueFamily::initializeQueueMap() initialiazes DeviceQueueMap object. After this CL, that logic now moves to DeviceQueueMap::initialize(). QueueFamily no longer modifies DeviceQueueMap class. No functional change is expected. Bug: b/337135577 Change-Id: I3f96fb78aedc89d96d6235b060c88b769bdd1e24 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5553066 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao ea36ed34 2024-05-21T10:03:51 Vulkan: Rename mIndex to mQueueFamilyIndex In preparation for the later CLs that expose the VkQueue index to vk::Context, this CL renames mIndex to mQueueFamilyIndex so that we do not confused what *index* really means. No functional change expected. Bug: b/337135577 Change-Id: I6a089716a9586e9c404ec6c1d557a563dccf927c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5553086 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Roman Lavrov 073b7628 2024-05-21T21:49:37 Revert "Cleanup: replace DirtyObjectType check with constexpr generator" This reverts commit 89caa0e1d99e45f3d6f355f6e14c147f8de3e0e5. Reason for revert: compile errors on gcc and msvc c++17 Original change's description: > Cleanup: replace DirtyObjectType check with constexpr generator > > Static assert was meant to avoid kDirtyObjectHandlers getting out of > sync, but it doesn't achieve that goal as it's just comparing values > with ints which is confusing. > > Replacing with constexpr generated std::array. C++20 allows to easily > validate that all values are set by _not_ default-initializing > `handlers`. C++17 makes it trickier, addeded static_assert on an > additional static constexpr bool (silly but I can't find a more concise > way) > > Bug: angleproject:8666 > Bug: b/335295728 > Change-Id: Idf9bbd087d09d5ba253a7587ce0503cae3fcf3a7 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5478231 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Roman Lavrov <romanl@google.com> Bug: angleproject:8666 Bug: b/335295728 Change-Id: Ie272f09f0e21498848ac3ed6477dabf28aa3da42 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5554615 Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi b8c64f3e 2024-05-21T15:34:26 Fix build on compilers that get confused with templates - part 2 Bug: angleproject:8667 Change-Id: I1db327643f0b16bea5dc59635ac51c2398fdedf6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5554174 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Charlie Lao e5fe13df 2024-05-20T11:03:49 Vulkan: Destroy VkEvent instead of putting into recycler VVL is complaining about SYNC-vkCmdSetEvent-missingbarrier-reset (See https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/8032). I am not sure if the way I did VkCmdResetEvent followed by VkCmdSetEvent is correct either. So destroy VkEvent instead of put it into recycler for now until I sort this out. Bug: b/336844257 Change-Id: I8baf87fa6f6e8c5ed9e2f7e0a29226caa85ebb31 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5549896 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 9ed415e5 2024-05-16T14:28:31 Vulkan: Clean up in ImageHelper::updateLayoutAndBarrier There was a duplicated pipelineBarrier wait in ImageHelper::updateLayoutAndBarrier that possibly come from bad code merge. It is removed in this CL. The check of hasEvent and subsequently call addAdditionalStageAccess has moved out of addMemoryEvent and make its own function so that it only affects the specific case where the image is used in different shader stage in the *same* render pass. Bug: b/336844257 Change-Id: I78b0c952be32124cb0fb6a2cf750df41f6c8259d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5544450 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Roman Lavrov e83dd780 2024-05-21T12:08:38 Skip texture_lod_bias_all on tsan SwS Flaky timeouts at 120s, green builds barely make it https://ci.chromium.org/ui/p/angle/builders/try/linux-tsan-test/12609/overview Bug: b/332383430 Change-Id: I4abde927b3cd42805164de0e0efd97835000ab71 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5554983 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Roman Lavrov <romanl@google.com> Auto-Submit: Roman Lavrov <romanl@google.com>
Shahbaz Youssefi b257da86 2024-05-21T12:04:21 Fix build on compilers that get confused with templates Bug: angleproject:8667 Change-Id: Ie3d35b617ceb5bb6c0e13e0dfda370bbe18d888a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5554982 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Charlie Lao c4d266cc 2024-05-17T15:07:43 Vulkan: Use std::deque for EventBarrierArray::mBarriers Most time mBarriers is small, only ~1.5% time the vector size is greater than 4. So more complicated optimization for it may not worth it. In very rare time it could be over 100. But there is no need for storage to be continuous, so switch to std::deque here so that the overhead for occasionally large barrier array size won't be too bad. Bug: b/336844257 Bug: b/293297177 Change-Id: I79b91128a1a9e460b9687862f00fed51e4258511 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5545884 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Yuxin Hu 6f8b736e 2024-05-20T11:19:55 Manual roll VK-GL-CTS from 13344922ae81 to fd5cc7b1e075 (7 revisions) https://chromium.googlesource.com/external/github.com/KhronosGroup/VK-GL-CTS.git/+log/13344922ae81..fd5cc7b1e075 2024-05-17 marcin.hajder@mobica.com Run clip and cull distance tests on OpenGL ES 2024-05-17 cturner@igalia.com Add coverage for transfer-only copies with multiplanar formats 2024-05-17 lorenzo@khronosgroup.org Merge vk-gl-cts/vulkan-cts-1.3.8 into vk-gl-cts/main 2024-05-16 gleese@broadcom.com Remove 'decor' specialisation in SPIR-V tests 2024-05-16 lorenzo@khronosgroup.org Merge vk-gl-cts/opengl-cts-4.6.4 into vk-gl-cts/main 2024-05-16 lorenzo@khronosgroup.org Merge vk-gl-cts/opengl-es-cts-3.2.10 into vk-gl-cts/main 2024-05-15 lorenzo@khronosgroup.org Merge remote-tracking branch 'vk-gl-cts/dev/VK_NV_raw_access_chains' If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/vk-gl-cts-angle-autoroll Please CC angle-team@google.com,yuxinhu@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: angleproject:341780527 Tbr: yuxinhu@google.com Change-Id: Idddeb19e94307f2313ab572432c547a76e0e7f91 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5547022 Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Yiwei Zhang a00babd8 2024-05-17T20:38:56 Vulkan: disable supportsShaderFramebufferFetchNonCoherent on Android Not just ARM or QC, but also Intel and AMD are impacted. So just disable this for Android as a whole since it's for app compat but not specific to a particular impl. Bug: b/340665604 Test: LIMBO, Diablo Immortal, Real Racing 3, etc are running properly Change-Id: Id11ad4cd541166c9e6c6d84bb09d9c06a175d5a1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5547687 Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Lepton Wu <lepton@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi 519d6d7e 2024-05-15T15:08:54 Vulkan: Remove AMD deqp expectations We no longer test on AMD. These expectations were added when AMD drivers were very old, so they likely don't apply anymore anyway. Bug: angleproject:3586 Bug: angleproject:3588 Bug: angleproject:5276 Bug: angleproject:7415 Change-Id: Ic7e172186abaf034ef28d87dfd40e21b8298e6ae Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5539021 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi c73d0776 2024-05-15T15:07:56 Vulkan: Enable ASTC tests on Nvidia ANGLE emulates ASTC, so we are able to run these tests fine. Bug: angleproject:6441 Change-Id: I641a729db5c00d203c857710b17754161251d785 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5539020 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Charlie Lao b4562086 2024-05-16T12:22:47 Vulkan: Remove std::vector from EventBarrier::mEvents mEvents and mImageMemoryBarriers field of EventBarrier never being more than 1. This CL removes std::vector and just store the handle. Similarly max count for mImageMemoryBarriers is 1, so std::vector also removed. mImageMemoryBarrierCount added (which can be either 0 or 1) to indicate if mImageMemoryBarrier is valid or nullptr should be send to VK driver. Bug: b/336844257 Change-Id: Ib367c649d3a9d790c5e15d4129cde6673bca6cae Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5545883 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Charlie Lao 7cbac5de 2024-05-16T10:01:41 Vulkan: Switch RefCountedEventCollector to use std::deque Right now it is using std::vector. The vector could potentially grow big. The grow is costly with vector when storage has to resize. This CL switches it to use std::deque. Bug: b/293297177 Bug: b/336844257 Change-Id: Ia407e7d4e1b68bd0cb7cf76ccc5e7523c0e83415 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5545882 Reviewed-by: Roman Lavrov <romanl@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao f82d812d 2024-05-16T15:46:05 Vulkan: Fix EventBarrier bug when asyncSubmission is enabled Since we have moved RefCountedEvent garbage collection into ShareGroupVk, we have changed the reference counting to use non-atomic. There is a bug with async submission code path where the executeSetEvents gets called from submission thread which does not have share group lock. This CL fixes this bug by storing VkEvent in RenderPassCommandBufferHelper so that executeSetEvents uses VkEvent instead of RefCountedEvent when async submission is enabled. This CL also adds assertion that RefCountedEvent::releaseImpl does not get called from async submission thread. Bug: b/336844257 Change-Id: Ifcbd5a09d2bc7636cc15b2c6728dbbca103d4d9c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5544449 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 2d0e92ee 2024-05-16T09:36:44 Vulkan: Let Recycler class use std::deque instead of vector Vector is expensive when storage has to be expanded. The Recycler only use the storage as a stack operation, there is no requirements of storage being continuous, thus deque works perfectly. Bug: b/293297177 Change-Id: I89f02b4a7e7f356942bb6606e3d38dcbdcc8bb4d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5545881 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Roman Lavrov <romanl@google.com>
Yuly Novikov b71fe1c5 2024-05-16T15:10:09 Flatten vulkan-deps. Sub-repos will be now checked out in third_party directly, instead of under third_party/vulkan-deps. Bug: chromium:341002187 Change-Id: Ia1c10ce5e7865c164b29bdcabb6ab8a7e4ae35b7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5545577 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi 7ac85733 2024-05-15T15:06:31 Vulkan: Enable advanced blend emulation on Intel/Linux Only Intel/windows drivers miss the required functionality. Bug: angleproject:3586 Change-Id: I53eeb100c7ac7ee469e0bb35c19ae42d21f79ed2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5539019 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi b1267bf3 2024-05-15T15:05:10 Skip concurrent ResourceMap tests in Chromium Chromium builds ANGLE with locking disabled because it ensures concurrent access doesn't happen. So testing that concurrent access works in unit tests is meaningless in those builds. Bug: angleproject:8667 Change-Id: I30f36ed72d64303a590afd727bbe9875d06b3d96 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5539018 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Charlie Lao 8884cf06 2024-05-09T11:21:38 Vulkan: Use QueueSerial to track RefCountedEvent garbage RefCountedEvent garbage are only used on one command buffer, so it is a single QueueSerial is enough to track it. Bug: b/336844257 Change-Id: Icafeee722fe19f41dd863a2e6aca6ddd981d28a4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5529952 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 4629bf6c 2024-05-08T17:43:59 Vulkan: Move RefCountedEvent GC and recycler to ShareGroupVk (3/3) With previous CLs, RefCountedEvents are increment/decrement only within contexts in the same ShareGroup, thus we no longer needs atomic operation. This CL switchs RefCountedEvent to use RefCounted instead of AtomicRefCounted. Bug: b/336844257 Change-Id: Ic5aa9b0f28b8f817f820f595d3de945ce37dbd0e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5527617 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Amirali Abdolrashidi 44db69ab 2024-05-06T17:12:17 Add Qualcomm version with fixed CmdClearAttachment * Added QualcommDriverVersion (angle::VersionTriple) to make comparing versions more clear. * Added ParseGenericVulkanDriverVersion() to parse the version of drivers using the generic Vulkan format. * Updated the condition for the following feature to no longer apply to more recent drivers. * preferDrawClearOverVkCmdClearAttachments Bug: b/339054824 Change-Id: I0016c6c19ef1606b7c9475d684d98134494d8524 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5514933 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Charlie Lao 0636b509 2024-05-06T12:36:20 Vulkan: Move RefCountedEvent GC and recycler to ShareGroupVk (2/3) One of the problem we had with RefCountedEvents is CPU overhead comes with it, and some part of the CPU overhead is due to atomic reference counting. The RefCountedEvents are only used by ImageHelper and ImageHelpers are per share group, so they are already protected by front end context share lock. The only reason we needs atomic here is due to garbage cleanup, which runs in separate thread and will decrement the refCount. The idea is to move that garbage list from RendererVk to ShareGroupVk so that access of RefCountedEvents are all protected already, thus we can remove the use of atomic. The down side with this approach is that a share group will hold onto its event garbage and not available for other context to reuse. But VkEvents are expected to be very light weighted objects, so that should be acceptable. This is the second CL in the series. In this CL, we added RefCountedEventsGarbageRecycler to the ShareGroupVk which is responsible to garbage collect and recycle RefCountedEvent. Since most of ImageHelper code have only access to Context argument, for convenience we also stored the RefCountedEventsGarbageRecycler pointer in the vk::Context for easy access. vk::Context argument is also passed to RefCounteEvent::init and release function so that it has access to the recycler. The garbage collection happens when RefCountedEvent is needed. The per renderer recycler is still kept to hold the RefCounteEvents that gets released from ShareGroupVk or when it is released without access to context information. Bug: b/336844257 Change-Id: I36fe5d1c8dacdbe35bb2d380f94a32b9b72bbaa5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5529951 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Charlie Lao 2e0aefe9 2024-05-06T11:03:19 Vulkan: Move RefCountedEvent GC and recycler to ShareGroupVk (1/3) One of the problem we had with RefCountedEvents is CPU overhead comes with it, and some part of the CPU overhead is due to atomic reference counting. The RefCountedEvents are only used by ImageHelper and ImageHelpers are per share group, so they are already protected by front end context share lock. The only reason we needs atomic here is due to garbage cleanup, which runs in separate thread and will decrement the refCount. The idea is to move that garbage list from RendererVk to ShareGroupVk so that access of RefCountedEvents are all protected already, thus we can remove the use of atomic. The down side with this approach is that a share group will hold onto its event garbage and not available for other context to reuse. But VkEvents are expected to be very light weighted objects, so that should be acceptable (If not, we can add some limit to the number of events it can hold in the garbage list). This is the first CL in the series. Before this CL, the RefCounteEvents are garbage collected at flushToPrimrary time, at which time we have lost ContextVk information. In order for us to do garbage collect to ShareGroupVk, we need to move the garbage collection process early, before command buffers leaving ContextVk's visibility. For OutsideRenderPassCommands, this is easy to do, we just call flushSetEvents before we call mRenderer->flushRenderPassCommands. For RenderPassCommands, that flushSetEvents call will simply make another copy of RefCountedEvents and add to the garbage list and the actual VkCmdSetEvents are defered at the executeSetEvents call that get called from flushToPrimrary time. Bug: b/336844257 Change-Id: I1948cd8240ff61d407931083b7584a54b1dc6b0d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5517891 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi e547126a 2024-05-15T13:46:10 Disable ResourceMapTest.ConcurrentAccessLargeIds ... until I figure out why it's failing on some bots. Bug: angleproject:8667 Change-Id: I4399739b257a8e49da0d94ed162f472ed84c41c7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5539016 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang d0bdec30 2024-05-13T18:11:17 EGL: Handle null resultOut for sync tail call destruction Syncs can be destroyed during eglDestroySync or as part of display destruction. During display distruction there is no result so swallow any errors. Bug: angleproject:8434 Change-Id: I172d268c91fd0d6ba534eceff8914f9c719bdf39 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5533777 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 5332ab8c 2024-05-10T19:48:34 Vulkan: Add RefCountedEventRecycler to vk::Renderer This CL adds event recycler in vk::Renderer to avoid the constant create and destroy of VkEvents. When RefCountedEvent is destroyed previously, it now goes into per renderer recycler. When RefCountedEvent is created previously, it now dips into this recycler and fetch it. Before we issue VkCmdSetEvent, if this event was from recycler, we also issue VkCmdResetEvent before VkCmdSetEvebt. When glFinish/EGLSwapBuffer is called or context gets destroyed, this recycler is purged to keep the free count under limit. Bug: b/336844257 Change-Id: I92ec1b183f708112a96c3d06fcfa265024f5aa04 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5519174 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Alexey Knyazev 0ac0603e 2024-05-14T00:00:00 Fold nested std::max calls When a maximum of three values is needed, an initializer list with all three values is more readable than two std::max calls. Fixed: angleproject:8695 Change-Id: I073ea1af07b215610c85981eea03f6e73107bce6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5541974 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev b98b2c34 2024-05-14T00:00:00 Minor TextureState::getEnabledLevelCount cleanup The return value of TextureState::getMipmapMaxLevel() is by definition less than or equal to the return value of TextureState::getEffectiveMaxLevel(). Bug: None Change-Id: I5cea291bb786adb698f0c66435ac09b2e40221c4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5541970 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
angle-autoroll 1409a05a 2024-05-14T08:01:10 Manual roll VK-GL-CTS to 13344922ae81 (14 revisions) Added new test files to gni and skipped BGRA and SwS failures glcUniformBlockNegativeTests.cpp/hpp glcBufferObjectsTests.cpp/hpp https://chromium.googlesource.com/external/github.com/KhronosGroup/VK-GL-CTS.git/+log/9d7b4c3d5533..13344922ae81 2024-05-10 marcin.hajder@mobica.com Port KC-CTS tests to VK-GL-CTS (buffer_objects), PART 5 2024-05-10 lorenzo@khronosgroup.org Merge vk-gl-cts/opengl-es-cts-3.2.10 into vk-gl-cts/main 2024-05-09 cturner@igalia.com Add consistency checks for video format query interactions 2024-05-09 rgarcia@igalia.com Check pipeline libraries are supported if RT pipelines are 2024-05-09 rgarcia@igalia.com QPA image viewer improvements 2024-05-09 eric@igalia.com scripts/ctsbuild: fix backslash escapes 2024-05-09 russellc@nvidia.com Reduce host memory in VK_EXT_host_image_copy tests 2024-05-09 scerveau@igalia.com EncodeTests: use the correct align for bitStreamBufferOffset 2024-05-09 javed@igalia.com Fix mesh shader to avoid reading output variables. 2024-05-09 marcin.hajder@mobica.com Port KC-CTS tests to VK-GL-CTS (uniform_buffer_object_structure_declaration), PART 6 2024-05-09 rgarcia@igalia.com Add test for scalarized flat saturation 2024-05-09 lorenzo@khronosgroup.org Merge vk-gl-cts/vulkan-cts-1.3.8 into vk-gl-cts/main 2024-05-08 nathaniel@lunarg.com Fixup some VK_EXT_debug_utils references 2024-05-08 erik.faye-lund@collabora.com Test BGRA when supported If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/vk-gl-cts-angle-autoroll Please CC angle-team@google.com,romanl@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: angleproject:8692 Bug: angleproject:8693 Tbr: romanl@google.com Change-Id: Idc2ad8d21825754ee58a7e27ce6f21f20fe5d637 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5536541 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Roman Lavrov <romanl@google.com>
Shahbaz Youssefi f4140c76 2024-05-10T16:56:13 Remove share group lock from glBindBuffer This is a very hot function. Removing the share group lock from this function improves the driver_overhead_2 execution time by ~1ms on Pixel 6. Bug: angleproject:8667 Change-Id: I9ea04f48aa1d2d0efec21407374393e88a1316e3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5533081 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 49317d73 2024-05-10T16:11:59 Prepare resource map for being potentially thread-safe Resource maps are used for both shared and context-private resources. Context-private resource maps do not need any locking. Once glBind* and similar commands are made free of the share group lock, the resource map of the corresponding type must be made thread safe, especially for look up. This change adds the ability to the resource map to be either thread safe or not, based on the type of the resource it contains. Currently, only a test type (unsigned int) is thread safe (used in unit tests). This is achieved by a combination of the following: - For resource maps that need a lock, the flat part of the map has an initially reasonable size, but is _never_ reallocated. This makes access to that part of the map lockfree. - The hash-map that contains large ids is always protected by a mutex. Follow up changes will start enabling thread-safety for resources as their corresponding glBind command is made lockless. Bug: angleproject:8667 Change-Id: Ia4ffffee41f021d833d31f296bc883bf12f1135f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5527771 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang cbeaebf1 2024-05-13T17:53:25 eglCreateContext: always fail for invalid versions Since error generation can be disabled in EGL, it's not always possible for a client to detect if a context client version is valid. Always validate the context version after resolving backwards compatible versions so that the application can handle unsupported versions. Bug: chromium:339948886 Change-Id: I438fa1fcf5160a491f2b996797c29c69b1ab71b4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5533776 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi a1665d2f 2024-05-10T00:15:31 Reland "Document thread-unsafe iterator access to resource maps" This is a reland of commit d1bb6ed8399dd12e79484f30f9e9ded95c25625a The crash was due to another issue (disabling EGL validation in Chrome) Original change's description: > Document thread-unsafe iterator access to resource maps > > By using a proxy type, everywhere resource maps are iterated are clearly > marked as not being thread safe. In most cases, only destruction and > capture/replay iterate over these maps, which means thread safety is not > an issue (or is externally enforced). > > The only case where iterators are used in the presence of other contexts > is with ANGLE_request_extension, which is changed to explicitly require > the application to ensure thread safety. In practice, the user is > Chrome which already guarantees this. > > Bug: angleproject:8667 > Change-Id: I7af13c6433b6955d9c36f9088b3aa4c065e1cfc1 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5526428 > Reviewed-by: Charlie Lao <cclao@google.com> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> Bug: angleproject:8667 Change-Id: Id539cabac01df5f242150f6684222577003eef3f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5531278 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Charlie Lao df2e7bd7 2024-05-10T19:48:34 Vulkan: Handle the case that VkEvent failed to create. If VkEvent failed to create, we can still fall back to pipeline barrier. This CL changes RefCountedEvent::init to return boolean. Also when it fail, this CL did an immediate garbage clean up in case it will free up more event from garbage list and then retry again. Bug: b/336844257 Change-Id: I28251849a92d1785701c55eb028a8fed63cfc372 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5532869 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Roman Lavrov 3b470cf5 2024-05-13T12:43:25 Move PPO executables to ProgramExecutable This will allow to recursively deal with PPO uniforms Bug: angleproject:8666 Bug: b/335295728 Change-Id: Iadc2d009937fb5e8a39b070674ef5d67c9f0fb19 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5532715 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Roman Lavrov <romanl@google.com>
Le Hoang Quyen 0044f4d1 2024-05-13T00:29:30 Metal: fix IOSurface's render targets invalidated by max level change. This CL fixes a bug in the following tricky situation: - Client binds an IOSurface to a texture. - Previously this would internally intialize the texture's max level to the default value 1000. - Client changes the texture's max level to 0. - Client attachs the texture to FBO 1. - Client binds FBO 1 and clear it. - This triggers TextureMtl::getAttachmentRenderTarget() that initializes the RenderTargetMtl of the texture. - Client binds FBO 0 and sample the texture. - Previously this could trigger TextureMtl::onBaseMaxLevelsChanged() which would invalidate the texture's RenderTargetMtl. - Client binds FBO 1. - Client blits FBO 0 to FBO 1. - This will set DIRTY_BIT_COLOR_BUFFER_CONTENTS_0 in FBO 1. - Client calls glFlush to restart render command encoder. - Client issues a draw call. - DIRTY_BIT_COLOR_BUFFER_CONTENTS_0 would cause FrameBufferMtl to re-initialize RenderPassDesc from invalid RenderTargetMtl. - A new render encoder would be created from the invalid RenderPassDesc. - the draw call would be encoded to a render command encoder without any valid color attachment. The fix in this CL is that when we bind an IOSurface to a texture, the texture's max level will be automatically set to 0. This will avoid its RenderTargetMtl from being invalidated if users explicitly change the max level to 0 in future. Note: this is not a foolproof fix for every scenario concerning the base/max level in IOSurface bound/or immutable textures. We will fix them in future CLs. Bug: b/335353385 Change-Id: I3a2da6991764f22393178f40c1d7bbe60503cba4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5531388 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Alexey Knyazev 82ddb33b 2024-05-10T00:00:00 Metal: Do not separate vector and matrix constants Do not create temporary variables for already folded constant vector and matrix values. This reduces register usage and partially fixes MSL compilation errors caused by matrices present in constant initializers. Bug: angleproject:8691 Change-Id: Iedfabadd9b7bcb2e6e1e08a5ad39f48305365747 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5533925 Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 4e887491 2024-05-11T18:08:03 Revert "Document thread-unsafe iterator access to resource maps" This reverts commit d1bb6ed8399dd12e79484f30f9e9ded95c25625a. Reason for revert: Checking to see if it's the reason for crbug.com/339948886 Original change's description: > Document thread-unsafe iterator access to resource maps > > By using a proxy type, everywhere resource maps are iterated are clearly > marked as not being thread safe. In most cases, only destruction and > capture/replay iterate over these maps, which means thread safety is not > an issue (or is externally enforced). > > The only case where iterators are used in the presence of other contexts > is with ANGLE_request_extension, which is changed to explicitly require > the application to ensure thread safety. In practice, the user is > Chrome which already guarantees this. > > Bug: angleproject:8667 > Change-Id: I7af13c6433b6955d9c36f9088b3aa4c065e1cfc1 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5526428 > Reviewed-by: Charlie Lao <cclao@google.com> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> Bug: angleproject:8667 Change-Id: I1245c9e57dfeb27a7f0e5718b1455614c70bc0dc No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5532187 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi d1bb6ed8 2024-05-10T00:15:31 Document thread-unsafe iterator access to resource maps By using a proxy type, everywhere resource maps are iterated are clearly marked as not being thread safe. In most cases, only destruction and capture/replay iterate over these maps, which means thread safety is not an issue (or is externally enforced). The only case where iterators are used in the presence of other contexts is with ANGLE_request_extension, which is changed to explicitly require the application to ensure thread safety. In practice, the user is Chrome which already guarantees this. Bug: angleproject:8667 Change-Id: I7af13c6433b6955d9c36f9088b3aa4c065e1cfc1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5526428 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 4cacc66e 2024-05-09T16:08:58 Remove unused ResourceMap::find Bug: angleproject:8667 Change-Id: I0d0c00337895b247a1f0536f5072fdcf12b7de1e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5527560 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Mohan Maiya 1202055c 2024-05-09T11:25:38 Vulkan: Updates to perf counters 1. don't reset pipeline cache hit / miss counters after every frame 2. bugfix in LinkTaskVk::getResult(...) 3. accumulate counters in WarmUpTaskCommon::getResultImpl(...) Bug: angleproject:8297 Change-Id: I39d7e1a438d78e2e353c5cf8246fb24fb3cfefea Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5529942 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Geoff Lang 394e8767 2024-05-08T15:18:37 WebGPU: Fix accumulating mCurrentColorAttachments. mCurrentColorAttachments was not being cleared so multiple clear operations would have incorrect color attachments. Comparing against the previous RenderPassDescriptor also compared the same color attachment memory since the same scratch buffer was used to generate the new descriptor. Bug: angleproject:8582 Change-Id: I9026007607941b92856728b421bc43812195ca57 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5526978 Reviewed-by: Matthew Denton <mpdenton@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org>
Geoff Lang a70ef7fc 2024-04-25T14:19:50 Add EGL_ANGLE_no_error for disabling EGL validation. Chrome makes many small EGL calls that can have proportionally expensive validation. Bug: angleproject:8434 Change-Id: I4f4d0e6eff64839f76a0f7bf48e5c94b8df9d809 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5491459 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Scott Marcy 2ecfc5a1 2024-05-03T18:29:12 Issue 8644: Deeply nested iterator declarations can crash Avoid stack overflow crash when parsing nested iterators (especially `while` statements). Limits the number of nested iterator statements to `mMaxStatementDepth` (defaults to 256). Bug: angleproject:8644 Change-Id: I9b0fd2ab456c3cdd731b41ab97f495ae4dc0b0bb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5519169 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Auto-Submit: Scott M <mscott@apple.com>
Liza Burakova 36cd4c1f 2024-05-08T12:27:22 Adding basic readPixels. This change adds to methods in ImageHelper to read texture data. It also implements FramebufferWgpu::readPixels to get the parameters and read the texture data from an ImageHelper that's stored in mRenderTargetCache. Bug: angleproject:8653 Change-Id: I349ed8a0ae3d8d0e187c658f3402c4f8cac23eb8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5441353 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Liza Burakova <liza@chromium.org> Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Cody Northrop 6a6192c8 2024-05-08T08:42:24 Tests: Add native to EGLPrintEGLinfoTest For comparisons, it is useful to run the EGLPrintEGLinfoTest against native drivers. Test: angle_end2end_tests --gtest_filter=EGLPrintEGLinfoTest.*/ES3_2_EGL Bug: b/337554150 Change-Id: If7c94296fbbd9f3057449d54581f334a37e59216 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5525656 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang 071e1e83 2024-05-08T10:33:49 EGL: eglCreateSyncKHR uses a return value for the tail call eglCreateSyncKHR was duplicated in two lists for using a tail call and needing a return value tail call. Bug: angleproject:8434, chromium:338902974 Change-Id: I9dffeaec3468e4ea3f5ed7d885e9ef418e8d8da5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5525854 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Brian Sheedy 1dc83614 2024-05-07T14:54:06 Suppress experimental Linux/Intel failure Adds a test skip for a flaky test that was accidentally omitted when enabling the Linux/Intel experiment. Bug: angleproject:8683 Change-Id: I28dea9cb9617f5b8e4cb26d4626a5472608ac398 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5523916 Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: Brian Sheedy <bsheedy@chromium.org> Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Liza Burakova 1d0ef518 2024-05-07T16:56:43 Fixing glClear tests. This CL makes a few changes to fix up the basic glClear test RGBA8Framebuffer, as well as adding a test that uploads a texture before clearing a RGBA8 framebuffer. It moves the wgpu::RenderPassDescriptor(RPD), as well as helper methods for comparing RPDs from the context to the framebuffer. The color attachments that are created in when FramebufferWgpu::clear is called are also stored in the framebuffer now as well. This CL also changes texture creation to use the RGBA8Unorm format instead of RGBA8Uint format. It also adds the wgpu viewFormats parameter to an ImageHelper. Future formats support is still TBD. Bug: angleproject:8582 Change-Id: Idfc4182eb4d6de8a771f2f91d337564ee71df010 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5503549 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Matthew Denton <mpdenton@chromium.org> Commit-Queue: Liza Burakova <liza@chromium.org>
Shahbaz Youssefi e29d643e 2024-05-07T13:40:18 Vulkan: Fix missing per-present-mode query ... if VK_EXT_surface_maintenance1 is supported but VK_EXT_swapchain_maintenance1 isn't. The code mistakenly made the appropriate query conditional to the presence of swapchain_maint1 instead of surface_maint1. On devices where surface_maint1 was available but swapchain_maint1 wasn't, this caused a VVL error that is now fixed. Bug: angleproject:8680 Change-Id: Ide9a87f0e50887572f693d741d5476361320ea19 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5522756 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 3d04180c 2024-05-02T17:30:02 Vulkan: Add a dedicated garbage list for RefCountedEvents Previously each individual RefCountedEvent is wrapped into a GarbageObject. That is the reason behind RefCountedEvent being a subclass from WrappedObject, since vk::GetGarbage call requires garbage object is a subclass of WrappedObject. This CL adds a new garbage list dedicated for RefCountedEvents, named mRefCountedEventGarbageList. With this new change, we no longer limited by the vk::GetGarbage requirements since it no longer called for RefCountedEvents. RefCountedEventCollector is a vector of RefCountedEvents and every time a RefCountedEvent needs to be released, it adds into the collector. Then the event collector entire thing is treated like a garbage object and gets ResourceUse tracked and added into mRefCountedEventGarbageList. This list gets walked and cleaned when GPU is completed. This CL is also a preparation for later CLs that adds event recycle support. Bug: b/336844257 Change-Id: I4eff69b66922dfe5521b6994f240e967ff3726bd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5516458 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Charlie Lao 5b9e7f20 2024-05-06T14:50:44 Vulkan: Release mCurrentEvent before oneOff surface image copy In ImageHelper::copySurfaceImageToBuffer and ImageHelper::copyBufferToSurfaceImage, which get called from lockSurface, we are doing a one off submission to do the data copy between image and buffer. Surface image may have a current event set earlier, but we do not have a garbage collector to collect it. This will crash in barrierImpl when we try to add mCurrentEvent to the garbage collector. This CL releases mCurrentEvent so that it will fall back to pipelineBarrier. Since this is not on performance critical code path, the impact should be acceptable as well. Bug: b/336844257 Change-Id: Ib85c3038657a1845e86286cdb5f52247c2b9eb73 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5519173 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Le Hoang Quyen f3089d1d 2024-05-07T00:14:53 Metal: fix UBO data update undetected between draw calls. This CL fixes an issue where an UBO was updated between two draw calls. This would internally allocate a new metal buffer however ContextMtl didn't know that hence it didn't rebind with new buffers. Bug: b/338348430 Change-Id: I3d8ce22921811e49ae1b8016ae4a20d770f6f372 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5515858 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Mohan Maiya 62eb8fbe 2024-05-06T07:22:15 Vulkan: Switch to using zlib::crc32_z for CRC generation A CRC is generated to validate blobs that are compressed / decompressed. There was a custom CRC generator being used, switch over to using zlib's crc32_z(...) Also increment kPipelineCacheVersion's version since both the header and structure have been updated. Data collected with dEQP test suite - 1. egl size of blob - 74022 bytes ComputeCRC16 - 0.001683 sec zlib::crc32_z - 0.000008 sec 2. gles2 size of blob - 8709119 bytes ComputeCRC16 - 0.130268 sec zlib::crc32_z - 0.000625 sec 3. gles3 size of blob - 20308078 bytes ComputeCRC16 - 0.433155 sec zlib::crc32_z - 0.002547 sec 4. gles31 size of blob - 11041841 bytes ComputeCRC16 - 0.192512 sec zlib::crc32_z - 0.000452 sec Bug: angleproject:4722 Change-Id: Iaa7026c9c8a748b446ef2320e584a2937336c7b4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5518595 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Shahbaz Youssefi c3a1cae4 2024-04-15T14:58:55 Use angle::SimpleMutex everywhere in libGLESv2 Only cases left that use std::mutex are: - Share group and the context ErrorSet mutexes as they need try_lock() - Anywhere mutexes are used in conjunction with std::condition_variables (as they explicitly require std::mutex) Bug: angleproject:8667 Change-Id: Ib6d68938b0886f9e7c43e023162557990ecfb300 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5453294 Reviewed-by: Roman Lavrov <romanl@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Le Hoang Quyen a951e0e0 2024-05-05T23:29:33 Metal: add test for active blit/compute & render encoder mistracking. The bug was already fixed but we need to add the test to avoid the issue from resurfacing in future. Bug: angleproject:8685 Change-Id: Ia10c0954ef39b20b1d891389b7e7a1c81cdc758d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5514529 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Mohan Maiya 58742dfb 2024-05-05T12:46:11 Use trim() instead of resize() ... when decompressing a blob, this prevents a reallocation and copy. Bug: angleproject:4722 Change-Id: Iedc20cb9a41feb754c7f48188e01ab73c5c03c15 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5517530 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Le Hoang Quyen 251067ed 2024-05-03T22:36:11 Metal: don't break render pass when uploading a texture. Bug: b/337214693 Change-Id: Ib2dc77c364a72f2973cbc3882f6125bffbc0a11b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5514948 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Le Hoang Quyen 9ccb9b41 2024-05-03T22:23:03 Metal: fix incorrect tracking if blit & render encoder coexist Currently mtl::CommandBuffer tracks only one active command encoder. However this tracking is wrong if a blit/compute encoder is created without ending the current render encoder. Blit/compute and render encoders are allowed to coexist because the actual rendering encoding is deferred. The bug would happen for e.g. if: - There is an active render encoder. - ContextMtl::getBlitCommandEncoderWithoutEndingRenderEncoder() is called. - In this case, active encoder will be set to the blit encoder. - Later when blit encoder is ended, tracked active encoder would be set to null even though it should be the render encoder. This CL fixes the bug by tracking separate active blit/compute & render encoders. Bug: angleproject:7643 Bug: angleproject:8685 Change-Id: I9893402ecd4c0388aa0153acdb2be04315563086 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5514184 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Charlie Lao 28d4c3eb 2024-05-03T13:00:03 Vulkan: Remove BarrierType argument from ImageHelper::barrierImpl Originally I passed the barrierType argument into barrierImpl function to force pipelineBArrier in a few edge cases. Notably when we do a oneoff submission. In that case if we have an event that is pending setEvent call, and we will end up inserting a waitEvent call on an event that has not yet set, which is bad. But this really won't not happen. This CL removed BarrierType from the API and added a few assertions in the caller to ensure we do not have a valid event when doing a oneoff submission (if there is a pending setEvent, mCurrentEvent will be valid). Bug: b/336844257 Change-Id: I7161b844fc1f36993cf7ff6c90a070d9f92930cc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5512878 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao ef8d9f10 2024-05-01T11:52:04 Vulkan: Use DEVICE_ONLY VkEvent when available VK_KHR_synchronization2 adds device only event. Since we are not using host operations on the event, this CL adds VK_EVENT_CREATE_DEVICE_ONLY_BIT_KHR bit when create VkEvent for RefCountedEvent. Bug: b/336844257 Change-Id: I0528b7f45b0da162daa228aea2adf5ce06b5fd6b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5503644 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 5eb3bca0 2024-05-01T11:47:34 Vulkan: Minor cleanup Bug: b/336844257 Change-Id: I8d93c6dd814a666debf9990d151cad79c45469f1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5503645 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Mohan Maiya 4880a6c2 2024-05-03T14:43:20 Enhance VulkanPerformanceCounterTest coverage Enable additional config with PadBuffersToMaxVertexAttribStride feature Bug: b/271915956 Change-Id: I5fe27781fc51cdf477d5c2f453ad05a211788739 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5512875 Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao d30e4772 2024-02-02T14:13:33 Vulkan: Add VkCmdWaitEvents for image barriers This CL add EventBarrierArray (sister class of PipelineBarrierArray) that accumulates the event barriers instead of pipeline barriers. ImageHelper::barrierImpl and ImageHelper::updateLayoutAndBarrier has been updated to have a code path that inserts waiting event to EventBarrierArray. PipelineBarrier code path is still kept and is also used when event is invalid or under certain situation as a fallback method from waitEvent. After we generate barrier (regardless it is pipelineBarrier or eventBarrier, we always release ImageHelper::mCurrentEvent. When next barrier/layout call is made, if we see mCurrentEvent is invalid, we always fallback to pipelineBarrier. This way it is safe that if somehow we did not (intentionally or accidentally) insert a new event between two barrier calls, we will not end up with second barrier call wait for old event which creates synchronization hazard. With this approach, second barrier will use pipelineBarrier which is still safe. In this CL the useVkEventForImageBarrier feature flag is still disabled, so no events are created and thus pipelineBarrier is still used. Bug: b/336844257 Change-Id: Idaf5a7200b85f901eae5d376543f189d21522022 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5263701 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Liza Burakova ead98ed9 2024-05-02T14:04:14 Implement basic texture upload. This change modifies ImageHelper's methods to upload textures to fix webgpu API calls, as well as fully implements uploading texture data via TextureWgpu::setImage for RGBA8 formats. Bug: angleproject:8457 Change-Id: I1c5be3d79ad996a709086ca7157cca6229a336ce Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5398002 Reviewed-by: Matthew Denton <mpdenton@chromium.org> Commit-Queue: Liza Burakova <liza@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 81c2b6e7 2024-05-03T08:12:18 Vulkan: Account for padBuffersToMaxVertexAttribStride ... in BufferVk::shouldRedefineStorage. For vendors that require additional padding, redefine storage iff the padded size is greater than existing buffer size. Bug: b/271915956 Change-Id: I2acf2bb32f85b71bcfdba6919974dd2922ee787b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5512870 Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Mohan Maiya 9aa6d3da 2024-04-26T11:34:10 Add trim support to MemoryBuffer There are usecases where we need a MemoryBuffer to be trimmed to a smaller size. In such cases there is no need to perform a resize, which would trigger a reallocation. Instead just update MemoryBuffer's size. Bug: angleproject:4722 Change-Id: I5b6cca121977903ffa7663591eaec62f6ffda97a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5513269 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Roman Lavrov be9e63ad 2024-05-02T16:04:25 spirv::Print without ANGLE_ENABLE_ASSERTS -> compile error Currently a link error as we have a declaration but no definition Bug: b/338429767 Change-Id: I06175356613c410c8d7652b28b09636244f8b717 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5513002 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com>
Mohan Maiya 97aaad3a 2024-04-20T19:27:13 Vulkan: Pack DescriptorSetLayoutDesc layout Use angle::FastVector instead of arrays to further compact DescriptorSetLayoutDesc layout Bug: angleproject:8677 Tests: VulkanDescriptorSetLayoutDescTest* Change-Id: I5bb7b2ebf0aa5aba3d7c47c45384788245dce3dc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5470362 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Charlie Lao a96e9197 2024-04-25T10:35:02 Vulkan: Add RefCountedEvent class and VkCmdSetEvent call This CL defines RefCountedEvent class that adds reference counting to VkEvent. CommandBufferHelper and ImageHelper each holds one reference count to the event. Every time an event is added to the command buffer, the corresponding RefCountedEvent will be added to the garbage list which tracks the GPU completion using ResourceUse. That event garbage's reference count will not decremented until GPU is finished, thus ensures we never destroy a VkEvent until GPU is completed. For images used by RenderPassCommands, As RenderPassCommandBufferHelper::imageRead and imageWrite get called, an event with that layout gets created and added to the image. That event is saved in RenderPassCommandBufferHelper::mRefCountedEvents and that VkCmdSetEvents calls are issued from RenderPassCommandBufferHelper::flushToPrimary(). For renderPass attachments, the events are created and added to image when attachment image gets finalized. For images used in OutsideRenderPassCommands, The events are inserted as needed as we generates commands that uses image. We do not wait until commands gets flushed to issue VkCmdSetEvent calls. A convenient function trackImageWithEvent() is added to create and setEvent and add event to image all in one call. You can add this call after the image operation whenever we think it benefits, which gives us better control. (Note: Even if forgot to insert the trackImageWithEvent call, it is still okay since every time barrier is inserted, the event gets released. Next time when we inserts barrier again we will fallback to pipelineBarrier since there is no event associated with it. But that is next CL's content). This CL only adds the VkCmdSetEvent call when feature flag is enabled. The feature flag is still disabled and no VkCmdWaitEvent is used in this CL (will be added in later CL). Bug: b/336844257 Change-Id: Iae5c4d2553a80f0f74cd6065d72a9c592c79f075 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5490203 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi e4a12a67 2024-05-02T13:25:53 Vulkan: Dynamic depth test + static depth write When depth test changes in such a situation, the static state is still affected (because we mask depth write with depth test) so the graphics pipeline still needs to be invalidated. Bug: b/336386662 Change-Id: Iebba79ffd7d6fa3962a5b20c27efcca3aa35b10a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5511602 Commit-Queue: Yuxin Hu <yuxinhu@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>