Add WSI extension support to Vulkan framework
authorPyry Haulos <phaulos@google.com>
Tue, 16 Feb 2016 13:42:20 +0000 (15:42 +0200)
committerPyry Haulos <phaulos@google.com>
Thu, 10 Mar 2016 00:03:17 +0000 (16:03 -0800)
Change-Id: I4619c2f8b42c0d08bf6b9377592b100d588037f9

39 files changed:
Android.mk
external/vulkancts/framework/vulkan/CMakeLists.txt
external/vulkancts/framework/vulkan/vkBasicTypes.inl
external/vulkancts/framework/vulkan/vkConcreteDeviceInterface.inl
external/vulkancts/framework/vulkan/vkConcreteInstanceInterface.inl
external/vulkancts/framework/vulkan/vkDefs.hpp
external/vulkancts/framework/vulkan/vkDeviceDriverImpl.inl
external/vulkancts/framework/vulkan/vkDeviceFunctionPointers.inl
external/vulkancts/framework/vulkan/vkDeviceUtil.cpp
external/vulkancts/framework/vulkan/vkDeviceUtil.hpp
external/vulkancts/framework/vulkan/vkFunctionPointerTypes.inl
external/vulkancts/framework/vulkan/vkInitDeviceFunctionPointers.inl
external/vulkancts/framework/vulkan/vkInitInstanceFunctionPointers.inl
external/vulkancts/framework/vulkan/vkInstanceDriverImpl.inl
external/vulkancts/framework/vulkan/vkInstanceFunctionPointers.inl
external/vulkancts/framework/vulkan/vkNullDriver.cpp
external/vulkancts/framework/vulkan/vkNullDriverImpl.inl
external/vulkancts/framework/vulkan/vkPlatform.cpp
external/vulkancts/framework/vulkan/vkPlatform.hpp
external/vulkancts/framework/vulkan/vkQueryUtil.cpp
external/vulkancts/framework/vulkan/vkQueryUtil.hpp
external/vulkancts/framework/vulkan/vkRef.hpp
external/vulkancts/framework/vulkan/vkRefUtil.inl
external/vulkancts/framework/vulkan/vkRefUtilImpl.inl
external/vulkancts/framework/vulkan/vkStrUtil.inl
external/vulkancts/framework/vulkan/vkStrUtilImpl.inl
external/vulkancts/framework/vulkan/vkStructTypes.inl
external/vulkancts/framework/vulkan/vkTypeUtil.inl
external/vulkancts/framework/vulkan/vkVirtualDeviceInterface.inl
external/vulkancts/framework/vulkan/vkVirtualInstanceInterface.inl
external/vulkancts/framework/vulkan/vkWsiPlatform.cpp [new file with mode: 0644]
external/vulkancts/framework/vulkan/vkWsiPlatform.hpp [new file with mode: 0644]
external/vulkancts/framework/vulkan/vkWsiUtil.cpp [new file with mode: 0644]
external/vulkancts/framework/vulkan/vkWsiUtil.hpp [new file with mode: 0644]
external/vulkancts/gen_framework.py
framework/platform/android/tcuAndroidPlatform.cpp
framework/platform/android/tcuAndroidPlatform.hpp
framework/platform/win32/tcuWin32Platform.cpp
framework/platform/win32/tcuWin32Platform.hpp

index f9aaa76..b308ad7 100644 (file)
@@ -802,7 +802,9 @@ LOCAL_SRC_FILES := \
        external/vulkancts/framework/vulkan/vkTypeUtil.cpp \
        external/vulkancts/framework/vulkan/vkImageUtil.cpp \
        external/vulkancts/framework/vulkan/vkQueryUtil.cpp \
-       external/vulkancts/framework/vulkan/vkRef.cpp
+       external/vulkancts/framework/vulkan/vkRef.cpp \
+       external/vulkancts/framework/vulkan/vkWsiPlatform.cpp \
+       external/vulkancts/framework/vulkan/vkWsiUtil.cpp
 
 LOCAL_C_INCLUDES := \
        frameworks/native/opengl/include \
