src/libANGLE/renderer/vulkan/TextureVk.cpp


Log

Author Commit Date CI Message
Kaiyi Li ac0a4a7d 2023-02-03T15:34:32 Add finer memory allocation type ... so that when we hit an OOM we have better understanding on why. Bug: b/266466279 Test: trigger a Vulkan OOM, see detailed allocation logging info Change-Id: I71c1ebd83e18ddb22e7abfd29a785bf4ad6454dc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4219365 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Auto-Submit: Kaiyi Li <kaiyili@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Shahbaz Youssefi d859ed39 2023-01-19T10:54:54 Vulkan: Disallow INPUT_ATTACHMENT usage on sampled image views Input attachments have similar requirements to draw attachments w.r.t swizzling. Bug: b/265647457 Change-Id: I7ff007b2b2ae2d8615b4b339bc621835888eebde Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4178023 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 626b10c1 2022-12-20T20:22:19 Vulkan: Add read/write depth/stencil layouts This CL only adds the layouts in the list, but does not use them. The layouts are renamed for consistency in this change. Bug: angleproject:7899 Bug: b/192477489 Change-Id: I47986c7252d32626e9f26c6670c0a4e3496fe0c8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4116736 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 301ed545 2022-12-20T20:16:22 Vulkan: Pass context to layout getters In preparation for a change that optionally uses read/write depth/stencil layouts. Context is used to test for the supportsMixedReadWriteDepthStencilLayouts feature to know whether those layouts are supported or that a fallback must be chosen. Bug: angleproject:7899 Bug: b/192477489 Change-Id: I1453dc9d060453a3806ad0f261b94368fe01fb29 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4116735 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi fd75686e 2022-12-07T16:40:54 Vulkan: Fix EGL image queue change vs threads ANGLE records commands (a queue transfer and layout transition) when an external image is bound to a texture or a renderbuffer. If another thread starts using these resources, the recorded commands should have been flushed. The application is not required to synchronize between the threads in this case (or at least, there are applications that don't). Bug: b/261552549 Change-Id: I9f345316269baf5f10576dbef73b86924efd5c6f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4088903 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Charlie Lao 02cc4cd5 2022-12-07T12:03:26 Vulkan: Remove ImageHelper::mImageAndViewGarbage This was introduced in crrev.com/c/3449450. At that time this is necessary, because we can not copy mUse for immediate view garbage collection. Now with recent work, mUse is copyable, we no longer need to accumulate the view garbage. They can be released immediately with a copy of image's mUse. Bug: b/261737134 Change-Id: Ic4393f8c4ee7c0e3be4669a0a557507c909a77ab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4087323 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi fbd7d5fa 2022-10-17T17:20:09 Move thread pool classes to common/ In preparation for access by image_util files. Bug: b/250688943 Change-Id: I24777269a5071eae9a60f939635d01ed7246461f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3961454 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Hailin Zhang 836cc5e2 2022-09-09T22:06:22 Vulkan: add etc to bc compute transcoding. use compute shader to transcode etc format to bc format. Bug: b/243398683 Change-Id: Idbd0820a2df8d92fe690055dae2933bc559e9bfd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3888501 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Hailin Zhang <hailinzhang@google.com>
Constantine Shablya ff7aa214 2022-09-29T19:56:28 GL_PALETTE* sampling Implement GL_PALETTE* formats by decoding them into a R8G8B8A8_UNORM image at load time. Test: angle_end2end_tests --gtest_filter="PalettedTextureTest.*" Bug: angleproject:7599 Bug: angleproject:7688 Bug: angleproject:7710 Change-Id: I94d51e2c480fcdd39f1a0ad241b311d3b4de1579 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3863251 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Constantine Shablya <constantine.shablya@collabora.com>
Shahbaz Youssefi ff46a03a 2022-08-25T20:19:02 Vulkan: Use VK_EXT_multisampled_render_to_single_sampled Previously, the GOOGLEX version was used. The EXT version is favored now. Bug: angleproject:4836 Change-Id: Ie41d750b0729f0b3a14d1937fbf2dd386b65dd59 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3857993 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 4c6f7d8e 2022-08-10T15:21:57 Vulkan: Never stage update for EGLImage EGLImage could be shared between contexts in different share groups. If we stage any update in the ImageHelper for such EGLImage, then you may run into threading bugs when two textures are trying to flush out the staged update at the same time. There is no evidence showing we are running into this issue, but this CL forces this requirement. Bug: b/169868803 Change-Id: Ie26542225705ee4638ca1b3cf3cc5af499685137 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3824159 Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Amirali Abdolrashidi f5de8e01 2022-08-05T10:23:37 Vulkan: Disable texture upload if texture sharing * Disabled mutable texture upload in cases of display-level texture sharing. Bug: chromium:1346808 Change-Id: Ia54496521d151ca7f273845fb40c56b5322470af Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3812386 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Lingfeng Yang bd82a5e4 2022-07-07T17:03:27 Vulkan: __samplerExternal2DY2YEXT-aware ProgramExecutableVk This CL incorporates __samplerExternal2DY2YEXT into the Vulkan objects involved in ProgramExecutableVk. Specifically, we need: 1. TextureVk to create and return a VkSampler imbued with identity conversion model, so we can create an immutable sampler from it. 2. Access to the identity conversion desc so that it can be traced in mImmutableSamplerIndexMap. Bug: b/223456677 Change-Id: Ia302226a8aa4a97d4a42f79c79ce47af3abec37c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3753294 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Lingfeng Yang <lfy@google.com>
Lingfeng Yang 6c418f8c 2022-07-07T14:28:06 Vulkan: __samplerExternal2DY2YEXT-aware TextureVk This CL adds the ability for TextureVk to return an ImageView that is created with a VkSamplerYcbcrConversion object that uses an identity conversion model. This allows direct sampling of YUV values without RGB conversion, which is needed for __samplerExternal2DY2YEXT. Bug: b/223456677 Change-Id: Ie1d4e12375b7808a1f060747bc2d74baeda3fdea Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3751889 Commit-Queue: Lingfeng Yang <lfy@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi d9763c60 2022-07-14T14:42:27 Disable mutable texture upload on Win/Intel devs After adding the mutable texture upload CL, we are experiencing some instances of flakiness in the form of lost context/device errors in the perf tests in Win/Intel cases. * Added mutableMipmapTextureUpload as an ANGLE feature, which is used to determine if onMutableTextureUpload() should be called. * It is disabled on Windows when using an Intel GPU. * Disabled the related unit tests on Win/Intel cases. Bug: angleproject:7308 Bug: b/202744914 Change-Id: Ib8c1bddc39cc4354468831a4a599a7c343d05f0e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3764460 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Charlie Lao 01092c48 2022-07-12T10:11:22 Vulkan: Destroy descriptorSet cache when shader image is destroyed Similar to texture descriptor set, this applies to images used as shader resource. When a texture is used in a shader resource descriptorSet, we record it. When texture is destroyed, we also destroy that shader resource descriptorSet cache. Bug: b/237686097 Change-Id: I475982fcec45535cc285a4aebca922d01efc7ed2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3758884 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Auto-Submit: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Amirali Abdolrashidi 32c5fd8a 2022-05-13T14:31:03 Reland "Vulkan: Flush texture updates more often" This is a reland of 8bb7c35c2159de2fa9e9a008679c692edd4402a6 * Added a condition to make sure the previous texture is not immutable when performing the optimization. * Fixed the issue where mipmap textures with unequal dimensions were not flushed. * Added related tests. * Added kEnableMutableMipmapTextureUpload, a flag to enable/disable the feature (enabled by default). Original change's description: > Vulkan: Flush texture updates more often > > * Added a pointer to the previous texture in ShareGroupVk so we can > flush the texture updates once we switch to a new texture. > > * We check if mip levels 0 and 1 are conformant in terms of > size, format and number of samples. > > * As a part of size check, we also check depths if the texture > target is either 3D, 2D array, or cube map array. For the former > two, they have to conform to mip scaling similar to width and > height. For the latter, the depth represents layer-faces and does > not change for mipmaps. > > * Added a test to ensure the pointer to the previous texture is > deleted when the corresponding texture is deleted, so the old value > is not accessed by a future mutable texture. > > * Added tests to make sure the mutable texture is uploaded with > the appropriate mip level attributes, and not uploaded in cases of > size/format inconsistencies, incompleteness, and no base level. > > Bug: b/202744914 > Change-Id: I9c2c1af87a8a49e75d3ad25523436b0cd51a7e81 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3606329 > Reviewed-by: Charlie Lao <cclao@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Bug: b/202744914 Change-Id: I2bdbcd0182a57c18c1a18968396251a2e366731b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3646959 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Mark Lobodzinski fb3e2def 2022-05-24T15:47:01 Extend labelObject functionality Modify interface to fully support labelObject return codes. Fix issues with texture implementation, including handling deferred Vulkan object creation. Bug: b/229105865 Change-Id: I0c64b72dd0b54642fb643ee7f5ccbb2a134c6787 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3703184 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
Mohan Maiya 81a69da6 2022-06-30T09:56:54 Vulkan: min/mag filters follow chroma filter value The Vulkan spec states that for those formats lacking support for VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT the min and mag filter must be equal to the sampler YCbCr conversion's chroma filter. Having the min/mag filters follow the chroma filter leads to simpler and more efficient code. Also update getPreferredFilterForYUV function to return existing filter value when preferLinearFilterForYUV feature is disabled. Bug: angleproject:7382 Bug: angleproject:7392 Tests: Texture2DTestES3YUV.TexStorage2DYuvFilterModes* Tests: ImageTestES3.SourceYUVAHBTargetExternalYUVSampleLinearFiltering/ES3_Vulkan Change-Id: I550ef8feede1dc6c3a0d8e32f790113e90ef7a4b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3739582 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Charlie Lao 723cc880 2022-06-10T17:55:54 Reland "Reland "Vulkan: Destroy DescriptorSet cache when it becomes invalid"" This is a reland of commit 551a26aeedbfd971d6199c8eddb433a4f4ff871c Original change's description: > Reland "Vulkan: Destroy DescriptorSet cache when it becomes invalid" > > This is a reland of commit 0779ccbcd427dcb00e53afa6385fb4e8e2377993 with > the fix for angleproject:7466. When DescriptorPoolhelper gets > release/destroyed, we ensure all sharedCacheKeys are destroyed. > > Original change's description: > > Vulkan: Destroy DescriptorSet cache when it becomes invalid > > > > When a new texture descriptorSet is allocated, we store one reference of > > the cache key in ProgramExecutableVk and all TextureVks that it > > associated with. When any of the TextureVk is destroyed or its view > > destroyed, we immediately erase the descriptorSet from the cache and > > track GPU progress and free the descriptorSet when it's GPU completed. > > That way we delete the dead descriptorSet that will for sure never been > > reused ASAP so that its space is avialable for reuse. > > > > Bug: b/235523746 > > Change-Id: Ib1b9662a254eea5a3f410dc6d5d89fca6727a647 > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3700226 > > Reviewed-by: Lingfeng Yang <lfy@google.com> > > Commit-Queue: Charlie Lao <cclao@google.com> > > Reviewed-by: Ian Elliott <ianelliott@google.com> > > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > > Bug: b/235523746 > Bug: angleproject:7466 > Change-Id: I4413bec27ea0ca830010e2ca15036c2e667141c0 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3726964 > Reviewed-by: Ian Elliott <ianelliott@google.com> > Commit-Queue: Charlie Lao <cclao@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bug: b/235523746 Bug: angleproject:7466 Change-Id: I6b88b884841c5dbc625ee7e0c52c45af09dec199 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3741027 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com>
Ian Elliott 4b745c2b 2022-07-01T01:25:36 Revert "Reland "Vulkan: Destroy DescriptorSet cache when it becomes invalid"" This reverts commit 551a26aeedbfd971d6199c8eddb433a4f4ff871c. Reason for revert: Blink test failures at: https://ci.chromium.org/ui/p/chromium/builders/ci/WebKit%20Linux%20MSAN/15546/overview Original change's description: > Reland "Vulkan: Destroy DescriptorSet cache when it becomes invalid" > > This is a reland of commit 0779ccbcd427dcb00e53afa6385fb4e8e2377993 with > the fix for angleproject:7466. When DescriptorPoolhelper gets > release/destroyed, we ensure all sharedCacheKeys are destroyed. > > Original change's description: > > Vulkan: Destroy DescriptorSet cache when it becomes invalid > > > > When a new texture descriptorSet is allocated, we store one reference of > > the cache key in ProgramExecutableVk and all TextureVks that it > > associated with. When any of the TextureVk is destroyed or its view > > destroyed, we immediately erase the descriptorSet from the cache and > > track GPU progress and free the descriptorSet when it's GPU completed. > > That way we delete the dead descriptorSet that will for sure never been > > reused ASAP so that its space is avialable for reuse. > > > > Bug: b/235523746 > > Change-Id: Ib1b9662a254eea5a3f410dc6d5d89fca6727a647 > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3700226 > > Reviewed-by: Lingfeng Yang <lfy@google.com> > > Commit-Queue: Charlie Lao <cclao@google.com> > > Reviewed-by: Ian Elliott <ianelliott@google.com> > > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > > Bug: b/235523746 > Bug: angleproject:7466 > Change-Id: I4413bec27ea0ca830010e2ca15036c2e667141c0 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3726964 > Reviewed-by: Ian Elliott <ianelliott@google.com> > Commit-Queue: Charlie Lao <cclao@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bug: b/235523746 Bug: angleproject:7466 Change-Id: Icdde2752c462b7ebbb51d46fd35ce749b5caf377 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3739585 Reviewed-by: Ian Elliott <ianelliott@google.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: Ian Elliott <ianelliott@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Charlie Lao 551a26ae 2022-06-10T17:55:54 Reland "Vulkan: Destroy DescriptorSet cache when it becomes invalid" This is a reland of commit 0779ccbcd427dcb00e53afa6385fb4e8e2377993 with the fix for angleproject:7466. When DescriptorPoolhelper gets release/destroyed, we ensure all sharedCacheKeys are destroyed. Original change's description: > Vulkan: Destroy DescriptorSet cache when it becomes invalid > > When a new texture descriptorSet is allocated, we store one reference of > the cache key in ProgramExecutableVk and all TextureVks that it > associated with. When any of the TextureVk is destroyed or its view > destroyed, we immediately erase the descriptorSet from the cache and > track GPU progress and free the descriptorSet when it's GPU completed. > That way we delete the dead descriptorSet that will for sure never been > reused ASAP so that its space is avialable for reuse. > > Bug: b/235523746 > Change-Id: Ib1b9662a254eea5a3f410dc6d5d89fca6727a647 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3700226 > Reviewed-by: Lingfeng Yang <lfy@google.com> > Commit-Queue: Charlie Lao <cclao@google.com> > Reviewed-by: Ian Elliott <ianelliott@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bug: b/235523746 Bug: angleproject:7466 Change-Id: I4413bec27ea0ca830010e2ca15036c2e667141c0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3726964 Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Yuly Novikov f8690429 2022-06-27T13:50:44 Revert "Vulkan: Destroy DescriptorSet cache when it becomes invalid" This reverts commit 0779ccbcd427dcb00e53afa6385fb4e8e2377993. Reason for revert: crashes in blink_web_tests on linux-rel https://ci.chromium.org/ui/p/chromium/builders/try/linux-rel/1051045/overview Original change's description: > Vulkan: Destroy DescriptorSet cache when it becomes invalid > > When a new texture descriptorSet is allocated, we store one reference of > the cache key in ProgramExecutableVk and all TextureVks that it > associated with. When any of the TextureVk is destroyed or its view > destroyed, we immediately erase the descriptorSet from the cache and > track GPU progress and free the descriptorSet when it's GPU completed. > That way we delete the dead descriptorSet that will for sure never been > reused ASAP so that its space is avialable for reuse. > > Bug: b/235523746 > Change-Id: Ib1b9662a254eea5a3f410dc6d5d89fca6727a647 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3700226 > Reviewed-by: Lingfeng Yang <lfy@google.com> > Commit-Queue: Charlie Lao <cclao@google.com> > Reviewed-by: Ian Elliott <ianelliott@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bug: b/235523746, angleproject:7466 Change-Id: I7e5067de2f2add08af1f9804cc2e952238b2e942 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3726097 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Charlie Lao 0779ccbc 2022-06-10T17:55:54 Vulkan: Destroy DescriptorSet cache when it becomes invalid When a new texture descriptorSet is allocated, we store one reference of the cache key in ProgramExecutableVk and all TextureVks that it associated with. When any of the TextureVk is destroyed or its view destroyed, we immediately erase the descriptorSet from the cache and track GPU progress and free the descriptorSet when it's GPU completed. That way we delete the dead descriptorSet that will for sure never been reused ASAP so that its space is avialable for reuse. Bug: b/235523746 Change-Id: Ib1b9662a254eea5a3f410dc6d5d89fca6727a647 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3700226 Reviewed-by: Lingfeng Yang <lfy@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 0a7cfa08 2022-06-16T16:24:54 Vulkan: Fix marking external images as renderable Bug: chromium:1266094 Change-Id: Ie8d7b82f859697530f6581c7109d773d6fa35d37 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3710690 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Charlie Lao 72e457fe 2022-06-03T15:36:01 Vulkan: Promptly destroy cached framebuffer when it becomes invalid When Texture gets respecified, the VkFramebuffer cache created out of it becomes invalid and will never possibly get used. Before this CL, we never clear such invalid framebuffer objects from the cache. This CL keeps a reference to the cache key in each attachment and will immediately destroy the cached VkFramebuffer object when one of the attachment has become invalid. Bug: b/234769934 Change-Id: Ib01f6dffe9211084b1ada340081daf905e3f1bef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3682164 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 0bc70e96 2022-06-10T22:27:04 Vulkan: Rename getShareGroupVk to getShareGroup + other miscellaneous clean up Bug: angleproject:7375 Change-Id: I25690860478a2fd181a67ce2b6cb4d7aac7dbaa7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3700197 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Charlie Lao 4c6d47c8 2022-06-08T15:20:49 Vulkan: Optimize glEGLImageTargetTexture2DOES with same args If we are creating a texture with the same source eglImage, right now we will release the existing mImage (will not actually destroyed) and then free VkImageViews. Then it point back to the same mImage and allocate new VkImageViews. Since these ImageViews have different serial number, we end up with DescriptorSet cache miss. This CL avoid all these hassles if we are creating with the exact same image. Bug: b/234602034 Change-Id: I04cec05716974e274d6e3678e91ff248f50e9355 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3697204 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Auto-Submit: Charlie Lao <cclao@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Mark Lobodzinski 7fb021b0 2022-05-12T16:19:14 Reland "Add Vulkan backend support for texture labels" This is a reland of commit 1afb80587e302e2ce9a901a69fd66e5ef98a73b6 Added check to ensure vkSetDebugUtilsObjectName fcn ptr is valid before use. Fixes failures on mac-swangle-chromium-try-x64. Original change's description: > Add Vulkan backend support for texture labels > > Add onLableUpdate support for textures in the Vulkan backend. > > Bug: b/229105865 > Change-Id: Id9e5b2b81352e97b7843a63f27709739005dc2f3 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3645854 > Reviewed-by: Ian Elliott <ianelliott@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Ian Elliott <ianelliott@google.com> Bug: b/229105865 Change-Id: I994da6db2771671c204e4ab01c69912c1be4a48f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3674296 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Kai Ninomiya 7ad48b84 2022-05-26T00:23:35 Revert "Add Vulkan backend support for texture labels" This reverts commit 1afb80587e302e2ce9a901a69fd66e5ef98a73b6. Reason for revert: Null-dereference crash starting here: https://ci.chromium.org/ui/p/chromium/builders/ci/mac-swangle-chromium-x64/26323/blamelist (see angle blamelist) Crash reason: EXC_BAD_ACCESS / KERN_INVALID_ADDRESS Crash address: 0x0 Process uptime: 24 seconds Thread 0 (crashed) 0 0x0 rax = 0x0000011c0113c000 rdx = 0x0000011c09094590 rcx = 0x0000000000000006 rbx = 0x0000011c0e2a0000 rsi = 0x00007ffedfc11500 rdi = 0x0000011c01378010 rbp = 0x00007ffedfc11540 rsp = 0x00007ffedfc114f8 r8 = 0x0000000000000006 r9 = 0x0000000123a6ccc4 r10 = 0x0000011c011018d0 r11 = 0x00007ffdbc1a4834 r12 = 0x0000000000000006 r13 = 0x0000011c090944b0 r14 = 0x0000011c0e34c000 r15 = 0x00007ffedfc11550 rip = 0x0000000000000000 Found by: given as instruction pointer in context 1 libGLESv2.dylib!gl::Context::objectLabel(unsigned int, unsigned int, int, char const*) + 0x156 rbp = 0x00007ffedfc116a0 rsp = 0x00007ffedfc11550 rip = 0x00000001357b38e6 Found by: previous frame's frame pointer 2 libGLESv2.dylib!_GL_ObjectLabelKHR + 0xa5 rbp = 0x00007ffedfc116f0 rsp = 0x00007ffedfc116b0 rip = 0x000000013578e7e5 Found by: previous frame's frame pointer 3 Chromium Framework!gpu::gles2::GLES2DecoderPassthroughImpl::DoBindTexture(unsigned int, unsigned int) + 0x1ea rbp = 0x00007ffedfc11780 rsp = 0x00007ffedfc11700 rip = 0x000000011e7dcd4a Found by: previous frame's frame pointer Original change's description: > Add Vulkan backend support for texture labels > > Add onLableUpdate support for textures in the Vulkan backend. > > Bug: b/229105865 > Change-Id: Id9e5b2b81352e97b7843a63f27709739005dc2f3 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3645854 > Reviewed-by: Ian Elliott <ianelliott@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Ian Elliott <ianelliott@google.com> Bug: b/229105865 Change-Id: I5a5e00084e1320a486c43fec9d41b9ae6cb2b1db Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3669657 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Mark Lobodzinski 1afb8058 2022-05-12T16:19:14 Add Vulkan backend support for texture labels Add onLableUpdate support for textures in the Vulkan backend. Bug: b/229105865 Change-Id: Id9e5b2b81352e97b7843a63f27709739005dc2f3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3645854 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Ian Elliott <ianelliott@google.com>
Amirali Abdolrashidi 8701f53a 2022-05-17T13:54:53 Vulkan: Fix clear value for incomplete MS textures * Added initializeContentsWithBlack() for the cases we wish to use opaque black. * Added stageResourceClearWithFormat(), which also takes an initial clear value. stageRobustResourceClearWithFormat() is included as a special case. Bug: angleproject:7151 Change-Id: I32d7a9af53b51499fe46d6e397301744dbf3c236 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3652995 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 2fdd7bfd 2022-05-17T13:31:58 Vulkan: Support binding 2D slice of a 3D texture to an image unit Support binding a 3d texture as a 2d texture by specifying that it is non-layered during glBindImageTexture and expose support for EGL_KHR_gl_texture_3D_image when VK_EXT_image_2d_view_of_3d vulkan extension is supported. Tests: ComputeShaderTest.BindImageTexture3D dEQP-GLES31.functional.image_load_store.3d.*single_layer Bug: angleproject:7320 Change-Id: Ie2f0dfcdf302a4aa58990f74329ca36e62cd3902 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3648586 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Roman Lavrov 03ccd9cc 2022-05-13T16:12:11 Revert "Vulkan: Flush texture updates more often" This reverts commit 8bb7c35c2159de2fa9e9a008679c692edd4402a6. Reason for revert: crashes tests in linux-rel Example: https://ci.chromium.org/ui/p/chromium/builders/try/linux-rel/1012030/overview Also possible flakiness https://anglebug.com/7308 Repro: out/Debug/bin/run_blink_web_tests fast/canvas/OffscreenCanvas-2d-drawImage.html Original change's description: > Vulkan: Flush texture updates more often > > * Added a pointer to the previous texture in ShareGroupVk so we can > flush the texture updates once we switch to a new texture. > > * We check if mip levels 0 and 1 are conformant in terms of > size, format and number of samples. > > * As a part of size check, we also check depths if the texture > target is either 3D, 2D array, or cube map array. For the former > two, they have to conform to mip scaling similar to width and > height. For the latter, the depth represents layer-faces and does > not change for mipmaps. > > * Added a test to ensure the pointer to the previous texture is > deleted when the corresponding texture is deleted, so the old value > is not accessed by a future mutable texture. > > * Added tests to make sure the mutable texture is uploaded with > the appropriate mip level attributes, and not uploaded in cases of > size/format inconsistencies, incompleteness, and no base level. > > Bug: b/202744914 > Change-Id: I9c2c1af87a8a49e75d3ad25523436b0cd51a7e81 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3606329 > Reviewed-by: Charlie Lao <cclao@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Bug: b/202744914 Change-Id: Id51fd4c76d058aa5100ec58ba618098c8f614253 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3645493 Auto-Submit: Roman Lavrov <romanl@google.com> Commit-Queue: Lingfeng Yang <lfy@google.com> Reviewed-by: Lingfeng Yang <lfy@google.com>
Jamie Madill 21ad9b3c 2022-04-07T09:57:26 Vulkan: Add generic descriptors for DS cache. With the new design, the descriptor set cache keys include all identifying information needed to reconstruct the update descriptor sets calls except the specific resource handles. The places for the resource handles are held by serials intead. When we miss the cache, we no longer need a second step to then construct the update calls, and can build the update calls directly from the key structures in combination with a list of resource handles. Bug: angleproject:6776 Change-Id: If1660a557585a75e9aa2560d6a38c56b62f555c8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3484981 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Amirali Abdolrashidi 8bb7c35c 2022-03-23T19:14:54 Vulkan: Flush texture updates more often * Added a pointer to the previous texture in ShareGroupVk so we can flush the texture updates once we switch to a new texture. * We check if mip levels 0 and 1 are conformant in terms of size, format and number of samples. * As a part of size check, we also check depths if the texture target is either 3D, 2D array, or cube map array. For the former two, they have to conform to mip scaling similar to width and height. For the latter, the depth represents layer-faces and does not change for mipmaps. * Added a test to ensure the pointer to the previous texture is deleted when the corresponding texture is deleted, so the old value is not accessed by a future mutable texture. * Added tests to make sure the mutable texture is uploaded with the appropriate mip level attributes, and not uploaded in cases of size/format inconsistencies, incompleteness, and no base level. Bug: b/202744914 Change-Id: I9c2c1af87a8a49e75d3ad25523436b0cd51a7e81 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3606329 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Jamie Madill 86d9d66d 2022-05-04T12:21:32 Vulkan: Determined sized-ness of format in initImageViews. Bug: angleproject:7269 Change-Id: I1f1f58a0079c8ead28cc2bf7f9aa91cd3f9dc7bc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3628019 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Jamie Madill b54b1146 2022-05-04T10:45:15 Vulkan: Use ImageView layer count functions in TextureVk. Refactoring change only. Bug: angleproject:7269 Change-Id: Iccc271afdee30d1c8df982f713083fabc7848bb4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3625523 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e1de0950 2022-05-04T09:37:50 Vulkan: Always init image views using image format. The same format is already in the image helper. Refactoring change only, no functional change. Bug: angleproject:7269 Change-Id: Ifdd1d71045602ed41cf642ec0b3e1282fcbd6e49 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3625522 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Lingfeng Yang <lfy@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e0d00563 2022-05-03T17:02:06 Vulkan: Simplify external format Chroma code. The prior code used a const_cast and some other twiddling when we really just needed to add a separate small setting function. Also encapsulates the YcbcrConversionDesc string into a class with private data. The end goal is to refactor image view init and caching. The const_cast and the SamplerState were getting in the way. Bug: angleproject:7269 Change-Id: Ie2fb4ba848c46adc63618f313f7a68a1df5cef8f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3625492 Reviewed-by: Trevor Black <vantablack@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Jamie Madill 77cd0b5a 2022-04-14T13:32:07 Re-land: "Vulkan: Cache ImageView serials on texture changes." Re-land fixes BindTexImage serial caching. This significantly reduces overhead when changing textures before draw calls in the Vulkan back-end. Bug: angleproject:6776 Change-Id: I2cc03cb8a70e8c181f7658ab45df780e412bfc57 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3623860 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Auto-Submit: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi 37c53684 2022-04-05T15:03:14 Split Context ResourceUseList to RP Commandbuffers * Split the resource use lists retained in context between the render pass command buffer and the outside render pass command buffer, mostly in vk_helper.cpp and ContextVk.cpp. Bug: angleproject:7103 Change-Id: Ib696bdec2c545cd7df9ae4ab86c54a294041d908 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3573581 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill e1fdef90 2022-04-22T14:55:11 Revert "Vulkan: Cache ImageView serials on texture changes." This reverts commit 7d229d047f742e93ca194272da9b93959e49d75e. Reason for revert: Crash on Mac blink-web-tests: https://ci.chromium.org/ui/p/chromium/builders/try/mac-rel/979339/overview Original change's description: > Vulkan: Cache ImageView serials on texture changes. > > This significantly reduces overhead when changing textures before > draw calls in the Vulkan back-end. > > Bug: angleproject:6776 > Change-Id: I24e2938c0122c3b23db4a90ec85b7d8f459cc063 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3583360 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Yuxin Hu <yuxinhu@google.com> > Commit-Queue: Jamie Madill <jmadill@chromium.org> Bug: angleproject:6776 Change-Id: Icdf4f4a3628690fd9e074c6f400614890848be7f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3600910 Auto-Submit: Jamie Madill <jmadill@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2dd13ebb 2022-04-21T11:25:00 Track Surface color & depth/stencil init separately. This clears up some trace testing confusion due when robust resource init is enabled, and the app clears color but not depth on the default surface. Bug: angleproject:7221 Change-Id: Id97871aec32ad831b663aaa9116e04b582ab5a36 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3600375 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7d229d04 2022-04-14T13:32:07 Vulkan: Cache ImageView serials on texture changes. This significantly reduces overhead when changing textures before draw calls in the Vulkan back-end. Bug: angleproject:6776 Change-Id: I24e2938c0122c3b23db4a90ec85b7d8f459cc063 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3583360 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi af51a287 2022-04-12T11:04:30 Vulkan: Enum class instead of bool didRespecify Bug: angleproject:6909 Change-Id: I1e90df54f89717a419e6b647e5f2ee6972d9a904 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3583607 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi aed5951e 2022-03-29T16:29:58 Reland "Vulkan: Fix texture-after-framebuffer sync issues" This is a reland of commit 535cd538f3585b44855647339f04bae1c1acf63a Original change's description: > Vulkan: Fix texture-after-framebuffer sync issues > > In TextureVk::syncState, for various reasons, the underlying image may > need to be respecified. For example because base/max level changed, > usage/create flags have changed, the format needs modification to become > renderable, generate mipmap is adding levels, etc. > > Currently, ANGLE syncs FramebufferVk before TextureVk for the sake of > the deferred clear optimization. This means that if the texture needs > to recreate its underlying image, it needs to do so earlier than its own > syncState, and do so in FramebufferVk::syncState through the > TextureVk::getAttachmentRenderTarget function. > > Over time, TextureVk::getAttachmentRenderTarget was modified to do parts > of what TextureVk::syncState did for this matter as bugs were > discovered, and more continue to be discovered. The bug that prompted > this change is missing image recreation when usage/create flags change. > > In this change, the relevant code in TextureVk::syncState is refactored > in a helper that's called by TextureVk::getAttachmentRenderTarget. This > way, the two functions should always be in agreement, avoiding > TextureVk::syncState recreating the image after > FramebufferVk::syncState, leading to use-after-free bugs. > > Bug: angleproject:4418 > Bug: angleproject:6909 > Bug: chromium:1266094 > Bug: chromium:1296866 > Change-Id: I856a34ca5cf573578c771f5adbeb9208420a3f62 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3557817 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Charlie Lao <cclao@google.com> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Bug: angleproject:4418 Bug: angleproject:6909 Bug: chromium:1266094 Bug: chromium:1296866 Change-Id: I0110eab88eb9d8f77e204b84a6e90308e2384fd7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3572715 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill b33767ec 2022-04-04T15:26:29 Revert "Vulkan: Fix texture-after-framebuffer sync issues" This reverts commit 535cd538f3585b44855647339f04bae1c1acf63a. Reason for revert: May fix Win/Intel blockman_go flakiness. Bug: angleproject:7167 Original change's description: > Vulkan: Fix texture-after-framebuffer sync issues > > In TextureVk::syncState, for various reasons, the underlying image may > need to be respecified. For example because base/max level changed, > usage/create flags have changed, the format needs modification to become > renderable, generate mipmap is adding levels, etc. > > Currently, ANGLE syncs FramebufferVk before TextureVk for the sake of > the deferred clear optimization. This means that if the texture needs > to recreate its underlying image, it needs to do so earlier than its own > syncState, and do so in FramebufferVk::syncState through the > TextureVk::getAttachmentRenderTarget function. > > Over time, TextureVk::getAttachmentRenderTarget was modified to do parts > of what TextureVk::syncState did for this matter as bugs were > discovered, and more continue to be discovered. The bug that prompted > this change is missing image recreation when usage/create flags change. > > In this change, the relevant code in TextureVk::syncState is refactored > in a helper that's called by TextureVk::getAttachmentRenderTarget. This > way, the two functions should always be in agreement, avoiding > TextureVk::syncState recreating the image after > FramebufferVk::syncState, leading to use-after-free bugs. > > Bug: angleproject:4418 > Bug: angleproject:6909 > Bug: chromium:1266094 > Bug: chromium:1296866 > Change-Id: I856a34ca5cf573578c771f5adbeb9208420a3f62 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3557817 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Charlie Lao <cclao@google.com> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Bug: angleproject:4418 Bug: angleproject:6909 Bug: chromium:1266094 Bug: chromium:1296866 Change-Id: I26b6f644442e2875aba954d6417543b1d5121376 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3569801 Auto-Submit: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 535cd538 2022-03-29T16:29:58 Vulkan: Fix texture-after-framebuffer sync issues In TextureVk::syncState, for various reasons, the underlying image may need to be respecified. For example because base/max level changed, usage/create flags have changed, the format needs modification to become renderable, generate mipmap is adding levels, etc. Currently, ANGLE syncs FramebufferVk before TextureVk for the sake of the deferred clear optimization. This means that if the texture needs to recreate its underlying image, it needs to do so earlier than its own syncState, and do so in FramebufferVk::syncState through the TextureVk::getAttachmentRenderTarget function. Over time, TextureVk::getAttachmentRenderTarget was modified to do parts of what TextureVk::syncState did for this matter as bugs were discovered, and more continue to be discovered. The bug that prompted this change is missing image recreation when usage/create flags change. In this change, the relevant code in TextureVk::syncState is refactored in a helper that's called by TextureVk::getAttachmentRenderTarget. This way, the two functions should always be in agreement, avoiding TextureVk::syncState recreating the image after FramebufferVk::syncState, leading to use-after-free bugs. Bug: angleproject:4418 Bug: angleproject:6909 Bug: chromium:1266094 Bug: chromium:1296866 Change-Id: I856a34ca5cf573578c771f5adbeb9208420a3f62 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3557817 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 078da78f 2022-03-17T13:06:58 Vulkan: Support GL_EXT_EGL_image_storage extension This extension provides a mechanism for creating texture objects that are both EGLImage targets and immutable and removes the possibility of implicit orphaning. EGL images created from external sources now support types other than 2D. Tests covering the new feature were added to ImageTest.cpp. Bug: angleproject:6346 Change-Id: Id3e328f352deb1af47062be232384229a8b1c341 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3530489 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Jamie Madill e8ee847d 2022-02-23T12:25:39 Vulkan: Add UpdateDescriptorSetsBuilder. This helper class encapsulates the vkUpdateDescriptorSets caching. As part of the refactor, we switch passing a ContextVk to passing a vk::Context with some mutable variables. This helps encapsulate ContextVk. Since we use the perf counters in many places, this CL moves the perf counters to vk::Context, so we can access them everywhere. Refactoring change only. Bug: angleproject:6776 Change-Id: Id529962b2f425bece6f9b3bd0cd1698c692e58cb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3484980 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuxin Hu 1dc9f126 2022-03-16T19:29:26 Revert "Flush the texture staged updates when destroying context share group" This reverts commit 5c29d795d1625f71ac6999f157b6f3bba79d5256. Reason for revert: this is causing some test failures on chromium and blocking the angle-chromium auto roller job: https://chromium-review.googlesource.com/c/chromium/src/+/3529771/ Original change's description: > Flush the texture staged updates when destroying context share group > > If we are using the extension EGL_ANGLE_display_texture_share_group, > flush the texture staged updates upon destroying the context. With the > extension enabled, the texture could still be alive when both context > and its' EGL::ShareGroup are destroyed. If we have staged updates not > yet flushed, the updates will keep the ShareGroupVk bufferpool occupied, > causing an error upon ShareGroupVk::onDestroy(). > > Bug: chromium:1299211 > Change-Id: I260de93c3a3099e023e31acbe017803e824459ad > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3495879 > Reviewed-by: Charlie Lao <cclao@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Yuxin Hu <yuxinhu@google.com> Bug: chromium:1299211 Change-Id: I214161d6a8aec834e1efc5fc9d2479e62e3bfae0 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3530505 Auto-Submit: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuxin Hu 5c29d795 2022-02-28T23:56:46 Flush the texture staged updates when destroying context share group If we are using the extension EGL_ANGLE_display_texture_share_group, flush the texture staged updates upon destroying the context. With the extension enabled, the texture could still be alive when both context and its' EGL::ShareGroup are destroyed. If we have staged updates not yet flushed, the updates will keep the ShareGroupVk bufferpool occupied, causing an error upon ShareGroupVk::onDestroy(). Bug: chromium:1299211 Change-Id: I260de93c3a3099e023e31acbe017803e824459ad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3495879 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Yuxin Hu 1cef917c 2022-03-02T23:50:11 Reland "Remove ImageViewHelper from ResourceUseList" This is a reland of 126e967de3978f0dc4f6cf0fa3f9749366ea39ba Original change's description: > Remove ImageViewHelper from ResourceUseList > > Instead of keeping a dedicated SharedResourceUse mUse for > ImageViewHelper, let ImageViewHelper take ImageHelper.mUse > for lifetime tracking. ImageViewHelper no longer needs to > add its' own mUse in the ResourceUseList through retain() > calls, and this should cut the ResourceUseList size by > almost half. For instance, in the trace aztec_ruins, > the maximum ResourceUseList size before the change is 3643, > and the maximum ResourceUseList size after the change is 1694. > Since ImageViewHelper no longer needs to keep SharedResourceUse > mUse as a class memberWe can remove the inheritance from > Resource class, and make ImageViewHelper simply a NonCopyable class. > Bug: angleproject:6717 > Change-Id: I460e83f5f3c1d6ef9722b9f3c9a5ba9552563cb9 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3449450 > Reviewed-by: Charlie Lao <cclao@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Yuxin Hu <yuxinhu@google.com> Bug: angleproject:6717 Change-Id: I3aa9785d7dcdc8db82847f1586f8cd7d5c838d7c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3501194 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Jamie Madill 348ece42 2022-03-01T15:40:38 Vulkan: Fix issue with redefining a layered attachment. The fix ensures we complete level redefinition before we get the layer render target in TextureVk::getAttachmentRenderTarget. Bug: chromium:1296866 Change-Id: Id7fa8e9fed5e766c30580b09336713c675c4e4f0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3498283 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 8390196a 2022-02-26T02:36:22 Revert "Remove ImageViewHelper from ResourceUseList" This reverts commit 126e967de3978f0dc4f6cf0fa3f9749366ea39ba. Reason for revert: Hits an ASSERT about too much garbage being accumulated. anglebug.com/7063 Original change's description: > Remove ImageViewHelper from ResourceUseList > > Instead of keeping a dedicated SharedResourceUse mUse for > ImageViewHelper, let ImageViewHelper take ImageHelper.mUse > for lifetime tracking. ImageViewHelper no longer needs to > add its' own mUse in the ResourceUseList through retain() > calls, and this should cut the ResourceUseList size by > almost half. For instance, in the trace aztec_ruins, > the maximum ResourceUseList size before the change is 3643, > and the maximum ResourceUseList size after the change is 1694. > Since ImageViewHelper no longer needs to keep SharedResourceUse > mUse as a class memberWe can remove the inheritance from > Resource class, and make ImageViewHelper simply a NonCopyable class. > > Bug: angleproject:6717 > Change-Id: I460e83f5f3c1d6ef9722b9f3c9a5ba9552563cb9 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3449450 > Reviewed-by: Charlie Lao <cclao@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Yuxin Hu <yuxinhu@google.com> Bug: angleproject:6717 Change-Id: Iea3d40458e2cc5be6ab0257ba6df8b82a4eeecda No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3491345 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yuxin Hu 126e967d 2022-02-09T01:46:25 Remove ImageViewHelper from ResourceUseList Instead of keeping a dedicated SharedResourceUse mUse for ImageViewHelper, let ImageViewHelper take ImageHelper.mUse for lifetime tracking. ImageViewHelper no longer needs to add its' own mUse in the ResourceUseList through retain() calls, and this should cut the ResourceUseList size by almost half. For instance, in the trace aztec_ruins, the maximum ResourceUseList size before the change is 3643, and the maximum ResourceUseList size after the change is 1694. Since ImageViewHelper no longer needs to keep SharedResourceUse mUse as a class memberWe can remove the inheritance from Resource class, and make ImageViewHelper simply a NonCopyable class. Bug: angleproject:6717 Change-Id: I460e83f5f3c1d6ef9722b9f3c9a5ba9552563cb9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3449450 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Charlie Lao de37ad17 2022-02-16T15:30:46 Vulkan: Call releaseStagedUpdates before releaseImage When Texture is destroyed, we call TextureVk::releaseAndDeleteImageAndViews(). Right now it calls releaseImage() first and then calls releaseStagedUpdates(). The correct order should be releaseStagedUpdates() before releaseImages(). Otherwise for EGLImages, releaseImages will set mImage to nullptr which will make releaseStagedUpdates skip and leave the staged updates there which causes problem since context gets destroyed while EGLImage still hold onto staging buffer belongs to this context's shared group. Bug: b/219646764 Change-Id: I04a005b742a0d90b981a2f399a5e03b03e3a0adb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3469727 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Lubosz Sarnecki bdedf146 2022-01-14T13:35:30 TextureVk: Implement getCompressedTexImage. Extend ImageHelper::readPixels to support compressed formats. Implement readPixelsForCompressedGetImage. Add compression tests to GetImageTest. Implement CaptureGetCompressedTexImageANGLE_pixels in capture_gles_ext_params. Test: angle_end2end_tests --gtest_filter="GetImageTest*.CompressedTexImage*" Bug: angleproject:6177 Change-Id: I6e5b6d746b9c6cc9b885fa44f75a985660d8fb58 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3452110 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
Mohan Maiya cf4b50c5 2022-02-14T14:12:13 Vulkan: Retain images before changeLayoutAndQueue This change d9882db5f694c1c added retain calls for images in some places. Such retains are needed for textures and renderbuffers as well. Bug: angleproject:4628 Change-Id: I6b08033870f82851cc62a123bfd9c780812f17b5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3462801 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Charlie Lao f7f26956 2022-02-10T13:33:32 Vulkan: Fix two bugs exposed by moving mEmptyBuffer to suballocation There are two bugs exposed when I try to switch mEmptyBuffer to use suballocation. 1) BufferHelper::initializeNonZeroMemory() for device local memory uses GPU to do zero fill, but it is missing an vkEndCommandBuffer call. 2) glTexSubImage2D call try to pick glCopyuBufferToImage code path and we are not checking against pixel format. Vulkan spec requires offset must be number of pixel size and we are using "4" for pixel size which does not work for RGB format. Bug: b/205337962 Change-Id: Ibca6a60ebd6afc5e2bca07b9cc6a43ebdd240f15 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3449348 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Mohan Maiya 1b9774f5 2022-01-26T13:37:03 Vulkan: Force submit updates to immutable textures Submit immutable texture updates recorded in outside renderpass commands when the following conditions are met - 1. "forceSubmitImmutableTextureUpdates" feature is enabled 2. The texture is immutable This works around a problem that manifests in some applications that do not perform appropriate synchronization of shared contexts. Bug: angleproject:6929 Test: EGLContextSharingTestNoSyncTextureUploads.* Change-Id: I2a237046e2cc53650eb8dc07e3697f7481df9b02 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3418138 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Jamie Madill 868c0739 2022-01-29T13:59:30 Vulkan: Fix image base/max level respecification case. Bug: angleproject:6776 Change-Id: I3e7774c20bae6d7ad7b1775d46797104e2429b81 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3426208 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 168e0ae5 2022-01-27T16:50:00 Vulkan: Refactor descriptor pool code. This uses vk::Context to init DynamicDescriptorPool, and removes some accesses to ProgramExecutableVk member variables so the methods can more easily be moved into another class. The changes should have no effective behaviour difference. Note that the immutable sampler descriptor count is entirely set by the format of the immutable samplers. However we can't determine this count by looking at the descriptor set layout desc with the current implementation. Bug: angleproject:6776 Change-Id: I0a323d19fa3720b5afd8300401ed9c30b105c0ef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3424657 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 2ad5f350 2022-01-25T12:15:16 Vulkan: Fix texture array level redefinition When a level of a texture is redefined, all staged updates to that level should be removed, not the ones specific to the new layers. The bug fixed was that if the texture was redefined to have its number of layers changed, the staged higher-layer-count update to the image was not removed. Bug: chromium:1289383 Change-Id: I9b90025f78af80ab19a280f90b58510716da31d2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3413004 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
SeongHwan Park 9b231f09 2022-01-18T04:49:08 Vulkan: Fix incorrect bit test when mipmapping Fixed an issue where angle::Bit was used instead of angle::BitMask when should selecting [0, x) to set bit range (x, y] in an n-bit bitmask. Bug: chromium:1287962 Change-Id: I053fbc836ef12b0dfd30305fd527de3fabfdf525 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3394468 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi acd8fc76 2021-12-16T01:05:02 Vulkan: Distinguish RP and outside-RP command buffer types What goes inside and outside a render pass command buffer is largely mutually exclusive. Moreover, the size and frequency of allocations is different between the two. This change distinguishes the C++ types used for inside and outside render pass command buffers: - The type now documents which command buffer a function is able to receive. - `isRenderPass` flag passing, checking and asserting is largely removed. - A follow up change experiments with using different (Vulkan vs ANGLE) secondary command buffers for inside and outside RP command buffers. - A future change could specialize the pool behaviors per command buffer type. Bug: angleproject:6811 Change-Id: Ia4bc669d26ac7e94e8a0dfb9b361666c82f42cc3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3344373 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao caf6433a 2022-01-04T14:37:29 Vulkan: Rename releaseStagingBuffer to releaseStagedUpdate There is no more per ImageHelper dynamic buffer for staging, and this function is not just removing staging buffer, but removing all staged updates. Rename it to reflect what it actually does. Bug: b/208323792 Change-Id: I5a2182291848a9e137ed29b888f31215664b46fd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3367078 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 8589c456 2021-12-22T17:13:33 Vulkan: Remove mStagingBuffer from ImageHelper and ContextVk This CL removes ImageHelper::mStagingBuffer and ContextVk::mStagingBuffer and uses per shared group staging buffer pool instead. Bug: b/208323792 Change-Id: I46b5fd542697eb860def9c6d592dd147ad4dc973 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3354090 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 6da1ac81 2021-12-22T10:13:43 Vulkan: Switch ReadPixels from DynamicBuffer to shared pool FramebufferVk::readPixelsImpl() and ImageHelper::copyImageDataToBuffer() use per FramebufferVk DynamicBuffer. This CL removes this and uses shared buffer pool to allocate a temporary staging buffer for readPixels as needed and frees it immediately afterwards. Bug: b/208323792 Change-Id: I65ddf9bf9f1f14578d9def63f5287cb1a4121dff Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3354038 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Tim Van Patten fd014271 2021-12-16T20:44:42 Vulkan: Match chromaFilter to min/mag for YUV AHBs From the VVL: VUID-VkSamplerCreateInfo-minFilter VkCreateSampler: VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT specifies that the format can have different chroma, min, and mag filters. However, VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT is not supported for VkSamplerYcbcrConversionCreateInfo.format = VK_FORMAT_UNDEFINED so chromaFilter needs to be equal to minFilter/magFilter. We don't know what the min/mag filters are when the AHB is imported, so we need to update the YcbcrConversionDesc with the current min/mag filter value before creating the VkSamplerYcbcrConversion when the ImageView is created. Additionally, if the min/mag filters are updated later, TextureVk::syncState() needs to recreate the ImageViews to ensure the chromaFilter matches the new min/magFilters. Test: atest android.media.cts.DecodeAccuracyTest#testGLViewDecodeAccuracy[0] Test: ImageTestES3.SourceYUVAHBTargetExternalYUVSampleLinearFiltering Bug: b/210526871 Change-Id: I95dbd9738f6e3fd0870e484518eee105e995f93a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3346394 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
Tim Van Patten 542f7d80 2021-12-22T19:36:27 Vulkan: Copy buffer data to correct cube map face TextureVk::copyBufferDataToImage() was failing to set region.imageSubresource.baseArrayLayer to the correct cube map face value, causing every glTexSubImage2D()-type call using GL_PIXEL_UNPACK_BUFFER to only copy to the GL_TEXTURE_CUBE_MAP_POSITIVE_X face. In the case of PUBG Mobile, this left all other faces with "random" data, resulting in corrupted reflections on things like water, the airplane, etc. Bug: b/194140619 Test: TextureCubeTestES3.CubeMapPixelUnpackBuffer Change-Id: I93a9219ce098985f9f4b906f8fe2e05850fb8d43 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3354091 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Tim Van Patten <timvp@google.com>
Charlie Lao 6c894e82 2021-11-04T14:49:41 Vulkan: Replace BufferVk::getBufferAndOffset() with getBuffer() Now BufferHelper class already keeps offset information. There is no reason for BufferVk to have that information any more. Bug: b/205337962 Change-Id: I6e014fb480bfcd5018ef9231b0fb87a50021f179 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3266147 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 55840e90 2021-12-03T15:24:00 Vulkan: Fix deferred flush vs UtilsVk Take the following scenario: 1. Draw 2. Flush (this is deferred) 3. Get image view (this is retain()ed) 4. Pass view to a draw-based UtilsVk function 5. Flush 6. Delete image view At step 4, UtilsVk may start a new render pass and use the image view from step 3. Since the flush at step 2 is deferred, it will be performed at this step, and so the serial of the image view is set to the previous submission. When step 4 uses this view, it doesn't retain it. Step 5 submits the new command buffer using this image view. At step 6, if the previous submission has finished, it will destroy the view immediately even though it's in use by the new submission. One solution could have been to make sure render pass closure originating from UtilsVk doesn't incur a flush. However, due to the current design where the render pass is immediately recorded in RendererVk's primary command buffer, it's possible that an unrelated context would perform the flush anyway. This change makes sure instead that the render pass is closed before any views are allocated/retained to be used by UtilsVk. Bug: chromium:1272266 Change-Id: I5bdefb34e03c368511c4c174cf7965fda158d2b8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3315976 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Lingfeng Yang 929c8ed4 2021-12-01T18:16:14 Vulkan: remove staged updates on storage set Previously we would allow staged updates to bigger versions of a texture to go through even if the texture was redefined via glTexStorage*. Bug: chromium:1262080 Change-Id: I9d861fed68d4a1fdcd0777b97caf729cc74c595e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3312718 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Lingfeng Yang <lfy@google.com>
Alexis Hetu 7817761a 2021-11-23T22:47:44 Vulkan: Use the correct format when binding a pBuffer. Vulkan would get the texture format from the pBuffer's config but some pBuffer types use different formats which are queried with getBindTexImageFormat. This CL also removes nativeSizedExternalFormat. nativeSizedExternalFormat was only used when the format/type is GL_RGB/GL_UNSIGNED_BYTE. This is now obsolete since the real fix was the pBuffer fix mentioned above, so this CL cleans up the now unnecessary code. Bug: angleproject:4369 Bug: chromium:1237561 Bug: chromium:1099979 Change-Id: Ibfedea60d10856831e3a1975ac20ae5eb6a73786 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3298352 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexis Hétu <sugoi@chromium.org>
Mohan Maiya 44d0ef69 2021-11-25T14:37:38 Vulkan: Enhance SamplerDesc for YUV formats In order to uniquely identify a VkSamplerYcbcrConversion, having just the format is insufficient. We need to account for conversion model and color component range. Refactor SamplerDesc by encapsulating YUV related fields into its own YcbcrConversionDesc. Bug: angleproject:6732 Test: Texture2DTestES3.*Yuv*Vulkan Change-Id: I23114c50646232dccde988a52b0649778ad72a90 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3301899 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Shahbaz Youssefi 6fe13477 2021-11-11T00:47:14 Vulkan: Add external's pNext to ANGLE_external_objects_flags ANGLE was chaining VkImageFormatListCreateInfoKHR to VkImageCreateInfo::pNext to support sRGB extensions. For external images, it was unknown whether that was valid because there was no way to know if external used an identical chain of pNexts. This was causing a discrepancy between images created by Chrome and those created by ANGLE as part of an import. This change updates ANGLE_external_objects_flags to take in the pNext chain external has used to create the image so ANGLE could create the image identically. Bug: chromium:1266094 Change-Id: I479b9e7ff39d437425dc91c79834880749766f99 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3274177 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Peng Huang <penghuang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi dbc0c646 2021-11-06T01:09:26 Vulkan: Output the reason for RP closure in command buffer To make it easier when viewing the command buffer in a graphics debugger, this change inserts a marker just before closing the render pass that specifies why the render pass was closed. Bug: angleproject:2472 Change-Id: I862e500cd58332d6e199c853315c560fe6a73dc2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3265609 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi d2d3a546 2021-11-11T12:22:04 Vulkan: Write perf warnings in command buffer It's much easier to understand what command the perf warning refers to when it's visible in the command buffer using a graphics API debugger. This change creates ANGLE_VK_PERF_WARNING which gives the warning both to the application (through ANGLE_PERF_WARNING) and inserts it in the command buffer. Bug: angleproject:2472 Change-Id: Ie84feed53eca5cda93e1f2bc653fcbf9bcd57b56 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3275839 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 96b587b0 2021-11-10T15:10:09 Vulkan: Fix rendering to RGB external images Based on the provided usage flags, the texture's image access mode is updated to be renderable. Bug: chromium:1266094 Change-Id: I5d092a2786fc12537ef0ad1f224137cc1fd8f864 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3270980 Reviewed-by: Craig Stout <cstout@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 0fcad626 2021-11-09T14:02:08 Vulkan: Fix edge case with changing base level. Bug: chromium:1267624 Change-Id: I36b983fdbbb258454215abe827837517df5a5aff Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3270971 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao bae19e06 2021-10-26T13:35:57 Vulkan: Avoid unnecessary wait if mapBufferRange indicates read only When we call BufferVk::mapRangeImpl(), both from internal code paths for data reads or due to glMapBufferRange call, we are not passing the access bit to the call. This CL passes the proper access bits to the call and only wait for GPU writes to finish if access is for read only. This CL also adds access bitfield to the BufferVk::mapImpl() API and have various callers pass in the proper access bits as well. Bug: b/203582620 Change-Id: Ica8493c902dbd7b15996266c81ce0fd4dbfc2520 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3245487 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Tim Van Patten 9ac2409e 2021-10-26T00:55:06 Reland "Vulkan: Flush descriptor set updates during flush*Commands()" This reverts commit 420e77a64e890ad4c585d72789ca59501be3ac75. Reason for revert: The crash is in ProgramExecutableVk::getOrAllocateShaderResourcesDescriptorSet(), which is unrelated to this change. Creating a CL to reland this (the reland button is failing), to try and investigate further. Original change's description: > Revert "Vulkan: Flush descriptor set updates during flush*Commands()" > > This reverts commit 02b73c2fd738b237f1ab3ecd400feec222903a48. > > Reason for revert: Causes test to crash on Linux/Intel: anglebug.com/6591 > > Original change's description: > > Vulkan: Flush descriptor set updates during flush*Commands() > > > > The intent of this CL is to reduce the number of descriptor set updates > > by delaying the work until all of the GLES commands that could trigger a > > re-update have been performed and the command stream is being flushed. > > To achieve this, flushDescriptorSetUpdates() is being moved from > > setupDraw()/setupDispatch() to > > flushRenderPassCommands()/flushOutsideRPCommands(). > > > > This change also exposed an issue where the BufferView handles were not > > being preserved until flushDescriptorSetUpdates() was called. To resolve > > this, flushDescriptorSetUpdates() is also being called during > > BufferViewHelper::release() before the BufferView memory is released. > > > > Bug: angleproject:5706 > > Change-Id: I61e19af9c0fac891aa2115d72391459b80d22f19 > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2939385 > > Reviewed-by: Charlie Lao <cclao@google.com> > > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > > Reviewed-by: Jamie Madill <jmadill@chromium.org> > > Commit-Queue: Tim Van Patten <timvp@google.com> > > Bug: angleproject:5706 > Bug: angleproject:6591 > Change-Id: I9d1ee3fcb3d1aebc86e60896e0065cab847a92b4 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3233901 > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Bug: angleproject:5706 Bug: angleproject:6591 Change-Id: Ibc7e934b82e6cd90e766f43135583f7c45acfe39 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3244024 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi 420e77a6 2021-10-20T15:02:45 Revert "Vulkan: Flush descriptor set updates during flush*Commands()" This reverts commit 02b73c2fd738b237f1ab3ecd400feec222903a48. Reason for revert: Causes test to crash on Linux/Intel: anglebug.com/6591 Original change's description: > Vulkan: Flush descriptor set updates during flush*Commands() > > The intent of this CL is to reduce the number of descriptor set updates > by delaying the work until all of the GLES commands that could trigger a > re-update have been performed and the command stream is being flushed. > To achieve this, flushDescriptorSetUpdates() is being moved from > setupDraw()/setupDispatch() to > flushRenderPassCommands()/flushOutsideRPCommands(). > > This change also exposed an issue where the BufferView handles were not > being preserved until flushDescriptorSetUpdates() was called. To resolve > this, flushDescriptorSetUpdates() is also being called during > BufferViewHelper::release() before the BufferView memory is released. > > Bug: angleproject:5706 > Change-Id: I61e19af9c0fac891aa2115d72391459b80d22f19 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2939385 > Reviewed-by: Charlie Lao <cclao@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Tim Van Patten <timvp@google.com> Bug: angleproject:5706 Bug: angleproject:6591 Change-Id: I9d1ee3fcb3d1aebc86e60896e0065cab847a92b4 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3233901 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Tim Van Patten 02b73c2f 2021-07-14T15:45:47 Vulkan: Flush descriptor set updates during flush*Commands() The intent of this CL is to reduce the number of descriptor set updates by delaying the work until all of the GLES commands that could trigger a re-update have been performed and the command stream is being flushed. To achieve this, flushDescriptorSetUpdates() is being moved from setupDraw()/setupDispatch() to flushRenderPassCommands()/flushOutsideRPCommands(). This change also exposed an issue where the BufferView handles were not being preserved until flushDescriptorSetUpdates() was called. To resolve this, flushDescriptorSetUpdates() is also being called during BufferViewHelper::release() before the BufferView memory is released. Bug: angleproject:5706 Change-Id: I61e19af9c0fac891aa2115d72391459b80d22f19 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2939385 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
Tim Van Patten eb1d2474 2021-10-04T20:23:26 Vulkan: Add R8G8B8_UNORM to vk_format_map.json The map of R8G8B8_UNORM -> VK_FORMAT_R8G8B8_UNORM is missing from vk_format_map.json. This leads to attempting to get format bits for angle::FormatID::NONE / VK_FORMAT_UNDEFINED. This CL adds R8G8B8_UNORM to vk_format_map.json, so devices that support it, like ARM, can use it. This allows those devices to import AHBs created with R8G8B8_UNORM. This CL also adds some additional ASSERT() and UNREACHABLE() calls to catch missing formats sooner. This allows the EGL tests to pass on ARM devices, but the tests are still skipped due to Qualcomm not having the necessary support for optimal tiling. Bug: angleproject:6277 Test: dEQP-EGL.functional.image* Change-Id: I41b7ead97a10ae80be4b6048d36d0d85ad71784f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3204152 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi f3334d03 2021-09-30T23:44:54 Vulkan: Fix importing layered AHBs Bug: angleproject:6475 Change-Id: Iceb0880cadc54552d3f01593d2e12088cafa10cc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3198733 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 6793d50e 2021-10-06T15:48:55 Vulkan: Remove ImageHelper::setFirstAllocatedLevel and Add assertion ImageHelper::mFirstAllocatedLevel is set via ImageHelper::initExternal. There isn't a good use to set the mFirstAllocatedLevel when mImage is invalid, and semantically it is wrong to try to get mFirstAllocatedLevel or format while its storage is invalid (i.e., not allocated). This CL removes ImageHelper::setFirstAllocatedLevel() API all together and added assertion that image is valid when ImageHelper::getFirstAllocatedLevel and getActualFormat and various other get APIs whose value are set during initExternal call. Bug: angleproject:6532 Change-Id: I9c97f488b3e959443fec632540e7f0906a49dc13 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3209838 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 185e48a7 2021-10-06T18:53:08 Vulkan: Make TextureVk::mRedefinedLevels bitmask of gl::LevelIndex We have gl::LevelIndex and vk::LevelIndex. gl::LevelIndex means level index at OpenGL concept and is used in TextureVk code. vk::LevelIndex means already adjusted with baseLevel and is used by ImageHelper object. This mRedefinedLevel is gl::TexLevelMask type, but it actually is a bit mask of vk::LevelIndex right now. This is inconsistent and confusing. This CL changes it to bit mask of gl::LevelIndex to be consistent with the namespace of "gl". Bug: angleproject:6532 Change-Id: Ic88e373f70d3bd3e3fea676765c82fd0941e245c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3210726 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 6cb599f9 2021-10-06T13:07:27 Vulkan: Change dest to dst for consistency Cleanup only, no functional change. dst aligns better with src. Bug: angleproject:6502 Change-Id: I69821b1aae50a7ce647c7cc876468b6de309eec8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3208514 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Charlie Lao a52f4032 2021-09-24T15:31:26 Vulkan: Skip releaseImage call when image is invalid releaseImage is only useful if image is already valid. Otherwise it is wasting CPU cycles to go through bunch of release calls that essentially doing nothing. Bug: angleproject:6014 Change-Id: I550b12bdc566cca699f6bf6662d176a01b2bce2e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3183800 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Charlie Lao b600d212 2021-09-24T15:05:34 Vulkan: Consolidate calls to respecifyImageStorageAndLevels respecifyImageStorage() calls respecifyImageStorageAndLevels with the same arguments that respecifyImageStorageAndLevels() could easily get from the mImage and TextureState. This CL get rid of respecifyImageStorageAndLevels and only uses respecifyImageStorage(). Bug: angleproject:6532 Change-Id: I388af1f1db0e3ce6c77475a03667fca451ab7013 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3183399 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 34ee74be 2021-10-06T15:00:49 Vulkan: Remove unused imageBaseLevel from TextureVk::setImageHelper We used to store baseLevel in ImageHelper object. Since then we have removed baseLevel from ImageHelper to make ImageHelper object able to be immutable for immutable textures. During that effort, the usage of baseLevel has been switched to retrieve directly from TextureState directly. This CL removes imageBaseLevel from the call. Bug: angleproject:4999 Change-Id: I6ea8a651ee81bebc8529ffaaaba22c3ce4f8ac90 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3209831 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi a097ee2e 2021-09-27T15:18:02 Vulkan: Fix clearing external images with emulated format External images may already have data, and clearing them due to their format being emulated is incorrect. This change makes sure that only the emulated channels are cleared. The RGBXDataPreservedAHB test is based on one contributed by Jason Macnak <natsu@google.com>. Bug: b/192315789 Change-Id: Ibc8953fdac356f2a62a5b46512a51e1916b4a1b6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3193416 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Tim Van Patten 57d59e83 2021-09-07T17:41:11 Vulkan: Add ResourceWrite to track Read and Write Access vk::Resource currently only tracks accesses in general, not which type of access is being performed. This CL adds the new class ResourceWrite to track whether the access is a Read or Read/Write access and when the access completes. This allows a follow-on CL to know when a buffer is being written to by the GPU or if the GPU is only reading from a buffer. Tracking write accesses to buffers is required when attempting to "Ghost" (duplicate) GPU-read-only buffers to prevent breaking the render pass when the CPU maps the buffer memory. Bug: angleproject:5971 Test: ComputeShaderTest.ImageBufferMapWrite Change-Id: I965e3e75730719ccce77334744ae4feae33c6101 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3146319 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Jamie Madill 9184973f 2021-07-21T08:28:30 Add GetCompressedTexImageANGLE to ANGLE_get_image Includes front-end support for reading back compressed texture images. Back-end support is incomplete and will be implemented in a future CL. CL authored by cnorthrop@google.com. Bug: angleproject:6177 Change-Id: I1482b15e5ffec6120f09f51b2718cdbef07c93c8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3163359 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Charlie Lao ca70b636 2021-09-09T16:34:34 Vulkan: Reformat staged buffer data using CPU When a R4G4B4A4 texture is attached to FBO, we dynamically choose a new format to fallback to R8G8B8A8 on some GPU that can't render to R4G4B4A4. During this format switch, if we already have a staged buffer update with old format, we must reformat the data to new format. Right now this is done by initImage and flush out staged update and read back and restage. This is very inefficient. This CL adds a new code path that just uses CPU to convert the staged data from old format to new format. Bug: b/198788068 Change-Id: I9b763dafdc9431d4fbbc26169c156b09ac13c815 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3153055 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Charlie Lao 0a592aa4 2021-09-01T19:00:24 Vulkan: Add warning when a fallback texture format is used. Emit a performance warning message when a fallback texture format is been used for sampling. Emit a performance warning when we have to do data copy during format fallback transition. Bug: b/196456356 Change-Id: Ifbe66069e506597dbacfefda10e699a8e9f320d5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3139239 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Charlie Lao 856a0e03 2021-09-01T18:09:14 Vulkan: Make vk::Format from struct to class With all the recent changes that there are two actualImageFormatIDs, retrieve the actual format requires pass in a renderable boolean. And the vertex format also has a similar requirement to the real format may differ depends on if it is compressed or not. This struct no longer safe to expose the underline data members directly. This CL turns it into a class and expose the actual format via method that requires renderable or compressed boolean. Bug: b/196456356 Change-Id: Ie2f8308cc408bde1b0787e0b392e143187cc4425 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3139236 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>