Skip to content

Commit 5a924a9

Browse files
authored
[Impeller] Fix validation error about incorrect aspect on buffer to texture copies. (flutter#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.
1 parent 99053b9 commit 5a924a9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

impeller/renderer/backend/vulkan/texture_vk.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ bool TextureVK::OnSetContents(const uint8_t* contents,
9393
copy.imageExtent.width = desc.size.width;
9494
copy.imageExtent.height = desc.size.height;
9595
copy.imageExtent.depth = 1u;
96-
copy.imageSubresource.aspectMask = vk::ImageAspectFlagBits::eColor;
96+
copy.imageSubresource.aspectMask =
97+
ToImageAspectFlags(GetTextureDescriptor().format);
9798
copy.imageSubresource.mipLevel = 0u;
9899
copy.imageSubresource.baseArrayLayer = slice;
99100
copy.imageSubresource.layerCount = 1u;

0 commit comments

Comments
 (0)