Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[impeller] fixed flake where blit wasn't tracking its texture #41347

Merged
merged 2 commits into from
Apr 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions impeller/renderer/backend/vulkan/blit_command_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ bool BlitCopyTextureToTextureCommandVK::Encode(
const auto& src = TextureVK::Cast(*source);
const auto& dst = TextureVK::Cast(*destination);

if (!encoder.Track(source) || !encoder.Track(destination)) {
return false;
}

LayoutTransition src_tran;
src_tran.cmd_buffer = cmd_buffer;
src_tran.new_layout = vk::ImageLayout::eTransferSrcOptimal;
Expand Down Expand Up @@ -96,6 +100,10 @@ bool BlitCopyTextureToBufferCommandVK::Encode(CommandEncoderVK& encoder) const {
// cast source and destination to TextureVK
const auto& src = TextureVK::Cast(*source);

if (!encoder.Track(source)) {
return false;
}

LayoutTransition transition;
transition.cmd_buffer = cmd_buffer;
transition.new_layout = vk::ImageLayout::eTransferSrcOptimal;
Expand Down Expand Up @@ -190,6 +198,10 @@ bool BlitGenerateMipmapCommandVK::Encode(CommandEncoderVK& encoder) const {
const auto& image = src.GetImage();
const auto& cmd = encoder.GetCommandBuffer();

if (!encoder.Track(texture)) {
return false;
}

// Transition the base mip level to transfer-src layout so we can read from
// it and transition the rest to dst-optimal since they are going to be
// written to.
Expand Down