| BUILD_WSI_XCB_SUPPORT | Linux | `ON` | Build the components with XCB support. |
| BUILD_WSI_XLIB_SUPPORT | Linux | `ON` | Build the components with Xlib support. |
| BUILD_WSI_WAYLAND_SUPPORT | Linux | `ON` | Build the components with Wayland support. |
-| BUILD_WSI_MIR_SUPPORT | Linux | `OFF` | Build the components with Mir support. |
| USE_CCACHE | Linux | `OFF` | Enable caching with the CCache program. |
The following is a table of all string options currently supported by this repository:
#### Required Package List
sudo apt-get install git cmake build-essential libx11-xcb-dev \
- libxkbcommon-dev libmirclient-dev libwayland-dev libxrandr-dev
+ libxkbcommon-dev libwayland-dev libxrandr-dev
### Linux Build
+++ /dev/null
-# Try to find Mir on a Unix system
-#
-# This will define:
-#
-# MIR_FOUND - System has Mir
-# MIR_LIBRARIES - Link these to use Mir
-# MIR_INCLUDE_DIR - Include directory for Mir
-# MIR_DEFINITIONS - Compiler switches required for using Mir
-
-if (NOT WIN32)
-
- find_package (PkgConfig)
- pkg_check_modules (PKG_MIR QUIET mirclient)
- set(MIR_DEFINITIONS ${PKG_MIR_CFLAGS_OTHER})
-
- find_path(MIR_INCLUDE_DIR
- NAMES xkbcommon/xkbcommon.h
- HINTS ${PC_XKBCOMMON_INCLUDE_DIR} ${PC_XKBCOMMON_INCLUDE_DIRS}
- )
-
- find_library(MIR_LIBRARY
- NAMES mirclient
- HINTS ${PKG_MIR_LIBRARIES} ${MIR_LIBRARY_DIRS}
- )
-
- set (MIR_INCLUDE_DIR ${PKG_MIR_INCLUDE_DIRS})
- set (MIR_LIBRARIES ${MIR_LIBRARY})
-
- include (FindPackageHandleStandardArgs)
- find_package_handle_standard_args (MIR DEFAULT_MSG
- MIR_LIBRARIES
- MIR_INCLUDE_DIR
- )
-
- mark_as_advanced (MIR_LIBRARIES MIR_INCLUDE_DIR)
-
-endif ()
option(BUILD_WSI_XCB_SUPPORT "Build XCB WSI support" ON)
option(BUILD_WSI_XLIB_SUPPORT "Build Xlib WSI support" ON)
option(BUILD_WSI_WAYLAND_SUPPORT "Build Wayland WSI support" ON)
- option(BUILD_WSI_MIR_SUPPORT "Build Mir WSI support" OFF)
- set(CUBE_WSI_SELECTION "XCB" CACHE STRING "Select WSI target for cube (XCB, XLIB, WAYLAND, MIR, DISPLAY)")
+ set(CUBE_WSI_SELECTION "XCB" CACHE STRING "Select WSI target for cube (XCB, XLIB, WAYLAND, DISPLAY)")
if(BUILD_WSI_XCB_SUPPORT)
find_package(XCB REQUIRED)
find_package(Wayland REQUIRED)
include_directories(${WAYLAND_CLIENT_INCLUDE_DIR})
endif()
-
- if(BUILD_WSI_MIR_SUPPORT)
- find_package(Mir REQUIRED)
- endif()
-
endif()
if(WIN32)
set(CUBE_INCLUDE_DIRS ${WAYLAND_CLIENT_INCLUDE_DIR} ${CUBE_INCLUDE_DIRS})
link_libraries(${WAYLAND_CLIENT_LIBRARIES})
add_definitions(-DVK_USE_PLATFORM_WAYLAND_KHR)
- elseif(CUBE_WSI_SELECTION STREQUAL "MIR")
- if(NOT BUILD_WSI_MIR_SUPPORT)
- message(FATAL_ERROR "Selected MIR for cube build but not building Mir support")
- endif()
- add_definitions(-DVK_USE_PLATFORM_MIR_KHR)
- set(CUBE_INCLUDE_DIRS ${MIR_INCLUDE_DIR} ${CUBE_INCLUDE_DIRS})
elseif(CUBE_WSI_SELECTION STREQUAL "DISPLAY")
add_definitions(-DVK_USE_PLATFORM_DISPLAY_KHR)
else()
#define APP_NAME_STR_LEN 80
#endif // _WIN32
-#if defined(VK_USE_PLATFORM_MIR_KHR)
-#warning "Cube does not have code for Mir at this time"
-#endif
-
#ifdef ANDROID
#include "vulkan_wrapper.h"
#else
struct wl_seat *seat;
struct wl_pointer *pointer;
struct wl_keyboard *keyboard;
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#elif defined(VK_USE_PLATFORM_ANDROID_KHR)
struct ANativeWindow *window;
#elif (defined(VK_USE_PLATFORM_IOS_MVK) || defined(VK_USE_PLATFORM_MACOS_MVK))
wl_compositor_destroy(demo->compositor);
wl_registry_destroy(demo->registry);
wl_display_disconnect(demo->display);
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
vkDestroyInstance(demo->inst, NULL);
demo->quit = TRUE;
}
}
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#elif defined(VK_USE_PLATFORM_DISPLAY_KHR)
static VkResult demo_create_display_surface(struct demo *demo) {
VkResult U_ASSERT_ONLY err;
platformSurfaceExtFound = 1;
demo->extension_names[demo->enabled_extension_count++] = VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME;
}
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#elif defined(VK_USE_PLATFORM_DISPLAY_KHR)
if (!strcmp(VK_KHR_DISPLAY_EXTENSION_NAME, instance_extensions[i].extensionName)) {
platformSurfaceExtFound = 1;
"Do you have a compatible Vulkan installable client driver (ICD) installed?\n"
"Please look at the Getting Started guide for additional information.\n",
"vkCreateInstance Failure");
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#elif defined(VK_USE_PLATFORM_DISPLAY_KHR)
ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_DISPLAY_EXTENSION_NAME
" extension.\n\n"
createInfo.surface = demo->window;
err = vkCreateWaylandSurfaceKHR(demo->inst, &createInfo, NULL, &demo->surface);
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#elif defined(VK_USE_PLATFORM_ANDROID_KHR)
VkAndroidSurfaceCreateInfoKHR createInfo;
createInfo.sType = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR;
static void registry_handle_global_remove(void *data UNUSED, struct wl_registry *registry UNUSED, uint32_t name UNUSED) {}
static const struct wl_registry_listener registry_listener = {registry_handle_global, registry_handle_global_remove};
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
static void demo_init_connection(struct demo *demo) {
demo->registry = wl_display_get_registry(demo->display);
wl_registry_add_listener(demo->registry, ®istry_listener, demo);
wl_display_dispatch(demo->display);
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
}
demo_create_xlib_window(&demo);
#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)
demo_create_window(&demo);
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
demo_init_vk_swapchain(&demo);
demo_run_xlib(&demo);
#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)
demo_run(&demo);
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#elif defined(VK_USE_PLATFORM_DISPLAY_KHR)
demo_run_display(&demo);
#endif
#include <csignal>
#include <memory>
-#if defined(VK_USE_PLATFORM_MIR_KHR)
-#warning "Cubepp does not have code for Mir at this time"
-#endif
-
#define VULKAN_HPP_NO_SMART_HANDLE
#define VULKAN_HPP_NO_EXCEPTIONS
#include <vulkan/vulkan.hpp>
void create_window();
#elif defined(VK_USE_PLATFORM_MACOS_MVK)
void run();
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#elif defined(VK_USE_PLATFORM_DISPLAY_KHR)
vk::Result create_display_surface();
void run_display();
wl_seat *seat;
wl_pointer *pointer;
wl_keyboard *keyboard;
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#elif (defined(VK_USE_PLATFORM_IOS_MVK) || defined(VK_USE_PLATFORM_MACOS_MVK))
void *window;
#endif
static void registry_handle_global_remove(void *data, wl_registry *registry, uint32_t name) {}
static const wl_registry_listener registry_listener = {registry_handle_global, registry_handle_global_remove};
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
Demo::Demo()
seat{nullptr},
pointer{nullptr},
keyboard{nullptr},
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
prepared{false},
use_staging_buffer{false},
wl_compositor_destroy(compositor);
wl_registry_destroy(registry);
wl_display_disconnect(display);
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
inst.destroy(nullptr);
registry = wl_display_get_registry(display);
wl_registry_add_listener(registry, ®istry_listener, this);
wl_display_dispatch(display);
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
}
platformSurfaceExtFound = 1;
extension_names[enabled_extension_count++] = VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME;
}
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#elif defined(VK_USE_PLATFORM_DISPLAY_KHR)
if (!strcmp(VK_KHR_DISPLAY_EXTENSION_NAME, instance_extensions[i].extensionName)) {
platformSurfaceExtFound = 1;
"Do you have a compatible Vulkan installable client driver (ICD) installed?\n"
"Please look at the Getting Started guide for additional information.\n",
"vkCreateInstance Failure");
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#elif defined(VK_USE_PLATFORM_XLIB_KHR)
ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find the " VK_KHR_XLIB_SURFACE_EXTENSION_NAME
" extension.\n\n"
auto result = inst.createWaylandSurfaceKHR(&createInfo, nullptr, &surface);
VERIFY(result == vk::Result::eSuccess);
}
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#elif defined(VK_USE_PLATFORM_XLIB_KHR)
{
auto const createInfo = vk::XlibSurfaceCreateInfoKHR().setDpy(display).setWindow(xlib_window);
quit = true;
}
}
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#elif defined(VK_USE_PLATFORM_DISPLAY_KHR)
vk::Result Demo::create_display_surface() {
demo.create_xlib_window();
#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)
demo.create_window();
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
demo.init_vk_swapchain();
demo.run_xlib();
#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)
demo.run();
-#elif defined(VK_USE_PLATFORM_MIR_KHR)
#elif defined(VK_USE_PLATFORM_DISPLAY_KHR)
demo.run_display();
#endif
if(BUILD_WSI_WAYLAND_SUPPORT)
add_definitions(-DVK_USE_PLATFORM_WAYLAND_KHR -DVK_USE_PLATFORM_WAYLAND_KHX)
endif()
-
- if(BUILD_WSI_MIR_SUPPORT)
- add_definitions(-DVK_USE_PLATFORM_MIR_KHR -DVK_USE_PLATFORM_MIR_KHX)
- include_directories(${MIR_INCLUDE_DIR})
- endif()
else()
message(FATAL_ERROR "Unsupported Platform!")
endif()
}
#endif /* VK_USE_PLATFORM_WAYLAND_KHR */
-#ifdef VK_USE_PLATFORM_MIR_KHR
-
-EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateMirSurfaceKHR(
- VkInstance instance,
- const VkMirSurfaceCreateInfoKHR* pCreateInfo,
- const VkAllocationCallbacks* pAllocator,
- VkSurfaceKHR* pSurface)
-{
- return vkmock::CreateMirSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
-}
-#endif /* VK_USE_PLATFORM_MIR_KHR */
-
#ifdef VK_USE_PLATFORM_ANDROID_KHR
EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR(
#include <X11/Xutil.h>
#endif
-#if defined(VK_USE_PLATFORM_MIR_KHR)
-#warning "Vulkaninfo does not have code for Mir at this time"
-#endif
-
#if defined(VK_USE_PLATFORM_MACOS_MVK)
#include "metal_view.h"
#endif
}
#endif
- // TODO: Android / Wayland / MIR
+ // TODO: Android / Wayland
if (!format_count && !present_mode_count) {
if (html_output) {
fprintf(out, "\t\t\t\t<details><summary>None found</summary></details>\n");