Skip to content

Commit

Permalink
define ext macros
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Nov 7, 2023
1 parent 8af5770 commit 06ba175
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 56 deletions.
14 changes: 9 additions & 5 deletions src/simplevk.h
Original file line number Diff line number Diff line change
Expand Up @@ -2037,7 +2037,8 @@ typedef void(VKAPI_PTR* PFN_vkUnmapMemory)(VkDevice device, VkDeviceMemory memor
typedef void(VKAPI_PTR* PFN_vkUpdateDescriptorSets)(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies);
typedef VkResult(VKAPI_PTR* PFN_vkWaitForFences)(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout);

// VK_KHR_surface
#ifndef VK_KHR_surface
#define VK_KHR_surface 1
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR)
#define VK_COLORSPACE_SRGB_NONLINEAR_KHR VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
typedef enum VkColorSpaceKHR
Expand Down Expand Up @@ -2115,8 +2116,10 @@ typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysical
typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities);
typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats);
typedef VkResult(VKAPI_PTR* PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes);
#endif // VK_KHR_surface

// VK_KHR_swapchain
#ifndef VK_KHR_swapchain
#define VK_KHR_swapchain 1
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR)
typedef enum VkSwapchainCreateFlagBitsKHR
{
Expand Down Expand Up @@ -2161,9 +2164,10 @@ typedef void(VKAPI_PTR* PFN_vkDestroySwapchainKHR)(VkDevice device, VkSwapchainK
typedef VkResult(VKAPI_PTR* PFN_vkGetSwapchainImagesKHR)(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages);
typedef VkResult(VKAPI_PTR* PFN_vkAcquireNextImageKHR)(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex);
typedef VkResult(VKAPI_PTR* PFN_vkQueuePresentKHR)(VkQueue queue, const VkPresentInfoKHR* pPresentInfo);
#endif // VK_KHR_swapchain

#ifdef VK_USE_PLATFORM_ANDROID_KHR
// VK_KHR_android_surface
#ifndef VK_KHR_android_surface
#define VK_KHR_android_surface 1
struct ANativeWindow;
typedef VkFlags VkAndroidSurfaceCreateFlagsKHR;
typedef struct VkAndroidSurfaceCreateInfoKHR
Expand All @@ -2174,7 +2178,7 @@ typedef struct VkAndroidSurfaceCreateInfoKHR
struct ANativeWindow* window;
} VkAndroidSurfaceCreateInfoKHR;
typedef VkResult(VKAPI_PTR* PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#endif /* VK_USE_PLATFORM_ANDROID_KHR */
#endif // VK_KHR_android_surface

namespace ncnn {

Expand Down
Loading

0 comments on commit 06ba175

Please sign in to comment.