misc: Remove GetDisplayInfoWSI()
authorJon Ashburn <jon@lunarg.com>
Tue, 16 Jun 2015 18:44:51 +0000 (12:44 -0600)
committerCourtney Goeltzenleuchter <courtney@LunarG.com>
Thu, 18 Jun 2015 16:22:58 +0000 (10:22 -0600)
This entry point was a challenge for loader to handle correctly. Since it is
going away in the new WSI proposal remove it in all components.

14 files changed:
demos/cube.c
demos/tri.c
icd/nulldrv/nulldrv.c
include/vkLayer.h
include/vk_wsi_lunarg.h
layers/param_checker.cpp
loader/loader.c
loader/loader.h
loader/table_ops.h
loader/wsi_lunarg.c
loader/wsi_lunarg.h
vk-generate.py
vk-layer-generate.py
vulkan.py

index 8e585b72c287a06e655c0c7e72064c2e8163f200..8ddeb19ffe1b7874f42293f0fa38e0213a4b4b0e 100644 (file)
@@ -295,9 +295,6 @@ struct demo {
     int width, height;
     VkFormat format;
 
-    VkDisplayPropertiesWSI *display_props;
-    int num_displays;
-    PFN_vkGetDisplayInfoWSI fpGetDisplayInfoWSI;
     PFN_vkCreateSwapChainWSI fpCreateSwapChainWSI;
     PFN_vkDestroySwapChainWSI fpDestroySwapChainWSI;
     PFN_vkGetSwapChainInfoWSI fpGetSwapChainInfoWSI;
@@ -1917,10 +1914,6 @@ static void demo_init_vk(struct demo *demo)
     err = vkCreateDevice(demo->gpu, &device, &demo->device);
     assert(!err);
 
-    demo->fpGetDisplayInfoWSI = vkGetDeviceProcAddr(demo->device, "vkGetDisplayInfoWSI");
-    if (demo->fpGetDisplayInfoWSI == NULL)
-        ERR_EXIT("vkGetDeviceProcAddr failed to find vkGetDisplayInfoWSI",
-                                 "vkGetDeviceProcAddr Failure");
     demo->fpCreateSwapChainWSI = vkGetDeviceProcAddr(demo->device, "vkCreateSwapChainWSI");
     if (demo->fpCreateSwapChainWSI == NULL)
         ERR_EXIT("vkGetDeviceProcAddr failed to find vkCreateSwapChainWSI",
@@ -1972,38 +1965,9 @@ static void demo_init_vk(struct demo *demo)
             0, &demo->queue);
     assert(!err);
 
+    // for now hardcode format till get WSI support
+    demo->format = VK_FORMAT_B8G8R8A8_UNORM;
 
-    // Get the VkDisplayWSI's associated with this physical device:
-    VkDisplayWSI display;
-    err = vkGetPhysicalDeviceInfo(demo->gpu, VK_PHYSICAL_DEVICE_INFO_TYPE_DISPLAY_PROPERTIES_WSI,
-                                  &data_size, NULL);
-    if (err != VK_SUCCESS) {
-        printf("The Vulkan installable client driver (ICD) does not support "
-               "querying\nfor the swap-chain image format.  Therefore, am "
-               "hardcoding this\nformat to  VK_FORMAT_B8G8R8A8_UNORM.\n");
-        fflush(stdout);
-        demo->format = VK_FORMAT_B8G8R8A8_UNORM;
-        return;
-    }
-    demo->display_props = (VkDisplayPropertiesWSI *) malloc(data_size);
-    err = vkGetPhysicalDeviceInfo(demo->gpu, VK_PHYSICAL_DEVICE_INFO_TYPE_DISPLAY_PROPERTIES_WSI,
-                                  &data_size, demo->display_props);
-    assert(!err);
-    demo->num_displays = data_size / sizeof(VkDisplayPropertiesWSI);
-    // For now, simply use the first display (TODO: Enhance this for the
-    // future):
-    display = demo->display_props[0].display;
-
-    // Get a VkFormat to use with the VkDisplayWSI we are using:
-    err = demo->fpGetDisplayInfoWSI(display, VK_DISPLAY_INFO_TYPE_FORMAT_PROPERTIES_WSI,
-                              &data_size, NULL);
-    VkDisplayFormatPropertiesWSI* display_format_props =
-        (VkDisplayFormatPropertiesWSI*) malloc(data_size);
-    err = demo->fpGetDisplayInfoWSI(display, VK_DISPLAY_INFO_TYPE_FORMAT_PROPERTIES_WSI,
-                              &data_size, display_format_props);
-    // For now, simply use the first VkFormat (TODO: Enhance this for the
-    // future):
-    demo->format = display_format_props[0].swapChainFormat;
 }
 
 static void demo_init_connection(struct demo *demo)
