Revert "[Impeller] mark decoded images as optimized for GPU access (#40356)" (flutter/engine#40387)

Revert "[Impeller] mark decoded images as optimized for GPU access"
This commit is contained in:
Jonah Williams 2023-03-17 12:14:52 -07:00 committed by GitHub
parent c7b040ec98
commit c13f016ce4
12 changed files with 0 additions and 86 deletions

View File

@ -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) {

View File

@ -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;

View File

@ -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

View File

@ -112,23 +112,4 @@ bool BlitGenerateMipmapCommandMTL::Encode(
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

View File

@ -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);
};

View File

@ -134,15 +134,4 @@ bool BlitPassMTL::OnGenerateMipmapCommand(std::shared_ptr<Texture> texture,
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

View File

@ -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) {

View File

@ -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;

View File

@ -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) {

View File

@ -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.
///
@ -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;

View File

@ -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));
};

View File

@ -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()) {