Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
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
5 changes: 0 additions & 5 deletions impeller/renderer/backend/gles/blit_pass_gles.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ bool BlitPassGLES::OnCopyTextureToBufferCommand(
return true;
}

bool BlitPassGLES::OnOptimizeForGPUAccess(std::shared_ptr<Texture> texture,
std::string label) {
return true;
}

// |BlitPass|
bool BlitPassGLES::OnGenerateMipmapCommand(std::shared_ptr<Texture> texture,
std::string label) {
Expand Down
4 changes: 0 additions & 4 deletions impeller/renderer/backend/gles/blit_pass_gles.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ class BlitPassGLES final : public BlitPass {
size_t destination_offset,
std::string label) override;

// |BlitPass|
bool OnOptimizeForGPUAccess(std::shared_ptr<Texture> texture,
std::string label) override;

// |BlitPass|
bool OnGenerateMipmapCommand(std::shared_ptr<Texture> texture,
std::string label) override;
Expand Down
9 changes: 0 additions & 9 deletions impeller/renderer/backend/metal/blit_command_mtl.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,4 @@ struct BlitGenerateMipmapCommandMTL : public BlitGenerateMipmapCommand,
[[nodiscard]] bool Encode(id<MTLBlitCommandEncoder> encoder) const override;
};

struct BlitOptimizeGPUAccessCommandMTL : public BlitGenerateMipmapCommand,
public BlitEncodeMTL {
~BlitOptimizeGPUAccessCommandMTL() override;

std::string GetLabel() const override;

[[nodiscard]] bool Encode(id<MTLBlitCommandEncoder> encoder) const override;
};

} // namespace impeller
19 changes: 0 additions & 19 deletions impeller/renderer/backend/metal/blit_command_mtl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -112,23 +112,4 @@
return true;
};

BlitOptimizeGPUAccessCommandMTL::~BlitOptimizeGPUAccessCommandMTL() = default;

std::string BlitOptimizeGPUAccessCommandMTL::GetLabel() const {
return label;
}

bool BlitOptimizeGPUAccessCommandMTL::Encode(
id<MTLBlitCommandEncoder> encoder) const {
if (@available(macOS 10.14, iOS 12, tvOS 12, *)) {
auto texture_mtl = TextureMTL::Cast(*texture).GetMTLTexture();
if (!texture_mtl) {
return false;
}

[encoder optimizeContentsForGPUAccess:texture_mtl];
}
return true;
}

} // namespace impeller
4 changes: 0 additions & 4 deletions impeller/renderer/backend/metal/blit_pass_mtl.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ class BlitPassMTL final : public BlitPass {
bool OnGenerateMipmapCommand(std::shared_ptr<Texture> texture,
std::string label) override;

// |BlitPass|
bool OnOptimizeForGPUAccess(std::shared_ptr<Texture> texture,
std::string label) override;

FML_DISALLOW_COPY_AND_ASSIGN(BlitPassMTL);
};

Expand Down
11 changes: 0 additions & 11 deletions impeller/renderer/backend/metal/blit_pass_mtl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,4 @@
return true;
}

// |BlitPass|
bool BlitPassMTL::OnOptimizeForGPUAccess(std::shared_ptr<Texture> texture,
std::string label) {
auto command = std::make_unique<BlitOptimizeGPUAccessCommandMTL>();
command->label = label;
command->texture = std::move(texture);

commands_.emplace_back(std::move(command));
return true;
}

} // namespace impeller
6 changes: 0 additions & 6 deletions impeller/renderer/backend/vulkan/blit_pass_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,6 @@ bool BlitPassVK::OnCopyTextureToBufferCommand(
return true;
}

// |BlitPass|
bool BlitPassVK::OnOptimizeForGPUAccess(std::shared_ptr<Texture> texture,
std::string label) {
return true;
}

// |BlitPass|
bool BlitPassVK::OnGenerateMipmapCommand(std::shared_ptr<Texture> texture,
std::string label) {
Expand Down
3 changes: 0 additions & 3 deletions impeller/renderer/backend/vulkan/blit_pass_vk.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ class BlitPassVK final : public BlitPass {
std::string label) override;

// |BlitPass|
bool OnOptimizeForGPUAccess(std::shared_ptr<Texture> texture,
std::string label) override;
// |BlitPass|
bool OnGenerateMipmapCommand(std::shared_ptr<Texture> texture,
std::string label) override;

Expand Down
5 changes: 0 additions & 5 deletions impeller/renderer/blit_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,6 @@ bool BlitPass::AddCopy(std::shared_ptr<Texture> source,
std::move(label));
}

bool BlitPass::OptimizeForGPUAccess(std::shared_ptr<Texture> texture,
std::string label) {
return OnOptimizeForGPUAccess(std::move(texture), std::move(label));
}

bool BlitPass::GenerateMipmap(std::shared_ptr<Texture> texture,
std::string label) {
if (!texture) {
Expand Down
16 changes: 0 additions & 16 deletions impeller/renderer/blit_pass.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,6 @@ class BlitPass {
///
bool GenerateMipmap(std::shared_ptr<Texture> texture, std::string label = "");

//----------------------------------------------------------------------------
/// @brief Optimize the provided texture for GPU access.
/// This will no-op on platforms where this functionality is
/// unsupported.
///
/// @param[in] texture The texture to generate mipmaps for.
/// @param[in] label The optional debug label to give the command.
///
/// @return If the command was valid for subsequent commitment.
///
bool OptimizeForGPUAccess(std::shared_ptr<Texture> texture,
std::string label = "");

//----------------------------------------------------------------------------
/// @brief Encode the recorded commands to the underlying command buffer.
///
Expand Down Expand Up @@ -140,9 +127,6 @@ class BlitPass {
size_t destination_offset,
std::string label) = 0;

virtual bool OnOptimizeForGPUAccess(std::shared_ptr<Texture> texture,
std::string label) = 0;

virtual bool OnGenerateMipmapCommand(std::shared_ptr<Texture> texture,
std::string label) = 0;

Expand Down
3 changes: 0 additions & 3 deletions impeller/renderer/testing/mocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ class MockBlitPass : public BlitPass {
size_t destination_offset,
std::string label));

MOCK_METHOD2(OnOptimizeForGPUAccess,
bool(std::shared_ptr<Texture> texture, std::string label));

MOCK_METHOD2(OnGenerateMipmapCommand,
bool(std::shared_ptr<Texture> texture, std::string label));
};
Expand Down
1 change: 0 additions & 1 deletion lib/ui/painting/image_decoder_impeller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ sk_sp<DlImage> ImageDecoderImpeller::UploadTexture(
}
blit_pass->SetLabel("Mipmap Blit Pass");
blit_pass->GenerateMipmap(texture);
blit_pass->OptimizeForGPUAccess(texture);

blit_pass->EncodeCommands(context->GetResourceAllocator());
if (!command_buffer->SubmitCommands()) {
Expand Down