successfully allocating with VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT working copying vulkan texture successfully passing D3D texture back to Flutter chore: Dart/Windows sample project: remove unnnecessary InvalidateRect from update() chore: Dart/Windows sample project: add generated bindings successfully blitting from Vulkan swapchain to D3D texture working Vulkan texture integration with Flutter refactor to allow disposal of resources in destructors handle destroyTexture correctly correctly implement surface resizing/destruction move Windows engine to Vulkan backend and flush after creating swapchain add vulkan + vkshaders to Windows libs update materials with Vulkan move Vulkan implementation to thermion_Dart remove extras folder thermion_flutter plugin updates update build hook to copy .lib file to output directory and use -vulkan lib zip file thermion_flutter cleanup reinstate stereoscopic on Windows add dxgi and d3d11.lib to windows header pragma update cli_windows sample project copy filament/vulkan headers to output directory. This was originally added to facilitate linking on Windows (where thermion_flutter_plugin.cpp needs the Vulkan-related headers), but this doesn't actually solve the problem because there's no way that I've found to get the directory structure correct in the Dart native_assets build directory unless you explicitly address each inidivual file. The current approach is therefore to just keep a permanent copy of the headers in the thermion_filament directory (meaning these will need to be updated manually if the Filament version changes). However, I decided to keep the changes to build.dart because it doesn't have much negative impact and may be helpful in future. disable stereoscopic on Windows and disable handle use after free checks use filament headers for thermion_flutter throw Exception for MSAA on Windows (note that passing msaa:true for setAntiAliasing doesn't actually set MSAA on other platforms, but at least it won't cause the engine to crash) change header include path for Windows/Vulkan change header include path for Windows/Vulkan add filament/vulkan headers for flutter (Windows) ensure destroyTexture platform methods accept an integer rather than a list handle Android/Windows swapchain creation separately
316 lines
13 KiB
C
316 lines
13 KiB
C
#ifndef VULKAN_WIN32_H_
|
|
#define VULKAN_WIN32_H_ 1
|
|
|
|
/*
|
|
** Copyright 2015-2022 The Khronos Group Inc.
|
|
**
|
|
** SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/*
|
|
** This header is generated from the Khronos Vulkan XML API Registry.
|
|
**
|
|
*/
|
|
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
|
|
|
|
#define VK_KHR_win32_surface 1
|
|
#define VK_KHR_WIN32_SURFACE_SPEC_VERSION 6
|
|
#define VK_KHR_WIN32_SURFACE_EXTENSION_NAME "VK_KHR_win32_surface"
|
|
typedef VkFlags VkWin32SurfaceCreateFlagsKHR;
|
|
typedef struct VkWin32SurfaceCreateInfoKHR {
|
|
VkStructureType sType;
|
|
const void* pNext;
|
|
VkWin32SurfaceCreateFlagsKHR flags;
|
|
HINSTANCE hinstance;
|
|
HWND hwnd;
|
|
} VkWin32SurfaceCreateInfoKHR;
|
|
|
|
typedef VkResult (VKAPI_PTR *PFN_vkCreateWin32SurfaceKHR)(VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
|
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex);
|
|
|
|
#ifndef VK_NO_PROTOTYPES
|
|
VKAPI_ATTR VkResult VKAPI_CALL vkCreateWin32SurfaceKHR(
|
|
VkInstance instance,
|
|
const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
|
|
const VkAllocationCallbacks* pAllocator,
|
|
VkSurfaceKHR* pSurface);
|
|
|
|
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWin32PresentationSupportKHR(
|
|
VkPhysicalDevice physicalDevice,
|
|
uint32_t queueFamilyIndex);
|
|
#endif
|
|
|
|
|
|
#define VK_KHR_external_memory_win32 1
|
|
#define VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
|
|
#define VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_KHR_external_memory_win32"
|
|
typedef struct VkImportMemoryWin32HandleInfoKHR {
|
|
VkStructureType sType;
|
|
const void* pNext;
|
|
VkExternalMemoryHandleTypeFlagBits handleType;
|
|
HANDLE handle;
|
|
LPCWSTR name;
|
|
} VkImportMemoryWin32HandleInfoKHR;
|
|
|
|
typedef struct VkExportMemoryWin32HandleInfoKHR {
|
|
VkStructureType sType;
|
|
const void* pNext;
|
|
const SECURITY_ATTRIBUTES* pAttributes;
|
|
DWORD dwAccess;
|
|
LPCWSTR name;
|
|
} VkExportMemoryWin32HandleInfoKHR;
|
|
|
|
typedef struct VkMemoryWin32HandlePropertiesKHR {
|
|
VkStructureType sType;
|
|
void* pNext;
|
|
uint32_t memoryTypeBits;
|
|
} VkMemoryWin32HandlePropertiesKHR;
|
|
|
|
typedef struct VkMemoryGetWin32HandleInfoKHR {
|
|
VkStructureType sType;
|
|
const void* pNext;
|
|
VkDeviceMemory memory;
|
|
VkExternalMemoryHandleTypeFlagBits handleType;
|
|
} VkMemoryGetWin32HandleInfoKHR;
|
|
|
|
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleKHR)(VkDevice device, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
|
|
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandlePropertiesKHR)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties);
|
|
|
|
#ifndef VK_NO_PROTOTYPES
|
|
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleKHR(
|
|
VkDevice device,
|
|
const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo,
|
|
HANDLE* pHandle);
|
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandlePropertiesKHR(
|
|
VkDevice device,
|
|
VkExternalMemoryHandleTypeFlagBits handleType,
|
|
HANDLE handle,
|
|
VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties);
|
|
#endif
|
|
|
|
|
|
#define VK_KHR_win32_keyed_mutex 1
|
|
#define VK_KHR_WIN32_KEYED_MUTEX_SPEC_VERSION 1
|
|
#define VK_KHR_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_KHR_win32_keyed_mutex"
|
|
typedef struct VkWin32KeyedMutexAcquireReleaseInfoKHR {
|
|
VkStructureType sType;
|
|
const void* pNext;
|
|
uint32_t acquireCount;
|
|
const VkDeviceMemory* pAcquireSyncs;
|
|
const uint64_t* pAcquireKeys;
|
|
const uint32_t* pAcquireTimeouts;
|
|
uint32_t releaseCount;
|
|
const VkDeviceMemory* pReleaseSyncs;
|
|
const uint64_t* pReleaseKeys;
|
|
} VkWin32KeyedMutexAcquireReleaseInfoKHR;
|
|
|
|
|
|
|
|
#define VK_KHR_external_semaphore_win32 1
|
|
#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION 1
|
|
#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME "VK_KHR_external_semaphore_win32"
|
|
typedef struct VkImportSemaphoreWin32HandleInfoKHR {
|
|
VkStructureType sType;
|
|
const void* pNext;
|
|
VkSemaphore semaphore;
|
|
VkSemaphoreImportFlags flags;
|
|
VkExternalSemaphoreHandleTypeFlagBits handleType;
|
|
HANDLE handle;
|
|
LPCWSTR name;
|
|
} VkImportSemaphoreWin32HandleInfoKHR;
|
|
|
|
typedef struct VkExportSemaphoreWin32HandleInfoKHR {
|
|
VkStructureType sType;
|
|
const void* pNext;
|
|
const SECURITY_ATTRIBUTES* pAttributes;
|
|
DWORD dwAccess;
|
|
LPCWSTR name;
|
|
} VkExportSemaphoreWin32HandleInfoKHR;
|
|
|
|
typedef struct VkD3D12FenceSubmitInfoKHR {
|
|
VkStructureType sType;
|
|
const void* pNext;
|
|
uint32_t waitSemaphoreValuesCount;
|
|
const uint64_t* pWaitSemaphoreValues;
|
|
uint32_t signalSemaphoreValuesCount;
|
|
const uint64_t* pSignalSemaphoreValues;
|
|
} VkD3D12FenceSubmitInfoKHR;
|
|
|
|
typedef struct VkSemaphoreGetWin32HandleInfoKHR {
|
|
VkStructureType sType;
|
|
const void* pNext;
|
|
VkSemaphore semaphore;
|
|
VkExternalSemaphoreHandleTypeFlagBits handleType;
|
|
} VkSemaphoreGetWin32HandleInfoKHR;
|
|
|
|
typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreWin32HandleKHR)(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo);
|
|
typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreWin32HandleKHR)(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
|
|
|
|
#ifndef VK_NO_PROTOTYPES
|
|
VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreWin32HandleKHR(
|
|
VkDevice device,
|
|
const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo);
|
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreWin32HandleKHR(
|
|
VkDevice device,
|
|
const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo,
|
|
HANDLE* pHandle);
|
|
#endif
|
|
|
|
|
|
#define VK_KHR_external_fence_win32 1
|
|
#define VK_KHR_EXTERNAL_FENCE_WIN32_SPEC_VERSION 1
|
|
#define VK_KHR_EXTERNAL_FENCE_WIN32_EXTENSION_NAME "VK_KHR_external_fence_win32"
|
|
typedef struct VkImportFenceWin32HandleInfoKHR {
|
|
VkStructureType sType;
|
|
const void* pNext;
|
|
VkFence fence;
|
|
VkFenceImportFlags flags;
|
|
VkExternalFenceHandleTypeFlagBits handleType;
|
|
HANDLE handle;
|
|
LPCWSTR name;
|
|
} VkImportFenceWin32HandleInfoKHR;
|
|
|
|
typedef struct VkExportFenceWin32HandleInfoKHR {
|
|
VkStructureType sType;
|
|
const void* pNext;
|
|
const SECURITY_ATTRIBUTES* pAttributes;
|
|
DWORD dwAccess;
|
|
LPCWSTR name;
|
|
} VkExportFenceWin32HandleInfoKHR;
|
|
|
|
typedef struct VkFenceGetWin32HandleInfoKHR {
|
|
VkStructureType sType;
|
|
const void* pNext;
|
|
VkFence fence;
|
|
VkExternalFenceHandleTypeFlagBits handleType;
|
|
} VkFenceGetWin32HandleInfoKHR;
|
|
|
|
typedef VkResult (VKAPI_PTR *PFN_vkImportFenceWin32HandleKHR)(VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo);
|
|
typedef VkResult (VKAPI_PTR *PFN_vkGetFenceWin32HandleKHR)(VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
|
|
|
|
#ifndef VK_NO_PROTOTYPES
|
|
VKAPI_ATTR VkResult VKAPI_CALL vkImportFenceWin32HandleKHR(
|
|
VkDevice device,
|
|
const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo);
|
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceWin32HandleKHR(
|
|
VkDevice device,
|
|
const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo,
|
|
HANDLE* pHandle);
|
|
#endif
|
|
|
|
|
|
#define VK_NV_external_memory_win32 1
|
|
#define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
|
|
#define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32"
|
|
typedef struct VkImportMemoryWin32HandleInfoNV {
|
|
VkStructureType sType;
|
|
const void* pNext;
|
|
VkExternalMemoryHandleTypeFlagsNV handleType;
|
|
HANDLE handle;
|
|
} VkImportMemoryWin32HandleInfoNV;
|
|
|
|
typedef struct VkExportMemoryWin32HandleInfoNV {
|
|
VkStructureType sType;
|
|
const void* pNext;
|
|
const SECURITY_ATTRIBUTES* pAttributes;
|
|
DWORD dwAccess;
|
|
} VkExportMemoryWin32HandleInfoNV;
|
|
|
|
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleNV)(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle);
|
|
|
|
#ifndef VK_NO_PROTOTYPES
|
|
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleNV(
|
|
VkDevice device,
|
|
VkDeviceMemory memory,
|
|
VkExternalMemoryHandleTypeFlagsNV handleType,
|
|
HANDLE* pHandle);
|
|
#endif
|
|
|
|
|
|
#define VK_NV_win32_keyed_mutex 1
|
|
#define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 2
|
|
#define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex"
|
|
typedef struct VkWin32KeyedMutexAcquireReleaseInfoNV {
|
|
VkStructureType sType;
|
|
const void* pNext;
|
|
uint32_t acquireCount;
|
|
const VkDeviceMemory* pAcquireSyncs;
|
|
const uint64_t* pAcquireKeys;
|
|
const uint32_t* pAcquireTimeoutMilliseconds;
|
|
uint32_t releaseCount;
|
|
const VkDeviceMemory* pReleaseSyncs;
|
|
const uint64_t* pReleaseKeys;
|
|
} VkWin32KeyedMutexAcquireReleaseInfoNV;
|
|
|
|
|
|
|
|
#define VK_EXT_full_screen_exclusive 1
|
|
#define VK_EXT_FULL_SCREEN_EXCLUSIVE_SPEC_VERSION 4
|
|
#define VK_EXT_FULL_SCREEN_EXCLUSIVE_EXTENSION_NAME "VK_EXT_full_screen_exclusive"
|
|
|
|
typedef enum VkFullScreenExclusiveEXT {
|
|
VK_FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT = 0,
|
|
VK_FULL_SCREEN_EXCLUSIVE_ALLOWED_EXT = 1,
|
|
VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT = 2,
|
|
VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT = 3,
|
|
VK_FULL_SCREEN_EXCLUSIVE_MAX_ENUM_EXT = 0x7FFFFFFF
|
|
} VkFullScreenExclusiveEXT;
|
|
typedef struct VkSurfaceFullScreenExclusiveInfoEXT {
|
|
VkStructureType sType;
|
|
void* pNext;
|
|
VkFullScreenExclusiveEXT fullScreenExclusive;
|
|
} VkSurfaceFullScreenExclusiveInfoEXT;
|
|
|
|
typedef struct VkSurfaceCapabilitiesFullScreenExclusiveEXT {
|
|
VkStructureType sType;
|
|
void* pNext;
|
|
VkBool32 fullScreenExclusiveSupported;
|
|
} VkSurfaceCapabilitiesFullScreenExclusiveEXT;
|
|
|
|
typedef struct VkSurfaceFullScreenExclusiveWin32InfoEXT {
|
|
VkStructureType sType;
|
|
const void* pNext;
|
|
HMONITOR hmonitor;
|
|
} VkSurfaceFullScreenExclusiveWin32InfoEXT;
|
|
|
|
typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfacePresentModes2EXT)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes);
|
|
typedef VkResult (VKAPI_PTR *PFN_vkAcquireFullScreenExclusiveModeEXT)(VkDevice device, VkSwapchainKHR swapchain);
|
|
typedef VkResult (VKAPI_PTR *PFN_vkReleaseFullScreenExclusiveModeEXT)(VkDevice device, VkSwapchainKHR swapchain);
|
|
typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupSurfacePresentModes2EXT)(VkDevice device, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkDeviceGroupPresentModeFlagsKHR* pModes);
|
|
|
|
#ifndef VK_NO_PROTOTYPES
|
|
VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModes2EXT(
|
|
VkPhysicalDevice physicalDevice,
|
|
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
|
|
uint32_t* pPresentModeCount,
|
|
VkPresentModeKHR* pPresentModes);
|
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL vkAcquireFullScreenExclusiveModeEXT(
|
|
VkDevice device,
|
|
VkSwapchainKHR swapchain);
|
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL vkReleaseFullScreenExclusiveModeEXT(
|
|
VkDevice device,
|
|
VkSwapchainKHR swapchain);
|
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModes2EXT(
|
|
VkDevice device,
|
|
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
|
|
VkDeviceGroupPresentModeFlagsKHR* pModes);
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|