9#include "flutter/impeller/entity/vk/entity_shaders_vk.h"
10#include "flutter/impeller/entity/vk/framebuffer_blend_shaders_vk.h"
11#include "flutter/impeller/entity/vk/modern_shaders_vk.h"
15#include "include/gpu/ganesh/GrDirectContext.h"
23 size_t instance_extension_count,
24 const char** instance_extensions,
25 size_t device_extension_count,
26 const char** device_extensions,
32 std::shared_ptr<EmbedderExternalViewEmbedder> external_view_embedder)
33 : vk_(
fml::MakeRefCounted<
vulkan::VulkanProcTable>(
34 vulkan_dispatch_table.get_instance_proc_address)),
35 vulkan_dispatch_table_(vulkan_dispatch_table),
36 external_view_embedder_(
std::move(external_view_embedder)) {
44 std::vector<std::shared_ptr<fml::Mapping>> shader_mappings = {
45 std::make_shared<fml::NonOwnedMapping>(impeller_entity_shaders_vk_data,
46 impeller_entity_shaders_vk_length),
47 std::make_shared<fml::NonOwnedMapping>(impeller_modern_shaders_vk_data,
48 impeller_modern_shaders_vk_length),
49 std::make_shared<fml::NonOwnedMapping>(
50 impeller_framebuffer_blend_shaders_vk_data,
51 impeller_framebuffer_blend_shaders_vk_length),
64 data.instance_extensions.reserve(instance_extension_count);
65 for (
auto i = 0u;
i < instance_extension_count;
i++) {
66 data.instance_extensions.push_back(std::string{instance_extensions[
i]});
68 data.device_extensions.reserve(device_extension_count);
69 for (
auto i = 0u;
i < device_extension_count;
i++) {
70 data.device_extensions.push_back(std::string{device_extensions[
i]});
76 FML_LOG(ERROR) <<
"Failed to initialize Vulkan Context.";
80 FML_LOG(IMPORTANT) <<
"Using the Impeller rendering backend (Vulkan).";
87std::shared_ptr<impeller::Context>
110bool EmbedderSurfaceVulkanImpeller::IsValid()
const {
115std::unique_ptr<Surface> EmbedderSurfaceVulkanImpeller::CreateGPUSurface() {
116 return std::make_unique<GPUSurfaceVulkanImpeller>(
this, context_);
120sk_sp<GrDirectContext> EmbedderSurfaceVulkanImpeller::CreateResourceContext()
std::shared_ptr< impeller::Context > CreateImpellerContext() const override
~EmbedderSurfaceVulkanImpeller() override
EmbedderSurfaceVulkanImpeller(uint32_t version, VkInstance instance, size_t instance_extension_count, const char **instance_extensions, size_t device_extension_count, const char **device_extensions, VkPhysicalDevice physical_device, VkDevice device, uint32_t queue_family_index, VkQueue queue, const VulkanDispatchTable &vulkan_dispatch_table, std::shared_ptr< EmbedderExternalViewEmbedder > external_view_embedder)
FlutterVulkanImage AcquireImage(const DlISize &size) override
Called by the engine to fetch a VkImage for writing the next frame.
bool PresentImage(VkImage image, VkFormat format) override
Called by the engine once a frame has been rendered to the image and it's ready to be bound for furth...
const vulkan::VulkanProcTable & vk() override
Obtain a reference to the Vulkan implementation's proc table.
static std::shared_ptr< ContextVK > Create(Settings settings)
FlutterVulkanImage * image
VkPhysicalDevice physical_device
uint32_t queue_family_index
uint32_t uint32_t * format
#define FML_LOG(severity)
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
PFN_vkGetInstanceProcAddr get_instance_proc_address
std::function< bool(VkImage image, VkFormat format)> present_image
std::function< FlutterVulkanImage(const DlISize &frame_size)> get_next_image
std::vector< std::shared_ptr< fml::Mapping > > shader_libraries_data
PFN_vkGetInstanceProcAddr proc_address_callback
std::optional< EmbedderData > embedder_data