index 9814ce54f18ea98957e6ad9b256967a448c54a39..35db14d589aa59411bf220709335b3c6d80b79e1 100644 (file)
@@ -117,9 +117,6 @@ struct demo {
     int width, height;
     VkFormat format;
 
-    VkDisplayPropertiesWSI *display_props;
-    int num_displays;
-    PFN_vkGetDisplayInfoWSI fpGetDisplayInfoWSI;
     PFN_vkCreateSwapChainWSI fpCreateSwapChainWSI;
     PFN_vkDestroySwapChainWSI fpDestroySwapChainWSI;
     PFN_vkGetSwapChainInfoWSI fpGetSwapChainInfoWSI;
@@ -1433,10 +1430,6 @@ static void demo_init_vk(struct demo *demo)
                  "vkCreateInstance Failure");
     }
 
-    demo->fpGetDisplayInfoWSI = vkGetInstanceProcAddr(demo->inst, "vkGetDisplayInfoWSI");
-    if (demo->fpGetDisplayInfoWSI == NULL)
-        ERR_EXIT("vkGetInstanceProcAddr failed to find vkGetDisplayInfoWSI",
-                                 "vkGetInstanceProcAddr Failure");
     demo->fpCreateSwapChainWSI = vkGetInstanceProcAddr(demo->inst, "vkCreateSwapChainWSI");
     if (demo->fpCreateSwapChainWSI == NULL)
         ERR_EXIT("vkGetInstanceProcAddr failed to find vkCreateSwapChainWSI",
@@ -1492,38 +1485,9 @@ static void demo_init_vk(struct demo *demo)
             0, &demo->queue);
     assert(!err);
 
+    // for now hardcode format till get WSI support
+    demo->format = VK_FORMAT_B8G8R8A8_UNORM;
 
-    // Get the VkDisplayWSI's associated with this physical device:
-    VkDisplayWSI display;
-    err = vkGetPhysicalDeviceInfo(demo->gpu, VK_PHYSICAL_DEVICE_INFO_TYPE_DISPLAY_PROPERTIES_WSI,
-                                  &data_size, NULL);
-    if (err != VK_SUCCESS) {
-        printf("The Vulkan installable client driver (ICD) does not support "
-               "querying\nfor the swap-chain image format.  Therefore, am "
-               "hardcoding this\nformat to  VK_FORMAT_B8G8R8A8_UNORM.\n");
-        fflush(stdout);
-        demo->format = VK_FORMAT_B8G8R8A8_UNORM;
-        return;
-    }
-    demo->display_props = (VkDisplayPropertiesWSI *) malloc(data_size);
-    err = vkGetPhysicalDeviceInfo(demo->gpu, VK_PHYSICAL_DEVICE_INFO_TYPE_DISPLAY_PROPERTIES_WSI,
-                                  &data_size, demo->display_props);
-    assert(!err);
-    demo->num_displays = data_size / sizeof(VkDisplayPropertiesWSI);
-    // For now, simply use the first display (TODO: Enhance this for the
-    // future):
-    display = demo->display_props[0].display;
-
-    // Get a VkFormat to use with the VkDisplayWSI we are using:
-    err = demo->fpGetDisplayInfoWSI(display, VK_DISPLAY_INFO_TYPE_FORMAT_PROPERTIES_WSI,
-                              &data_size, NULL);
-    VkDisplayFormatPropertiesWSI* display_format_props =
-        (VkDisplayFormatPropertiesWSI*) malloc(data_size);
-    err = demo->fpGetDisplayInfoWSI(display, VK_DISPLAY_INFO_TYPE_FORMAT_PROPERTIES_WSI,
-                              &data_size, display_format_props);
-    // For now, simply use the first VkFormat (TODO: Enhance this for the
-    // future):
-    demo->format = display_format_props[0].swapChainFormat;
 }
 
 static void demo_init_connection(struct demo *demo)
