8#include "impeller/entity/vk/entity_shaders_vk.h"
9#include "impeller/entity/vk/framebuffer_blend_shaders_vk.h"
10#include "impeller/entity/vk/modern_shaders_vk.h"
12#include "impeller/renderer/vk/compute_shaders_vk.h"
16static std::vector<std::shared_ptr<fml::Mapping>>
19 std::make_shared<fml::NonOwnedMapping>(impeller_entity_shaders_vk_data,
20 impeller_entity_shaders_vk_length),
21 std::make_shared<fml::NonOwnedMapping>(impeller_modern_shaders_vk_data,
22 impeller_modern_shaders_vk_length),
23 std::make_shared<fml::NonOwnedMapping>(
24 impeller_framebuffer_blend_shaders_vk_data,
25 impeller_framebuffer_blend_shaders_vk_length),
26 std::make_shared<fml::NonOwnedMapping>(
27 impeller_compute_shaders_vk_data, impeller_compute_shaders_vk_length),
32thread_local std::function<PFN_vkVoidFunction(VkInstance
instance,
33 const char* proc_name)>
36VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL
56 auto impeller_context =
59 if (!impeller_context) {
63 return Create(std::move(impeller_context));
67 std::shared_ptr<impeller::Context> impeller_context) {
70 auto context = Adopt<Context>(
new ContextVK(std::move(impeller_context)));
71 if (!context->IsValid()) {
84 : enable_validation(settings.enable_vulkan_validation) {
87 const char* proc_name) -> PFN_vkVoidFunction {
89 return reinterpret_cast<PFN_vkVoidFunction
>(
103 info.
vk_instance =
reinterpret_cast<void*
>(VkInstance(context.GetInstance()));
105 reinterpret_cast<void*
>(VkPhysicalDevice(context.GetPhysicalDevice()));
107 reinterpret_cast<void*
>(VkDevice(context.GetDevice()));
110 context.GetGraphicsQueue()->GetIndex().family;
116 return !!instance_proc_address_callback;
static ContextVK & Cast(Context &base)
static std::shared_ptr< ContextVK > Create(Settings settings)
std::shared_ptr< impeller::Context > GetContext() const
ContextVK(const ContextVK &)=delete
bool GetInfo(ImpellerContextVulkanInfo &info) const
static ScopedObject< Context > Create(const Settings &settings)
fml::UniqueFD GetCachesDirectory()
thread_local std::function< PFN_vkVoidFunction(VkInstance instance, const char *proc_name)> sContextVKProcAddressCallback
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL ContextVKGetInstanceProcAddress(VkInstance instance, const char *proc_name)
static std::vector< std::shared_ptr< fml::Mapping > > CreateShaderLibraryMappings()
uint32_t graphics_queue_index
uint32_t graphics_queue_family_index
void *IMPELLER_NULLABLE vk_instance
void *IMPELLER_NULLABLE vk_logical_device
void *IMPELLER_NULLABLE vk_physical_device
ImpellerVulkanProcAddressCallback IMPELLER_NONNULL proc_address_callback
void *IMPELLER_NULLABLE user_data
std::vector< std::shared_ptr< fml::Mapping > > shader_libraries_data
PFN_vkGetInstanceProcAddr proc_address_callback
fml::UniqueFD cache_directory
std::function< PFN_vkVoidFunction(VkInstance instance, const char *proc_name)> instance_proc_address_callback