Skip to content
Open
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: 5 additions & 0 deletions flutter/shell/platform/embedder/embedder.h
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,11 @@ typedef struct {
/// that external texture details can be supplied to the engine for subsequent
/// composition.
FlutterVulkanTextureFrameCallback external_texture_frame_callback;
/// The path to the Vulkan pipeline cache data.
/// The string can be collected after the call to `FlutterEngineRun` returns.
/// The string must be NULL terminated.
/// If NULL, Impeller will not use the Vulkan pipeline cache.
const char* cache_path;
} FlutterVulkanRendererConfig;

typedef struct {
Expand Down
11 changes: 11 additions & 0 deletions flutter/shell/platform/tizen/tizen_renderer_vulkan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "flutter/shell/platform/tizen/tizen_renderer_vulkan.h"

#include <app.h>
#include <stddef.h>
#include <optional>
#include "flutter/shell/platform/tizen/external_texture_pixel_vulkan.h"
Expand Down Expand Up @@ -49,6 +50,14 @@ TizenRendererVulkan::TizenRendererVulkan(TizenViewBase* view) {
FT_LOG(Info) << "Vulkan version: " << VK_VERSION_MAJOR(version) << "."
<< VK_VERSION_MINOR(version) << "." << VK_VERSION_PATCH(version);

char* cache_path = app_get_cache_path();
if (cache_path) {
cache_path_ = cache_path;
free(cache_path);
} else {
FT_LOG(Warn)
<< "app_get_cache_path() failed. Vulkan pipeline cache is disabled.";
}
Comment on lines +53 to +60

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

} else {
  FT_LOG(Warn)
      << "app_get_cache_path() failed. Vulkan pipeline cache is disabled.";
}

Hmm... I'm not sure if there are actually cases where app_get_cache_path() fails, but since the cache won't work if the path doesn't exist, I think it's a good idea to log it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

InitVulkan(view);
}

Expand Down Expand Up @@ -200,6 +209,8 @@ FlutterRendererConfig TizenRendererVulkan::GetRendererConfig() {
return engine->texture_registrar()->PopulateVulkanTexture(texture_id, width,
height, texture);
};
config.vulkan.cache_path =
cache_path_.empty() ? nullptr : cache_path_.c_str();
return config;
}

Expand Down
1 change: 1 addition & 0 deletions flutter/shell/platform/tizen/tizen_renderer_vulkan.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class TizenRendererVulkan : public TizenRenderer {
bool resize_pending_ = false;
int32_t width_ = 0;
int32_t height_ = 0;
std::string cache_path_;
};
} // namespace flutter

Expand Down
Loading