index 9f76ec3..133aa57 100644 (file)
@@ -39,6 +39,10 @@ set(VKUTIL_SRCS
        vkTypeUtil.hpp
        vkAllocationCallbackUtil.cpp
        vkAllocationCallbackUtil.hpp
+       vkWsiPlatform.cpp
+       vkWsiPlatform.hpp
+       vkWsiUtil.cpp
+       vkWsiUtil.hpp
        )
 
 set(VKUTIL_LIBS
index ff28762..b5b9484 100644 (file)
@@ -1153,3 +1153,16 @@ typedef deUint32 VkAndroidSurfaceCreateFlagsKHR;
 
 typedef deUint32 VkWin32SurfaceCreateFlagsKHR;
 
+VK_DEFINE_PLATFORM_TYPE(XlibDisplayPtr,                        void*);
+VK_DEFINE_PLATFORM_TYPE(XlibWindow,                            deUintptr);
+VK_DEFINE_PLATFORM_TYPE(XlibVisualID,                  deUint32);
+VK_DEFINE_PLATFORM_TYPE(XcbConnectionPtr,              void*);
+VK_DEFINE_PLATFORM_TYPE(XcbWindow,                             deUintptr);
+VK_DEFINE_PLATFORM_TYPE(XcbVisualid,                   deUint32);
+VK_DEFINE_PLATFORM_TYPE(WaylandDisplayPtr,             void*);
+VK_DEFINE_PLATFORM_TYPE(WaylandSurfacePtr,             void*);
+VK_DEFINE_PLATFORM_TYPE(MirConnectionPtr,              void*);
+VK_DEFINE_PLATFORM_TYPE(MirSurfacePtr,                 void*);
+VK_DEFINE_PLATFORM_TYPE(AndroidNativeWindowPtr,        void*);
+VK_DEFINE_PLATFORM_TYPE(Win32InstanceHandle,   void*);
+VK_DEFINE_PLATFORM_TYPE(Win32WindowHandle,             void*);
index 3bcc88b..9c67a49 100644 (file)
@@ -122,3 +122,9 @@ virtual void                cmdBeginRenderPass                                                              (VkCommandBuffer commandBuffer, const Vk
 virtual void           cmdNextSubpass                                                                  (VkCommandBuffer commandBuffer, VkSubpassContents contents) const;
 virtual void           cmdEndRenderPass                                                                (VkCommandBuffer commandBuffer) const;
 virtual void           cmdExecuteCommands                                                              (VkCommandBuffer commandBuffer, deUint32 commandBufferCount, const VkCommandBuffer* pCommandBuffers) const;
+virtual VkResult       createSwapchainKHR                                                              (VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain) const;
+virtual void           destroySwapchainKHR                                                             (VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator) const;
+virtual VkResult       getSwapchainImagesKHR                                                   (VkDevice device, VkSwapchainKHR swapchain, deUint32* pSwapchainImageCount, VkImage* pSwapchainImages) const;
+virtual VkResult       acquireNextImageKHR                                                             (VkDevice device, VkSwapchainKHR swapchain, deUint64 timeout, VkSemaphore semaphore, VkFence fence, deUint32* pImageIndex) const;
+virtual VkResult       queuePresentKHR                                                                 (VkQueue queue, const VkPresentInfoKHR* pPresentInfo) const;
+virtual VkResult       createSharedSwapchainsKHR                                               (VkDevice device, deUint32 swapchainCount, const VkSwapchainCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains) const;
index 5a32065..db1d3ff 100644 (file)
@@ -1,18 +1,41 @@
 /* WARNING: This is auto-generated file. Do not modify, since changes will
  * be lost! Modify the generating script instead.
  */
-virtual void                           destroyInstance                                                 (VkInstance instance, const VkAllocationCallbacks* pAllocator) const;
-virtual VkResult                       enumeratePhysicalDevices                                (VkInstance instance, deUint32* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices) const;
-virtual void                           getPhysicalDeviceFeatures                               (VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures) const;
-virtual void                           getPhysicalDeviceFormatProperties               (VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties) const;
-virtual VkResult                       getPhysicalDeviceImageFormatProperties  (VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties) const;
-virtual void                           getPhysicalDeviceProperties                             (VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties) const;
-virtual void                           getPhysicalDeviceQueueFamilyProperties  (VkPhysicalDevice physicalDevice, deUint32* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties) const;
-virtual void                           getPhysicalDeviceMemoryProperties               (VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties) const;
-virtual PFN_vkVoidFunction     getDeviceProcAddr                                               (VkDevice device, const char* pName) const;
-virtual VkResult                       createDevice                                                    (VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice) const;
-virtual VkResult                       enumerateDeviceExtensionProperties              (VkPhysicalDevice physicalDevice, const char* pLayerName, deUint32* pPropertyCount, VkExtensionProperties* pProperties) const;
-virtual VkResult                       enumerateDeviceLayerProperties                  (VkPhysicalDevice physicalDevice, deUint32* pPropertyCount, VkLayerProperties* pProperties) const;
-virtual VkResult                       createDebugReportCallbackEXT                    (VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback) const;
-virtual void                           destroyDebugReportCallbackEXT                   (VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator) const;
-virtual void                           debugReportMessageEXT                                   (VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, deUint64 object, deUintptr location, deInt32 messageCode, const char* pLayerPrefix, const char* pMessage) const;
+virtual void                           destroyInstance                                                                 (VkInstance instance, const VkAllocationCallbacks* pAllocator) const;
+virtual VkResult                       enumeratePhysicalDevices                                                (VkInstance instance, deUint32* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices) const;
+virtual void                           getPhysicalDeviceFeatures                                               (VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures) const;
+virtual void                           getPhysicalDeviceFormatProperties                               (VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties) const;
+virtual VkResult                       getPhysicalDeviceImageFormatProperties                  (VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties) const;
+virtual void                           getPhysicalDeviceProperties                                             (VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties) const;
+virtual void                           getPhysicalDeviceQueueFamilyProperties                  (VkPhysicalDevice physicalDevice, deUint32* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties) const;
+virtual void                           getPhysicalDeviceMemoryProperties                               (VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties) const;
+virtual PFN_vkVoidFunction     getDeviceProcAddr                                                               (VkDevice device, const char* pName) const;
+virtual VkResult                       createDevice                                                                    (VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice) const;
+virtual VkResult                       enumerateDeviceExtensionProperties                              (VkPhysicalDevice physicalDevice, const char* pLayerName, deUint32* pPropertyCount, VkExtensionProperties* pProperties) const;
+virtual VkResult                       enumerateDeviceLayerProperties                                  (VkPhysicalDevice physicalDevice, deUint32* pPropertyCount, VkLayerProperties* pProperties) const;
+virtual void                           destroySurfaceKHR                                                               (VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator) const;
+virtual VkResult                       getPhysicalDeviceSurfaceSupportKHR                              (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported) const;
+virtual VkResult                       getPhysicalDeviceSurfaceCapabilitiesKHR                 (VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) const;
+virtual VkResult                       getPhysicalDeviceSurfaceFormatsKHR                              (VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, deUint32* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats) const;
+virtual VkResult                       getPhysicalDeviceSurfacePresentModesKHR                 (VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, deUint32* pPresentModeCount, VkPresentModeKHR* pPresentModes) const;
+virtual VkResult                       getPhysicalDeviceDisplayPropertiesKHR                   (VkPhysicalDevice physicalDevice, deUint32* pPropertyCount, VkDisplayPropertiesKHR* pProperties) const;
+virtual VkResult                       getPhysicalDeviceDisplayPlanePropertiesKHR              (VkPhysicalDevice physicalDevice, deUint32* pPropertyCount, VkDisplayPlanePropertiesKHR* pProperties) const;
+virtual VkResult                       getDisplayPlaneSupportedDisplaysKHR                             (VkPhysicalDevice physicalDevice, deUint32 planeIndex, deUint32* pDisplayCount, VkDisplayKHR* pDisplays) const;
+virtual VkResult                       getDisplayModePropertiesKHR                                             (VkPhysicalDevice physicalDevice, VkDisplayKHR display, deUint32* pPropertyCount, VkDisplayModePropertiesKHR* pProperties) const;
+virtual VkResult                       createDisplayModeKHR                                                    (VkPhysicalDevice physicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDisplayModeKHR* pMode) const;
+virtual VkResult                       getDisplayPlaneCapabilitiesKHR                                  (VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, deUint32 planeIndex, VkDisplayPlaneCapabilitiesKHR* pCapabilities) const;
+virtual VkResult                       createDisplayPlaneSurfaceKHR                                    (VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const;
+virtual VkResult                       createXlibSurfaceKHR                                                    (VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const;
+virtual VkBool32                       getPhysicalDeviceXlibPresentationSupportKHR             (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, pt::XlibDisplayPtr dpy, pt::XlibVisualID visualID) const;
+virtual VkResult                       createXcbSurfaceKHR                                                             (VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const;
+virtual VkBool32                       getPhysicalDeviceXcbPresentationSupportKHR              (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, pt::XcbConnectionPtr connection, pt::XcbVisualid visual_id) const;
+virtual VkResult                       createWaylandSurfaceKHR                                                 (VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const;
+virtual VkBool32                       getPhysicalDeviceWaylandPresentationSupportKHR  (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, pt::WaylandDisplayPtr display) const;
+virtual VkResult                       createMirSurfaceKHR                                                             (VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const;
+virtual VkBool32                       getPhysicalDeviceMirPresentationSupportKHR              (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, pt::MirConnectionPtr connection) const;
+virtual VkResult                       createAndroidSurfaceKHR                                                 (VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const;
+virtual VkResult                       createWin32SurfaceKHR                                                   (VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const;
+virtual VkBool32                       getPhysicalDeviceWin32PresentationSupportKHR    (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex) const;
+virtual VkResult                       createDebugReportCallbackEXT                                    (VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback) const;
+virtual void                           destroyDebugReportCallbackEXT                                   (VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator) const;
+virtual void                           debugReportMessageEXT                                                   (VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, deUint64 object, deUintptr location, deInt32 messageCode, const char* pLayerPrefix, const char* pMessage) const;
index 6a6717b..6cf6c51 100644 (file)
 #define VK_DEFINE_HANDLE(NAME, TYPE)                                   typedef struct NAME##_s* NAME
 #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(NAME, TYPE)  typedef Handle<TYPE> NAME
 
+#define VK_DEFINE_PLATFORM_TYPE(NAME, COMPATIBLE)              \
+namespace pt {                                                                                 \
+struct NAME {                                                                                  \
+       COMPATIBLE internal;                                                            \
+       explicit NAME (COMPATIBLE internal_)                            \
+               : internal(internal_) {}                                                \
+};                                                                                                             \
+} // pt
+
 #define VK_MAKE_VERSION(MAJOR, MINOR, PATCH)   ((MAJOR << 22) | (MINOR << 12) | PATCH)
 #define VK_BIT(NUM)                                                            (1<<NUM)
 
@@ -101,6 +110,23 @@ enum
        VK_WHOLE_SIZE   = (~0ULL),
 };
 
+namespace wsi
+{
+
+enum Type
+{
+       TYPE_XLIB = 0,
+       TYPE_XCB,
+       TYPE_WAYLAND,
+       TYPE_MIR,
+       TYPE_ANDROID,
+       TYPE_WIN32,
+
+       TYPE_LAST
+};
+
+} // wsi
+
 typedef VKAPI_ATTR void                (VKAPI_CALL* PFN_vkVoidFunction)                                        (void);
 
 typedef VKAPI_ATTR void*       (VKAPI_CALL* PFN_vkAllocationFunction)                          (void*                                          pUserData,
index ff65bf2..8a5f4fe 100644 (file)
@@ -606,3 +606,33 @@ void DeviceDriver::cmdExecuteCommands (VkCommandBuffer commandBuffer, deUint32 c
 {
        m_vk.cmdExecuteCommands(commandBuffer, commandBufferCount, pCommandBuffers);
 }
+
+VkResult DeviceDriver::createSwapchainKHR (VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain) const
+{
+       return m_vk.createSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain);
+}
+
+void DeviceDriver::destroySwapchainKHR (VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator) const
+{
+       m_vk.destroySwapchainKHR(device, swapchain, pAllocator);
+}
+
+VkResult DeviceDriver::getSwapchainImagesKHR (VkDevice device, VkSwapchainKHR swapchain, deUint32* pSwapchainImageCount, VkImage* pSwapchainImages) const
+{
+       return m_vk.getSwapchainImagesKHR(device, swapchain, pSwapchainImageCount, pSwapchainImages);
+}
+
+VkResult DeviceDriver::acquireNextImageKHR (VkDevice device, VkSwapchainKHR swapchain, deUint64 timeout, VkSemaphore semaphore, VkFence fence, deUint32* pImageIndex) const
+{
+       return m_vk.acquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex);
+}
+
+VkResult DeviceDriver::queuePresentKHR (VkQueue queue, const VkPresentInfoKHR* pPresentInfo) const
+{
+       return m_vk.queuePresentKHR(queue, pPresentInfo);
+}
+
+VkResult DeviceDriver::createSharedSwapchainsKHR (VkDevice device, deUint32 swapchainCount, const VkSwapchainCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains) const
+{
+       return m_vk.createSharedSwapchainsKHR(device, swapchainCount, pCreateInfos, pAllocator, pSwapchains);
+}
index acf07f2..56df99e 100644 (file)
@@ -122,3 +122,9 @@ CmdBeginRenderPassFunc                                                              cmdBeginRenderPass;
 CmdNextSubpassFunc                                                                     cmdNextSubpass;
 CmdEndRenderPassFunc                                                           cmdEndRenderPass;
 CmdExecuteCommandsFunc                                                         cmdExecuteCommands;
+CreateSwapchainKHRFunc                                                         createSwapchainKHR;
+DestroySwapchainKHRFunc                                                                destroySwapchainKHR;
+GetSwapchainImagesKHRFunc                                                      getSwapchainImagesKHR;
+AcquireNextImageKHRFunc                                                                acquireNextImageKHR;
+QueuePresentKHRFunc                                                                    queuePresentKHR;
+CreateSharedSwapchainsKHRFunc                                          createSharedSwapchainsKHR;
index cb3c708..a551680 100644 (file)
 #include "vkDeviceUtil.hpp"
 #include "vkQueryUtil.hpp"
 #include "vkRefUtil.hpp"
+#include "vkApiVersion.hpp"
 
 #include "tcuCommandLine.hpp"
 
 #include "qpInfo.h"
 
-#include <vector>
-
 namespace vk
 {
 
 using std::vector;
+using std::string;
 
-Move<VkInstance> createDefaultInstance (const PlatformInterface& vkPlatform)
+Move<VkInstance> createDefaultInstance (const PlatformInterface&       vkPlatform,
+                                                                               const vector<string>&           enabledLayers,
+                                                                               const vector<string>&           enabledExtensions)
 {
+       vector<const char*>             layerNamePtrs           (enabledLayers.size());
+       vector<const char*>             extensionNamePtrs       (enabledExtensions.size());
+       const deUint32                  apiVersion                      = pack(ApiVersion(1, 0, 0));
+
        const struct VkApplicationInfo          appInfo                 =
        {
                VK_STRUCTURE_TYPE_APPLICATION_INFO,
@@ -53,7 +59,7 @@ Move<VkInstance> createDefaultInstance (const PlatformInterface& vkPlatform)
                qpGetReleaseId(),                                               // appVersion
                "deqp",                                                                 // pEngineName
                qpGetReleaseId(),                                               // engineVersion
-               VK_API_VERSION                                                  // apiVersion
+               apiVersion                                                              // apiVersion
        };
        const struct VkInstanceCreateInfo       instanceInfo    =
        {
@@ -61,15 +67,26 @@ Move<VkInstance> createDefaultInstance (const PlatformInterface& vkPlatform)
                DE_NULL,
                (VkInstanceCreateFlags)0,
                &appInfo,
-               0u,                                                                             // enabledLayerNameCount
-               DE_NULL,                                                                // ppEnabledLayerNames
-               0u,                                                                             // enabledExtensionNameCount;
-               DE_NULL                                                                 // ppEnabledExtensionNames
+               (deUint32)layerNamePtrs.size(),
+               layerNamePtrs.empty() ? DE_NULL : &layerNamePtrs[0],
+               (deUint32)extensionNamePtrs.size(),
+               extensionNamePtrs.empty() ? DE_NULL : &extensionNamePtrs[0],
        };
 
+       for (size_t ndx = 0; ndx < enabledLayers.size(); ++ndx)
+               layerNamePtrs[ndx] = enabledLayers[ndx].c_str();
+
+       for (size_t ndx = 0; ndx < enabledExtensions.size(); ++ndx)
+               extensionNamePtrs[ndx] = enabledExtensions[ndx].c_str();
+
        return createInstance(vkPlatform, &instanceInfo);
 }
 
+Move<VkInstance> createDefaultInstance (const PlatformInterface& vkPlatform)
+{
+       return createDefaultInstance(vkPlatform, vector<string>(), vector<string>());
+}
+
 VkPhysicalDevice chooseDevice (const InstanceInterface& vkInstance, VkInstance instance, const tcu::CommandLine& cmdLine)
 {
        const vector<VkPhysicalDevice>  devices = enumeratePhysicalDevices(vkInstance, instance);
index fc74a65..3b59e8b 100644 (file)
@@ -33,6 +33,9 @@
 #include "vkDefs.hpp"
 #include "vkRef.hpp"
 
+#include <vector>
+#include <string>
+
 namespace tcu
 {
 class CommandLine;
@@ -41,8 +44,14 @@ class CommandLine;
 namespace vk
 {
 
-Move<VkInstance>       createDefaultInstance   (const PlatformInterface& vkPlatform);
-VkPhysicalDevice       chooseDevice                    (const InstanceInterface& vkInstance, VkInstance instance, const tcu::CommandLine& cmdLine);
+Move<VkInstance>       createDefaultInstance   (const PlatformInterface&                       vkPlatform);
+Move<VkInstance>       createDefaultInstance   (const PlatformInterface&                       vkPlatform,
+                                                                                        const std::vector<std::string>&        enabledLayers,
+                                                                                        const std::vector<std::string>&        enabledExtensions);
+
+VkPhysicalDevice       chooseDevice                    (const InstanceInterface&                       vkInstance,
+                                                                                        VkInstance                                                     instance,
+                                                                                        const tcu::CommandLine&                        cmdLine);
 
 } // vk
 
index e31845a..ca89c7c 100644 (file)
 /* WARNING: This is auto-generated file. Do not modify, since changes will
  * be lost! Modify the generating script instead.
  */
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateInstanceFunc)                                                                (const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyInstanceFunc)                                                               (VkInstance instance, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* EnumeratePhysicalDevicesFunc)                                              (VkInstance instance, deUint32* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetPhysicalDeviceFeaturesFunc)                                             (VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetPhysicalDeviceFormatPropertiesFunc)                             (VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* GetPhysicalDeviceImageFormatPropertiesFunc)                (VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetPhysicalDevicePropertiesFunc)                                   (VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetPhysicalDeviceQueueFamilyPropertiesFunc)                (VkPhysicalDevice physicalDevice, deUint32* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetPhysicalDeviceMemoryPropertiesFunc)                             (VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties);
-typedef VKAPI_ATTR PFN_vkVoidFunction  (VKAPI_CALL* GetInstanceProcAddrFunc)                                                   (VkInstance instance, const char* pName);
-typedef VKAPI_ATTR PFN_vkVoidFunction  (VKAPI_CALL* GetDeviceProcAddrFunc)                                                             (VkDevice device, const char* pName);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateDeviceFunc)                                                                  (VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyDeviceFunc)                                                                 (VkDevice device, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* EnumerateInstanceExtensionPropertiesFunc)                  (const char* pLayerName, deUint32* pPropertyCount, VkExtensionProperties* pProperties);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* EnumerateDeviceExtensionPropertiesFunc)                    (VkPhysicalDevice physicalDevice, const char* pLayerName, deUint32* pPropertyCount, VkExtensionProperties* pProperties);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* EnumerateInstanceLayerPropertiesFunc)                              (deUint32* pPropertyCount, VkLayerProperties* pProperties);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* EnumerateDeviceLayerPropertiesFunc)                                (VkPhysicalDevice physicalDevice, deUint32* pPropertyCount, VkLayerProperties* pProperties);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetDeviceQueueFunc)                                                                (VkDevice device, deUint32 queueFamilyIndex, deUint32 queueIndex, VkQueue* pQueue);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* QueueSubmitFunc)                                                                   (VkQueue queue, deUint32 submitCount, const VkSubmitInfo* pSubmits, VkFence fence);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* QueueWaitIdleFunc)                                                                 (VkQueue queue);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* DeviceWaitIdleFunc)                                                                (VkDevice device);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* AllocateMemoryFunc)                                                                (VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* FreeMemoryFunc)                                                                    (VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* MapMemoryFunc)                                                                             (VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* UnmapMemoryFunc)                                                                   (VkDevice device, VkDeviceMemory memory);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* FlushMappedMemoryRangesFunc)                                               (VkDevice device, deUint32 memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* InvalidateMappedMemoryRangesFunc)                                  (VkDevice device, deUint32 memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetDeviceMemoryCommitmentFunc)                                             (VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* BindBufferMemoryFunc)                                                              (VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* BindImageMemoryFunc)                                                               (VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetBufferMemoryRequirementsFunc)                                   (VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetImageMemoryRequirementsFunc)                                    (VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetImageSparseMemoryRequirementsFunc)                              (VkDevice device, VkImage image, deUint32* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetPhysicalDeviceSparseImageFormatPropertiesFunc)  (VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, deUint32* pPropertyCount, VkSparseImageFormatProperties* pProperties);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* QueueBindSparseFunc)                                                               (VkQueue queue, deUint32 bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateFenceFunc)                                                                   (VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyFenceFunc)                                                                  (VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* ResetFencesFunc)                                                                   (VkDevice device, deUint32 fenceCount, const VkFence* pFences);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* GetFenceStatusFunc)                                                                (VkDevice device, VkFence fence);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* WaitForFencesFunc)                                                                 (VkDevice device, deUint32 fenceCount, const VkFence* pFences, VkBool32 waitAll, deUint64 timeout);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateSemaphoreFunc)                                                               (VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroySemaphoreFunc)                                                              (VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateEventFunc)                                                                   (VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkEvent* pEvent);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyEventFunc)                                                                  (VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* GetEventStatusFunc)                                                                (VkDevice device, VkEvent event);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* SetEventFunc)                                                                              (VkDevice device, VkEvent event);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* ResetEventFunc)                                                                    (VkDevice device, VkEvent event);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateQueryPoolFunc)                                                               (VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyQueryPoolFunc)                                                              (VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* GetQueryPoolResultsFunc)                                                   (VkDevice device, VkQueryPool queryPool, deUint32 firstQuery, deUint32 queryCount, deUintptr dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateBufferFunc)                                                                  (VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyBufferFunc)                                                                 (VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateBufferViewFunc)                                                              (VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferView* pView);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyBufferViewFunc)                                                             (VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateImageFunc)                                                                   (VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyImageFunc)                                                                  (VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetImageSubresourceLayoutFunc)                                             (VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateImageViewFunc)                                                               (VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyImageViewFunc)                                                              (VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateShaderModuleFunc)                                                    (VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyShaderModuleFunc)                                                   (VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreatePipelineCacheFunc)                                                   (VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyPipelineCacheFunc)                                                  (VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* GetPipelineCacheDataFunc)                                                  (VkDevice device, VkPipelineCache pipelineCache, deUintptr* pDataSize, void* pData);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* MergePipelineCachesFunc)                                                   (VkDevice device, VkPipelineCache dstCache, deUint32 srcCacheCount, const VkPipelineCache* pSrcCaches);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateGraphicsPipelinesFunc)                                               (VkDevice device, VkPipelineCache pipelineCache, deUint32 createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateComputePipelinesFunc)                                                (VkDevice device, VkPipelineCache pipelineCache, deUint32 createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyPipelineFunc)                                                               (VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreatePipelineLayoutFunc)                                                  (VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyPipelineLayoutFunc)                                                 (VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateSamplerFunc)                                                                 (VkDevice device, const VkSamplerCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSampler* pSampler);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroySamplerFunc)                                                                (VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateDescriptorSetLayoutFunc)                                             (VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyDescriptorSetLayoutFunc)                                    (VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateDescriptorPoolFunc)                                                  (VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyDescriptorPoolFunc)                                                 (VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* ResetDescriptorPoolFunc)                                                   (VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* AllocateDescriptorSetsFunc)                                                (VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* FreeDescriptorSetsFunc)                                                    (VkDevice device, VkDescriptorPool descriptorPool, deUint32 descriptorSetCount, const VkDescriptorSet* pDescriptorSets);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* UpdateDescriptorSetsFunc)                                                  (VkDevice device, deUint32 descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, deUint32 descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateFramebufferFunc)                                                             (VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyFramebufferFunc)                                                    (VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateRenderPassFunc)                                                              (VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyRenderPassFunc)                                                             (VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetRenderAreaGranularityFunc)                                              (VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateCommandPoolFunc)                                                             (VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyCommandPoolFunc)                                                    (VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* ResetCommandPoolFunc)                                                              (VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* AllocateCommandBuffersFunc)                                                (VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* FreeCommandBuffersFunc)                                                    (VkDevice device, VkCommandPool commandPool, deUint32 commandBufferCount, const VkCommandBuffer* pCommandBuffers);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* BeginCommandBufferFunc)                                                    (VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* EndCommandBufferFunc)                                                              (VkCommandBuffer commandBuffer);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* ResetCommandBufferFunc)                                                    (VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdBindPipelineFunc)                                                               (VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdSetViewportFunc)                                                                (VkCommandBuffer commandBuffer, deUint32 firstViewport, deUint32 viewportCount, const VkViewport* pViewports);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdSetScissorFunc)                                                                 (VkCommandBuffer commandBuffer, deUint32 firstScissor, deUint32 scissorCount, const VkRect2D* pScissors);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdSetLineWidthFunc)                                                               (VkCommandBuffer commandBuffer, float lineWidth);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdSetDepthBiasFunc)                                                               (VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdSetBlendConstantsFunc)                                                  (VkCommandBuffer commandBuffer, const float blendConstants[4]);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdSetDepthBoundsFunc)                                                             (VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdSetStencilCompareMaskFunc)                                              (VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, deUint32 compareMask);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdSetStencilWriteMaskFunc)                                                (VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, deUint32 writeMask);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdSetStencilReferenceFunc)                                                (VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, deUint32 reference);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdBindDescriptorSetsFunc)                                                 (VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, deUint32 firstSet, deUint32 descriptorSetCount, const VkDescriptorSet* pDescriptorSets, deUint32 dynamicOffsetCount, const deUint32* pDynamicOffsets);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdBindIndexBufferFunc)                                                    (VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdBindVertexBuffersFunc)                                                  (VkCommandBuffer commandBuffer, deUint32 firstBinding, deUint32 bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdDrawFunc)                                                                               (VkCommandBuffer commandBuffer, deUint32 vertexCount, deUint32 instanceCount, deUint32 firstVertex, deUint32 firstInstance);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdDrawIndexedFunc)                                                                (VkCommandBuffer commandBuffer, deUint32 indexCount, deUint32 instanceCount, deUint32 firstIndex, deInt32 vertexOffset, deUint32 firstInstance);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdDrawIndirectFunc)                                                               (VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, deUint32 drawCount, deUint32 stride);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdDrawIndexedIndirectFunc)                                                (VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, deUint32 drawCount, deUint32 stride);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdDispatchFunc)                                                                   (VkCommandBuffer commandBuffer, deUint32 x, deUint32 y, deUint32 z);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdDispatchIndirectFunc)                                                   (VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdCopyBufferFunc)                                                                 (VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, deUint32 regionCount, const VkBufferCopy* pRegions);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdCopyImageFunc)                                                                  (VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, deUint32 regionCount, const VkImageCopy* pRegions);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdBlitImageFunc)                                                                  (VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, deUint32 regionCount, const VkImageBlit* pRegions, VkFilter filter);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdCopyBufferToImageFunc)                                                  (VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, deUint32 regionCount, const VkBufferImageCopy* pRegions);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdCopyImageToBufferFunc)                                                  (VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, deUint32 regionCount, const VkBufferImageCopy* pRegions);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdUpdateBufferFunc)                                                               (VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const deUint32* pData);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdFillBufferFunc)                                                                 (VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, deUint32 data);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdClearColorImageFunc)                                                    (VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, deUint32 rangeCount, const VkImageSubresourceRange* pRanges);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdClearDepthStencilImageFunc)                                             (VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, deUint32 rangeCount, const VkImageSubresourceRange* pRanges);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdClearAttachmentsFunc)                                                   (VkCommandBuffer commandBuffer, deUint32 attachmentCount, const VkClearAttachment* pAttachments, deUint32 rectCount, const VkClearRect* pRects);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdResolveImageFunc)                                                               (VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, deUint32 regionCount, const VkImageResolve* pRegions);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdSetEventFunc)                                                                   (VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdResetEventFunc)                                                                 (VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdWaitEventsFunc)                                                                 (VkCommandBuffer commandBuffer, deUint32 eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, deUint32 memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, deUint32 bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, deUint32 imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdPipelineBarrierFunc)                                                    (VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, deUint32 memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, deUint32 bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, deUint32 imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdBeginQueryFunc)                                                                 (VkCommandBuffer commandBuffer, VkQueryPool queryPool, deUint32 query, VkQueryControlFlags flags);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdEndQueryFunc)                                                                   (VkCommandBuffer commandBuffer, VkQueryPool queryPool, deUint32 query);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdResetQueryPoolFunc)                                                             (VkCommandBuffer commandBuffer, VkQueryPool queryPool, deUint32 firstQuery, deUint32 queryCount);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdWriteTimestampFunc)                                                             (VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, deUint32 query);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdCopyQueryPoolResultsFunc)                                               (VkCommandBuffer commandBuffer, VkQueryPool queryPool, deUint32 firstQuery, deUint32 queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdPushConstantsFunc)                                                              (VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, deUint32 offset, deUint32 size, const void* pValues);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdBeginRenderPassFunc)                                                    (VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdNextSubpassFunc)                                                                (VkCommandBuffer commandBuffer, VkSubpassContents contents);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdEndRenderPassFunc)                                                              (VkCommandBuffer commandBuffer);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdExecuteCommandsFunc)                                                    (VkCommandBuffer commandBuffer, deUint32 commandBufferCount, const VkCommandBuffer* pCommandBuffers);
-typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateDebugReportCallbackEXTFunc)                                  (VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyDebugReportCallbackEXTFunc)                                 (VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator);
-typedef VKAPI_ATTR void                                        (VKAPI_CALL* DebugReportMessageEXTFunc)                                                 (VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, deUint64 object, deUintptr location, deInt32 messageCode, const char* pLayerPrefix, const char* pMessage);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateInstanceFunc)                                                                        (const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyInstanceFunc)                                                                       (VkInstance instance, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* EnumeratePhysicalDevicesFunc)                                                      (VkInstance instance, deUint32* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetPhysicalDeviceFeaturesFunc)                                                     (VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetPhysicalDeviceFormatPropertiesFunc)                                     (VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* GetPhysicalDeviceImageFormatPropertiesFunc)                        (VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetPhysicalDevicePropertiesFunc)                                           (VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetPhysicalDeviceQueueFamilyPropertiesFunc)                        (VkPhysicalDevice physicalDevice, deUint32* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetPhysicalDeviceMemoryPropertiesFunc)                                     (VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties);
+typedef VKAPI_ATTR PFN_vkVoidFunction  (VKAPI_CALL* GetInstanceProcAddrFunc)                                                           (VkInstance instance, const char* pName);
+typedef VKAPI_ATTR PFN_vkVoidFunction  (VKAPI_CALL* GetDeviceProcAddrFunc)                                                                     (VkDevice device, const char* pName);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateDeviceFunc)                                                                          (VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyDeviceFunc)                                                                         (VkDevice device, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* EnumerateInstanceExtensionPropertiesFunc)                          (const char* pLayerName, deUint32* pPropertyCount, VkExtensionProperties* pProperties);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* EnumerateDeviceExtensionPropertiesFunc)                            (VkPhysicalDevice physicalDevice, const char* pLayerName, deUint32* pPropertyCount, VkExtensionProperties* pProperties);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* EnumerateInstanceLayerPropertiesFunc)                                      (deUint32* pPropertyCount, VkLayerProperties* pProperties);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* EnumerateDeviceLayerPropertiesFunc)                                        (VkPhysicalDevice physicalDevice, deUint32* pPropertyCount, VkLayerProperties* pProperties);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetDeviceQueueFunc)                                                                        (VkDevice device, deUint32 queueFamilyIndex, deUint32 queueIndex, VkQueue* pQueue);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* QueueSubmitFunc)                                                                           (VkQueue queue, deUint32 submitCount, const VkSubmitInfo* pSubmits, VkFence fence);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* QueueWaitIdleFunc)                                                                         (VkQueue queue);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* DeviceWaitIdleFunc)                                                                        (VkDevice device);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* AllocateMemoryFunc)                                                                        (VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* FreeMemoryFunc)                                                                            (VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* MapMemoryFunc)                                                                                     (VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* UnmapMemoryFunc)                                                                           (VkDevice device, VkDeviceMemory memory);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* FlushMappedMemoryRangesFunc)                                                       (VkDevice device, deUint32 memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* InvalidateMappedMemoryRangesFunc)                                          (VkDevice device, deUint32 memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetDeviceMemoryCommitmentFunc)                                                     (VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* BindBufferMemoryFunc)                                                                      (VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* BindImageMemoryFunc)                                                                       (VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetBufferMemoryRequirementsFunc)                                           (VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetImageMemoryRequirementsFunc)                                            (VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetImageSparseMemoryRequirementsFunc)                                      (VkDevice device, VkImage image, deUint32* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetPhysicalDeviceSparseImageFormatPropertiesFunc)          (VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, deUint32* pPropertyCount, VkSparseImageFormatProperties* pProperties);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* QueueBindSparseFunc)                                                                       (VkQueue queue, deUint32 bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateFenceFunc)                                                                           (VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyFenceFunc)                                                                          (VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* ResetFencesFunc)                                                                           (VkDevice device, deUint32 fenceCount, const VkFence* pFences);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* GetFenceStatusFunc)                                                                        (VkDevice device, VkFence fence);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* WaitForFencesFunc)                                                                         (VkDevice device, deUint32 fenceCount, const VkFence* pFences, VkBool32 waitAll, deUint64 timeout);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateSemaphoreFunc)                                                                       (VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroySemaphoreFunc)                                                                      (VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateEventFunc)                                                                           (VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkEvent* pEvent);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyEventFunc)                                                                          (VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* GetEventStatusFunc)                                                                        (VkDevice device, VkEvent event);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* SetEventFunc)                                                                                      (VkDevice device, VkEvent event);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* ResetEventFunc)                                                                            (VkDevice device, VkEvent event);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateQueryPoolFunc)                                                                       (VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyQueryPoolFunc)                                                                      (VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* GetQueryPoolResultsFunc)                                                           (VkDevice device, VkQueryPool queryPool, deUint32 firstQuery, deUint32 queryCount, deUintptr dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateBufferFunc)                                                                          (VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyBufferFunc)                                                                         (VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateBufferViewFunc)                                                                      (VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferView* pView);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyBufferViewFunc)                                                                     (VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateImageFunc)                                                                           (VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyImageFunc)                                                                          (VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetImageSubresourceLayoutFunc)                                                     (VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateImageViewFunc)                                                                       (VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyImageViewFunc)                                                                      (VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateShaderModuleFunc)                                                            (VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyShaderModuleFunc)                                                           (VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreatePipelineCacheFunc)                                                           (VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyPipelineCacheFunc)                                                          (VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* GetPipelineCacheDataFunc)                                                          (VkDevice device, VkPipelineCache pipelineCache, deUintptr* pDataSize, void* pData);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* MergePipelineCachesFunc)                                                           (VkDevice device, VkPipelineCache dstCache, deUint32 srcCacheCount, const VkPipelineCache* pSrcCaches);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateGraphicsPipelinesFunc)                                                       (VkDevice device, VkPipelineCache pipelineCache, deUint32 createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateComputePipelinesFunc)                                                        (VkDevice device, VkPipelineCache pipelineCache, deUint32 createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyPipelineFunc)                                                                       (VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreatePipelineLayoutFunc)                                                          (VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyPipelineLayoutFunc)                                                         (VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateSamplerFunc)                                                                         (VkDevice device, const VkSamplerCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSampler* pSampler);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroySamplerFunc)                                                                        (VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateDescriptorSetLayoutFunc)                                                     (VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyDescriptorSetLayoutFunc)                                            (VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateDescriptorPoolFunc)                                                          (VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyDescriptorPoolFunc)                                                         (VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* ResetDescriptorPoolFunc)                                                           (VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* AllocateDescriptorSetsFunc)                                                        (VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* FreeDescriptorSetsFunc)                                                            (VkDevice device, VkDescriptorPool descriptorPool, deUint32 descriptorSetCount, const VkDescriptorSet* pDescriptorSets);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* UpdateDescriptorSetsFunc)                                                          (VkDevice device, deUint32 descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, deUint32 descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateFramebufferFunc)                                                                     (VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyFramebufferFunc)                                                            (VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateRenderPassFunc)                                                                      (VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyRenderPassFunc)                                                                     (VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* GetRenderAreaGranularityFunc)                                                      (VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateCommandPoolFunc)                                                                     (VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyCommandPoolFunc)                                                            (VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* ResetCommandPoolFunc)                                                                      (VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* AllocateCommandBuffersFunc)                                                        (VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* FreeCommandBuffersFunc)                                                            (VkDevice device, VkCommandPool commandPool, deUint32 commandBufferCount, const VkCommandBuffer* pCommandBuffers);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* BeginCommandBufferFunc)                                                            (VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* EndCommandBufferFunc)                                                                      (VkCommandBuffer commandBuffer);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* ResetCommandBufferFunc)                                                            (VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdBindPipelineFunc)                                                                       (VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdSetViewportFunc)                                                                        (VkCommandBuffer commandBuffer, deUint32 firstViewport, deUint32 viewportCount, const VkViewport* pViewports);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdSetScissorFunc)                                                                         (VkCommandBuffer commandBuffer, deUint32 firstScissor, deUint32 scissorCount, const VkRect2D* pScissors);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdSetLineWidthFunc)                                                                       (VkCommandBuffer commandBuffer, float lineWidth);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdSetDepthBiasFunc)                                                                       (VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdSetBlendConstantsFunc)                                                          (VkCommandBuffer commandBuffer, const float blendConstants[4]);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdSetDepthBoundsFunc)                                                                     (VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdSetStencilCompareMaskFunc)                                                      (VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, deUint32 compareMask);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdSetStencilWriteMaskFunc)                                                        (VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, deUint32 writeMask);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdSetStencilReferenceFunc)                                                        (VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, deUint32 reference);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdBindDescriptorSetsFunc)                                                         (VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, deUint32 firstSet, deUint32 descriptorSetCount, const VkDescriptorSet* pDescriptorSets, deUint32 dynamicOffsetCount, const deUint32* pDynamicOffsets);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdBindIndexBufferFunc)                                                            (VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdBindVertexBuffersFunc)                                                          (VkCommandBuffer commandBuffer, deUint32 firstBinding, deUint32 bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdDrawFunc)                                                                                       (VkCommandBuffer commandBuffer, deUint32 vertexCount, deUint32 instanceCount, deUint32 firstVertex, deUint32 firstInstance);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdDrawIndexedFunc)                                                                        (VkCommandBuffer commandBuffer, deUint32 indexCount, deUint32 instanceCount, deUint32 firstIndex, deInt32 vertexOffset, deUint32 firstInstance);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdDrawIndirectFunc)                                                                       (VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, deUint32 drawCount, deUint32 stride);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdDrawIndexedIndirectFunc)                                                        (VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, deUint32 drawCount, deUint32 stride);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdDispatchFunc)                                                                           (VkCommandBuffer commandBuffer, deUint32 x, deUint32 y, deUint32 z);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdDispatchIndirectFunc)                                                           (VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdCopyBufferFunc)                                                                         (VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, deUint32 regionCount, const VkBufferCopy* pRegions);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdCopyImageFunc)                                                                          (VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, deUint32 regionCount, const VkImageCopy* pRegions);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdBlitImageFunc)                                                                          (VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, deUint32 regionCount, const VkImageBlit* pRegions, VkFilter filter);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdCopyBufferToImageFunc)                                                          (VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, deUint32 regionCount, const VkBufferImageCopy* pRegions);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdCopyImageToBufferFunc)                                                          (VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, deUint32 regionCount, const VkBufferImageCopy* pRegions);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdUpdateBufferFunc)                                                                       (VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const deUint32* pData);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdFillBufferFunc)                                                                         (VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, deUint32 data);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdClearColorImageFunc)                                                            (VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, deUint32 rangeCount, const VkImageSubresourceRange* pRanges);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdClearDepthStencilImageFunc)                                                     (VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, deUint32 rangeCount, const VkImageSubresourceRange* pRanges);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdClearAttachmentsFunc)                                                           (VkCommandBuffer commandBuffer, deUint32 attachmentCount, const VkClearAttachment* pAttachments, deUint32 rectCount, const VkClearRect* pRects);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdResolveImageFunc)                                                                       (VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, deUint32 regionCount, const VkImageResolve* pRegions);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdSetEventFunc)                                                                           (VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdResetEventFunc)                                                                         (VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdWaitEventsFunc)                                                                         (VkCommandBuffer commandBuffer, deUint32 eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, deUint32 memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, deUint32 bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, deUint32 imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdPipelineBarrierFunc)                                                            (VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, deUint32 memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, deUint32 bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, deUint32 imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdBeginQueryFunc)                                                                         (VkCommandBuffer commandBuffer, VkQueryPool queryPool, deUint32 query, VkQueryControlFlags flags);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdEndQueryFunc)                                                                           (VkCommandBuffer commandBuffer, VkQueryPool queryPool, deUint32 query);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdResetQueryPoolFunc)                                                                     (VkCommandBuffer commandBuffer, VkQueryPool queryPool, deUint32 firstQuery, deUint32 queryCount);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdWriteTimestampFunc)                                                                     (VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, deUint32 query);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdCopyQueryPoolResultsFunc)                                                       (VkCommandBuffer commandBuffer, VkQueryPool queryPool, deUint32 firstQuery, deUint32 queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdPushConstantsFunc)                                                                      (VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, deUint32 offset, deUint32 size, const void* pValues);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdBeginRenderPassFunc)                                                            (VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdNextSubpassFunc)                                                                        (VkCommandBuffer commandBuffer, VkSubpassContents contents);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdEndRenderPassFunc)                                                                      (VkCommandBuffer commandBuffer);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* CmdExecuteCommandsFunc)                                                            (VkCommandBuffer commandBuffer, deUint32 commandBufferCount, const VkCommandBuffer* pCommandBuffers);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroySurfaceKHRFunc)                                                                     (VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* GetPhysicalDeviceSurfaceSupportKHRFunc)                            (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* GetPhysicalDeviceSurfaceCapabilitiesKHRFunc)                       (VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* GetPhysicalDeviceSurfaceFormatsKHRFunc)                            (VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, deUint32* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* GetPhysicalDeviceSurfacePresentModesKHRFunc)                       (VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, deUint32* pPresentModeCount, VkPresentModeKHR* pPresentModes);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateSwapchainKHRFunc)                                                            (VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroySwapchainKHRFunc)                                                           (VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* GetSwapchainImagesKHRFunc)                                                         (VkDevice device, VkSwapchainKHR swapchain, deUint32* pSwapchainImageCount, VkImage* pSwapchainImages);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* AcquireNextImageKHRFunc)                                                           (VkDevice device, VkSwapchainKHR swapchain, deUint64 timeout, VkSemaphore semaphore, VkFence fence, deUint32* pImageIndex);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* QueuePresentKHRFunc)                                                                       (VkQueue queue, const VkPresentInfoKHR* pPresentInfo);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* GetPhysicalDeviceDisplayPropertiesKHRFunc)                         (VkPhysicalDevice physicalDevice, deUint32* pPropertyCount, VkDisplayPropertiesKHR* pProperties);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* GetPhysicalDeviceDisplayPlanePropertiesKHRFunc)            (VkPhysicalDevice physicalDevice, deUint32* pPropertyCount, VkDisplayPlanePropertiesKHR* pProperties);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* GetDisplayPlaneSupportedDisplaysKHRFunc)                           (VkPhysicalDevice physicalDevice, deUint32 planeIndex, deUint32* pDisplayCount, VkDisplayKHR* pDisplays);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* GetDisplayModePropertiesKHRFunc)                                           (VkPhysicalDevice physicalDevice, VkDisplayKHR display, deUint32* pPropertyCount, VkDisplayModePropertiesKHR* pProperties);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateDisplayModeKHRFunc)                                                          (VkPhysicalDevice physicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDisplayModeKHR* pMode);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* GetDisplayPlaneCapabilitiesKHRFunc)                                        (VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, deUint32 planeIndex, VkDisplayPlaneCapabilitiesKHR* pCapabilities);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateDisplayPlaneSurfaceKHRFunc)                                          (VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateSharedSwapchainsKHRFunc)                                                     (VkDevice device, deUint32 swapchainCount, const VkSwapchainCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateXlibSurfaceKHRFunc)                                                          (VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
+typedef VKAPI_ATTR VkBool32                            (VKAPI_CALL* GetPhysicalDeviceXlibPresentationSupportKHRFunc)           (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, pt::XlibDisplayPtr dpy, pt::XlibVisualID visualID);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateXcbSurfaceKHRFunc)                                                           (VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
+typedef VKAPI_ATTR VkBool32                            (VKAPI_CALL* GetPhysicalDeviceXcbPresentationSupportKHRFunc)            (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, pt::XcbConnectionPtr connection, pt::XcbVisualid visual_id);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateWaylandSurfaceKHRFunc)                                                       (VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
+typedef VKAPI_ATTR VkBool32                            (VKAPI_CALL* GetPhysicalDeviceWaylandPresentationSupportKHRFunc)        (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, pt::WaylandDisplayPtr display);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateMirSurfaceKHRFunc)                                                           (VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
+typedef VKAPI_ATTR VkBool32                            (VKAPI_CALL* GetPhysicalDeviceMirPresentationSupportKHRFunc)            (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, pt::MirConnectionPtr connection);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateAndroidSurfaceKHRFunc)                                                       (VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateWin32SurfaceKHRFunc)                                                         (VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
+typedef VKAPI_ATTR VkBool32                            (VKAPI_CALL* GetPhysicalDeviceWin32PresentationSupportKHRFunc)          (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex);
+typedef VKAPI_ATTR VkResult                            (VKAPI_CALL* CreateDebugReportCallbackEXTFunc)                                          (VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DestroyDebugReportCallbackEXTFunc)                                         (VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator);
+typedef VKAPI_ATTR void                                        (VKAPI_CALL* DebugReportMessageEXTFunc)                                                         (VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, deUint64 object, deUintptr location, deInt32 messageCode, const char* pLayerPrefix, const char* pMessage);
index 4e4c44b..60a335b 100644 (file)
@@ -122,3 +122,9 @@ m_vk.cmdBeginRenderPass                                                             = (CmdBeginRenderPassFunc)                                                              GET_PROC_ADDR("
 m_vk.cmdNextSubpass                                                                    = (CmdNextSubpassFunc)                                                                  GET_PROC_ADDR("vkCmdNextSubpass");
 m_vk.cmdEndRenderPass                                                          = (CmdEndRenderPassFunc)                                                                GET_PROC_ADDR("vkCmdEndRenderPass");
 m_vk.cmdExecuteCommands                                                                = (CmdExecuteCommandsFunc)                                                              GET_PROC_ADDR("vkCmdExecuteCommands");
+m_vk.createSwapchainKHR                                                                = (CreateSwapchainKHRFunc)                                                              GET_PROC_ADDR("vkCreateSwapchainKHR");
+m_vk.destroySwapchainKHR                                                       = (DestroySwapchainKHRFunc)                                                             GET_PROC_ADDR("vkDestroySwapchainKHR");
+m_vk.getSwapchainImagesKHR                                                     = (GetSwapchainImagesKHRFunc)                                                   GET_PROC_ADDR("vkGetSwapchainImagesKHR");
+m_vk.acquireNextImageKHR                                                       = (AcquireNextImageKHRFunc)                                                             GET_PROC_ADDR("vkAcquireNextImageKHR");
+m_vk.queuePresentKHR                                                           = (QueuePresentKHRFunc)                                                                 GET_PROC_ADDR("vkQueuePresentKHR");
+m_vk.createSharedSwapchainsKHR                                         = (CreateSharedSwapchainsKHRFunc)                                               GET_PROC_ADDR("vkCreateSharedSwapchainsKHR");
index 02d16a1..4b31d23 100644 (file)
@@ -1,18 +1,41 @@
 /* WARNING: This is auto-generated file. Do not modify, since changes will
  * be lost! Modify the generating script instead.
  */
-m_vk.destroyInstance                                           = (DestroyInstanceFunc)                                                 GET_PROC_ADDR("vkDestroyInstance");
-m_vk.enumeratePhysicalDevices                          = (EnumeratePhysicalDevicesFunc)                                GET_PROC_ADDR("vkEnumeratePhysicalDevices");
-m_vk.getPhysicalDeviceFeatures                         = (GetPhysicalDeviceFeaturesFunc)                               GET_PROC_ADDR("vkGetPhysicalDeviceFeatures");
-m_vk.getPhysicalDeviceFormatProperties         = (GetPhysicalDeviceFormatPropertiesFunc)               GET_PROC_ADDR("vkGetPhysicalDeviceFormatProperties");
-m_vk.getPhysicalDeviceImageFormatProperties    = (GetPhysicalDeviceImageFormatPropertiesFunc)  GET_PROC_ADDR("vkGetPhysicalDeviceImageFormatProperties");
-m_vk.getPhysicalDeviceProperties                       = (GetPhysicalDevicePropertiesFunc)                             GET_PROC_ADDR("vkGetPhysicalDeviceProperties");
-m_vk.getPhysicalDeviceQueueFamilyProperties    = (GetPhysicalDeviceQueueFamilyPropertiesFunc)  GET_PROC_ADDR("vkGetPhysicalDeviceQueueFamilyProperties");
-m_vk.getPhysicalDeviceMemoryProperties         = (GetPhysicalDeviceMemoryPropertiesFunc)               GET_PROC_ADDR("vkGetPhysicalDeviceMemoryProperties");
-m_vk.getDeviceProcAddr                                         = (GetDeviceProcAddrFunc)                                               GET_PROC_ADDR("vkGetDeviceProcAddr");
-m_vk.createDevice                                                      = (CreateDeviceFunc)                                                    GET_PROC_ADDR("vkCreateDevice");
-m_vk.enumerateDeviceExtensionProperties                = (EnumerateDeviceExtensionPropertiesFunc)              GET_PROC_ADDR("vkEnumerateDeviceExtensionProperties");
-m_vk.enumerateDeviceLayerProperties                    = (EnumerateDeviceLayerPropertiesFunc)                  GET_PROC_ADDR("vkEnumerateDeviceLayerProperties");
-m_vk.createDebugReportCallbackEXT                      = (CreateDebugReportCallbackEXTFunc)                    GET_PROC_ADDR("vkCreateDebugReportCallbackEXT");
-m_vk.destroyDebugReportCallbackEXT                     = (DestroyDebugReportCallbackEXTFunc)                   GET_PROC_ADDR("vkDestroyDebugReportCallbackEXT");
-m_vk.debugReportMessageEXT                                     = (DebugReportMessageEXTFunc)                                   GET_PROC_ADDR("vkDebugReportMessageEXT");
+m_vk.destroyInstance                                                           = (DestroyInstanceFunc)                                                                 GET_PROC_ADDR("vkDestroyInstance");
+m_vk.enumeratePhysicalDevices                                          = (EnumeratePhysicalDevicesFunc)                                                GET_PROC_ADDR("vkEnumeratePhysicalDevices");
+m_vk.getPhysicalDeviceFeatures                                         = (GetPhysicalDeviceFeaturesFunc)                                               GET_PROC_ADDR("vkGetPhysicalDeviceFeatures");
+m_vk.getPhysicalDeviceFormatProperties                         = (GetPhysicalDeviceFormatPropertiesFunc)                               GET_PROC_ADDR("vkGetPhysicalDeviceFormatProperties");
+m_vk.getPhysicalDeviceImageFormatProperties                    = (GetPhysicalDeviceImageFormatPropertiesFunc)                  GET_PROC_ADDR("vkGetPhysicalDeviceImageFormatProperties");
+m_vk.getPhysicalDeviceProperties                                       = (GetPhysicalDevicePropertiesFunc)                                             GET_PROC_ADDR("vkGetPhysicalDeviceProperties");
+m_vk.getPhysicalDeviceQueueFamilyProperties                    = (GetPhysicalDeviceQueueFamilyPropertiesFunc)                  GET_PROC_ADDR("vkGetPhysicalDeviceQueueFamilyProperties");
+m_vk.getPhysicalDeviceMemoryProperties                         = (GetPhysicalDeviceMemoryPropertiesFunc)                               GET_PROC_ADDR("vkGetPhysicalDeviceMemoryProperties");
+m_vk.getDeviceProcAddr                                                         = (GetDeviceProcAddrFunc)                                                               GET_PROC_ADDR("vkGetDeviceProcAddr");
+m_vk.createDevice                                                                      = (CreateDeviceFunc)                                                                    GET_PROC_ADDR("vkCreateDevice");
+m_vk.enumerateDeviceExtensionProperties                                = (EnumerateDeviceExtensionPropertiesFunc)                              GET_PROC_ADDR("vkEnumerateDeviceExtensionProperties");
+m_vk.enumerateDeviceLayerProperties                                    = (EnumerateDeviceLayerPropertiesFunc)                                  GET_PROC_ADDR("vkEnumerateDeviceLayerProperties");
+m_vk.destroySurfaceKHR                                                         = (DestroySurfaceKHRFunc)                                                               GET_PROC_ADDR("vkDestroySurfaceKHR");
+m_vk.getPhysicalDeviceSurfaceSupportKHR                                = (GetPhysicalDeviceSurfaceSupportKHRFunc)                              GET_PROC_ADDR("vkGetPhysicalDeviceSurfaceSupportKHR");
+m_vk.getPhysicalDeviceSurfaceCapabilitiesKHR           = (GetPhysicalDeviceSurfaceCapabilitiesKHRFunc)                 GET_PROC_ADDR("vkGetPhysicalDeviceSurfaceCapabilitiesKHR");
+m_vk.getPhysicalDeviceSurfaceFormatsKHR                                = (GetPhysicalDeviceSurfaceFormatsKHRFunc)                              GET_PROC_ADDR("vkGetPhysicalDeviceSurfaceFormatsKHR");
+m_vk.getPhysicalDeviceSurfacePresentModesKHR           = (GetPhysicalDeviceSurfacePresentModesKHRFunc)                 GET_PROC_ADDR("vkGetPhysicalDeviceSurfacePresentModesKHR");
+m_vk.getPhysicalDeviceDisplayPropertiesKHR                     = (GetPhysicalDeviceDisplayPropertiesKHRFunc)                   GET_PROC_ADDR("vkGetPhysicalDeviceDisplayPropertiesKHR");
+m_vk.getPhysicalDeviceDisplayPlanePropertiesKHR                = (GetPhysicalDeviceDisplayPlanePropertiesKHRFunc)              GET_PROC_ADDR("vkGetPhysicalDeviceDisplayPlanePropertiesKHR");
+m_vk.getDisplayPlaneSupportedDisplaysKHR                       = (GetDisplayPlaneSupportedDisplaysKHRFunc)                             GET_PROC_ADDR("vkGetDisplayPlaneSupportedDisplaysKHR");
+m_vk.getDisplayModePropertiesKHR                                       = (GetDisplayModePropertiesKHRFunc)                                             GET_PROC_ADDR("vkGetDisplayModePropertiesKHR");
+m_vk.createDisplayModeKHR                                                      = (CreateDisplayModeKHRFunc)                                                    GET_PROC_ADDR("vkCreateDisplayModeKHR");
+m_vk.getDisplayPlaneCapabilitiesKHR                                    = (GetDisplayPlaneCapabilitiesKHRFunc)                                  GET_PROC_ADDR("vkGetDisplayPlaneCapabilitiesKHR");
+m_vk.createDisplayPlaneSurfaceKHR                                      = (CreateDisplayPlaneSurfaceKHRFunc)                                    GET_PROC_ADDR("vkCreateDisplayPlaneSurfaceKHR");
+m_vk.createXlibSurfaceKHR                                                      = (CreateXlibSurfaceKHRFunc)                                                    GET_PROC_ADDR("vkCreateXlibSurfaceKHR");
+m_vk.getPhysicalDeviceXlibPresentationSupportKHR       = (GetPhysicalDeviceXlibPresentationSupportKHRFunc)             GET_PROC_ADDR("vkGetPhysicalDeviceXlibPresentationSupportKHR");
+m_vk.createXcbSurfaceKHR                                                       = (CreateXcbSurfaceKHRFunc)                                                             GET_PROC_ADDR("vkCreateXcbSurfaceKHR");
+m_vk.getPhysicalDeviceXcbPresentationSupportKHR                = (GetPhysicalDeviceXcbPresentationSupportKHRFunc)              GET_PROC_ADDR("vkGetPhysicalDeviceXcbPresentationSupportKHR");
+m_vk.createWaylandSurfaceKHR                                           = (CreateWaylandSurfaceKHRFunc)                                                 GET_PROC_ADDR("vkCreateWaylandSurfaceKHR");
+m_vk.getPhysicalDeviceWaylandPresentationSupportKHR    = (GetPhysicalDeviceWaylandPresentationSupportKHRFunc)  GET_PROC_ADDR("vkGetPhysicalDeviceWaylandPresentationSupportKHR");
+m_vk.createMirSurfaceKHR                                                       = (CreateMirSurfaceKHRFunc)                                                             GET_PROC_ADDR("vkCreateMirSurfaceKHR");
+m_vk.getPhysicalDeviceMirPresentationSupportKHR                = (GetPhysicalDeviceMirPresentationSupportKHRFunc)              GET_PROC_ADDR("vkGetPhysicalDeviceMirPresentationSupportKHR");
+m_vk.createAndroidSurfaceKHR                                           = (CreateAndroidSurfaceKHRFunc)                                                 GET_PROC_ADDR("vkCreateAndroidSurfaceKHR");
+m_vk.createWin32SurfaceKHR                                                     = (CreateWin32SurfaceKHRFunc)                                                   GET_PROC_ADDR("vkCreateWin32SurfaceKHR");
+m_vk.getPhysicalDeviceWin32PresentationSupportKHR      = (GetPhysicalDeviceWin32PresentationSupportKHRFunc)    GET_PROC_ADDR("vkGetPhysicalDeviceWin32PresentationSupportKHR");
+m_vk.createDebugReportCallbackEXT                                      = (CreateDebugReportCallbackEXTFunc)                                    GET_PROC_ADDR("vkCreateDebugReportCallbackEXT");
+m_vk.destroyDebugReportCallbackEXT                                     = (DestroyDebugReportCallbackEXTFunc)                                   GET_PROC_ADDR("vkDestroyDebugReportCallbackEXT");
+m_vk.debugReportMessageEXT                                                     = (DebugReportMessageEXTFunc)                                                   GET_PROC_ADDR("vkDebugReportMessageEXT");
index 13ebdcb..db4ad9c 100644 (file)
@@ -62,6 +62,121 @@ VkResult InstanceDriver::enumerateDeviceLayerProperties (VkPhysicalDevice physic
        return m_vk.enumerateDeviceLayerProperties(physicalDevice, pPropertyCount, pProperties);
 }
 
+void InstanceDriver::destroySurfaceKHR (VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator) const
+{
+       m_vk.destroySurfaceKHR(instance, surface, pAllocator);
+}
+
+VkResult InstanceDriver::getPhysicalDeviceSurfaceSupportKHR (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported) const
+{
+       return m_vk.getPhysicalDeviceSurfaceSupportKHR(physicalDevice, queueFamilyIndex, surface, pSupported);
+}
+
+VkResult InstanceDriver::getPhysicalDeviceSurfaceCapabilitiesKHR (VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) const
+{
+       return m_vk.getPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, surface, pSurfaceCapabilities);
+}
+
+VkResult InstanceDriver::getPhysicalDeviceSurfaceFormatsKHR (VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, deUint32* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats) const
+{
+       return m_vk.getPhysicalDeviceSurfaceFormatsKHR(physicalDevice, surface, pSurfaceFormatCount, pSurfaceFormats);
+}
+
+VkResult InstanceDriver::getPhysicalDeviceSurfacePresentModesKHR (VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, deUint32* pPresentModeCount, VkPresentModeKHR* pPresentModes) const
+{
+       return m_vk.getPhysicalDeviceSurfacePresentModesKHR(physicalDevice, surface, pPresentModeCount, pPresentModes);
+}
+
+VkResult InstanceDriver::getPhysicalDeviceDisplayPropertiesKHR (VkPhysicalDevice physicalDevice, deUint32* pPropertyCount, VkDisplayPropertiesKHR* pProperties) const
+{
+       return m_vk.getPhysicalDeviceDisplayPropertiesKHR(physicalDevice, pPropertyCount, pProperties);
+}
+
+VkResult InstanceDriver::getPhysicalDeviceDisplayPlanePropertiesKHR (VkPhysicalDevice physicalDevice, deUint32* pPropertyCount, VkDisplayPlanePropertiesKHR* pProperties) const
+{
+       return m_vk.getPhysicalDeviceDisplayPlanePropertiesKHR(physicalDevice, pPropertyCount, pProperties);
+}
+
+VkResult InstanceDriver::getDisplayPlaneSupportedDisplaysKHR (VkPhysicalDevice physicalDevice, deUint32 planeIndex, deUint32* pDisplayCount, VkDisplayKHR* pDisplays) const
+{
+       return m_vk.getDisplayPlaneSupportedDisplaysKHR(physicalDevice, planeIndex, pDisplayCount, pDisplays);
+}
+
+VkResult InstanceDriver::getDisplayModePropertiesKHR (VkPhysicalDevice physicalDevice, VkDisplayKHR display, deUint32* pPropertyCount, VkDisplayModePropertiesKHR* pProperties) const
+{
+       return m_vk.getDisplayModePropertiesKHR(physicalDevice, display, pPropertyCount, pProperties);
+}
+
+VkResult InstanceDriver::createDisplayModeKHR (VkPhysicalDevice physicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDisplayModeKHR* pMode) const
+{
+       return m_vk.createDisplayModeKHR(physicalDevice, display, pCreateInfo, pAllocator, pMode);
+}
+
+VkResult InstanceDriver::getDisplayPlaneCapabilitiesKHR (VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, deUint32 planeIndex, VkDisplayPlaneCapabilitiesKHR* pCapabilities) const
+{
+       return m_vk.getDisplayPlaneCapabilitiesKHR(physicalDevice, mode, planeIndex, pCapabilities);
+}
+
+VkResult InstanceDriver::createDisplayPlaneSurfaceKHR (VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const
+{
+       return m_vk.createDisplayPlaneSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
+}
+
+VkResult InstanceDriver::createXlibSurfaceKHR (VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const
+{
+       return m_vk.createXlibSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
+}
+
+VkBool32 InstanceDriver::getPhysicalDeviceXlibPresentationSupportKHR (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, pt::XlibDisplayPtr dpy, pt::XlibVisualID visualID) const
+{
+       return m_vk.getPhysicalDeviceXlibPresentationSupportKHR(physicalDevice, queueFamilyIndex, dpy, visualID);
+}
+
+VkResult InstanceDriver::createXcbSurfaceKHR (VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const
+{
+       return m_vk.createXcbSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
+}
+
+VkBool32 InstanceDriver::getPhysicalDeviceXcbPresentationSupportKHR (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, pt::XcbConnectionPtr connection, pt::XcbVisualid visual_id) const
+{
+       return m_vk.getPhysicalDeviceXcbPresentationSupportKHR(physicalDevice, queueFamilyIndex, connection, visual_id);
+}
+
+VkResult InstanceDriver::createWaylandSurfaceKHR (VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const
+{
+       return m_vk.createWaylandSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
+}
+
+VkBool32 InstanceDriver::getPhysicalDeviceWaylandPresentationSupportKHR (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, pt::WaylandDisplayPtr display) const
+{
+       return m_vk.getPhysicalDeviceWaylandPresentationSupportKHR(physicalDevice, queueFamilyIndex, display);
+}
+
+VkResult InstanceDriver::createMirSurfaceKHR (VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const
+{
+       return m_vk.createMirSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
+}
+
+VkBool32 InstanceDriver::getPhysicalDeviceMirPresentationSupportKHR (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, pt::MirConnectionPtr connection) const
+{
+       return m_vk.getPhysicalDeviceMirPresentationSupportKHR(physicalDevice, queueFamilyIndex, connection);
+}
+
+VkResult InstanceDriver::createAndroidSurfaceKHR (VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const
+{
+       return m_vk.createAndroidSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
+}
+
+VkResult InstanceDriver::createWin32SurfaceKHR (VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const
+{
+       return m_vk.createWin32SurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
+}
+
+VkBool32 InstanceDriver::getPhysicalDeviceWin32PresentationSupportKHR (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex) const
+{
+       return m_vk.getPhysicalDeviceWin32PresentationSupportKHR(physicalDevice, queueFamilyIndex);
+}
+
 VkResult InstanceDriver::createDebugReportCallbackEXT (VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback) const
 {
        return m_vk.createDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pCallback);
index 1f60df8..2e33b46 100644 (file)
@@ -1,18 +1,41 @@
 /* WARNING: This is auto-generated file. Do not modify, since changes will
  * be lost! Modify the generating script instead.
  */
-DestroyInstanceFunc                                                    destroyInstance;
-EnumeratePhysicalDevicesFunc                           enumeratePhysicalDevices;
-GetPhysicalDeviceFeaturesFunc                          getPhysicalDeviceFeatures;
-GetPhysicalDeviceFormatPropertiesFunc          getPhysicalDeviceFormatProperties;
-GetPhysicalDeviceImageFormatPropertiesFunc     getPhysicalDeviceImageFormatProperties;
-GetPhysicalDevicePropertiesFunc                                getPhysicalDeviceProperties;
-GetPhysicalDeviceQueueFamilyPropertiesFunc     getPhysicalDeviceQueueFamilyProperties;
-GetPhysicalDeviceMemoryPropertiesFunc          getPhysicalDeviceMemoryProperties;
-GetDeviceProcAddrFunc                                          getDeviceProcAddr;
-CreateDeviceFunc                                                       createDevice;
-EnumerateDeviceExtensionPropertiesFunc         enumerateDeviceExtensionProperties;
-EnumerateDeviceLayerPropertiesFunc                     enumerateDeviceLayerProperties;
-CreateDebugReportCallbackEXTFunc                       createDebugReportCallbackEXT;
-DestroyDebugReportCallbackEXTFunc                      destroyDebugReportCallbackEXT;
-DebugReportMessageEXTFunc                                      debugReportMessageEXT;
+DestroyInstanceFunc                                                                    destroyInstance;
+EnumeratePhysicalDevicesFunc                                           enumeratePhysicalDevices;
+GetPhysicalDeviceFeaturesFunc                                          getPhysicalDeviceFeatures;
+GetPhysicalDeviceFormatPropertiesFunc                          getPhysicalDeviceFormatProperties;
+GetPhysicalDeviceImageFormatPropertiesFunc                     getPhysicalDeviceImageFormatProperties;
+GetPhysicalDevicePropertiesFunc                                                getPhysicalDeviceProperties;
+GetPhysicalDeviceQueueFamilyPropertiesFunc                     getPhysicalDeviceQueueFamilyProperties;
+GetPhysicalDeviceMemoryPropertiesFunc                          getPhysicalDeviceMemoryProperties;
+GetDeviceProcAddrFunc                                                          getDeviceProcAddr;
+CreateDeviceFunc                                                                       createDevice;
+EnumerateDeviceExtensionPropertiesFunc                         enumerateDeviceExtensionProperties;
+EnumerateDeviceLayerPropertiesFunc                                     enumerateDeviceLayerProperties;
+DestroySurfaceKHRFunc                                                          destroySurfaceKHR;
+GetPhysicalDeviceSurfaceSupportKHRFunc                         getPhysicalDeviceSurfaceSupportKHR;
+GetPhysicalDeviceSurfaceCapabilitiesKHRFunc                    getPhysicalDeviceSurfaceCapabilitiesKHR;
+GetPhysicalDeviceSurfaceFormatsKHRFunc                         getPhysicalDeviceSurfaceFormatsKHR;
+GetPhysicalDeviceSurfacePresentModesKHRFunc                    getPhysicalDeviceSurfacePresentModesKHR;
+GetPhysicalDeviceDisplayPropertiesKHRFunc                      getPhysicalDeviceDisplayPropertiesKHR;
+GetPhysicalDeviceDisplayPlanePropertiesKHRFunc         getPhysicalDeviceDisplayPlanePropertiesKHR;
+GetDisplayPlaneSupportedDisplaysKHRFunc                                getDisplayPlaneSupportedDisplaysKHR;
+GetDisplayModePropertiesKHRFunc                                                getDisplayModePropertiesKHR;
+CreateDisplayModeKHRFunc                                                       createDisplayModeKHR;
+GetDisplayPlaneCapabilitiesKHRFunc                                     getDisplayPlaneCapabilitiesKHR;
+CreateDisplayPlaneSurfaceKHRFunc                                       createDisplayPlaneSurfaceKHR;
+CreateXlibSurfaceKHRFunc                                                       createXlibSurfaceKHR;
+GetPhysicalDeviceXlibPresentationSupportKHRFunc                getPhysicalDeviceXlibPresentationSupportKHR;
+CreateXcbSurfaceKHRFunc                                                                createXcbSurfaceKHR;
+GetPhysicalDeviceXcbPresentationSupportKHRFunc         getPhysicalDeviceXcbPresentationSupportKHR;
+CreateWaylandSurfaceKHRFunc                                                    createWaylandSurfaceKHR;
+GetPhysicalDeviceWaylandPresentationSupportKHRFunc     getPhysicalDeviceWaylandPresentationSupportKHR;
+CreateMirSurfaceKHRFunc                                                                createMirSurfaceKHR;
+GetPhysicalDeviceMirPresentationSupportKHRFunc         getPhysicalDeviceMirPresentationSupportKHR;
+CreateAndroidSurfaceKHRFunc                                                    createAndroidSurfaceKHR;
+CreateWin32SurfaceKHRFunc                                                      createWin32SurfaceKHR;
+GetPhysicalDeviceWin32PresentationSupportKHRFunc       getPhysicalDeviceWin32PresentationSupportKHR;
+CreateDebugReportCallbackEXTFunc                                       createDebugReportCallbackEXT;
+DestroyDebugReportCallbackEXTFunc                                      destroyDebugReportCallbackEXT;
+DebugReportMessageEXTFunc                                                      debugReportMessageEXT;
index e512d68..2916051 100644 (file)
@@ -188,6 +188,26 @@ private:
        const tcu::StaticFunctionLibrary        m_functions;
 };
 
+class SurfaceKHR
+{
+public:
+                                                                               SurfaceKHR              (VkInstance, const VkXlibSurfaceCreateInfoKHR*)         {}
+                                                                               SurfaceKHR              (VkInstance, const VkXcbSurfaceCreateInfoKHR*)          {}
+                                                                               SurfaceKHR              (VkInstance, const VkWaylandSurfaceCreateInfoKHR*)      {}
+                                                                               SurfaceKHR              (VkInstance, const VkMirSurfaceCreateInfoKHR*)          {}
+                                                                               SurfaceKHR              (VkInstance, const VkAndroidSurfaceCreateInfoKHR*)      {}
+                                                                               SurfaceKHR              (VkInstance, const VkWin32SurfaceCreateInfoKHR*)        {}
+                                                                               SurfaceKHR              (VkInstance, const VkDisplaySurfaceCreateInfoKHR*)      {}
+                                                                               ~SurfaceKHR             (void) {}
+};
+
+class DisplayModeKHR
+{
+public:
+                                                                               DisplayModeKHR  (VkDisplayKHR, const VkDisplayModeCreateInfoKHR*) {}
+                                                                               ~DisplayModeKHR (void) {}
+};
+
 class DebugReportCallbackEXT
 {
 public:
@@ -214,6 +234,13 @@ public:
        Pipeline (VkDevice, const VkComputePipelineCreateInfo*) {}
 };
 
+class SwapchainKHR
+{
+public:
+                                                                               SwapchainKHR    (VkDevice, const VkSwapchainCreateInfoKHR*) {}
+                                                                               ~SwapchainKHR   (void) {}
+};
+
 void* allocateHeap (const VkMemoryAllocateInfo* pAllocInfo)
 {
        // \todo [2015-12-03 pyry] Alignment requirements?
@@ -637,6 +664,23 @@ VKAPI_ATTR void VKAPI_CALL freeCommandBuffers (VkDevice device, VkCommandPool co
                delete reinterpret_cast<CommandBuffer*>(pCommandBuffers[ndx]);
 }
 
+
+VKAPI_ATTR VkResult VKAPI_CALL createDisplayModeKHR (VkPhysicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDisplayModeKHR* pMode)
+{
+       DE_UNREF(pAllocator);
+       VK_NULL_RETURN((*pMode = allocateNonDispHandle<DisplayModeKHR, VkDisplayModeKHR>(display, pCreateInfo, pAllocator)));
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL createSharedSwapchainsKHR (VkDevice device, deUint32 swapchainCount, const VkSwapchainCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains)
+{
+       for (deUint32 ndx = 0; ndx < swapchainCount; ++ndx)
+       {
+               pSwapchains[ndx] = allocateNonDispHandle<SwapchainKHR, VkSwapchainKHR>(device, pCreateInfos+ndx, pAllocator);
+       }
+
+       return VK_SUCCESS;
+}
+
 #include "vkNullDriverImpl.inl"
 
 } // extern "C"
index a5c3b84..c627a81 100644 (file)
@@ -121,6 +121,54 @@ VKAPI_ATTR VkResult VKAPI_CALL createCommandPool (VkDevice device, const VkComma
        VK_NULL_RETURN((*pCommandPool = allocateNonDispHandle<CommandPool, VkCommandPool>(device, pCreateInfo, pAllocator)));
 }
 
+VKAPI_ATTR VkResult VKAPI_CALL createSwapchainKHR (VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain)
+{
+       DE_UNREF(pAllocator);
+       VK_NULL_RETURN((*pSwapchain = allocateNonDispHandle<SwapchainKHR, VkSwapchainKHR>(device, pCreateInfo, pAllocator)));
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL createDisplayPlaneSurfaceKHR (VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface)
+{
+       DE_UNREF(pAllocator);
+       VK_NULL_RETURN((*pSurface = allocateNonDispHandle<SurfaceKHR, VkSurfaceKHR>(instance, pCreateInfo, pAllocator)));
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL createXlibSurfaceKHR (VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface)
+{
+       DE_UNREF(pAllocator);
+       VK_NULL_RETURN((*pSurface = allocateNonDispHandle<SurfaceKHR, VkSurfaceKHR>(instance, pCreateInfo, pAllocator)));
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL createXcbSurfaceKHR (VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface)
+{
+       DE_UNREF(pAllocator);
+       VK_NULL_RETURN((*pSurface = allocateNonDispHandle<SurfaceKHR, VkSurfaceKHR>(instance, pCreateInfo, pAllocator)));
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL createWaylandSurfaceKHR (VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface)
+{
+       DE_UNREF(pAllocator);
+       VK_NULL_RETURN((*pSurface = allocateNonDispHandle<SurfaceKHR, VkSurfaceKHR>(instance, pCreateInfo, pAllocator)));
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL createMirSurfaceKHR (VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface)
+{
+       DE_UNREF(pAllocator);
+       VK_NULL_RETURN((*pSurface = allocateNonDispHandle<SurfaceKHR, VkSurfaceKHR>(instance, pCreateInfo, pAllocator)));
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL createAndroidSurfaceKHR (VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface)
+{
+       DE_UNREF(pAllocator);
+       VK_NULL_RETURN((*pSurface = allocateNonDispHandle<SurfaceKHR, VkSurfaceKHR>(instance, pCreateInfo, pAllocator)));
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL createWin32SurfaceKHR (VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface)
+{
+       DE_UNREF(pAllocator);
+       VK_NULL_RETURN((*pSurface = allocateNonDispHandle<SurfaceKHR, VkSurfaceKHR>(instance, pCreateInfo, pAllocator)));
+}
+
 VKAPI_ATTR VkResult VKAPI_CALL createDebugReportCallbackEXT (VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback)
 {
        DE_UNREF(pAllocator);
@@ -251,6 +299,18 @@ VKAPI_ATTR void VKAPI_CALL destroyCommandPool (VkDevice device, VkCommandPool co
        freeNonDispHandle<CommandPool, VkCommandPool>(commandPool, pAllocator);
 }
 
+VKAPI_ATTR void VKAPI_CALL destroySurfaceKHR (VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator)
+{
+       DE_UNREF(instance);
+       freeNonDispHandle<SurfaceKHR, VkSurfaceKHR>(surface, pAllocator);
+}
+
+VKAPI_ATTR void VKAPI_CALL destroySwapchainKHR (VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator)
+{
+       DE_UNREF(device);
+       freeNonDispHandle<SwapchainKHR, VkSwapchainKHR>(swapchain, pAllocator);
+}
+
 VKAPI_ATTR void VKAPI_CALL destroyDebugReportCallbackEXT (VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator)
 {
        DE_UNREF(instance);
@@ -924,6 +984,152 @@ VKAPI_ATTR void VKAPI_CALL cmdExecuteCommands (VkCommandBuffer commandBuffer, de
        DE_UNREF(pCommandBuffers);
 }
 
+VKAPI_ATTR VkResult VKAPI_CALL getPhysicalDeviceSurfaceSupportKHR (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported)
+{
+       DE_UNREF(physicalDevice);
+       DE_UNREF(queueFamilyIndex);
+       DE_UNREF(surface);
+       DE_UNREF(pSupported);
+       return VK_SUCCESS;
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL getPhysicalDeviceSurfaceCapabilitiesKHR (VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities)
+{
+       DE_UNREF(physicalDevice);
+       DE_UNREF(surface);
+       DE_UNREF(pSurfaceCapabilities);
+       return VK_SUCCESS;
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL getPhysicalDeviceSurfaceFormatsKHR (VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, deUint32* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats)
+{
+       DE_UNREF(physicalDevice);
+       DE_UNREF(surface);
+       DE_UNREF(pSurfaceFormatCount);
+       DE_UNREF(pSurfaceFormats);
+       return VK_SUCCESS;
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL getPhysicalDeviceSurfacePresentModesKHR (VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, deUint32* pPresentModeCount, VkPresentModeKHR* pPresentModes)
+{
+       DE_UNREF(physicalDevice);
+       DE_UNREF(surface);
+       DE_UNREF(pPresentModeCount);
+       DE_UNREF(pPresentModes);
+       return VK_SUCCESS;
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL getSwapchainImagesKHR (VkDevice device, VkSwapchainKHR swapchain, deUint32* pSwapchainImageCount, VkImage* pSwapchainImages)
+{
+       DE_UNREF(device);
+       DE_UNREF(swapchain);
+       DE_UNREF(pSwapchainImageCount);
+       DE_UNREF(pSwapchainImages);
+       return VK_SUCCESS;
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL acquireNextImageKHR (VkDevice device, VkSwapchainKHR swapchain, deUint64 timeout, VkSemaphore semaphore, VkFence fence, deUint32* pImageIndex)
+{
+       DE_UNREF(device);
+       DE_UNREF(swapchain);
+       DE_UNREF(timeout);
+       DE_UNREF(semaphore);
+       DE_UNREF(fence);
+       DE_UNREF(pImageIndex);
+       return VK_SUCCESS;
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL queuePresentKHR (VkQueue queue, const VkPresentInfoKHR* pPresentInfo)
+{
+       DE_UNREF(queue);
+       DE_UNREF(pPresentInfo);
+       return VK_SUCCESS;
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL getPhysicalDeviceDisplayPropertiesKHR (VkPhysicalDevice physicalDevice, deUint32* pPropertyCount, VkDisplayPropertiesKHR* pProperties)
+{
+       DE_UNREF(physicalDevice);
+       DE_UNREF(pPropertyCount);
+       DE_UNREF(pProperties);
+       return VK_SUCCESS;
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL getPhysicalDeviceDisplayPlanePropertiesKHR (VkPhysicalDevice physicalDevice, deUint32* pPropertyCount, VkDisplayPlanePropertiesKHR* pProperties)
+{
+       DE_UNREF(physicalDevice);
+       DE_UNREF(pPropertyCount);
+       DE_UNREF(pProperties);
+       return VK_SUCCESS;
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL getDisplayPlaneSupportedDisplaysKHR (VkPhysicalDevice physicalDevice, deUint32 planeIndex, deUint32* pDisplayCount, VkDisplayKHR* pDisplays)
+{
+       DE_UNREF(physicalDevice);
+       DE_UNREF(planeIndex);
+       DE_UNREF(pDisplayCount);
+       DE_UNREF(pDisplays);
+       return VK_SUCCESS;
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL getDisplayModePropertiesKHR (VkPhysicalDevice physicalDevice, VkDisplayKHR display, deUint32* pPropertyCount, VkDisplayModePropertiesKHR* pProperties)
+{
+       DE_UNREF(physicalDevice);
+       DE_UNREF(display);
+       DE_UNREF(pPropertyCount);
+       DE_UNREF(pProperties);
+       return VK_SUCCESS;
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL getDisplayPlaneCapabilitiesKHR (VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, deUint32 planeIndex, VkDisplayPlaneCapabilitiesKHR* pCapabilities)
+{
+       DE_UNREF(physicalDevice);
+       DE_UNREF(mode);
+       DE_UNREF(planeIndex);
+       DE_UNREF(pCapabilities);
+       return VK_SUCCESS;
+}
+
+VKAPI_ATTR VkBool32 VKAPI_CALL getPhysicalDeviceXlibPresentationSupportKHR (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, pt::XlibDisplayPtr dpy, pt::XlibVisualID visualID)
+{
+       DE_UNREF(physicalDevice);
+       DE_UNREF(queueFamilyIndex);
+       DE_UNREF(dpy);
+       DE_UNREF(visualID);
+       return VK_SUCCESS;
+}
+
+VKAPI_ATTR VkBool32 VKAPI_CALL getPhysicalDeviceXcbPresentationSupportKHR (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, pt::XcbConnectionPtr connection, pt::XcbVisualid visual_id)
+{
+       DE_UNREF(physicalDevice);
+       DE_UNREF(queueFamilyIndex);
+       DE_UNREF(connection);
+       DE_UNREF(visual_id);
+       return VK_SUCCESS;
+}
+
+VKAPI_ATTR VkBool32 VKAPI_CALL getPhysicalDeviceWaylandPresentationSupportKHR (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, pt::WaylandDisplayPtr display)
+{
+       DE_UNREF(physicalDevice);
+       DE_UNREF(queueFamilyIndex);
+       DE_UNREF(display);
+       return VK_SUCCESS;
+}
+
+VKAPI_ATTR VkBool32 VKAPI_CALL getPhysicalDeviceMirPresentationSupportKHR (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, pt::MirConnectionPtr connection)
+{
+       DE_UNREF(physicalDevice);
+       DE_UNREF(queueFamilyIndex);
+       DE_UNREF(connection);
+       return VK_SUCCESS;
+}
+
+VKAPI_ATTR VkBool32 VKAPI_CALL getPhysicalDeviceWin32PresentationSupportKHR (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex)
+{
+       DE_UNREF(physicalDevice);
+       DE_UNREF(queueFamilyIndex);
+       return VK_SUCCESS;
+}
+
 VKAPI_ATTR void VKAPI_CALL debugReportMessageEXT (VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, deUint64 object, deUintptr location, deInt32 messageCode, const char* pLayerPrefix, const char* pMessage)
 {
        DE_UNREF(instance);
@@ -946,21 +1152,44 @@ static const tcu::StaticFunctionLibrary::Entry s_platformFunctions[] =
 
 static const tcu::StaticFunctionLibrary::Entry s_instanceFunctions[] =
 {
-       VK_NULL_FUNC_ENTRY(vkDestroyInstance,                                                   destroyInstance),
-       VK_NULL_FUNC_ENTRY(vkEnumeratePhysicalDevices,                                  enumeratePhysicalDevices),
-       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceFeatures,                                 getPhysicalDeviceFeatures),
-       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceFormatProperties,                 getPhysicalDeviceFormatProperties),
-       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceImageFormatProperties,    getPhysicalDeviceImageFormatProperties),
-       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceProperties,                               getPhysicalDeviceProperties),
-       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceQueueFamilyProperties,    getPhysicalDeviceQueueFamilyProperties),
-       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceMemoryProperties,                 getPhysicalDeviceMemoryProperties),
-       VK_NULL_FUNC_ENTRY(vkGetDeviceProcAddr,                                                 getDeviceProcAddr),
-       VK_NULL_FUNC_ENTRY(vkCreateDevice,                                                              createDevice),
-       VK_NULL_FUNC_ENTRY(vkEnumerateDeviceExtensionProperties,                enumerateDeviceExtensionProperties),
-       VK_NULL_FUNC_ENTRY(vkEnumerateDeviceLayerProperties,                    enumerateDeviceLayerProperties),
-       VK_NULL_FUNC_ENTRY(vkCreateDebugReportCallbackEXT,                              createDebugReportCallbackEXT),
-       VK_NULL_FUNC_ENTRY(vkDestroyDebugReportCallbackEXT,                             destroyDebugReportCallbackEXT),
-       VK_NULL_FUNC_ENTRY(vkDebugReportMessageEXT,                                             debugReportMessageEXT),
+       VK_NULL_FUNC_ENTRY(vkDestroyInstance,                                                                   destroyInstance),
+       VK_NULL_FUNC_ENTRY(vkEnumeratePhysicalDevices,                                                  enumeratePhysicalDevices),
+       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceFeatures,                                                 getPhysicalDeviceFeatures),
+       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceFormatProperties,                                 getPhysicalDeviceFormatProperties),
+       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceImageFormatProperties,                    getPhysicalDeviceImageFormatProperties),
+       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceProperties,                                               getPhysicalDeviceProperties),
+       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceQueueFamilyProperties,                    getPhysicalDeviceQueueFamilyProperties),
+       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceMemoryProperties,                                 getPhysicalDeviceMemoryProperties),
+       VK_NULL_FUNC_ENTRY(vkGetDeviceProcAddr,                                                                 getDeviceProcAddr),
+       VK_NULL_FUNC_ENTRY(vkCreateDevice,                                                                              createDevice),
+       VK_NULL_FUNC_ENTRY(vkEnumerateDeviceExtensionProperties,                                enumerateDeviceExtensionProperties),
+       VK_NULL_FUNC_ENTRY(vkEnumerateDeviceLayerProperties,                                    enumerateDeviceLayerProperties),
+       VK_NULL_FUNC_ENTRY(vkDestroySurfaceKHR,                                                                 destroySurfaceKHR),
+       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceSurfaceSupportKHR,                                getPhysicalDeviceSurfaceSupportKHR),
+       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceSurfaceCapabilitiesKHR,                   getPhysicalDeviceSurfaceCapabilitiesKHR),
+       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceSurfaceFormatsKHR,                                getPhysicalDeviceSurfaceFormatsKHR),
+       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceSurfacePresentModesKHR,                   getPhysicalDeviceSurfacePresentModesKHR),
+       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceDisplayPropertiesKHR,                             getPhysicalDeviceDisplayPropertiesKHR),
+       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceDisplayPlanePropertiesKHR,                getPhysicalDeviceDisplayPlanePropertiesKHR),
+       VK_NULL_FUNC_ENTRY(vkGetDisplayPlaneSupportedDisplaysKHR,                               getDisplayPlaneSupportedDisplaysKHR),
+       VK_NULL_FUNC_ENTRY(vkGetDisplayModePropertiesKHR,                                               getDisplayModePropertiesKHR),
+       VK_NULL_FUNC_ENTRY(vkCreateDisplayModeKHR,                                                              createDisplayModeKHR),
+       VK_NULL_FUNC_ENTRY(vkGetDisplayPlaneCapabilitiesKHR,                                    getDisplayPlaneCapabilitiesKHR),
+       VK_NULL_FUNC_ENTRY(vkCreateDisplayPlaneSurfaceKHR,                                              createDisplayPlaneSurfaceKHR),
+       VK_NULL_FUNC_ENTRY(vkCreateXlibSurfaceKHR,                                                              createXlibSurfaceKHR),
+       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceXlibPresentationSupportKHR,               getPhysicalDeviceXlibPresentationSupportKHR),
+       VK_NULL_FUNC_ENTRY(vkCreateXcbSurfaceKHR,                                                               createXcbSurfaceKHR),
+       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceXcbPresentationSupportKHR,                getPhysicalDeviceXcbPresentationSupportKHR),
+       VK_NULL_FUNC_ENTRY(vkCreateWaylandSurfaceKHR,                                                   createWaylandSurfaceKHR),
+       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceWaylandPresentationSupportKHR,    getPhysicalDeviceWaylandPresentationSupportKHR),
+       VK_NULL_FUNC_ENTRY(vkCreateMirSurfaceKHR,                                                               createMirSurfaceKHR),
+       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceMirPresentationSupportKHR,                getPhysicalDeviceMirPresentationSupportKHR),
+       VK_NULL_FUNC_ENTRY(vkCreateAndroidSurfaceKHR,                                                   createAndroidSurfaceKHR),
+       VK_NULL_FUNC_ENTRY(vkCreateWin32SurfaceKHR,                                                             createWin32SurfaceKHR),
+       VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceWin32PresentationSupportKHR,              getPhysicalDeviceWin32PresentationSupportKHR),
+       VK_NULL_FUNC_ENTRY(vkCreateDebugReportCallbackEXT,                                              createDebugReportCallbackEXT),
+       VK_NULL_FUNC_ENTRY(vkDestroyDebugReportCallbackEXT,                                             destroyDebugReportCallbackEXT),
+       VK_NULL_FUNC_ENTRY(vkDebugReportMessageEXT,                                                             debugReportMessageEXT),
 };
 
 static const tcu::StaticFunctionLibrary::Entry s_deviceFunctions[] =
@@ -1086,5 +1315,11 @@ static const tcu::StaticFunctionLibrary::Entry s_deviceFunctions[] =
        VK_NULL_FUNC_ENTRY(vkCmdNextSubpass,                                                            cmdNextSubpass),
        VK_NULL_FUNC_ENTRY(vkCmdEndRenderPass,                                                          cmdEndRenderPass),
        VK_NULL_FUNC_ENTRY(vkCmdExecuteCommands,                                                        cmdExecuteCommands),
+       VK_NULL_FUNC_ENTRY(vkCreateSwapchainKHR,                                                        createSwapchainKHR),
+       VK_NULL_FUNC_ENTRY(vkDestroySwapchainKHR,                                                       destroySwapchainKHR),
+       VK_NULL_FUNC_ENTRY(vkGetSwapchainImagesKHR,                                                     getSwapchainImagesKHR),
+       VK_NULL_FUNC_ENTRY(vkAcquireNextImageKHR,                                                       acquireNextImageKHR),
+       VK_NULL_FUNC_ENTRY(vkQueuePresentKHR,                                                           queuePresentKHR),
+       VK_NULL_FUNC_ENTRY(vkCreateSharedSwapchainsKHR,                                         createSharedSwapchainsKHR),
 };
 
index 33e42d0..8f2e90e 100644 (file)
@@ -71,6 +71,11 @@ DeviceDriver::~DeviceDriver (void)
 #include "vkInstanceDriverImpl.inl"
 #include "vkDeviceDriverImpl.inl"
 
+wsi::Display* Platform::createWsiDisplay (wsi::Type) const
+{
+       TCU_THROW(NotSupportedError, "WSI not supported");
+}
+
 void Platform::describePlatform (std::ostream& dst) const
 {
        dst << "vk::Platform::describePlatform() not implemented";
index e20ea10..0f2f9ec 100644 (file)
@@ -102,19 +102,27 @@ protected:
        Functions       m_vk;
 };
 
+// Defined in vkWsiPlatform.hpp
+namespace wsi
+{
+class Display;
+} // wsi
+
 /*--------------------------------------------------------------------*//*!
  * \brief Vulkan platform interface
  *//*--------------------------------------------------------------------*/
 class Platform
 {
 public:
-                                               Platform                        (void) {}
-                                               ~Platform                       (void) {}
+                                                       Platform                        (void) {}
+                                                       ~Platform                       (void) {}
 
        // \todo [2015-01-05 pyry] Parametrize this to select for example debug library / interface?
-       virtual Library*        createLibrary           (void) const = 0;
+       virtual Library*                createLibrary           (void) const = 0;
+
+       virtual wsi::Display*   createWsiDisplay        (wsi::Type wsiType) const;
 
-       virtual void            describePlatform        (std::ostream& dst) const;
+       virtual void                    describePlatform        (std::ostream& dst) const;
 };
 
 } // vk
index 7d4aaad..d944a38 100644 (file)
@@ -216,4 +216,23 @@ bool isShaderStageSupported (const VkPhysicalDeviceFeatures& deviceFeatures, VkS
                return true;
 }
 
+bool isCompatible (const VkExtensionProperties& extensionProperties, const RequiredExtension& required)
+{
+       if (required.name != extensionProperties.extensionName)
+               return false;
+
+       if (required.minVersion && required.minVersion.get() > extensionProperties.specVersion)
+               return false;
+
+       if (required.maxVersion && required.maxVersion.get() < extensionProperties.specVersion)
+               return false;
+
+       return true;
+}
+
+bool isExtensionSupported (const std::vector<VkExtensionProperties>& extensions, const RequiredExtension& required)
+{
+       return isExtensionSupported(extensions.begin(), extensions.end(), required);
+}
+
 } // vk
index 32022de..5bb1f8a 100644 (file)
@@ -31,6 +31,7 @@
  *//*--------------------------------------------------------------------*/
 
 #include "vkDefs.hpp"
+#include "tcuMaybe.hpp"
 #include "deMemory.h"
 
 #include <vector>
@@ -38,6 +39,8 @@
 namespace vk
 {
 
+// API queries
+
 std::vector<VkPhysicalDevice>                  enumeratePhysicalDevices                                (const InstanceInterface& vk, VkInstance instance);
 std::vector<VkQueueFamilyProperties>   getPhysicalDeviceQueueFamilyProperties  (const InstanceInterface& vk, VkPhysicalDevice physicalDevice);
 VkPhysicalDeviceFeatures                               getPhysicalDeviceFeatures                               (const InstanceInterface& vk, VkPhysicalDevice physicalDevice);
@@ -54,8 +57,33 @@ std::vector<VkExtensionProperties>           enumerateInstanceExtensionProperties    (const
 std::vector<VkLayerProperties>                 enumerateDeviceLayerProperties                  (const InstanceInterface& vki, VkPhysicalDevice physicalDevice);
 std::vector<VkExtensionProperties>             enumerateDeviceExtensionProperties              (const InstanceInterface& vki, VkPhysicalDevice physicalDevice, const char* layerName);
 
+// Feature / extension support
+
 bool                                                                   isShaderStageSupported                                  (const VkPhysicalDeviceFeatures& deviceFeatures, VkShaderStageFlagBits stage);
 
+struct RequiredExtension
+{
+       std::string                             name;
+       tcu::Maybe<deUint32>    minVersion;
+       tcu::Maybe<deUint32>    maxVersion;
+
+       explicit RequiredExtension (const std::string&          name_,
+                                                               tcu::Maybe<deUint32>    minVersion_ = tcu::nothing<deUint32>(),
+                                                               tcu::Maybe<deUint32>    maxVersion_ = tcu::nothing<deUint32>())
+               : name                  (name_)
+               , minVersion    (minVersion_)
+               , maxVersion    (maxVersion_)
+       {}
+};
+
+bool                                                                   isCompatible                                                    (const VkExtensionProperties& extensionProperties, const RequiredExtension& required);
+
+template<typename ExtensionIterator>
+bool                                                                   isExtensionSupported                                    (ExtensionIterator begin, ExtensionIterator end, const RequiredExtension& required);
+bool                                                                   isExtensionSupported                                    (const std::vector<VkExtensionProperties>& extensions, const RequiredExtension& required);
+
+// Return variable initialization validation
+
 template <typename Context, typename Interface, typename Type>
 bool validateInitComplete(Context context, void (Interface::*Function)(Context, Type*)const, const Interface& interface)
 {
@@ -75,6 +103,19 @@ bool validateInitComplete(Context context, void (Interface::*Function)(Context,
        return true;
 }
 
+// Template implementations
+
+template<typename ExtensionIterator>
+bool isExtensionSupported (ExtensionIterator begin, ExtensionIterator end, const RequiredExtension& required)
+{
+       for (ExtensionIterator cur = begin; cur != end; ++cur)
+       {
+               if (isCompatible(*cur, required))
+                       return true;
+       }
+       return false;
+}
+
 } // vk
 
 #endif // _VKQUERYUTIL_HPP
index 86e3838..07c2055 100644 (file)
@@ -141,6 +141,29 @@ private:
 };
 
 template<>
+class Deleter<VkSurfaceKHR>
+{
+public:
+                                                                       Deleter         (const InstanceInterface& instanceIface, VkInstance instance, const VkAllocationCallbacks* allocator)
+                                                                               : m_instanceIface       (&instanceIface)
+                                                                               , m_instance            (instance)
+                                                                               , m_allocator           (allocator)
+                                                                       {}
+                                                                       Deleter         (void)
+                                                                               : m_instanceIface       (DE_NULL)
+                                                                               , m_instance            ((VkInstance)0)
+                                                                               , m_allocator           (DE_NULL)
+                                                                       {}
+
+       void                                                    operator()      (VkSurfaceKHR obj) const { m_instanceIface->destroySurfaceKHR(m_instance, obj, m_allocator); }
+
+private:
+       const InstanceInterface*                m_instanceIface;
+       VkInstance                                              m_instance;
+       const VkAllocationCallbacks*    m_allocator;
+};
+
+template<>
 class Deleter<VkDebugReportCallbackEXT>
 {
 public:
index 9733c1c..12e619e 100644 (file)
@@ -23,4 +23,13 @@ Move<VkDescriptorPool>                       createDescriptorPool                    (const DeviceInterface& vk, VkDe
 Move<VkFramebuffer>                            createFramebuffer                               (const DeviceInterface& vk, VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator = DE_NULL);
 Move<VkRenderPass>                             createRenderPass                                (const DeviceInterface& vk, VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator = DE_NULL);
 Move<VkCommandPool>                            createCommandPool                               (const DeviceInterface& vk, VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator = DE_NULL);
+Move<VkSwapchainKHR>                   createSwapchainKHR                              (const DeviceInterface& vk, VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator = DE_NULL);
+Move<VkSurfaceKHR>                             createDisplayPlaneSurfaceKHR    (const InstanceInterface& vk, VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator = DE_NULL);
+Move<VkSwapchainKHR>                   createSharedSwapchainsKHR               (const DeviceInterface& vk, VkDevice device, deUint32 swapchainCount, const VkSwapchainCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator = DE_NULL);
+Move<VkSurfaceKHR>                             createXlibSurfaceKHR                    (const InstanceInterface& vk, VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator = DE_NULL);
+Move<VkSurfaceKHR>                             createXcbSurfaceKHR                             (const InstanceInterface& vk, VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator = DE_NULL);
+Move<VkSurfaceKHR>                             createWaylandSurfaceKHR                 (const InstanceInterface& vk, VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator = DE_NULL);
+Move<VkSurfaceKHR>                             createMirSurfaceKHR                             (const InstanceInterface& vk, VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator = DE_NULL);
+Move<VkSurfaceKHR>                             createAndroidSurfaceKHR                 (const InstanceInterface& vk, VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator = DE_NULL);
+Move<VkSurfaceKHR>                             createWin32SurfaceKHR                   (const InstanceInterface& vk, VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator = DE_NULL);
 Move<VkDebugReportCallbackEXT> createDebugReportCallbackEXT    (const InstanceInterface& vk, VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator = DE_NULL);
index 15aa57a..f741852 100644 (file)
@@ -118,6 +118,12 @@ void Deleter<VkCommandPool>::operator() (VkCommandPool obj) const
        m_deviceIface->destroyCommandPool(m_device, obj, m_allocator);
 }
 
+template<>
+void Deleter<VkSwapchainKHR>::operator() (VkSwapchainKHR obj) const
+{
+       m_deviceIface->destroySwapchainKHR(m_device, obj, m_allocator);
+}
+
 } // refdetails
 
 Move<VkInstance> createInstance (const PlatformInterface& vk, const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator)
@@ -274,6 +280,69 @@ Move<VkCommandPool> createCommandPool (const DeviceInterface& vk, VkDevice devic
        return Move<VkCommandPool>(check<VkCommandPool>(object), Deleter<VkCommandPool>(vk, device, pAllocator));
 }
 
+Move<VkSwapchainKHR> createSwapchainKHR (const DeviceInterface& vk, VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator)
+{
+       VkSwapchainKHR object = 0;
+       VK_CHECK(vk.createSwapchainKHR(device, pCreateInfo, pAllocator, &object));
+       return Move<VkSwapchainKHR>(check<VkSwapchainKHR>(object), Deleter<VkSwapchainKHR>(vk, device, pAllocator));
+}
+
+Move<VkSurfaceKHR> createDisplayPlaneSurfaceKHR (const InstanceInterface& vk, VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator)
+{
+       VkSurfaceKHR object = 0;
+       VK_CHECK(vk.createDisplayPlaneSurfaceKHR(instance, pCreateInfo, pAllocator, &object));
+       return Move<VkSurfaceKHR>(check<VkSurfaceKHR>(object), Deleter<VkSurfaceKHR>(vk, instance, pAllocator));
+}
+
+Move<VkSwapchainKHR> createSharedSwapchainsKHR (const DeviceInterface& vk, VkDevice device, deUint32 swapchainCount, const VkSwapchainCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator)
+{
+       VkSwapchainKHR object = 0;
+       VK_CHECK(vk.createSharedSwapchainsKHR(device, swapchainCount, pCreateInfos, pAllocator, &object));
+       return Move<VkSwapchainKHR>(check<VkSwapchainKHR>(object), Deleter<VkSwapchainKHR>(vk, device, pAllocator));
+}
+
+Move<VkSurfaceKHR> createXlibSurfaceKHR (const InstanceInterface& vk, VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator)
+{
+       VkSurfaceKHR object = 0;
+       VK_CHECK(vk.createXlibSurfaceKHR(instance, pCreateInfo, pAllocator, &object));
+       return Move<VkSurfaceKHR>(check<VkSurfaceKHR>(object), Deleter<VkSurfaceKHR>(vk, instance, pAllocator));
+}
+
+Move<VkSurfaceKHR> createXcbSurfaceKHR (const InstanceInterface& vk, VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator)
+{
+       VkSurfaceKHR object = 0;
+       VK_CHECK(vk.createXcbSurfaceKHR(instance, pCreateInfo, pAllocator, &object));
+       return Move<VkSurfaceKHR>(check<VkSurfaceKHR>(object), Deleter<VkSurfaceKHR>(vk, instance, pAllocator));
+}
+
+Move<VkSurfaceKHR> createWaylandSurfaceKHR (const InstanceInterface& vk, VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator)
+{
+       VkSurfaceKHR object = 0;
+       VK_CHECK(vk.createWaylandSurfaceKHR(instance, pCreateInfo, pAllocator, &object));
+       return Move<VkSurfaceKHR>(check<VkSurfaceKHR>(object), Deleter<VkSurfaceKHR>(vk, instance, pAllocator));
+}
+
+Move<VkSurfaceKHR> createMirSurfaceKHR (const InstanceInterface& vk, VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator)
+{
+       VkSurfaceKHR object = 0;
+       VK_CHECK(vk.createMirSurfaceKHR(instance, pCreateInfo, pAllocator, &object));
+       return Move<VkSurfaceKHR>(check<VkSurfaceKHR>(object), Deleter<VkSurfaceKHR>(vk, instance, pAllocator));
+}
+
+Move<VkSurfaceKHR> createAndroidSurfaceKHR (const InstanceInterface& vk, VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator)
+{
+       VkSurfaceKHR object = 0;
+       VK_CHECK(vk.createAndroidSurfaceKHR(instance, pCreateInfo, pAllocator, &object));
+       return Move<VkSurfaceKHR>(check<VkSurfaceKHR>(object), Deleter<VkSurfaceKHR>(vk, instance, pAllocator));
+}
+
+Move<VkSurfaceKHR> createWin32SurfaceKHR (const InstanceInterface& vk, VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator)
+{
+       VkSurfaceKHR object = 0;
+       VK_CHECK(vk.createWin32SurfaceKHR(instance, pCreateInfo, pAllocator, &object));
+       return Move<VkSurfaceKHR>(check<VkSurfaceKHR>(object), Deleter<VkSurfaceKHR>(vk, instance, pAllocator));
+}
+
 Move<VkDebugReportCallbackEXT> createDebugReportCallbackEXT (const InstanceInterface& vk, VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator)
 {
        VkDebugReportCallbackEXT object = 0;
index 067ac09..ca4d028 100644 (file)
@@ -300,4 +300,22 @@ std::ostream&      operator<<      (std::ostream& s, const VkRenderPassBeginInfo& value);
 std::ostream&  operator<<      (std::ostream& s, const VkDispatchIndirectCommand& value);
 std::ostream&  operator<<      (std::ostream& s, const VkDrawIndexedIndirectCommand& value);
 std::ostream&  operator<<      (std::ostream& s, const VkDrawIndirectCommand& value);
+std::ostream&  operator<<      (std::ostream& s, const VkSurfaceCapabilitiesKHR& value);
+std::ostream&  operator<<      (std::ostream& s, const VkSurfaceFormatKHR& value);
+std::ostream&  operator<<      (std::ostream& s, const VkSwapchainCreateInfoKHR& value);
+std::ostream&  operator<<      (std::ostream& s, const VkPresentInfoKHR& value);
+std::ostream&  operator<<      (std::ostream& s, const VkDisplayPropertiesKHR& value);
+std::ostream&  operator<<      (std::ostream& s, const VkDisplayModeParametersKHR& value);
+std::ostream&  operator<<      (std::ostream& s, const VkDisplayModePropertiesKHR& value);
+std::ostream&  operator<<      (std::ostream& s, const VkDisplayModeCreateInfoKHR& value);
+std::ostream&  operator<<      (std::ostream& s, const VkDisplayPlaneCapabilitiesKHR& value);
+std::ostream&  operator<<      (std::ostream& s, const VkDisplayPlanePropertiesKHR& value);
+std::ostream&  operator<<      (std::ostream& s, const VkDisplaySurfaceCreateInfoKHR& value);
+std::ostream&  operator<<      (std::ostream& s, const VkDisplayPresentInfoKHR& value);
+std::ostream&  operator<<      (std::ostream& s, const VkXlibSurfaceCreateInfoKHR& value);
+std::ostream&  operator<<      (std::ostream& s, const VkXcbSurfaceCreateInfoKHR& value);
+std::ostream&  operator<<      (std::ostream& s, const VkWaylandSurfaceCreateInfoKHR& value);
+std::ostream&  operator<<      (std::ostream& s, const VkMirSurfaceCreateInfoKHR& value);
+std::ostream&  operator<<      (std::ostream& s, const VkAndroidSurfaceCreateInfoKHR& value);
+std::ostream&  operator<<      (std::ostream& s, const VkWin32SurfaceCreateInfoKHR& value);
 std::ostream&  operator<<      (std::ostream& s, const VkDebugReportCallbackCreateInfoEXT& value);
index b30ceee..28db303 100644 (file)
@@ -32,6 +32,23 @@ template<> const char*       getTypeName<VkDisplayKHR>                               (void) { return "VkDisplayKH
 template<> const char* getTypeName<VkDisplayModeKHR>                   (void) { return "VkDisplayModeKHR";                     }
 template<> const char* getTypeName<VkDebugReportCallbackEXT>   (void) { return "VkDebugReportCallbackEXT";     }
 
+namespace pt
+{
+std::ostream& operator<< (std::ostream& s, XlibDisplayPtr                      v) { return s << tcu::toHex(v.internal); }
+std::ostream& operator<< (std::ostream& s, XlibWindow                          v) { return s << tcu::toHex(v.internal); }
+std::ostream& operator<< (std::ostream& s, XlibVisualID                                v) { return s << tcu::toHex(v.internal); }
+std::ostream& operator<< (std::ostream& s, XcbConnectionPtr                    v) { return s << tcu::toHex(v.internal); }
+std::ostream& operator<< (std::ostream& s, XcbWindow                           v) { return s << tcu::toHex(v.internal); }
+std::ostream& operator<< (std::ostream& s, XcbVisualid                         v) { return s << tcu::toHex(v.internal); }
+std::ostream& operator<< (std::ostream& s, WaylandDisplayPtr           v) { return s << tcu::toHex(v.internal); }
+std::ostream& operator<< (std::ostream& s, WaylandSurfacePtr           v) { return s << tcu::toHex(v.internal); }
+std::ostream& operator<< (std::ostream& s, MirConnectionPtr                    v) { return s << tcu::toHex(v.internal); }
+std::ostream& operator<< (std::ostream& s, MirSurfacePtr                       v) { return s << tcu::toHex(v.internal); }
+std::ostream& operator<< (std::ostream& s, AndroidNativeWindowPtr      v) { return s << tcu::toHex(v.internal); }
+std::ostream& operator<< (std::ostream& s, Win32InstanceHandle         v) { return s << tcu::toHex(v.internal); }
+std::ostream& operator<< (std::ostream& s, Win32WindowHandle           v) { return s << tcu::toHex(v.internal); }
+}
+
 const char* getPipelineCacheHeaderVersionName (VkPipelineCacheHeaderVersion value)
 {
        switch (value)
@@ -2946,6 +2963,240 @@ std::ostream& operator<< (std::ostream& s, const VkDrawIndirectCommand& value)
        return s;
 }
 
+std::ostream& operator<< (std::ostream& s, const VkSurfaceCapabilitiesKHR& value)
+{
+       s << "VkSurfaceCapabilitiesKHR = {\n";
+       s << "\tminImageCount = " << value.minImageCount << '\n';
+       s << "\tmaxImageCount = " << value.maxImageCount << '\n';
+       s << "\tcurrentExtent = " << value.currentExtent << '\n';
+       s << "\tminImageExtent = " << value.minImageExtent << '\n';
+       s << "\tmaxImageExtent = " << value.maxImageExtent << '\n';
+       s << "\tmaxImageArrayLayers = " << value.maxImageArrayLayers << '\n';
+       s << "\tsupportedTransforms = " << getSurfaceTransformFlagsKHRStr(value.supportedTransforms) << '\n';
+       s << "\tcurrentTransform = " << value.currentTransform << '\n';
+       s << "\tsupportedCompositeAlpha = " << getCompositeAlphaFlagsKHRStr(value.supportedCompositeAlpha) << '\n';
+       s << "\tsupportedUsageFlags = " << getImageUsageFlagsStr(value.supportedUsageFlags) << '\n';
+       s << '}';
+       return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkSurfaceFormatKHR& value)
+{
+       s << "VkSurfaceFormatKHR = {\n";
+       s << "\tformat = " << value.format << '\n';
+       s << "\tcolorSpace = " << value.colorSpace << '\n';
+       s << '}';
+       return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkSwapchainCreateInfoKHR& value)
+{
+       s << "VkSwapchainCreateInfoKHR = {\n";
+       s << "\tsType = " << value.sType << '\n';
+       s << "\tpNext = " << value.pNext << '\n';
+       s << "\tflags = " << getSwapchainCreateFlagsKHRStr(value.flags) << '\n';
+       s << "\tsurface = " << value.surface << '\n';
+       s << "\tminImageCount = " << value.minImageCount << '\n';
+       s << "\timageFormat = " << value.imageFormat << '\n';
+       s << "\timageColorSpace = " << value.imageColorSpace << '\n';
+       s << "\timageExtent = " << value.imageExtent << '\n';
+       s << "\timageArrayLayers = " << value.imageArrayLayers << '\n';
+       s << "\timageUsage = " << getImageUsageFlagsStr(value.imageUsage) << '\n';
+       s << "\timageSharingMode = " << value.imageSharingMode << '\n';
+       s << "\tqueueFamilyIndexCount = " << value.queueFamilyIndexCount << '\n';
+       s << "\tpQueueFamilyIndices = " << value.pQueueFamilyIndices << '\n';
+       s << "\tpreTransform = " << value.preTransform << '\n';
+       s << "\tcompositeAlpha = " << value.compositeAlpha << '\n';
+       s << "\tpresentMode = " << value.presentMode << '\n';
+       s << "\tclipped = " << value.clipped << '\n';
+       s << "\toldSwapchain = " << value.oldSwapchain << '\n';
+       s << '}';
+       return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkPresentInfoKHR& value)
+{
+       s << "VkPresentInfoKHR = {\n";
+       s << "\tsType = " << value.sType << '\n';
+       s << "\tpNext = " << value.pNext << '\n';
+       s << "\twaitSemaphoreCount = " << value.waitSemaphoreCount << '\n';
+       s << "\tpWaitSemaphores = " << value.pWaitSemaphores << '\n';
+       s << "\tswapchainCount = " << value.swapchainCount << '\n';
+       s << "\tpSwapchains = " << value.pSwapchains << '\n';
+       s << "\tpImageIndices = " << value.pImageIndices << '\n';
+       s << "\tpResults = " << value.pResults << '\n';
+       s << '}';
+       return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkDisplayPropertiesKHR& value)
+{
+       s << "VkDisplayPropertiesKHR = {\n";
+       s << "\tdisplay = " << value.display << '\n';
+       s << "\tdisplayName = " << getCharPtrStr(value.displayName) << '\n';
+       s << "\tphysicalDimensions = " << value.physicalDimensions << '\n';
+       s << "\tphysicalResolution = " << value.physicalResolution << '\n';
+       s << "\tsupportedTransforms = " << getSurfaceTransformFlagsKHRStr(value.supportedTransforms) << '\n';
+       s << "\tplaneReorderPossible = " << value.planeReorderPossible << '\n';
+       s << "\tpersistentContent = " << value.persistentContent << '\n';
+       s << '}';
+       return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkDisplayModeParametersKHR& value)
+{
+       s << "VkDisplayModeParametersKHR = {\n";
+       s << "\tvisibleRegion = " << value.visibleRegion << '\n';
+       s << "\trefreshRate = " << value.refreshRate << '\n';
+       s << '}';
+       return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkDisplayModePropertiesKHR& value)
+{
+       s << "VkDisplayModePropertiesKHR = {\n";
+       s << "\tdisplayMode = " << value.displayMode << '\n';
+       s << "\tparameters = " << value.parameters << '\n';
+       s << '}';
+       return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkDisplayModeCreateInfoKHR& value)
+{
+       s << "VkDisplayModeCreateInfoKHR = {\n";
+       s << "\tsType = " << value.sType << '\n';
+       s << "\tpNext = " << value.pNext << '\n';
+       s << "\tflags = " << getDisplayModeCreateFlagsKHRStr(value.flags) << '\n';
+       s << "\tparameters = " << value.parameters << '\n';
+       s << '}';
+       return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkDisplayPlaneCapabilitiesKHR& value)
+{
+       s << "VkDisplayPlaneCapabilitiesKHR = {\n";
+       s << "\tsupportedAlpha = " << getDisplayPlaneAlphaFlagsKHRStr(value.supportedAlpha) << '\n';
+       s << "\tminSrcPosition = " << value.minSrcPosition << '\n';
+       s << "\tmaxSrcPosition = " << value.maxSrcPosition << '\n';
+       s << "\tminSrcExtent = " << value.minSrcExtent << '\n';
+       s << "\tmaxSrcExtent = " << value.maxSrcExtent << '\n';
+       s << "\tminDstPosition = " << value.minDstPosition << '\n';
+       s << "\tmaxDstPosition = " << value.maxDstPosition << '\n';
+       s << "\tminDstExtent = " << value.minDstExtent << '\n';
+       s << "\tmaxDstExtent = " << value.maxDstExtent << '\n';
+       s << '}';
+       return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkDisplayPlanePropertiesKHR& value)
+{
+       s << "VkDisplayPlanePropertiesKHR = {\n";
+       s << "\tcurrentDisplay = " << value.currentDisplay << '\n';
+       s << "\tcurrentStackIndex = " << value.currentStackIndex << '\n';
+       s << '}';
+       return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkDisplaySurfaceCreateInfoKHR& value)
+{
+       s << "VkDisplaySurfaceCreateInfoKHR = {\n";
+       s << "\tsType = " << value.sType << '\n';
+       s << "\tpNext = " << value.pNext << '\n';
+       s << "\tflags = " << getDisplaySurfaceCreateFlagsKHRStr(value.flags) << '\n';
+       s << "\tdisplayMode = " << value.displayMode << '\n';
+       s << "\tplaneIndex = " << value.planeIndex << '\n';
+       s << "\tplaneStackIndex = " << value.planeStackIndex << '\n';
+       s << "\ttransform = " << value.transform << '\n';
+       s << "\tglobalAlpha = " << value.globalAlpha << '\n';
+       s << "\talphaMode = " << value.alphaMode << '\n';
+       s << "\timageExtent = " << value.imageExtent << '\n';
+       s << '}';
+       return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkDisplayPresentInfoKHR& value)
+{
+       s << "VkDisplayPresentInfoKHR = {\n";
+       s << "\tsType = " << value.sType << '\n';
+       s << "\tpNext = " << value.pNext << '\n';
+       s << "\tsrcRect = " << value.srcRect << '\n';
+       s << "\tdstRect = " << value.dstRect << '\n';
+       s << "\tpersistent = " << value.persistent << '\n';
+       s << '}';
+       return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkXlibSurfaceCreateInfoKHR& value)
+{
+       s << "VkXlibSurfaceCreateInfoKHR = {\n";
+       s << "\tsType = " << value.sType << '\n';
+       s << "\tpNext = " << value.pNext << '\n';
+       s << "\tflags = " << getXlibSurfaceCreateFlagsKHRStr(value.flags) << '\n';
+       s << "\tdpy = " << value.dpy << '\n';
+       s << "\twindow = " << value.window << '\n';
+       s << '}';
+       return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkXcbSurfaceCreateInfoKHR& value)
+{
+       s << "VkXcbSurfaceCreateInfoKHR = {\n";
+       s << "\tsType = " << value.sType << '\n';
+       s << "\tpNext = " << value.pNext << '\n';
+       s << "\tflags = " << getXcbSurfaceCreateFlagsKHRStr(value.flags) << '\n';
+       s << "\tconnection = " << value.connection << '\n';
+       s << "\twindow = " << value.window << '\n';
+       s << '}';
+       return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkWaylandSurfaceCreateInfoKHR& value)
+{
+       s << "VkWaylandSurfaceCreateInfoKHR = {\n";
+       s << "\tsType = " << value.sType << '\n';
+       s << "\tpNext = " << value.pNext << '\n';
+       s << "\tflags = " << getWaylandSurfaceCreateFlagsKHRStr(value.flags) << '\n';
+       s << "\tdisplay = " << value.display << '\n';
+       s << "\tsurface = " << value.surface << '\n';
+       s << '}';
+       return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkMirSurfaceCreateInfoKHR& value)
+{
+       s << "VkMirSurfaceCreateInfoKHR = {\n";
+       s << "\tsType = " << value.sType << '\n';
+       s << "\tpNext = " << value.pNext << '\n';
+       s << "\tflags = " << getMirSurfaceCreateFlagsKHRStr(value.flags) << '\n';
+       s << "\tconnection = " << value.connection << '\n';
+       s << "\tmirSurface = " << value.mirSurface << '\n';
+       s << '}';
+       return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkAndroidSurfaceCreateInfoKHR& value)
+{
+       s << "VkAndroidSurfaceCreateInfoKHR = {\n";
+       s << "\tsType = " << value.sType << '\n';
+       s << "\tpNext = " << value.pNext << '\n';
+       s << "\tflags = " << getAndroidSurfaceCreateFlagsKHRStr(value.flags) << '\n';
+       s << "\twindow = " << value.window << '\n';
+       s << '}';
+       return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkWin32SurfaceCreateInfoKHR& value)
+{
+       s << "VkWin32SurfaceCreateInfoKHR = {\n";
+       s << "\tsType = " << value.sType << '\n';
+       s << "\tpNext = " << value.pNext << '\n';
+       s << "\tflags = " << getWin32SurfaceCreateFlagsKHRStr(value.flags) << '\n';
+       s << "\thinstance = " << value.hinstance << '\n';
+       s << "\thwnd = " << value.hwnd << '\n';
+       s << '}';
+       return s;
+}
+
 std::ostream& operator<< (std::ostream& s, const VkDebugReportCallbackCreateInfoEXT& value)
 {
        s << "VkDebugReportCallbackCreateInfoEXT = {\n";
index a59d81b..804944c 100644 (file)
@@ -1183,6 +1183,186 @@ struct VkDrawIndirectCommand
        deUint32        firstInstance;
 };
 
+struct VkSurfaceCapabilitiesKHR
+{
+       deUint32                                                minImageCount;
+       deUint32                                                maxImageCount;
+       VkExtent2D                                              currentExtent;
+       VkExtent2D                                              minImageExtent;
+       VkExtent2D                                              maxImageExtent;
+       deUint32                                                maxImageArrayLayers;
+       VkSurfaceTransformFlagsKHR              supportedTransforms;
+       VkSurfaceTransformFlagBitsKHR   currentTransform;
+       VkCompositeAlphaFlagsKHR                supportedCompositeAlpha;
+       VkImageUsageFlags                               supportedUsageFlags;
+};
+
+struct VkSurfaceFormatKHR
+{
+       VkFormat                format;
+       VkColorSpaceKHR colorSpace;
+};
+
+struct VkSwapchainCreateInfoKHR
+{
+       VkStructureType                                 sType;
+       const void*                                             pNext;
+       VkSwapchainCreateFlagsKHR               flags;
+       VkSurfaceKHR                                    surface;
+       deUint32                                                minImageCount;
+       VkFormat                                                imageFormat;
+       VkColorSpaceKHR                                 imageColorSpace;
+       VkExtent2D                                              imageExtent;
+       deUint32                                                imageArrayLayers;
+       VkImageUsageFlags                               imageUsage;
+       VkSharingMode                                   imageSharingMode;
+       deUint32                                                queueFamilyIndexCount;
+       const deUint32*                                 pQueueFamilyIndices;
+       VkSurfaceTransformFlagBitsKHR   preTransform;
+       VkCompositeAlphaFlagBitsKHR             compositeAlpha;
+       VkPresentModeKHR                                presentMode;
+       VkBool32                                                clipped;
+       VkSwapchainKHR                                  oldSwapchain;
+};
+
+struct VkPresentInfoKHR
+{
+       VkStructureType                 sType;
+       const void*                             pNext;
+       deUint32                                waitSemaphoreCount;
+       const VkSemaphore*              pWaitSemaphores;
+       deUint32                                swapchainCount;
+       const VkSwapchainKHR*   pSwapchains;
+       const deUint32*                 pImageIndices;
+       VkResult*                               pResults;
+};
+
+struct VkDisplayPropertiesKHR
+{
+       VkDisplayKHR                            display;
+       const char*                                     displayName;
+       VkExtent2D                                      physicalDimensions;
+       VkExtent2D                                      physicalResolution;
+       VkSurfaceTransformFlagsKHR      supportedTransforms;
+       VkBool32                                        planeReorderPossible;
+       VkBool32                                        persistentContent;
+};
+
+struct VkDisplayModeParametersKHR
+{
+       VkExtent2D      visibleRegion;
+       deUint32        refreshRate;
+};
+
+struct VkDisplayModePropertiesKHR
+{
+       VkDisplayModeKHR                        displayMode;
+       VkDisplayModeParametersKHR      parameters;
+};
+
+struct VkDisplayModeCreateInfoKHR
+{
+       VkStructureType                         sType;
+       const void*                                     pNext;
+       VkDisplayModeCreateFlagsKHR     flags;
+       VkDisplayModeParametersKHR      parameters;
+};
+
+struct VkDisplayPlaneCapabilitiesKHR
+{
+       VkDisplayPlaneAlphaFlagsKHR     supportedAlpha;
+       VkOffset2D                                      minSrcPosition;
+       VkOffset2D                                      maxSrcPosition;
+       VkExtent2D                                      minSrcExtent;
+       VkExtent2D                                      maxSrcExtent;
+       VkOffset2D                                      minDstPosition;
+       VkOffset2D                                      maxDstPosition;
+       VkExtent2D                                      minDstExtent;
+       VkExtent2D                                      maxDstExtent;
+};
+
+struct VkDisplayPlanePropertiesKHR
+{
+       VkDisplayKHR    currentDisplay;
+       deUint32                currentStackIndex;
+};
+
+struct VkDisplaySurfaceCreateInfoKHR
+{
+       VkStructureType                                 sType;
+       const void*                                             pNext;
+       VkDisplaySurfaceCreateFlagsKHR  flags;
+       VkDisplayModeKHR                                displayMode;
+       deUint32                                                planeIndex;
+       deUint32                                                planeStackIndex;
+       VkSurfaceTransformFlagBitsKHR   transform;
+       float                                                   globalAlpha;
+       VkDisplayPlaneAlphaFlagBitsKHR  alphaMode;
+       VkExtent2D                                              imageExtent;
+};
+
+struct VkDisplayPresentInfoKHR
+{
+       VkStructureType sType;
+       const void*             pNext;
+       VkRect2D                srcRect;
+       VkRect2D                dstRect;
+       VkBool32                persistent;
+};
+
+struct VkXlibSurfaceCreateInfoKHR
+{
+       VkStructureType                         sType;
+       const void*                                     pNext;
+       VkXlibSurfaceCreateFlagsKHR     flags;
+       pt::XlibDisplayPtr                      dpy;
+       pt::XlibWindow                          window;
+};
+
+struct VkXcbSurfaceCreateInfoKHR
+{
+       VkStructureType                         sType;
+       const void*                                     pNext;
+       VkXcbSurfaceCreateFlagsKHR      flags;
+       pt::XcbConnectionPtr            connection;
+       pt::XcbWindow                           window;
+};
+
+struct VkWaylandSurfaceCreateInfoKHR
+{
+       VkStructureType                                 sType;
+       const void*                                             pNext;
+       VkWaylandSurfaceCreateFlagsKHR  flags;
+       pt::WaylandDisplayPtr                   display;
+       pt::WaylandSurfacePtr                   surface;
+};
+
+struct VkMirSurfaceCreateInfoKHR
+{
+       VkStructureType                         sType;
+       const void*                                     pNext;
+       VkMirSurfaceCreateFlagsKHR      flags;
+       pt::MirConnectionPtr            connection;
+       pt::MirSurfacePtr                       mirSurface;
+};
+
+struct VkAndroidSurfaceCreateInfoKHR
+{
+       VkStructureType                                 sType;
+       const void*                                             pNext;
+       VkAndroidSurfaceCreateFlagsKHR  flags;
+       pt::AndroidNativeWindowPtr              window;
+};
+
+struct VkWin32SurfaceCreateInfoKHR
+{
+       VkStructureType                                 sType;
+       const void*                                             pNext;
+       VkWin32SurfaceCreateFlagsKHR    flags;
+       pt::Win32InstanceHandle                 hinstance;
+       pt::Win32WindowHandle                   hwnd;
+};
+
 struct VkDebugReportCallbackCreateInfoEXT
 {
        VkStructureType                                 sType;
index 52f65d6..c82dace 100644 (file)
@@ -367,3 +367,19 @@ inline VkDrawIndirectCommand makeDrawIndirectCommand (deUint32 vertexCount, deUi
        res.firstInstance       = firstInstance;
        return res;
 }
+
+inline VkSurfaceFormatKHR makeSurfaceFormatKHR (VkFormat format, VkColorSpaceKHR colorSpace)
+{
+       VkSurfaceFormatKHR res;
+       res.format              = format;
+       res.colorSpace  = colorSpace;
+       return res;
+}
+
+inline VkDisplayPlanePropertiesKHR makeDisplayPlanePropertiesKHR (VkDisplayKHR currentDisplay, deUint32 currentStackIndex)
+{
+       VkDisplayPlanePropertiesKHR res;
+       res.currentDisplay              = currentDisplay;
+       res.currentStackIndex   = currentStackIndex;
+       return res;
+}
index 14dceb0..3e8e972 100644 (file)
@@ -122,3 +122,9 @@ virtual void                cmdBeginRenderPass                                                              (VkCommandBuffer commandBuffer, const Vk
 virtual void           cmdNextSubpass                                                                  (VkCommandBuffer commandBuffer, VkSubpassContents contents) const = 0;
 virtual void           cmdEndRenderPass                                                                (VkCommandBuffer commandBuffer) const = 0;
 virtual void           cmdExecuteCommands                                                              (VkCommandBuffer commandBuffer, deUint32 commandBufferCount, const VkCommandBuffer* pCommandBuffers) const = 0;
+virtual VkResult       createSwapchainKHR                                                              (VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain) const = 0;
+virtual void           destroySwapchainKHR                                                             (VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator) const = 0;
+virtual VkResult       getSwapchainImagesKHR                                                   (VkDevice device, VkSwapchainKHR swapchain, deUint32* pSwapchainImageCount, VkImage* pSwapchainImages) const = 0;
+virtual VkResult       acquireNextImageKHR                                                             (VkDevice device, VkSwapchainKHR swapchain, deUint64 timeout, VkSemaphore semaphore, VkFence fence, deUint32* pImageIndex) const = 0;
+virtual VkResult       queuePresentKHR                                                                 (VkQueue queue, const VkPresentInfoKHR* pPresentInfo) const = 0;
+virtual VkResult       createSharedSwapchainsKHR                                               (VkDevice device, deUint32 swapchainCount, const VkSwapchainCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains) const = 0;
index 964d76b..8fb7657 100644 (file)
@@ -1,18 +1,41 @@
 /* WARNING: This is auto-generated file. Do not modify, since changes will
  * be lost! Modify the generating script instead.
  */
-virtual void                           destroyInstance                                                 (VkInstance instance, const VkAllocationCallbacks* pAllocator) const = 0;
-virtual VkResult                       enumeratePhysicalDevices                                (VkInstance instance, deUint32* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices) const = 0;
-virtual void                           getPhysicalDeviceFeatures                               (VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures) const = 0;
-virtual void                           getPhysicalDeviceFormatProperties               (VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties) const = 0;
-virtual VkResult                       getPhysicalDeviceImageFormatProperties  (VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties) const = 0;
-virtual void                           getPhysicalDeviceProperties                             (VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties) const = 0;
-virtual void                           getPhysicalDeviceQueueFamilyProperties  (VkPhysicalDevice physicalDevice, deUint32* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties) const = 0;
-virtual void                           getPhysicalDeviceMemoryProperties               (VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties) const = 0;
-virtual PFN_vkVoidFunction     getDeviceProcAddr                                               (VkDevice device, const char* pName) const = 0;
-virtual VkResult                       createDevice                                                    (VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice) const = 0;
-virtual VkResult                       enumerateDeviceExtensionProperties              (VkPhysicalDevice physicalDevice, const char* pLayerName, deUint32* pPropertyCount, VkExtensionProperties* pProperties) const = 0;
-virtual VkResult                       enumerateDeviceLayerProperties                  (VkPhysicalDevice physicalDevice, deUint32* pPropertyCount, VkLayerProperties* pProperties) const = 0;
-virtual VkResult                       createDebugReportCallbackEXT                    (VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback) const = 0;
-virtual void                           destroyDebugReportCallbackEXT                   (VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator) const = 0;
-virtual void                           debugReportMessageEXT                                   (VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, deUint64 object, deUintptr location, deInt32 messageCode, const char* pLayerPrefix, const char* pMessage) const = 0;
+virtual void                           destroyInstance                                                                 (VkInstance instance, const VkAllocationCallbacks* pAllocator) const = 0;
+virtual VkResult                       enumeratePhysicalDevices                                                (VkInstance instance, deUint32* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices) const = 0;
+virtual void                           getPhysicalDeviceFeatures                                               (VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures) const = 0;
+virtual void                           getPhysicalDeviceFormatProperties                               (VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties) const = 0;
+virtual VkResult                       getPhysicalDeviceImageFormatProperties                  (VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties) const = 0;
+virtual void                           getPhysicalDeviceProperties                                             (VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties) const = 0;
+virtual void                           getPhysicalDeviceQueueFamilyProperties                  (VkPhysicalDevice physicalDevice, deUint32* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties) const = 0;
+virtual void                           getPhysicalDeviceMemoryProperties                               (VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties) const = 0;
+virtual PFN_vkVoidFunction     getDeviceProcAddr                                                               (VkDevice device, const char* pName) const = 0;
+virtual VkResult                       createDevice                                                                    (VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice) const = 0;
+virtual VkResult                       enumerateDeviceExtensionProperties                              (VkPhysicalDevice physicalDevice, const char* pLayerName, deUint32* pPropertyCount, VkExtensionProperties* pProperties) const = 0;
+virtual VkResult                       enumerateDeviceLayerProperties                                  (VkPhysicalDevice physicalDevice, deUint32* pPropertyCount, VkLayerProperties* pProperties) const = 0;
+virtual void                           destroySurfaceKHR                                                               (VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator) const = 0;
+virtual VkResult                       getPhysicalDeviceSurfaceSupportKHR                              (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported) const = 0;
+virtual VkResult                       getPhysicalDeviceSurfaceCapabilitiesKHR                 (VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) const = 0;
+virtual VkResult                       getPhysicalDeviceSurfaceFormatsKHR                              (VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, deUint32* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats) const = 0;
+virtual VkResult                       getPhysicalDeviceSurfacePresentModesKHR                 (VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, deUint32* pPresentModeCount, VkPresentModeKHR* pPresentModes) const = 0;
+virtual VkResult                       getPhysicalDeviceDisplayPropertiesKHR                   (VkPhysicalDevice physicalDevice, deUint32* pPropertyCount, VkDisplayPropertiesKHR* pProperties) const = 0;
+virtual VkResult                       getPhysicalDeviceDisplayPlanePropertiesKHR              (VkPhysicalDevice physicalDevice, deUint32* pPropertyCount, VkDisplayPlanePropertiesKHR* pProperties) const = 0;
+virtual VkResult                       getDisplayPlaneSupportedDisplaysKHR                             (VkPhysicalDevice physicalDevice, deUint32 planeIndex, deUint32* pDisplayCount, VkDisplayKHR* pDisplays) const = 0;
+virtual VkResult                       getDisplayModePropertiesKHR                                             (VkPhysicalDevice physicalDevice, VkDisplayKHR display, deUint32* pPropertyCount, VkDisplayModePropertiesKHR* pProperties) const = 0;
+virtual VkResult                       createDisplayModeKHR                                                    (VkPhysicalDevice physicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDisplayModeKHR* pMode) const = 0;
+virtual VkResult                       getDisplayPlaneCapabilitiesKHR                                  (VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, deUint32 planeIndex, VkDisplayPlaneCapabilitiesKHR* pCapabilities) const = 0;
+virtual VkResult                       createDisplayPlaneSurfaceKHR                                    (VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const = 0;
+virtual VkResult                       createXlibSurfaceKHR                                                    (VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const = 0;
+virtual VkBool32                       getPhysicalDeviceXlibPresentationSupportKHR             (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, pt::XlibDisplayPtr dpy, pt::XlibVisualID visualID) const = 0;
+virtual VkResult                       createXcbSurfaceKHR                                                             (VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const = 0;
+virtual VkBool32                       getPhysicalDeviceXcbPresentationSupportKHR              (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, pt::XcbConnectionPtr connection, pt::XcbVisualid visual_id) const = 0;
+virtual VkResult                       createWaylandSurfaceKHR                                                 (VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const = 0;
+virtual VkBool32                       getPhysicalDeviceWaylandPresentationSupportKHR  (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, pt::WaylandDisplayPtr display) const = 0;
+virtual VkResult                       createMirSurfaceKHR                                                             (VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const = 0;
+virtual VkBool32                       getPhysicalDeviceMirPresentationSupportKHR              (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, pt::MirConnectionPtr connection) const = 0;
+virtual VkResult                       createAndroidSurfaceKHR                                                 (VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const = 0;
+virtual VkResult                       createWin32SurfaceKHR                                                   (VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const = 0;
+virtual VkBool32                       getPhysicalDeviceWin32PresentationSupportKHR    (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex) const = 0;
+virtual VkResult                       createDebugReportCallbackEXT                                    (VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback) const = 0;
+virtual void                           destroyDebugReportCallbackEXT                                   (VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator) const = 0;
+virtual void                           debugReportMessageEXT                                                   (VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, deUint64 object, deUintptr location, deInt32 messageCode, const char* pLayerPrefix, const char* pMessage) const = 0;
diff --git a/external/vulkancts/framework/vulkan/vkWsiPlatform.cpp b/external/vulkancts/framework/vulkan/vkWsiPlatform.cpp
new file mode 100644 (file)
index 0000000..bcdf62b
--- /dev/null
@@ -0,0 +1,44 @@
+/*-------------------------------------------------------------------------
+ * Vulkan CTS Framework
+ * --------------------
+ *
+ * Copyright (c) 2016 Google Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and/or associated documentation files (the
+ * "Materials"), to deal in the Materials without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Materials, and to
+ * permit persons to whom the Materials are furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice(s) and this permission notice shall be
+ * included in all copies or substantial portions of the Materials.
+ *
+ * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+ *
+ *//*!
+ * \file
+ * \brief WSI Platform Abstraction.
+ *//*--------------------------------------------------------------------*/
+
+#include "vkWsiPlatform.hpp"
+
+namespace vk
+{
+namespace wsi
+{
+
+void Window::resize (const tcu::UVec2&)
+{
+       TCU_THROW(InternalError, "resize() called on window not supporting it");
+}
+
+} // wsi
+} // vk
diff --git a/external/vulkancts/framework/vulkan/vkWsiPlatform.hpp b/external/vulkancts/framework/vulkan/vkWsiPlatform.hpp
new file mode 100644 (file)
index 0000000..d14c81a
--- /dev/null
@@ -0,0 +1,186 @@
+#ifndef _VKWSIPLATFORM_HPP
+#define _VKWSIPLATFORM_HPP
+/*-------------------------------------------------------------------------
+ * Vulkan CTS Framework
+ * --------------------
+ *
+ * Copyright (c) 2016 Google Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and/or associated documentation files (the
+ * "Materials"), to deal in the Materials without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Materials, and to
+ * permit persons to whom the Materials are furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice(s) and this permission notice shall be
+ * included in all copies or substantial portions of the Materials.
+ *
+ * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+ *
+ *//*!
+ * \file
+ * \brief WSI Platform Abstraction.
+ *//*--------------------------------------------------------------------*/
+
+#include "vkDefs.hpp"
+#include "tcuVector.hpp"
+#include "tcuMaybe.hpp"
+
+namespace vk
+{
+namespace wsi
+{
+
+class Window
+{
+public:
+       virtual                         ~Window                 (void) {}
+
+       virtual void            resize                  (const tcu::UVec2& newSize);
+
+protected:
+                                               Window                  (void) {}
+
+private:
+                                               Window                  (const Window&); // Not allowed
+       Window&                         operator=               (const Window&); // Not allowed
+};
+
+class Display
+{
+public:
+       virtual                         ~Display                (void) {}
+
+       virtual Window*         createWindow    (const tcu::Maybe<tcu::UVec2>& initialSize = tcu::nothing<tcu::UVec2>()) const = 0;
+
+protected:
+                                               Display                 (void) {}
+
+private:
+                                               Display                 (const Display&); // Not allowed
+       Display&                        operator=               (const Display&); // Not allowed
+};
+
+// WSI implementation-specific APIs
+
+template<int WsiType>
+struct TypeTraits;
+// {
+//             typedef <NativeDisplayType>     NativeDisplayType;
+//             typedef <NativeWindowType>      NativeWindowType;
+// };
+
+template<int WsiType>
+struct DisplayInterface : public Display
+{
+public:
+       typedef typename TypeTraits<WsiType>::NativeDisplayType NativeType;
+
+       NativeType                      getNative                       (void) const { return m_native; }
+
+protected:
+                                               DisplayInterface        (NativeType nativeDisplay)
+                                                       : m_native(nativeDisplay)
+                                               {}
+
+       const NativeType        m_native;
+};
+
+template<int WsiType>
+struct WindowInterface : public Window
+{
+public:
+       typedef typename TypeTraits<WsiType>::NativeWindowType  NativeType;
+
+       NativeType                      getNative                       (void) const { return m_native; }
+
+protected:
+                                               WindowInterface (NativeType nativeDisplay)
+                                                       : m_native(nativeDisplay)
+                                               {}
+
+       const NativeType        m_native;
+};
+
+// VK_KHR_xlib_surface
+
+template<>
+struct TypeTraits<TYPE_XLIB>
+{
+       typedef pt::XlibDisplayPtr                      NativeDisplayType;
+       typedef pt::XlibWindow                          NativeWindowType;
+};
+
+typedef DisplayInterface<TYPE_XLIB>            XlibDisplayInterface;
+typedef WindowInterface<TYPE_XLIB>             XlibWindowInterface;
+
+// VK_KHR_xcb_surface
+
+template<>
+struct TypeTraits<TYPE_XCB>
+{
+       typedef pt::XcbConnectionPtr            NativeDisplayType;
+       typedef pt::XcbWindow                           NativeWindowType;
+};
+
+typedef DisplayInterface<TYPE_XCB>             XcbDisplayInterface;
+typedef WindowInterface<TYPE_XCB>              XcbWindowInterface;
+
+// VK_KHR_wayland_surface
+
+template<>
+struct TypeTraits<TYPE_WAYLAND>
+{
+       typedef pt::WaylandDisplayPtr           NativeDisplayType;
+       typedef pt::WaylandSurfacePtr           NativeWindowType;
+};
+
+typedef DisplayInterface<TYPE_WAYLAND> WaylandDisplayInterface;
+typedef WindowInterface<TYPE_WAYLAND>  WaylandWindowInterface;
+
+// VK_KHR_mir_surface
+
+template<>
+struct TypeTraits<TYPE_MIR>
+{
+       typedef pt::MirConnectionPtr            NativeDisplayType;
+       typedef pt::MirSurfacePtr                       NativeWindowType;
+};
+
+typedef DisplayInterface<TYPE_MIR>             MirDisplayInterface;
+typedef WindowInterface<TYPE_MIR>              MirWindowInterface;
+
+// VK_KHR_android_surface
+
+template<>
+struct TypeTraits<TYPE_ANDROID>
+{
+       typedef pt::AndroidNativeWindowPtr      NativeWindowType;
+};
+
+typedef WindowInterface<TYPE_ANDROID>  AndroidWindowInterface;
+
+// VK_KHR_win32_surface
+
+template<>
+struct TypeTraits<TYPE_WIN32>
+{
+       typedef pt::Win32InstanceHandle         NativeDisplayType;
+       typedef pt::Win32WindowHandle           NativeWindowType;
+};
+
+typedef DisplayInterface<TYPE_WIN32>   Win32DisplayInterface;
+typedef WindowInterface<TYPE_WIN32>            Win32WindowInterface;
+
+} // wsi
+} // vk
+
+#endif // _VKWSIPLATFORM_HPP
diff --git a/external/vulkancts/framework/vulkan/vkWsiUtil.cpp b/external/vulkancts/framework/vulkan/vkWsiUtil.cpp
new file mode 100644 (file)
index 0000000..d3072eb
--- /dev/null
@@ -0,0 +1,269 @@
+/*-------------------------------------------------------------------------
+ * Vulkan CTS Framework
+ * --------------------
+ *
+ * Copyright (c) 2016 Google Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and/or associated documentation files (the
+ * "Materials"), to deal in the Materials without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Materials, and to
+ * permit persons to whom the Materials are furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice(s) and this permission notice shall be
+ * included in all copies or substantial portions of the Materials.
+ *
+ * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+ *
+ *//*!
+ * \file
+ * \brief Windowing System Integration (WSI) Utilities.
+ *//*--------------------------------------------------------------------*/
+
+#include "vkWsiUtil.hpp"
+#include "deArrayUtil.hpp"
+#include "deMemory.h"
+
+#include <limits>
+
+namespace vk
+{
+namespace wsi
+{
+
+//! Get canonical WSI name that should be used for example in test case and group names.
+const char* getName (Type wsiType)
+{
+       static const char* const s_names[] =
+       {
+               "xlib",
+               "xcb",
+               "wayland",
+               "mir",
+               "android",
+               "win32",
+       };
+       return de::getSizedArrayElement<TYPE_LAST>(s_names, wsiType);
+}
+
+const char* getExtensionName (Type wsiType)
+{
+       static const char* const s_extNames[] =
+       {
+               "VK_KHR_xlib_surface",
+               "VK_KHR_xcb_surface",
+               "VK_KHR_wayland_surface",
+               "VK_KHR_mir_surface",
+               "VK_KHR_android_surface",
+               "VK_KHR_win32_surface",
+       };
+       return de::getSizedArrayElement<TYPE_LAST>(s_extNames, wsiType);
+}
+
+const PlatformProperties& getPlatformProperties (Type wsiType)
+{
+       // \note These are declared here (rather than queried through vk::Platform for example)
+       //               on purpose. The behavior of a platform is partly defined by the platform spec,
+       //               and partly by WSI extensions, and platform ports should not need to override
+       //               that definition.
+
+       const deUint32  noDisplayLimit  = std::numeric_limits<deUint32>::max();
+       const deUint32  noWindowLimit   = std::numeric_limits<deUint32>::max();
+
+       static const PlatformProperties s_properties[] =
+       {
+               // VK_KHR_xlib_surface
+               {
+                       PlatformProperties::FEATURE_INITIAL_WINDOW_SIZE|PlatformProperties::FEATURE_RESIZE_WINDOW,
+                       PlatformProperties::SWAPCHAIN_EXTENT_MUST_MATCH_WINDOW_SIZE,
+                       noDisplayLimit,
+                       noWindowLimit,
+               },
+               // VK_KHR_xcb_surface
+               {
+                       PlatformProperties::FEATURE_INITIAL_WINDOW_SIZE|PlatformProperties::FEATURE_RESIZE_WINDOW,
+                       PlatformProperties::SWAPCHAIN_EXTENT_MUST_MATCH_WINDOW_SIZE,
+                       noDisplayLimit,
+                       noWindowLimit,
+               },
+               // VK_KHR_wayland_surface
+               {
+                       PlatformProperties::FEATURE_INITIAL_WINDOW_SIZE|PlatformProperties::FEATURE_RESIZE_WINDOW,
+                       PlatformProperties::SWAPCHAIN_EXTENT_SETS_WINDOW_SIZE,
+                       noDisplayLimit,
+                       noWindowLimit,
+               },
+               // VK_KHR_mir_surface
+               {
+                       PlatformProperties::FEATURE_INITIAL_WINDOW_SIZE|PlatformProperties::FEATURE_RESIZE_WINDOW,
+                       PlatformProperties::SWAPCHAIN_EXTENT_SCALED_TO_WINDOW_SIZE,
+                       noDisplayLimit,
+                       noWindowLimit,
+               },
+               // VK_KHR_android_surface
+               {
+                       PlatformProperties::FEATURE_INITIAL_WINDOW_SIZE,
+                       PlatformProperties::SWAPCHAIN_EXTENT_MUST_MATCH_WINDOW_SIZE,
+                       1u,
+                       1u, // Only one window available
+               },
+               // VK_KHR_win32_surface
+               {
+                       PlatformProperties::FEATURE_INITIAL_WINDOW_SIZE|PlatformProperties::FEATURE_RESIZE_WINDOW,
+                       PlatformProperties::SWAPCHAIN_EXTENT_MUST_MATCH_WINDOW_SIZE,
+                       noDisplayLimit,
+                       noWindowLimit,
+               },
+       };
+
+       return de::getSizedArrayElement<TYPE_LAST>(s_properties, wsiType);
+}
+
+VkResult createSurface (const InstanceInterface&               vki,
+                                               VkInstance                                              instance,
+                                               Type                                                    wsiType,
+                                               const Display&                                  nativeDisplay,
+                                               const Window&                                   nativeWindow,
+                                               const VkAllocationCallbacks*    pAllocator,
+                                               VkSurfaceKHR*                                   pSurface)
+{
+       // Update this function if you add more WSI implementations
+       DE_STATIC_ASSERT(TYPE_LAST == 6);
+
+       switch (wsiType)
+       {
+               case TYPE_XLIB:
+               {
+                       const XlibDisplayInterface&                     xlibDisplay             = dynamic_cast<const XlibDisplayInterface&>(nativeDisplay);
+                       const XlibWindowInterface&                      xlibWindow              = dynamic_cast<const XlibWindowInterface&>(nativeWindow);
+                       const VkXlibSurfaceCreateInfoKHR        createInfo              =
+                       {
+                               VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR,
+                               DE_NULL,
+                               (VkXlibSurfaceCreateFlagsKHR)0,
+                               xlibDisplay.getNative(),
+                               xlibWindow.getNative()
+                       };
+
+                       return vki.createXlibSurfaceKHR(instance, &createInfo, pAllocator, pSurface);
+               }
+
+               case TYPE_XCB:
+               {
+                       const XcbDisplayInterface&                      xcbDisplay              = dynamic_cast<const XcbDisplayInterface&>(nativeDisplay);
+                       const XcbWindowInterface&                       xcbWindow               = dynamic_cast<const XcbWindowInterface&>(nativeWindow);
+                       const VkXcbSurfaceCreateInfoKHR         createInfo              =
+                       {
+                               VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
+                               DE_NULL,
+                               (VkXcbSurfaceCreateFlagsKHR)0,
+                               xcbDisplay.getNative(),
+                               xcbWindow.getNative()
+                       };
+
+                       return vki.createXcbSurfaceKHR(instance, &createInfo, pAllocator, pSurface);
+               }
+
+               case TYPE_WAYLAND:
+               {
+                       const WaylandDisplayInterface&          waylandDisplay  = dynamic_cast<const WaylandDisplayInterface&>(nativeDisplay);
+                       const WaylandWindowInterface&           waylandWindow   = dynamic_cast<const WaylandWindowInterface&>(nativeWindow);
+                       const VkWaylandSurfaceCreateInfoKHR     createInfo              =
+                       {
+                               VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR,
+                               DE_NULL,
+                               (VkWaylandSurfaceCreateFlagsKHR)0,
+                               waylandDisplay.getNative(),
+                               waylandWindow.getNative()
+                       };
+
+                       return vki.createWaylandSurfaceKHR(instance, &createInfo, pAllocator, pSurface);
+               }
+
+               case TYPE_MIR:
+               {
+                       const MirDisplayInterface&                      mirDisplay              = dynamic_cast<const MirDisplayInterface&>(nativeDisplay);
+                       const MirWindowInterface&                       mirWindow               = dynamic_cast<const MirWindowInterface&>(nativeWindow);
+                       const VkMirSurfaceCreateInfoKHR         createInfo              =
+                       {
+                               VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR,
+                               DE_NULL,
+                               (VkXcbSurfaceCreateFlagsKHR)0,
+                               mirDisplay.getNative(),
+                               mirWindow.getNative()
+                       };
+
+                       return vki.createMirSurfaceKHR(instance, &createInfo, pAllocator, pSurface);
+               }
+
+               case TYPE_ANDROID:
+               {
+                       const AndroidWindowInterface&           androidWindow   = dynamic_cast<const AndroidWindowInterface&>(nativeWindow);
+                       const VkAndroidSurfaceCreateInfoKHR     createInfo              =
+                       {
+                               VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR,
+                               DE_NULL,
+                               (VkAndroidSurfaceCreateFlagsKHR)0,
+                               androidWindow.getNative()
+                       };
+
+                       return vki.createAndroidSurfaceKHR(instance, &createInfo, pAllocator, pSurface);
+               }
+
+               case TYPE_WIN32:
+               {
+                       const Win32DisplayInterface&            win32Display    = dynamic_cast<const Win32DisplayInterface&>(nativeDisplay);
+                       const Win32WindowInterface&                     win32Window             = dynamic_cast<const Win32WindowInterface&>(nativeWindow);
+                       const VkWin32SurfaceCreateInfoKHR       createInfo              =
+                       {
+                               VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
+                               DE_NULL,
+                               (VkWin32SurfaceCreateFlagsKHR)0,
+                               win32Display.getNative(),
+                               win32Window.getNative()
+                       };
+
+                       return vki.createWin32SurfaceKHR(instance, &createInfo, pAllocator, pSurface);
+               }
+
+               default:
+                       DE_FATAL("Unknown WSI type");
+                       return VK_ERROR_SURFACE_LOST_KHR;
+       }
+}
+
+Move<VkSurfaceKHR> createSurface (const InstanceInterface&             vki,
+                                                                 VkInstance                                    instance,
+                                                                 Type                                                  wsiType,
+                                                                 const Display&                                nativeDisplay,
+                                                                 const Window&                                 nativeWindow,
+                                                                 const VkAllocationCallbacks*  pAllocator)
+{
+       VkSurfaceKHR object = 0;
+       VK_CHECK(createSurface(vki, instance, wsiType, nativeDisplay, nativeWindow, pAllocator, &object));
+       return Move<VkSurfaceKHR>(check<VkSurfaceKHR>(object), Deleter<VkSurfaceKHR>(vki, instance, pAllocator));
+}
+
+VkSurfaceCapabilitiesKHR getPhysicalDeviceSurfaceCapabilities (const InstanceInterface&                vki,
+                                                                                                                          VkPhysicalDevice                             physicalDevice,
+                                                                                                                          VkSurfaceKHR                                 surface)
+{
+       VkSurfaceCapabilitiesKHR capabilities;
+
+       deMemset(&capabilities, 0, sizeof(capabilities));
+
+       VK_CHECK(vki.getPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, surface, &capabilities));
+
+       return capabilities;
+}
+
+} // wsi
+} // vk
diff --git a/external/vulkancts/framework/vulkan/vkWsiUtil.hpp b/external/vulkancts/framework/vulkan/vkWsiUtil.hpp
new file mode 100644 (file)
index 0000000..bc1e5a4
--- /dev/null
@@ -0,0 +1,92 @@
+#ifndef _VKWSIUTIL_HPP
+#define _VKWSIUTIL_HPP
+/*-------------------------------------------------------------------------
+ * Vulkan CTS Framework
+ * --------------------
+ *
+ * Copyright (c) 2016 Google Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and/or associated documentation files (the
+ * "Materials"), to deal in the Materials without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Materials, and to
+ * permit persons to whom the Materials are furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice(s) and this permission notice shall be
+ * included in all copies or substantial portions of the Materials.
+ *
+ * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+ *
+ *//*!
+ * \file
+ * \brief Windowing System Integration (WSI) Utilities.
+ *//*--------------------------------------------------------------------*/
+
+#include "vkDefs.hpp"
+#include "vkWsiPlatform.hpp"
+#include "vkRef.hpp"
+
+namespace vk
+{
+namespace wsi
+{
+
+struct PlatformProperties
+{
+       enum FeatureFlags
+       {
+               FEATURE_INITIAL_WINDOW_SIZE             = (1<<0),               //!< Platform honors initial window size request
+               FEATURE_RESIZE_WINDOW                   = (1<<1),               //!< Platform supports resizing window
+       };
+
+       enum SwapchainExtent
+       {
+               SWAPCHAIN_EXTENT_MUST_MATCH_WINDOW_SIZE = 0,    //!< Swapchain extent must match window size
+               SWAPCHAIN_EXTENT_SETS_WINDOW_SIZE,                              //!< Window will be resized to swapchain size when first image is presented
+               SWAPCHAIN_EXTENT_SCALED_TO_WINDOW_SIZE,                 //!< Presented image contents will be scaled to window size
+
+               SWAPCHAIN_EXTENT_LAST
+       };
+
+       deUint32                features;
+       SwapchainExtent swapchainExtent;
+       deUint32                maxDisplays;
+       deUint32                maxWindowsPerDisplay;
+};
+
+const char*                                    getName                                                                 (Type wsiType);
+const char*                                    getExtensionName                                                (Type wsiType);
+
+const PlatformProperties&      getPlatformProperties                                   (Type wsiType);
+
+VkResult                                       createSurface                                                   (const InstanceInterface&               vki,
+                                                                                                                                        VkInstance                                             instance,
+                                                                                                                                        Type                                                   wsiType,
+                                                                                                                                        const Display&                                 nativeDisplay,
+                                                                                                                                        const Window&                                  nativeWindow,
+                                                                                                                                        const VkAllocationCallbacks*   pAllocator,
+                                                                                                                                        VkSurfaceKHR*                                  pSurface);
+
+Move<VkSurfaceKHR>                     createSurface                                                   (const InstanceInterface&               vki,
+                                                                                                                                        VkInstance                                             instance,
+                                                                                                                                        Type                                                   wsiType,
+                                                                                                                                        const Display&                                 nativeDisplay,
+                                                                                                                                        const Window&                                  nativeWindow,
+                                                                                                                                        const VkAllocationCallbacks*   pAllocator = DE_NULL);
+
+VkSurfaceCapabilitiesKHR       getPhysicalDeviceSurfaceCapabilities    (const InstanceInterface&               vki,
+                                                                                                                                        VkPhysicalDevice                               physicalDevice,
+                                                                                                                                        VkSurfaceKHR                                   surface);
+
+} // wsi
+} // vk
+
+#endif // _VKWSIUTIL_HPP
index 6ac7c98..11a8758 100644 (file)
@@ -64,6 +64,47 @@ INSTANCE_FUNCTIONS   = [
        "vkEnumerateDeviceLayerProperties",
        "vkCreateDevice",
        "vkGetDeviceProcAddr",
+
+       # VK_KHR_surface
+       "vkDestroySurfaceKHR",
+       "vkGetPhysicalDeviceSurfaceSupportKHR",
+       "vkGetPhysicalDeviceSurfaceCapabilitiesKHR",
+       "vkGetPhysicalDeviceSurfaceFormatsKHR",
+       "vkGetPhysicalDeviceSurfacePresentModesKHR",
+
+       # VK_KHR_display
+       "vkGetPhysicalDeviceDisplayPropertiesKHR",
+       "vkGetPhysicalDeviceDisplayPlanePropertiesKHR",
+       "vkGetDisplayPlaneSupportedDisplaysKHR",
+       "vkGetDisplayModePropertiesKHR",
+       "vkCreateDisplayModeKHR",
+       "vkGetDisplayPlaneCapabilitiesKHR",
+       "vkCreateDisplayPlaneSurfaceKHR",
+
+       # VK_KHR_xlib_surface
+       "vkCreateXlibSurfaceKHR",
+       "vkGetPhysicalDeviceXlibPresentationSupportKHR",
+
+       # VK_KHR_xcb_surface
+       "vkCreateXcbSurfaceKHR",
+       "vkGetPhysicalDeviceXcbPresentationSupportKHR",
+
+       # VK_KHR_wayland_surface
+       "vkCreateWaylandSurfaceKHR",
+       "vkGetPhysicalDeviceWaylandPresentationSupportKHR",
+
+       # VK_KHR_mir_surface
+       "vkCreateMirSurfaceKHR",
+       "vkGetPhysicalDeviceMirPresentationSupportKHR",
+
+       # VK_KHR_android_surface
+       "vkCreateAndroidSurfaceKHR",
+
+       # VK_KHR_win32_surface
+       "vkCreateWin32SurfaceKHR",
+       "vkGetPhysicalDeviceWin32PresentationSupportKHR",
+
+       # VK_EXT_debug_report
        "vkCreateDebugReportCallbackEXT",
        "vkDestroyDebugReportCallbackEXT",
        "vkDebugReportMessageEXT",
@@ -80,6 +121,34 @@ DEFINITIONS                 = [
        "VK_ATTACHMENT_UNUSED",
 ]
 
+PLATFORM_TYPES         = [
+       # VK_KHR_xlib_surface
+       ("Display*",                    "XlibDisplayPtr",                       "void*"),
+       ("Window",                              "XlibWindow",                           "deUintptr",),
+       ("VisualID",                    "XlibVisualID",                         "deUint32"),
+
+       # VK_KHR_xcb_surface
+       ("xcb_connection_t*",   "XcbConnectionPtr",                     "void*"),
+       ("xcb_window_t",                "XcbWindow",                            "deUintptr"),
+       ("xcb_visualid_t",              "XcbVisualid",                          "deUint32"),
+
+       # VK_KHR_wayland_surface
+       ("struct wl_display*",  "WaylandDisplayPtr",            "void*"),
+       ("struct wl_surface*",  "WaylandSurfacePtr",            "void*"),
+
+       # VK_KHR_mir_surface
+       ("MirConnection*",              "MirConnectionPtr",                     "void*"),
+       ("MirSurface*",                 "MirSurfacePtr",                        "void*"),
+
+       # VK_KHR_android_surface
+       ("ANativeWindow*",              "AndroidNativeWindowPtr",       "void*"),
+
+       # VK_KHR_win32_surface
+       ("HINSTANCE",                   "Win32InstanceHandle",          "void*"),
+       ("HWND",                                "Win32WindowHandle",            "void*")
+]
+PLATFORM_TYPE_NAMESPACE        = "pt"
+
 class Handle:
        TYPE_DISP               = 0
        TYPE_NONDISP    = 1
@@ -167,6 +236,10 @@ def fixupEnumValues (values):
        return fixed
 
 def fixupType (type):
+       for platformType, substitute, compat in PLATFORM_TYPES:
+               if type == platformType:
+                       return PLATFORM_TYPE_NAMESPACE + "::" + substitute
+
        replacements = [
                        ("uint8_t",             "deUint8"),
                        ("uint16_t",    "deUint16"),
@@ -262,9 +335,6 @@ def parseCompositeTypes (src):
        types   = []
 
        for type, structname, contents, typename in matches:
-               if typename[-3:] == "KHR":
-                       continue # \todo [2016-01-05 pyry] Figure out how to handle platform-specific types
-
                types.append(parseCompositeType(typeMap[type], typename, contents))
 
        return types
@@ -296,9 +366,6 @@ def parseFunctions (src):
        functions       = []
 
        for returnType, name, argList in matches:
-               if name[-3:] == "KHR":
-                       continue # \todo [2015-11-16 pyry] Figure out how to handle platform-specific extension functions
-
                functions.append(Function(name.strip(), returnType.strip(), parseArgList(argList)))
 
        return [fixupFunction(f) for f in functions]
@@ -428,6 +495,8 @@ def writeBasicTypes (api, filename):
                        for line in genBitfieldSrc(bitfield):
                                yield line
                        yield ""
+               for line in indentLines(["VK_DEFINE_PLATFORM_TYPE(%s,\t%s);" % (s, c) for n, s, c in PLATFORM_TYPES]):
+                       yield line
 
        writeInlFile(filename, INL_HEADER, gen())
 
@@ -506,6 +575,15 @@ def writeStrUtilImpl (api, filename):
                for line in indentLines(["template<> const char*\tgetTypeName<%s>\t(void) { return \"%s\";\t}" % (handle.name, handle.name) for handle in api.handles]):
                        yield line
 
+               yield ""
+               yield "namespace %s" % PLATFORM_TYPE_NAMESPACE
+               yield "{"
+
+               for line in indentLines("std::ostream& operator<< (std::ostream& s, %s\tv) { return s << tcu::toHex(v.internal); }" % s for n, s, c in PLATFORM_TYPES):
+                       yield line
+
+               yield "}"
+
                for enum in api.enums:
                        yield ""
                        yield "const char* get%sName (%s value)" % (enum.name[2:], enum.name)
@@ -582,6 +660,9 @@ def getConstructorFunctions (api):
        funcs = []
        for function in api.functions:
                if (function.name[:8] == "vkCreate" or function.name == "vkAllocateMemory") and not "count" in [a.name for a in function.arguments]:
+                       if function.name == "vkCreateDisplayModeKHR":
+                               continue # No way to delete display modes (bug?)
+
                        # \todo [pyry] Rather hacky
                        iface = None
                        if function.getType() == Function.TYPE_PLATFORM:
@@ -671,7 +752,9 @@ def writeNullDriverImpl (api, filename):
                                "vkFreeDescriptorSets",
                                "vkResetDescriptorPool",
                                "vkAllocateCommandBuffers",
-                               "vkFreeCommandBuffers"
+                               "vkFreeCommandBuffers",
+                               "vkCreateDisplayModeKHR",
+                               "vkCreateSharedSwapchainsKHR",
                        ]
                specialFuncs            = [f for f in api.functions if f.name in specialFuncNames]
                createFuncs                     = [f for f in api.functions if (f.name[:8] == "vkCreate" or f.name == "vkAllocateMemory") and not f in specialFuncs]
index 89c5c5c..92b649d 100644 (file)
@@ -31,6 +31,7 @@
 #include "eglwLibrary.hpp"
 #include "eglwEnums.hpp"
 #include "tcuFunctionLibrary.hpp"
+#include "vkWsiPlatform.hpp"
 
 // Assume no call translation is needed
 #include <android/native_window.h>
@@ -205,6 +206,61 @@ private:
        const vk::PlatformDriver                        m_driver;
 };
 
+DE_STATIC_ASSERT(sizeof(vk::pt::AndroidNativeWindowPtr) == sizeof(ANativeWindow*));
+
+class VulkanWindow : public vk::wsi::AndroidWindowInterface
+{
+public:
+       VulkanWindow (tcu::Android::Window& window)
+               : vk::wsi::AndroidWindowInterface       (vk::pt::AndroidNativeWindowPtr(window.getNativeWindow()))
+               , m_window                                                      (window)
+       {
+       }
+
+       ~VulkanWindow (void)
+       {
+               m_window.release();
+       }
+
+private:
+       tcu::Android::Window&   m_window;
+};
+
+class VulkanDisplay : public vk::wsi::Display
+{
+public:
+       VulkanDisplay (WindowRegistry& windowRegistry)
+               : m_windowRegistry(windowRegistry)
+       {
+       }
+
+       vk::wsi::Window* createWindow (const Maybe<UVec2>& initialSize) const
+       {
+               Window* const   window  = m_windowRegistry.tryAcquireWindow();
+
+               if (window)
+               {
+                       try
+                       {
+                               if (initialSize)
+                                       window->setBuffersGeometry((int)initialSize->x(), (int)initialSize->y(), WINDOW_FORMAT_RGBA_8888);
+
+                               return new VulkanWindow(*window);
+                       }
+                       catch (...)
+                       {
+                               window->release();
+                               throw;
+                       }
+               }
+               else
+                       TCU_THROW(ResourceError, "Native window is not available");
+       }
+
+private:
+       WindowRegistry&         m_windowRegistry;
+};
+
 // Platform
 
 Platform::Platform (NativeActivity& activity)
@@ -234,5 +290,13 @@ void Platform::describePlatform (std::ostream& dst) const
        tcu::Android::describePlatform(m_activity.getNativeActivity(), dst);
 }
 
+vk::wsi::Display* Platform::createWsiDisplay (vk::wsi::Type wsiType) const
+{
+       if (wsiType == vk::wsi::TYPE_ANDROID)
+               return new VulkanDisplay(const_cast<WindowRegistry&>(m_windowRegistry));
+       else
+               TCU_THROW(NotSupportedError, "WSI type not supported on Android");
+}
+
 } // Android
 } // tcu
index 63ea6a6..a30fa3a 100644 (file)
@@ -50,8 +50,10 @@ public:
 
        WindowRegistry&                                 getWindowRegistry       (void) { return m_windowRegistry; }
 
+       // Vulkan Platform API
        vk::Library*                                    createLibrary           (void) const;
        void                                                    describePlatform        (std::ostream& dst) const;
+       vk::wsi::Display*                               createWsiDisplay        (vk::wsi::Type wsiType) const;
 
 private:
        NativeActivity&                                 m_activity;
index 3b7257f..60dd095 100644 (file)
 #pragma warning(disable : 4996)
 
 #include "tcuWin32Platform.hpp"
+#include "tcuWin32Window.hpp"
 #include "tcuWGLContextFactory.hpp"
 #include "tcuFunctionLibrary.hpp"
 #include "tcuFormatUtil.hpp"
 
+#include "vkWsiPlatform.hpp"
+#include "tcuVector.hpp"
+
+#include "deUniquePtr.hpp"
 #include "deMemory.h"
 
 #if defined(DEQP_SUPPORT_EGL)
 namespace tcu
 {
 
+// \todo [2016-02-23 pyry] Move vulkan platform implementation out
+
+using de::MovePtr;
+using de::UniquePtr;
+
+DE_STATIC_ASSERT(sizeof(vk::pt::Win32InstanceHandle)   == sizeof(HINSTANCE));
+DE_STATIC_ASSERT(sizeof(vk::pt::Win32WindowHandle)             == sizeof(HWND));
+
+class VulkanWindow : public vk::wsi::Win32WindowInterface
+{
+public:
+       VulkanWindow (MovePtr<Win32Window> window)
+               : vk::wsi::Win32WindowInterface (vk::pt::Win32WindowHandle(window->getHandle()))
+               , m_window                                              (window)
+       {
+       }
+
+       void resize (const UVec2& newSize)
+       {
+               m_window->setSize((int)newSize.x(), (int)newSize.y());
+       }
+
+private:
+       UniquePtr<Win32Window>  m_window;
+};
+
+class VulkanDisplay : public vk::wsi::Win32DisplayInterface
+{
+public:
+       VulkanDisplay (HINSTANCE instance)
+               : vk::wsi::Win32DisplayInterface        (vk::pt::Win32InstanceHandle(instance))
+       {
+       }
+
+       vk::wsi::Window* createWindow (const Maybe<UVec2>& initialSize) const
+       {
+               const HINSTANCE instance        = (HINSTANCE)m_native.internal;
+               const deUint32  width           = !initialSize ? 400 : initialSize->x();
+               const deUint32  height          = !initialSize ? 300 : initialSize->y();
+
+               return new VulkanWindow(MovePtr<Win32Window>(new Win32Window(instance, (int)width, (int)height)));
+       }
+};
+
 class VulkanLibrary : public vk::Library
 {
 public:
@@ -59,61 +108,16 @@ private:
        const vk::PlatformDriver                        m_driver;
 };
 
-Win32Platform::Win32Platform (void)
-       : m_instance(GetModuleHandle(NULL))
+Win32VulkanPlatform::Win32VulkanPlatform (HINSTANCE instance)
+       : m_instance(instance)
 {
-       // Set process priority to lower.
-       SetPriorityClass(GetCurrentProcess(), BELOW_NORMAL_PRIORITY_CLASS);
-
-       {
-               WGLContextFactory* factory = DE_NULL;
-
-               try
-               {
-                       factory = new WGLContextFactory(m_instance);
-               }
-               catch (const std::exception& e)
-               {
-                       print("Warning: WGL not supported: %s\n", e.what());
-               }
-
-               if (factory)
-               {
-                       try
-                       {
-                               m_contextFactoryRegistry.registerFactory(factory);
-                       }
-                       catch (...)
-                       {
-                               delete factory;
-                               throw;
-                       }
-               }
-       }
-
-#if defined(DEQP_SUPPORT_EGL)
-       m_nativeDisplayFactoryRegistry.registerFactory(new Win32EGLNativeDisplayFactory(m_instance));
-       m_contextFactoryRegistry.registerFactory(new eglu::GLContextFactory(m_nativeDisplayFactoryRegistry));
-#endif
 }
 
-Win32Platform::~Win32Platform (void)
+Win32VulkanPlatform::~Win32VulkanPlatform (void)
 {
 }
 
-bool Win32Platform::processEvents (void)
-{
-       MSG msg;
-       while (PeekMessage(&msg, (HWND)-1, 0, 0, PM_REMOVE))
-       {
-               DispatchMessage(&msg);
-               if (msg.message == WM_QUIT)
-                       return false;
-       }
-       return true;
-}
-
-vk::Library* Win32Platform::createLibrary (void) const
+vk::Library* Win32VulkanPlatform::createLibrary (void) const
 {
        return new VulkanLibrary();
 }
@@ -185,7 +189,7 @@ static void getProcessorInfo (std::ostream& dst)
        dst << ", level " << tcu::toHex(sysInfo.wProcessorLevel) << ", revision " << tcu::toHex(sysInfo.wProcessorRevision);
 }
 
-void Win32Platform::describePlatform (std::ostream& dst) const
+void Win32VulkanPlatform::describePlatform (std::ostream& dst) const
 {
        dst << "OS: ";
        getOSInfo(dst);
@@ -196,6 +200,69 @@ void Win32Platform::describePlatform (std::ostream& dst) const
        dst << "\n";
 }
 
+vk::wsi::Display* Win32VulkanPlatform::createWsiDisplay (vk::wsi::Type wsiType) const
+{
+       if (wsiType != vk::wsi::TYPE_WIN32)
+               TCU_THROW(NotSupportedError, "WSI type not supported");
+
+       return new VulkanDisplay(m_instance);
+}
+
+Win32Platform::Win32Platform (void)
+       : m_instance            (GetModuleHandle(NULL))
+       , m_vulkanPlatform      (m_instance)
+{
+       // Set process priority to lower.
+       SetPriorityClass(GetCurrentProcess(), BELOW_NORMAL_PRIORITY_CLASS);
+
+       {
+               WGLContextFactory* factory = DE_NULL;
+
+               try
+               {
+                       factory = new WGLContextFactory(m_instance);
+               }
+               catch (const std::exception& e)
+               {
+                       print("Warning: WGL not supported: %s\n", e.what());
+               }
+
+               if (factory)
+               {
+                       try
+                       {
+                               m_contextFactoryRegistry.registerFactory(factory);
+                       }
+                       catch (...)
+                       {
+                               delete factory;
+                               throw;
+                       }
+               }
+       }
+
+#if defined(DEQP_SUPPORT_EGL)
+       m_nativeDisplayFactoryRegistry.registerFactory(new Win32EGLNativeDisplayFactory(m_instance));
+       m_contextFactoryRegistry.registerFactory(new eglu::GLContextFactory(m_nativeDisplayFactoryRegistry));
+#endif
+}
+
+Win32Platform::~Win32Platform (void)
+{
+}
+
+bool Win32Platform::processEvents (void)
+{
+       MSG msg;
+       while (PeekMessage(&msg, (HWND)-1, 0, 0, PM_REMOVE))
+       {
+               DispatchMessage(&msg);
+               if (msg.message == WM_QUIT)
+                       return false;
+       }
+       return true;
+}
+
 } // tcu
 
 // Create platform
index ba62105..1abcc7c 100644 (file)
 #include "tcuWin32API.h"
 
 #if defined(DEQP_SUPPORT_EGL)
-#      ifndef _EGLUPLATFORM_HPP
-#              include "egluPlatform.hpp"
-#      endif
+#      include "egluPlatform.hpp"
 #endif
 
 namespace tcu
 {
 
-class Win32Platform : public tcu::Platform, private glu::Platform, private vk::Platform
+class Win32VulkanPlatform : public vk::Platform
+{
+public:
+                                               Win32VulkanPlatform             (HINSTANCE instance);
+                                               ~Win32VulkanPlatform    (void);
+
+       vk::Library*            createLibrary                   (void) const;
+       void                            describePlatform                (std::ostream& dst) const;
+       vk::wsi::Display*       createWsiDisplay                (vk::wsi::Type wsiType) const;
+
+private:
+       const HINSTANCE         m_instance;
+};
+
+class Win32Platform : public tcu::Platform, private glu::Platform
 #if defined(DEQP_SUPPORT_EGL)
        , private eglu::Platform
 #endif
 {
 public:
-                                                       Win32Platform           (void);
-                                                       ~Win32Platform          (void);
+                                                               Win32Platform           (void);
+                                                               ~Win32Platform          (void);
 
-       bool                                    processEvents           (void);
+       bool                                            processEvents           (void);
 
-       const glu::Platform&    getGLPlatform           (void) const { return static_cast<const glu::Platform&>(*this);         }
+       const glu::Platform&            getGLPlatform           (void) const { return static_cast<const glu::Platform&>(*this); }
 
 #if defined(DEQP_SUPPORT_EGL)
-       const eglu::Platform&   getEGLPlatform          (void) const { return static_cast<const eglu::Platform&>(*this);        }
+       const eglu::Platform&           getEGLPlatform          (void) const { return static_cast<const eglu::Platform&>(*this);}
 #endif
 
-       const vk::Platform&             getVulkanPlatform       (void) const { return static_cast<const vk::Platform&>(*this);          }
+       const vk::Platform&                     getVulkanPlatform       (void) const { return m_vulkanPlatform;                                                 }
 
 private:
-       vk::Library*                    createLibrary           (void) const;
-       void                                    describePlatform        (std::ostream& dst) const;
-
-       HINSTANCE                               m_instance;
+       const HINSTANCE                         m_instance;
+       const Win32VulkanPlatform       m_vulkanPlatform;
 };
 
 } // tcu