67 :
PlaygroundImpl(switches), handle_(
nullptr, &DestroyWindowHandle) {
69
70 InitGlobalVulkanInstance();
71
72 ::glfwDefaultWindowHints();
73 ::glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
75
76 auto window = ::glfwCreateWindow(1, 1,
"Test",
nullptr,
nullptr);
79 return;
80 }
81
86
88
89 ContextVK::Settings context_settings;
90 context_settings.proc_address_callback =
91 reinterpret_cast<PFN_vkGetInstanceProcAddr>(
92 &::glfwGetInstanceProcAddress);
96 context_settings.fatal_missing_validations =
99
101 if (!context_vk || !context_vk->IsValid()) {
102 VALIDATION_LOG <<
"Could not create Vulkan context in the playground.";
103 return;
104 }
105
106 VkSurfaceKHR vk_surface;
107 auto res = vk::Result{::glfwCreateWindowSurface(
108 context_vk->GetInstance(),
110 nullptr,
111 &vk_surface
112 )};
113 if (res != vk::Result::eSuccess) {
115 << vk::to_string(res);
116 return;
117 }
118
119 vk::UniqueSurfaceKHR
surface{vk_surface, context_vk->GetInstance()};
120 auto context = context_vk->CreateSurfaceContext();
121 if (!context->SetWindowSurface(std::move(surface), size_)) {
123 return;
124 }
125
126 context_ = std::move(context);
127}
static std::shared_ptr< ContextVK > Create(Settings settings)
PlaygroundImpl(PlaygroundSwitches switches)
const PlaygroundSwitches switches_
static bool IsVulkanDriverPresent()
#define FML_CHECK(condition)
fml::UniqueFD GetCachesDirectory()
static std::vector< std::shared_ptr< fml::Mapping > > ShaderLibraryMappingsForPlayground()
bool enable_vulkan_validation