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
126 lines
4.8 KiB
C
126 lines
4.8 KiB
C
#ifndef VULKAN_ANDROID_H_
|
|
#define VULKAN_ANDROID_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_android_surface 1
|
|
struct ANativeWindow;
|
|
#define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
|
|
#define VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface"
|
|
typedef VkFlags VkAndroidSurfaceCreateFlagsKHR;
|
|
typedef struct VkAndroidSurfaceCreateInfoKHR {
|
|
VkStructureType sType;
|
|
const void* pNext;
|
|
VkAndroidSurfaceCreateFlagsKHR flags;
|
|
struct ANativeWindow* window;
|
|
} VkAndroidSurfaceCreateInfoKHR;
|
|
|
|
typedef VkResult (VKAPI_PTR *PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
|
|
|
#ifndef VK_NO_PROTOTYPES
|
|
VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR(
|
|
VkInstance instance,
|
|
const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
|
|
const VkAllocationCallbacks* pAllocator,
|
|
VkSurfaceKHR* pSurface);
|
|
#endif
|
|
|
|
|
|
#define VK_ANDROID_external_memory_android_hardware_buffer 1
|
|
struct AHardwareBuffer;
|
|
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 5
|
|
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME "VK_ANDROID_external_memory_android_hardware_buffer"
|
|
typedef struct VkAndroidHardwareBufferUsageANDROID {
|
|
VkStructureType sType;
|
|
void* pNext;
|
|
uint64_t androidHardwareBufferUsage;
|
|
} VkAndroidHardwareBufferUsageANDROID;
|
|
|
|
typedef struct VkAndroidHardwareBufferPropertiesANDROID {
|
|
VkStructureType sType;
|
|
void* pNext;
|
|
VkDeviceSize allocationSize;
|
|
uint32_t memoryTypeBits;
|
|
} VkAndroidHardwareBufferPropertiesANDROID;
|
|
|
|
typedef struct VkAndroidHardwareBufferFormatPropertiesANDROID {
|
|
VkStructureType sType;
|
|
void* pNext;
|
|
VkFormat format;
|
|
uint64_t externalFormat;
|
|
VkFormatFeatureFlags formatFeatures;
|
|
VkComponentMapping samplerYcbcrConversionComponents;
|
|
VkSamplerYcbcrModelConversion suggestedYcbcrModel;
|
|
VkSamplerYcbcrRange suggestedYcbcrRange;
|
|
VkChromaLocation suggestedXChromaOffset;
|
|
VkChromaLocation suggestedYChromaOffset;
|
|
} VkAndroidHardwareBufferFormatPropertiesANDROID;
|
|
|
|
typedef struct VkImportAndroidHardwareBufferInfoANDROID {
|
|
VkStructureType sType;
|
|
const void* pNext;
|
|
struct AHardwareBuffer* buffer;
|
|
} VkImportAndroidHardwareBufferInfoANDROID;
|
|
|
|
typedef struct VkMemoryGetAndroidHardwareBufferInfoANDROID {
|
|
VkStructureType sType;
|
|
const void* pNext;
|
|
VkDeviceMemory memory;
|
|
} VkMemoryGetAndroidHardwareBufferInfoANDROID;
|
|
|
|
typedef struct VkExternalFormatANDROID {
|
|
VkStructureType sType;
|
|
void* pNext;
|
|
uint64_t externalFormat;
|
|
} VkExternalFormatANDROID;
|
|
|
|
typedef struct VkAndroidHardwareBufferFormatProperties2ANDROID {
|
|
VkStructureType sType;
|
|
void* pNext;
|
|
VkFormat format;
|
|
uint64_t externalFormat;
|
|
VkFormatFeatureFlags2 formatFeatures;
|
|
VkComponentMapping samplerYcbcrConversionComponents;
|
|
VkSamplerYcbcrModelConversion suggestedYcbcrModel;
|
|
VkSamplerYcbcrRange suggestedYcbcrRange;
|
|
VkChromaLocation suggestedXChromaOffset;
|
|
VkChromaLocation suggestedYChromaOffset;
|
|
} VkAndroidHardwareBufferFormatProperties2ANDROID;
|
|
|
|
typedef VkResult (VKAPI_PTR *PFN_vkGetAndroidHardwareBufferPropertiesANDROID)(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties);
|
|
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryAndroidHardwareBufferANDROID)(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer);
|
|
|
|
#ifndef VK_NO_PROTOTYPES
|
|
VKAPI_ATTR VkResult VKAPI_CALL vkGetAndroidHardwareBufferPropertiesANDROID(
|
|
VkDevice device,
|
|
const struct AHardwareBuffer* buffer,
|
|
VkAndroidHardwareBufferPropertiesANDROID* pProperties);
|
|
|
|
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryAndroidHardwareBufferANDROID(
|
|
VkDevice device,
|
|
const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo,
|
|
struct AHardwareBuffer** pBuffer);
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|