aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMd Abdullah Al Fahim <mdfahim@google.com>2022-04-08 05:53:36 +0000
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>2022-04-08 00:42:40 -0600
commit3903162ac4b01ed376bfa55a72ef7217a72c0b74 (patch)
tree2d119f846323143ae63958115a34e578af9cc382
parent38f9ee7a5bc8f137dc98a74698826f7fa53e3fd8 (diff)
downloadusermoji-3903162ac4b01ed376bfa55a72ef7217a72c0b74.tar.xz
Show surface information on GGP platform
-rw-r--r--vulkaninfo/vulkaninfo.h37
1 files changed, 36 insertions, 1 deletions
diff --git a/vulkaninfo/vulkaninfo.h b/vulkaninfo/vulkaninfo.h
index ad1b9989..c1baba49 100644
--- a/vulkaninfo/vulkaninfo.h
+++ b/vulkaninfo/vulkaninfo.h
@@ -335,6 +335,9 @@ struct VkDll {
#ifdef VK_USE_PLATFORM_ANDROID_KHR
PFN_vkCreateAndroidSurfaceKHR fp_vkCreateAndroidSurfaceKHR = APPLE_FP(vkCreateAndroidSurfaceKHR);
#endif // VK_USE_PLATFORM_ANDROID_KHR
+#ifdef VK_USE_PLATFORM_GGP
+ PFN_vkCreateStreamDescriptorSurfaceGGP fp_vkCreateStreamDescriptorSurfaceGGP = APPLE_FP(vkCreateStreamDescriptorSurfaceGGP);
+#endif // VK_USE_PLATFORM_GGP
#ifdef VK_USE_PLATFORM_WIN32_KHR
PFN_vkCreateWin32SurfaceKHR fp_vkCreateWin32SurfaceKHR = APPLE_FP(vkCreateWin32SurfaceKHR);
PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR fp_vkGetPhysicalDeviceWin32PresentationSupportKHR =
@@ -397,6 +400,9 @@ struct VkDll {
#ifdef VK_USE_PLATFORM_ANDROID_KHR
Load(fp_vkCreateAndroidSurfaceKHR, "vkCreateAndroidSurfaceKHR");
#endif // VK_USE_PLATFORM_ANDROID_KHR
+#ifdef VK_USE_PLATFORM_GGP
+ Load(fp_vkCreateStreamDescriptorSurfaceGGP, "vkCreateStreamDescriptorSurfaceGGP");
+#endif // VK_USE_PLATFORM_GGP
#ifdef VK_USE_PLATFORM_WIN32_KHR
Load(fp_vkCreateWin32SurfaceKHR, "vkCreateWin32SurfaceKHR");
Load(fp_vkGetPhysicalDeviceWin32PresentationSupportKHR, "vkGetPhysicalDeviceWin32PresentationSupportKHR");
@@ -715,7 +721,7 @@ struct AppInstance {
#if defined(VK_USE_PLATFORM_XCB_KHR) || defined(VK_USE_PLATFORM_XLIB_KHR) || defined(VK_USE_PLATFORM_WIN32_KHR) || \
defined(VK_USE_PLATFORM_MACOS_MVK) || defined(VK_USE_PLATFORM_METAL_EXT) || defined(VK_USE_PLATFORM_WAYLAND_KHR) || \
- defined(VK_USE_PLATFORM_DIRECTFB_EXT) || defined(VK_USE_PLATFORM_ANDROID_KHR)
+ defined(VK_USE_PLATFORM_DIRECTFB_EXT) || defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(VK_USE_PLATFORM_GGP)
#define VULKANINFO_WSI_ENABLED
#endif
//---------------------------Win32---------------------------
@@ -1057,7 +1063,24 @@ static VkSurfaceKHR AppCreateAndroidSurface(AppInstance &inst) {
static VkSurfaceKHR AppDestroyAndroidSurface(AppInstance &inst) {}
#endif
//-----------------------------------------------------------
+//---------------------------GGP-----------------------------
+#ifdef VK_USE_PLATFORM_GGP
+static void AppCreateGgpWindow(AppInstance &inst) {}
+static VkSurfaceKHR AppCreateGgpSurface(AppInstance &inst) {
+ VkStreamDescriptorSurfaceCreateInfoGGP createInfo;
+ createInfo.sType = VK_STRUCTURE_TYPE_STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP;
+ createInfo.pNext = NULL;
+ createInfo.flags = 0;
+ createInfo.streamDescriptor = 1;
+ VkSurfaceKHR surface;
+ VkResult err = inst.dll.fp_vkCreateStreamDescriptorSurfaceGGP(inst.instance, &createInfo, NULL, &surface);
+ if (err) THROW_VK_ERR("vkCreateStreamDescriptorSurfaceGGP", err);
+ return surface;
+}
+static void AppDestroyGgpWindow(AppInstance &inst) {}
+#endif
+//-----------------------------------------------------------
// ------------ Setup Windows ------------- //
void SetupWindowExtensions(AppInstance &inst) {
@@ -1178,6 +1201,18 @@ void SetupWindowExtensions(AppInstance &inst) {
inst.AddSurfaceExtension(surface_ext_android);
}
#endif
+//--GGP--
+#ifdef VK_USE_PLATFORM_GGP
+ SurfaceExtension surface_ext_ggp;
+ if (inst.CheckExtensionEnabled(VK_GGP_STREAM_DESCRIPTOR_SURFACE_EXTENSION_NAME)) {
+ surface_ext_ggp.name = VK_GGP_STREAM_DESCRIPTOR_SURFACE_EXTENSION_NAME;
+ surface_ext_ggp.create_window = AppCreateGgpWindow;
+ surface_ext_ggp.create_surface = AppCreateGgpSurface;
+ surface_ext_ggp.destroy_window = AppDestroyGgpWindow;
+
+ inst.AddSurfaceExtension(surface_ext_ggp);
+ }
+#endif
}
// ---------- Surfaces -------------- //