Repository navigation
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilitye: embedderUsers of the Embedder APIUsers of the Embedder APIperf: startupPerformance issues related to app startup timePerformance issues related to app startup timeteam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Description
Background
To improve startup performance in later runs of the app, Impeller can use Vulkan's pipeline cache to cache some shader pipeline data to disk. To enable this feature, the embedder must configure Impeller Vulkan's pipeline cache directory (ContextVK::Settings::cache_directory).
However, this feature is not yet available on the embedder API, so out-of-tree embedders cannot benefit from this optimization.
Work
Add an embedder API to configure Impeller Vulkan's cache directory.
Strawman API:
/// Callback for when a VkImage has been written to and is ready for use by the
/// embedder.
typedef bool (*FlutterVulkanPresentCallback)(
void* /* user data */,
const FlutterVulkanImage* /* image */);
typedef struct {
/// The size of this struct. Must be sizeof(FlutterVulkanRendererConfig).
size_t struct_size;
// ...
/// 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;Resources
- Vulkan's pipeline cache docs: https://docs.vulkan.org/guide/latest/pipeline_cache.html
- Impeller Vulkan's pipeline cache logic: https://github.com/flutter/flutter/blob/496e76f95b64889b03234f7d450aea0fdddf0c8e/engine/src/flutter/impeller/renderer/backend/vulkan/pipeline_cache_vk.cc
- Impeller Vulkan's config for the pipeline cache directory,
ContextVK::Settings::cache_directory:fml::UniqueFD cache_directory; - Embedder API's logic to create Impeller Vulkan's settings:
flutter/engine/src/flutter/shell/platform/embedder/embedder_surface_vulkan_impeller.cc
Lines 53 to 56 in 496e76f
impeller::ContextVK::Settings settings; settings.shader_libraries_data = shader_mappings; settings.proc_address_callback = vulkan_dispatch_table.get_instance_proc_address;
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilitye: embedderUsers of the Embedder APIUsers of the Embedder APIperf: startupPerformance issues related to app startup timePerformance issues related to app startup timeteam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Activity
xiaowei-guan commentedon Oct 21, 2026
@loic-sharma How can the pipeline cache feature be verified? In a typical app, there is no noticeable improvement in startup time.
loic-sharma commentedon Oct 22, 2026
@andywolff Would you know?
andywolff commentedon Oct 22, 2026
I haven't dealt with this kind of thing much yet, but maybe @walley892 can answer. He's been working on startup time improvements.