14#include <X11/Xlib-xcb.h>
21 if (!sk_gpu_test::LoadVkLibraryAndGetProcAddrFuncs(&instProc)) {
22 SkDebugf(
"Could not load vulkan library\n");
26 auto createVkSurface = [&
info, instProc](VkInstance
instance) -> VkSurfaceKHR {
28 if (!createXcbSurfaceKHR) {
38 surfaceCreateInfo.
pNext =
nullptr;
39 surfaceCreateInfo.
flags = 0;
51 auto canPresent = [&
info, instProc](VkInstance
instance, VkPhysicalDevice physDev,
52 uint32_t queueFamilyIndex) {
54 getPhysicalDeviceXcbPresentationSupportKHR =
nullptr;
55 if (!getPhysicalDeviceXcbPresentationSupportKHR) {
56 getPhysicalDeviceXcbPresentationSupportKHR =
58 instProc(
instance,
"vkGetPhysicalDeviceXcbPresentationSupportKHR");
61 Display* display =
info.fDisplay;
62 VisualID visualID = XVisualIDFromVisual(DefaultVisual(
info.fDisplay,
63 DefaultScreen(
info.fDisplay)));
64 VkBool32 check = getPhysicalDeviceXcbPresentationSupportKHR(physDev,
66 XGetXCBConnection(display),
70 std::unique_ptr<WindowContext> ctx(
71 new internal::GraphiteVulkanWindowContext(displayParams,
75 if (!ctx->isValid()) {
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
#define check(reporter, ref, unref, make, kill)
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
std::unique_ptr< WindowContext > MakeGraphiteVulkanForXlib(const XlibWindowInfo &info, const DisplayParams &displayParams)
VkXcbSurfaceCreateFlagsKHR flags
xcb_connection_t * connection
PFN_vkVoidFunction(VKAPI_PTR * PFN_vkGetInstanceProcAddr)(VkInstance instance, const char *pName)
@ VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR
VkResult(VKAPI_PTR * PFN_vkCreateXcbSurfaceKHR)(VkInstance instance, const VkXcbSurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface)
VkBool32(VKAPI_PTR * PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t *connection, xcb_visualid_t visual_id)