Skip to content

Commit

Permalink
[Impeller] Fix validation error about incorrect aspect on buffer to t…
Browse files Browse the repository at this point in the history
…exture copies. (#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.
  • Loading branch information
chinmaygarde authored and harryterkelsen committed Oct 23, 2023
1 parent 601745d commit 6f424ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion impeller/renderer/backend/vulkan/texture_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6f424ec

Please sign in to comment.