index ff0a901a8225a28a0eb01b80343f61ce77eaeb5c..651b3674af44bfdd70011b69ccd59b3330a425d2 100644 (file)
@@ -849,6 +849,7 @@ static const VkFormat nulldrv_presentable_formats[] = {
     VK_FORMAT_B8G8R8A8_UNORM,
 };
 
+#if 0
 ICD_EXPORT VkResult VKAPI vkGetDisplayInfoWSI(
     VkDisplayWSI                            display,
     VkDisplayInfoTypeWSI                    infoType,
@@ -889,6 +890,7 @@ ICD_EXPORT VkResult VKAPI vkGetDisplayInfoWSI(
 
     return ret;
 }
+#endif
 
 ICD_EXPORT VkResult VKAPI vkCreateSwapChainWSI(
     VkDevice                                device,
index bdbb8e9c02d79033a96d7fdc31af1bea15613742..6dcf104815a4ddf90b6caa73152e415dc11b9a6e 100644 (file)
@@ -151,7 +151,6 @@ typedef struct VkLayerInstanceDispatchTable_
     /* PFN_vkGetGlobalExtensionInfo GetGlobalExtensionInfo; non-dispatchable */
     PFN_vkGetPhysicalDeviceExtensionInfo GetPhysicalDeviceExtensionInfo;
     PFN_vkGetMultiDeviceCompatibility GetMultiDeviceCompatibility;
-    PFN_vkGetDisplayInfoWSI GetDisplayInfoWSI;
     PFN_vkDbgCreateMsgCallback DbgCreateMsgCallback;
     PFN_vkDbgDestroyMsgCallback DbgDestroyMsgCallback;
     PFN_vkDbgStringCallback DbgStringCallback;
index 3507cfe8873abc853d5c391b3ab7428ab0465a2f..40288622a2978ea3dcefac13733491ed2e6f22ed 100644 (file)
@@ -67,13 +67,6 @@ VK_DEFINE_DISP_SUBCLASS_HANDLE(VkSwapChainWSI, VkObject)
 // ------------------------------------------------------------------------------------------------
 // Enumerations
 
-typedef enum VkDisplayInfoTypeWSI_
-{
-    // Info type for vkGetDisplayInfo()
-    VK_DISPLAY_INFO_TYPE_FORMAT_PROPERTIES_WSI              = 0x00000003,   // Return the VkFormat(s) supported for swap chains with the display
-
-    VK_ENUM_RANGE(DISPLAY_INFO_TYPE, FORMAT_PROPERTIES_WSI, FORMAT_PROPERTIES_WSI)
-} VkDisplayInfoTypeWSI;
 
 typedef enum VkSwapChainInfoTypeWSI_
 {
@@ -154,7 +147,6 @@ typedef struct VkPresentInfoWSI_
 // ------------------------------------------------------------------------------------------------
 // Function types
 
-typedef VkResult (VKAPI *PFN_vkGetDisplayInfoWSI)(VkDisplayWSI display, VkDisplayInfoTypeWSI infoType, size_t* pDataSize, void* pData);
 typedef VkResult (VKAPI *PFN_vkCreateSwapChainWSI)(VkDevice device, const VkSwapChainCreateInfoWSI* pCreateInfo, VkSwapChainWSI* pSwapChain);
 typedef VkResult (VKAPI *PFN_vkDestroySwapChainWSI)(VkSwapChainWSI swapChain);
 typedef VkResult (VKAPI *PFN_vkGetSwapChainInfoWSI)(VkSwapChainWSI swapChain, VkSwapChainInfoTypeWSI infoType, size_t* pDataSize, void* pData);
@@ -165,11 +157,6 @@ typedef VkResult (VKAPI *PFN_vkQueuePresentWSI)(VkQueue queue, const VkPresentIn
 
 #ifdef VK_PROTOTYPES
 
-VkResult VKAPI vkGetDisplayInfoWSI(
-    VkDisplayWSI                            display,
-    VkDisplayInfoTypeWSI                    infoType,
-    size_t*                                 pDataSize,
-    void*                                   pData);
 
 VkResult VKAPI vkCreateSwapChainWSI(
     VkDevice                                device,
index eeea84b09ec7f0fa6d5eff05bdd371c327df57ef..670b31f161d970d2057b00015123c1dcd03ed6b8 100644 (file)
@@ -1923,12 +1923,6 @@ VkResult VKAPI vkDbgSetObjectName(VkDevice device, VkObjectType  objType, VkObje
     debug_marker_dispatch_table(device)->DbgSetObjectName(device, objType, object, nameSize, pName);
 }
 
-VK_LAYER_EXPORT VkResult VKAPI vkGetDisplayInfoWSI(VkDisplayWSI display, VkDisplayInfoTypeWSI infoType, size_t* pDataSize, void* pData)
-{
-    VkResult result = instance_dispatch_table(display)->GetDisplayInfoWSI(display, infoType, pDataSize, pData);
-    return result;
-}
-
 VK_LAYER_EXPORT VkResult VKAPI vkCreateSwapChainWSI(VkDevice device, const VkSwapChainCreateInfoWSI* pCreateInfo, VkSwapChainWSI* pSwapChain)
 {
     VkResult result = device_dispatch_table(device)->CreateSwapChainWSI(device, pCreateInfo, pSwapChain);
@@ -2151,8 +2145,6 @@ static inline void* layer_intercept_proc(const char *name)
         return (void*) vkCmdBeginRenderPass;
     if (!strcmp(name, "CmdEndRenderPass"))
         return (void*) vkCmdEndRenderPass;
-    if (!strcmp(name, "GetDisplayInfoWSI"))
-        return (void*) vkGetDisplayInfoWSI;
     if (!strcmp(name, "CreateSwapChainWSI"))
         return (void*) vkCreateSwapChainWSI;
     if (!strcmp(name, "DestroySwapChainWSI"))
index 3f13cdbc72ab855c99de5ec5f2f10ca94e6e5c3d..d5f8f46218ba746d8cf9f649ed0edb52e1d53603 100644 (file)
@@ -91,7 +91,6 @@ const VkLayerInstanceDispatchTable instance_disp = {
     .CreateDevice = loader_CreateDevice,
     .GetPhysicalDeviceExtensionInfo = loader_GetPhysicalDeviceExtensionInfo,
     .GetMultiDeviceCompatibility = loader_GetMultiDeviceCompatibility,
-    .GetDisplayInfoWSI = loader_GetDisplayInfoWSI,
     .DbgCreateMsgCallback = loader_DbgCreateMsgCallback,
     .DbgDestroyMsgCallback = loader_DbgDestroyMsgCallback,
 };
@@ -724,7 +723,6 @@ static void loader_icd_init_entrys(struct loader_icd *icd,
     LOOKUP(CreateDevice);
     LOOKUP(GetPhysicalDeviceExtensionInfo);
     LOOKUP(GetMultiDeviceCompatibility);
-    LOOKUP(GetDisplayInfoWSI);
     LOOKUP(DbgCreateMsgCallback);
     LOOKUP(DbgDestroyMsgCallback);
 #undef LOOKUP
index 19d9de5378675d5a168ce68f151541d1c22fc50b..d375ebcd1535b009499596fc99da0b69b4c775cb 100644 (file)
@@ -120,7 +120,6 @@ struct loader_icd {
     PFN_vkCreateDevice CreateDevice;
     PFN_vkGetPhysicalDeviceExtensionInfo GetPhysicalDeviceExtensionInfo;
     PFN_vkGetMultiDeviceCompatibility GetMultiDeviceCompatibility;
-    PFN_vkGetDisplayInfoWSI GetDisplayInfoWSI;
     PFN_vkDbgCreateMsgCallback DbgCreateMsgCallback;
     PFN_vkDbgDestroyMsgCallback DbgDestroyMsgCallback;
     /*
index a2c67c30a65c0dfba5e9d89db1ae941caa62c86c..45f411ed62929b5b0b3af8c8e7375ab6e59f2480 100644 (file)
@@ -376,7 +376,6 @@ static inline void loader_init_instance_core_dispatch_table(VkLayerInstanceDispa
     table->CreateDevice = (PFN_vkCreateDevice) gpa(inst, "vkCreateDevice");
     table->GetPhysicalDeviceExtensionInfo = (PFN_vkGetPhysicalDeviceExtensionInfo) gpa(inst, "vkGetPhysicalDeviceExtensionInfo");
     table->GetMultiDeviceCompatibility = (PFN_vkGetMultiDeviceCompatibility) gpa(inst, "vkGetMultiDeviceCompatibility");
-    table->GetDisplayInfoWSI = (PFN_vkGetDisplayInfoWSI) gpa(inst, "vkGetDisplayInfoWSI");
 }
 
 static inline void loader_init_instance_extension_dispatch_table(
@@ -412,8 +411,6 @@ static inline void *loader_lookup_instance_dispatch_table(
         return (void *) table->GetPhysicalDeviceExtensionInfo;
     if (!strcmp(name, "GetMultiDeviceCompatibility"))
         return (void *) table->GetMultiDeviceCompatibility;
-    if (!strcmp(name, "GetDisplayInfoWSI"))
-        return (void *) table->GetDisplayInfoWSI;
     if (!strcmp(name, "DbgCreateMsgCallback"))
         return (void *) table->DbgCreateMsgCallback;
     if (!strcmp(name, "DbgDestroyMsgCallback"))
index f4b62da7c70f40168dc0e1181c204979be3d2fd7..0269f272debd7ef81821c46bef27c8265f2c3d37 100644 (file)
 
 /************  Trampoline entrypoints *******************/
 /* since one entrypoint is instance level will make available all entrypoints */
-VkResult VKAPI wsi_lunarg_GetDisplayInfoWSI(
-        VkDisplayWSI                            display,
-        VkDisplayInfoTypeWSI                    infoType,
-        size_t*                                 pDataSize,
-        void*                                   pData)
-{
-    const VkLayerInstanceDispatchTable *disp;
-    VkResult res;
-
-    disp = loader_get_instance_dispatch(display);
-
-    loader_platform_thread_lock_mutex(&loader_lock);
-    res = disp->GetDisplayInfoWSI(display, infoType, pDataSize, pData);
-    loader_platform_thread_unlock_mutex(&loader_lock);
-    return res;
-}
+/* TODO make this a device extension with NO trampoline code */
 
 VkResult wsi_lunarg_CreateSwapChainWSI(
         VkDevice                                device,
@@ -102,31 +87,6 @@ static VkResult wsi_lunarg_QueuePresentWSI(
     return disp->QueuePresentWSI(queue, pPresentInfo);
 }
 
-/************  loader instance chain termination entrypoints ***************/
-VkResult loader_GetDisplayInfoWSI(
-        VkDisplayWSI                            display,
-        VkDisplayInfoTypeWSI                    infoType,
-        size_t*                                 pDataSize,
-        void*                                   pData)
-{
-    /* TODO: need another way to find the icd, display is not a gpu object */
-//    uint32_t gpu_index;
-//    struct loader_icd *icd = loader_get_icd((VkPhysicalDevice) display, &gpu_index); //TODO fix dispaly -> PhysDev
-    VkResult res = VK_ERROR_INITIALIZATION_FAILED;
-
-    for (struct loader_instance *inst = loader.instances; inst; inst = inst->next) {
-        for (struct loader_icd *icd = inst->icds; icd; icd = icd->next) {
-            for (uint32_t i = 0; i < icd->gpu_count; i++) {
-                if (icd->GetDisplayInfoWSI)
-                    res = icd->GetDisplayInfoWSI(display, infoType, pDataSize, pData);
-            }
-        }
-    }
-
-    return res;
-}
-
-
 /************ extension enablement ***************/
 #define WSI_LUNARG_EXT_ARRAY_SIZE 1
 static const struct loader_extension_property wsi_lunarg_extension_info = {
@@ -160,9 +120,7 @@ void *wsi_lunarg_GetInstanceProcAddr(
     if (instance == VK_NULL_HANDLE)
         return NULL;
 
-    /* since two of these entrypoints must be loader handled will report all */
-    if (!strcmp(pName, "vkGetDisplayInfoWSI"))
-        return (void*) wsi_lunarg_GetDisplayInfoWSI;
+    /* since one of these entrypoints must be loader handled will report all */
     if (!strcmp(pName, "vkCreateSwapChainWSI"))
         return (void*) wsi_lunarg_CreateSwapChainWSI;
     if (!strcmp(pName, "vkDestroySwapChainWSI"))
index da022c3966e743a07cfb2e62abf0709c2bb3f160..6a79c4923d96fca1dec579de7ffe86bbadfe3291 100644 (file)
 
 #include "vk_wsi_lunarg.h"
 
-VkResult loader_GetDisplayInfoWSI(
-        VkDisplayWSI                            display,
-        VkDisplayInfoTypeWSI                    infoType,
-        size_t*                                 pDataSize,
-        void*                                   pData);
-
 void wsi_lunarg_add_instance_extensions(
         struct loader_extension_list *ext_list);
 
index a0165c7e03f77c11ff1f6fffc48f5c7902267070..6f136b7b99f3f2511393ec23f52e6d1980844cc2 100755 (executable)
@@ -121,7 +121,7 @@ class DispatchTableOpsSubcommand(Subcommand):
             stmts.append("// GPA has to be first entry inited and uses wrapped object since it triggers init")
             stmts.append("table->GetDeviceProcAddr =(PFN_vkGetDeviceProcAddr)  gpa(device,\"vkGetDeviceProcAddr\");")
             for proto in self.protos:
-                if proto.name == "CreateInstance" or proto.name == "GetGlobalExtensionInfo" or proto.name == "GetDisplayInfoWSI" or proto.params[0].ty == "VkInstance" or proto.params[0].ty == "VkPhysicalDevice":
+                if proto.name == "CreateInstance" or proto.name == "GetGlobalExtensionInfo" or proto.params[0].ty == "VkInstance" or proto.params[0].ty == "VkPhysicalDevice":
                     continue
                 if proto.name != "GetDeviceProcAddr":
                     stmts.append("table->%s = (PFN_vk%s) gpa(baseDevice, \"vk%s\");" %
@@ -138,7 +138,7 @@ class DispatchTableOpsSubcommand(Subcommand):
             stmts.append("// GPA has to be first entry inited and uses wrapped object since it triggers init")
             stmts.append("table->GetInstanceProcAddr =(PFN_vkGetInstanceProcAddr)  gpa(instance,\"vkGetInstanceProcAddr\");")
             for proto in self.protos:
-                if proto.name != "CreateInstance"  and proto.name != "GetDisplayInfoWSI" and proto.params[0].ty != "VkInstance" and proto.params[0].ty != "VkPhysicalDevice":
+                if proto.name != "CreateInstance"  and proto.params[0].ty != "VkInstance" and proto.params[0].ty != "VkPhysicalDevice":
                     continue
                 if proto.name != "GetInstanceProcAddr":
                     stmts.append("table->%s = (PFN_vk%s) gpa(baseInstance, \"vk%s\");" %
index 2f3d576e7a7734468024056f960e2c318032cb02..d4b70d74611806ed96751652d1dd477843f16e75 100755 (executable)
@@ -33,7 +33,7 @@ import vulkan
 import vk_helper
 
 def proto_is_global(proto):
-    if proto.params[0].ty == "VkInstance" or proto.params[0].ty == "VkPhysicalDevice" or proto.name == "CreateInstance" or proto.name == "GetGlobalExtensionInfo" or proto.name == "GetPhysicalDeviceExtensionInfo" or proto.name == "GetDisplayInfoWSI":
+    if proto.params[0].ty == "VkInstance" or proto.params[0].ty == "VkPhysicalDevice" or proto.name == "CreateInstance" or proto.name == "GetGlobalExtensionInfo" or proto.name == "GetPhysicalDeviceExtensionInfo":
        return True
     else:
        return False
index a83aa8d2088da6361878ece5b127e7a391a8347b..a72614ffb9a77b340fcd086e540ff0a8dd4684dd 100755 (executable)
--- a/vulkan.py
+++ b/vulkan.py
@@ -867,12 +867,6 @@ wsi_lunarg = Extension(
         "VkDbgMsgCallback",
     ],
     protos=[
-        Proto("VkResult", "GetDisplayInfoWSI",
-            [Param("VkDisplayWSI", "display"),
-             Param("VkDisplayInfoTypeWSI", "infoType"),
-             Param("size_t*", "pDataSize"),
-             Param("void*", "pData")]),
-
         Proto("VkResult", "CreateSwapChainWSI",
             [Param("VkDevice", "device"),
              Param("const VkSwapChainCreateInfoWSI*", "pCreateInfo"),