aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Barbour <tony@LunarG.com>2016-12-07 14:45:12 -0700
committerTony Barbour <tony@LunarG.com>2016-12-09 11:48:58 -0700
commitefd0c5ab5e40ca97ee40a222b1e5d8a480f3f655 (patch)
tree43099e733ee3b8555a21e1a7bc9240ca41130ac7
parent153cb062d58ade7d11f158740f1989a157ab7146 (diff)
downloadusermoji-efd0c5ab5e40ca97ee40a222b1e5d8a480f3f655.tar.xz
Demos: Add Mir warnings and placeholders
Change-Id: I7e7ca30bd1452a216213c02a7aa29ce8829b2974
-rw-r--r--demos/cube.c14
-rw-r--r--demos/cube.cpp16
-rw-r--r--demos/vulkaninfo.c4
3 files changed, 33 insertions, 1 deletions
diff --git a/demos/cube.c b/demos/cube.c
index 90d1cb84..efd2ad0e 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -39,6 +39,10 @@
#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
@@ -308,6 +312,7 @@ struct demo {
struct wl_surface *window;
struct wl_shell *shell;
struct wl_shell_surface *shell_surface;
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#elif defined(VK_USE_PLATFORM_ANDROID_KHR)
ANativeWindow* window;
#endif
@@ -2087,6 +2092,7 @@ static void demo_cleanup(struct demo *demo) {
wl_compositor_destroy(demo->compositor);
wl_registry_destroy(demo->registry);
wl_display_disconnect(demo->display);
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
}
@@ -2503,6 +2509,7 @@ static void demo_run(struct demo *demo) {
demo_draw(demo);
demo->curFrame++;
}
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
/*
@@ -2648,6 +2655,7 @@ static void demo_init_vk(struct demo *demo) {
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_ANDROID_KHR)
if (!strcmp(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME,
instance_extensions[i].extensionName)) {
@@ -2703,6 +2711,7 @@ static void demo_init_vk(struct demo *demo) {
"look at the Getting Started guide for additional "
"information.\n",
"vkCreateInstance Failure");
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#elif defined(VK_USE_PLATFORM_ANDROID_KHR)
ERR_EXIT("vkEnumerateInstanceExtensionProperties failed to find "
"the " VK_KHR_ANDROID_SURFACE_EXTENSION_NAME
@@ -2969,6 +2978,7 @@ static void demo_init_vk_swapchain(struct demo *demo) {
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;
@@ -3149,6 +3159,7 @@ static void registry_handle_global_remove(void *data 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) {
@@ -3184,6 +3195,7 @@ static void demo_init_connection(struct demo *demo) {
demo->registry = wl_display_get_registry(demo->display);
wl_registry_add_listener(demo->registry, &registry_listener, demo);
wl_display_dispatch(demo->display);
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
}
@@ -3458,6 +3470,7 @@ int main(int argc, char **argv) {
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);
@@ -3470,6 +3483,7 @@ int main(int argc, char **argv) {
demo_run_xlib(&demo);
#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)
demo_run(&demo);
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
demo_cleanup(&demo);
diff --git a/demos/cube.cpp b/demos/cube.cpp
index 87783954..b28476a5 100644
--- a/demos/cube.cpp
+++ b/demos/cube.cpp
@@ -29,6 +29,10 @@
#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_EXCEPTIONS
#include <vulkan/vulkan.hpp>
#include <vulkan/vk_sdk_platform.h>
@@ -228,6 +232,7 @@ static void handle_announce_global_object_remove(
static const wl_registry_listener registry_listener = {
handle_announce_global_object, handle_announce_global_object_remove};
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
struct Demo {
@@ -249,6 +254,7 @@ struct Demo {
display{nullptr},
registry{nullptr}, compositor{nullptr}, window{nullptr},
shell{nullptr}, shell_surface{nullptr},
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
prepared{false}, use_staging_buffer{false}, use_xlib{false},
graphics_queue_family_index{0}, present_queue_family_index{0},
@@ -382,6 +388,7 @@ struct Demo {
wl_compositor_destroy(compositor);
wl_registry_destroy(registry);
wl_display_disconnect(display);
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
}
@@ -731,6 +738,7 @@ struct Demo {
registry = wl_display_get_registry(display);
wl_registry_add_listener(registry, &registry_listener, this);
wl_display_dispatch(display);
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
}
@@ -856,6 +864,7 @@ struct Demo {
extension_names[enabled_extension_count++] =
VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME;
}
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
assert(enabled_extension_count < 64);
}
@@ -898,6 +907,7 @@ struct Demo {
"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"
@@ -1042,6 +1052,7 @@ struct Demo {
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 =
@@ -2566,7 +2577,7 @@ struct Demo {
wl_shell_surface_set_toplevel(shell_surface);
wl_shell_surface_set_title(shell_surface, APP_SHORT_NAME);
}
-
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
#if defined(VK_USE_PLATFORM_WIN32_KHR)
@@ -2590,6 +2601,7 @@ struct Demo {
wl_surface *window;
wl_shell *shell;
wl_shell_surface *shell_surface;
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
vk::SurfaceKHR surface;
@@ -2813,6 +2825,7 @@ int main(int argc, char **argv) {
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();
@@ -2825,6 +2838,7 @@ demo.run_xcb();
demo.run_xlib();
#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)
demo.run();
+#elif defined(VK_USE_PLATFORM_MIR_KHR)
#endif
demo.cleanup();
diff --git a/demos/vulkaninfo.c b/demos/vulkaninfo.c
index 9091a3cf..277f0eb3 100644
--- a/demos/vulkaninfo.c
+++ b/demos/vulkaninfo.c
@@ -36,6 +36,10 @@
#include <X11/Xutil.h>
#endif
+#if defined(VK_USE_PLATFORM_MIR_KHR)
+#warning "Vulkaninfo does not have code for Mir at this time"
+#endif
+
#include <vulkan/vulkan.h>
#define ERR(err) \