62 :
PlaygroundImpl(switches), handle_(
nullptr, &DestroyWindowHandle) {
64
65 InitGlobalVulkanInstance();
66
67 ::glfwDefaultWindowHints();
68 ::glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
70
71 auto window = ::glfwCreateWindow(1, 1,
"Test",
nullptr,
nullptr);
74 return;
75 }
76
81
83
84 ContextVK::Settings context_settings;
85 context_settings.proc_address_callback =
87 &::glfwGetInstanceProcAddress);
91 context_settings.fatal_missing_validations =
93 ;
94
96 if (!context_vk || !context_vk->IsValid()) {
97 VALIDATION_LOG <<
"Could not create Vulkan context in the playground.";
98 return;
99 }
100
101 VkSurfaceKHR vk_surface;
102 auto res = vk::Result{::glfwCreateWindowSurface(
103 context_vk->GetInstance(),
105 nullptr,
106 &vk_surface
107 )};
108 if (res != vk::Result::eSuccess) {
111 return;
112 }
113
114 vk::UniqueSurfaceKHR
surface{vk_surface, context_vk->GetInstance()};
115 auto context = context_vk->CreateSurfaceContext();
116 if (!context->SetWindowSurface(std::move(
surface), size_)) {
118 return;
119 }
120
121 context_ = std::move(context);
122}
static std::shared_ptr< ContextVK > Create(Settings settings)
static bool IsVulkanDriverPresent()
PlaygroundImpl(PlaygroundSwitches switches)
const PlaygroundSwitches switches_
#define FML_CHECK(condition)
fml::UniqueFD GetCachesDirectory()
static std::vector< std::shared_ptr< fml::Mapping > > ShaderLibraryMappingsForPlayground()
static SkString to_string(int n)
bool enable_vulkan_validation
PFN_vkVoidFunction(VKAPI_PTR * PFN_vkGetInstanceProcAddr)(VkInstance instance, const char *pName)