[Impeller] Fix validation error about incorrect aspect on buffer to texture copies. (flutter/engine#46078)

This shows up when we try to set the contents of a depth of stencil image. The aspect was assumed to be color only because typical Impeller workloads have device-transient depth and stencil images. But the "stencil mask" test apparently does set the context directly. Besides, this is perfectly valid usage. This makes Vulkan resilient to said usage.
This commit is contained in:
Chinmay Garde
2023-09-19 16:40:14 -07:00
committed by GitHub
parent dc05767b39
commit c762dfe955

View File

@@ -93,7 +93,8 @@ bool TextureVK::OnSetContents(const uint8_t* contents,
copy.imageExtent.width = desc.size.width;
copy.imageExtent.height = desc.size.height;
copy.imageExtent.depth = 1u;
copy.imageSubresource.aspectMask = vk::ImageAspectFlagBits::eColor;
copy.imageSubresource.aspectMask =
ToImageAspectFlags(GetTextureDescriptor().format);
copy.imageSubresource.mipLevel = 0u;
copy.imageSubresource.baseArrayLayer = slice;
copy.imageSubresource.layerCount = 1u;