1 #ifndef DALI_GRAPHICS_VULKAN_VKSURFACEXLIB2XCB_H
2 #define DALI_GRAPHICS_VULKAN_VKSURFACEXLIB2XCB_H
5 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 #ifndef VK_USE_PLATFORM_XLIB_KHR
22 #define VK_USE_PLATFORM_XLIB_KHR
24 #ifndef VK_USE_PLATFORM_XCB_KHR
25 #define VK_USE_PLATFORM_XCB_KHR
29 #include <dali/integration-api/graphics/vulkan/vk-surface-factory.h>
32 #include <vulkan/vulkan.hpp>
43 * This surface exists only because of ( probably ) Nvidia driver bug.
44 * Presenting swapchain that uses Xlib surface crashes. Class VkSurfaceXlib2Xcb
45 * takes Xlib window arguments but creates Xcb surface. It's a workaround.
47 class VkSurfaceXlib2Xcb final : public Dali::Integration::Graphics::Vulkan::VkSurfaceFactory
50 VkSurfaceXlib2Xcb(Dali::RenderSurface& renderSurface);
52 VkSurfaceXlib2Xcb(Display* display, Window window);
54 virtual vk::SurfaceKHR Create(vk::Instance instance, vk::AllocationCallbacks* allocCallbacks,
55 vk::PhysicalDevice physicalDevice) const override;
58 xcb_connection_t* mConnection;
60 vk::SurfaceKHR mSurface;
64 } // Namespace Graphics
67 #endif // DALI_GRAPHICS_VULKAN_VKSURFACEXLIB2XCB_H