Lines 36-41
Link Here
|
36 |
int GetDisplayImplementation(const char *displayServer, vktrace_replay::ReplayDisplayImp **ppDisp) { |
36 |
int GetDisplayImplementation(const char *displayServer, vktrace_replay::ReplayDisplayImp **ppDisp) { |
37 |
#if defined(PLATFORM_LINUX) && !defined(ANDROID) |
37 |
#if defined(PLATFORM_LINUX) && !defined(ANDROID) |
38 |
// On linux, the option -ds will choose a display server |
38 |
// On linux, the option -ds will choose a display server |
|
|
39 |
#if defined(VK_USE_PLATFORM_XCB_KHR) |
39 |
if (strcasecmp(displayServer, "xcb") == 0) { |
40 |
if (strcasecmp(displayServer, "xcb") == 0) { |
40 |
// Attempt to load libvkdisplay_xcb and constructor |
41 |
// Attempt to load libvkdisplay_xcb and constructor |
41 |
auto xcb_handle = dlopen("libvkdisplay_xcb.so", RTLD_NOW); |
42 |
auto xcb_handle = dlopen("libvkdisplay_xcb.so", RTLD_NOW); |
Lines 45-51
int GetDisplayImplementation(const char *displayServer, vktrace_replay::ReplayDi
Link Here
|
45 |
} |
46 |
} |
46 |
auto CreateVkDisplayXcb = reinterpret_cast<vkDisplayXcb *(*)()>(dlsym(xcb_handle, "CreateVkDisplayXcb")); |
47 |
auto CreateVkDisplayXcb = reinterpret_cast<vkDisplayXcb *(*)()>(dlsym(xcb_handle, "CreateVkDisplayXcb")); |
47 |
*ppDisp = CreateVkDisplayXcb(); |
48 |
*ppDisp = CreateVkDisplayXcb(); |
48 |
} else if (strcasecmp(displayServer, "wayland") == 0) { |
49 |
#elif defined(VK_USE_PLATFORM_WAYLAND_KHR) |
|
|
50 |
if (strcasecmp(displayServer, "wayland") == 0) { |
49 |
// Attempt to load libvkdisplay_wayland and constructor |
51 |
// Attempt to load libvkdisplay_wayland and constructor |
50 |
auto wayland_handle = dlopen("libvkdisplay_wayland.so", RTLD_NOW); |
52 |
auto wayland_handle = dlopen("libvkdisplay_wayland.so", RTLD_NOW); |
51 |
if (dlerror()) { |
53 |
if (dlerror()) { |
Lines 54-59
int GetDisplayImplementation(const char *displayServer, vktrace_replay::ReplayDi
Link Here
|
54 |
} |
56 |
} |
55 |
auto CreateVkDisplayWayland = reinterpret_cast<vkDisplayWayland *(*)()>(dlsym(wayland_handle, "CreateVkDisplayWayland")); |
57 |
auto CreateVkDisplayWayland = reinterpret_cast<vkDisplayWayland *(*)()>(dlsym(wayland_handle, "CreateVkDisplayWayland")); |
56 |
*ppDisp = CreateVkDisplayWayland(); |
58 |
*ppDisp = CreateVkDisplayWayland(); |
|
|
59 |
#endif |
57 |
} else { |
60 |
} else { |
58 |
vktrace_LogError("Invalid display server. Valid options are: xcb, wayland"); |
61 |
vktrace_LogError("Invalid display server. Valid options are: xcb, wayland"); |
59 |
return -1; |
62 |
return -1; |