67 :
PlaygroundImpl(switches), handle_(
nullptr, &DestroyWindowHandle) {
70 InitGlobalVulkanInstance();
72 ::glfwDefaultWindowHints();
73 ::glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
74 ::glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
76 auto window = ::glfwCreateWindow(1, 1,
"Test",
nullptr,
nullptr);
84 ::glfwGetWindowSize(window, &width, &height);
85 size_ =
ISize{width, height};
87 handle_.reset(window);
89 ContextVK::Settings context_settings;
90 context_settings.proc_address_callback =
91 reinterpret_cast<PFN_vkGetInstanceProcAddr
>(
92 &::glfwGetInstanceProcAddress);
94 context_settings.cache_directory = fml::paths::GetCachesDirectory();
96 context_settings.fatal_missing_validations =
101 if (!context_vk || !context_vk->IsValid()) {
102 VALIDATION_LOG <<
"Could not create Vulkan context in the playground.";
106 VkSurfaceKHR vk_surface;
107 auto res = vk::Result{::glfwCreateWindowSurface(
108 context_vk->GetInstance(),
113 if (res != vk::Result::eSuccess) {
115 << vk::to_string(res);
119 vk::UniqueSurfaceKHR surface{vk_surface, context_vk->GetInstance()};
120 auto context = context_vk->CreateSurfaceContext();
121 if (!context->SetWindowSurface(std::move(surface), size_)) {
126 context_ = std::move(context);
static std::shared_ptr< ContextVK > Create(Settings settings)
PlaygroundImpl(PlaygroundSwitches switches)
const PlaygroundSwitches switches_
static bool IsVulkanDriverPresent()
static std::vector< std::shared_ptr< fml::Mapping > > ShaderLibraryMappingsForPlayground()
bool enable_vulkan_validation