Mercurial > games > semicongine
annotate semicongine/rendering/vulkan/platform/win32.nim @ 1207:804ff842d377 compiletime-tests
fix: problems with include-structure on windows
author | sam@sambook-windows.localdomain |
---|---|
date | Tue, 16 Jul 2024 15:56:55 +0700 |
parents | ba1af13233ee |
children |
rev | line source |
---|---|
1199 | 1 type |
2 VkWin32SurfaceCreateInfoKHR* = object | |
3 sType*: VkStructureType | |
4 pNext*: pointer | |
5 flags*: VkWin32SurfaceCreateFlagsKHR | |
6 hinstance*: HINSTANCE | |
7 hwnd*: HWND | |
8 VkImportMemoryWin32HandleInfoNV* = object | |
9 sType*: VkStructureType | |
10 pNext*: pointer | |
11 handleType*: VkExternalMemoryHandleTypeFlagsNV | |
12 handle*: HANDLE | |
13 VkExportMemoryWin32HandleInfoNV* = object | |
14 sType*: VkStructureType | |
15 pNext*: pointer | |
16 pAttributes*: ptr SECURITY_ATTRIBUTES | |
17 dwAccess*: DWORD | |
18 VkWin32KeyedMutexAcquireReleaseInfoNV* = object | |
19 sType*: VkStructureType | |
20 pNext*: pointer | |
21 acquireCount*: uint32 | |
22 pAcquireSyncs*: ptr VkDeviceMemory | |
23 pAcquireKeys*: ptr uint64 | |
24 pAcquireTimeoutMilliseconds*: ptr uint32 | |
25 releaseCount*: uint32 | |
26 pReleaseSyncs*: ptr VkDeviceMemory | |
27 pReleaseKeys*: ptr uint64 | |
28 VkImportMemoryWin32HandleInfoKHR* = object | |
29 sType*: VkStructureType | |
30 pNext*: pointer | |
31 handleType*: VkExternalMemoryHandleTypeFlagBits | |
32 handle*: HANDLE | |
33 name*: LPCWSTR | |
34 VkExportMemoryWin32HandleInfoKHR* = object | |
35 sType*: VkStructureType | |
36 pNext*: pointer | |
37 pAttributes*: ptr SECURITY_ATTRIBUTES | |
38 dwAccess*: DWORD | |
39 name*: LPCWSTR | |
40 VkMemoryWin32HandlePropertiesKHR* = object | |
41 sType*: VkStructureType | |
42 pNext*: pointer | |
43 memoryTypeBits*: uint32 | |
44 VkMemoryGetWin32HandleInfoKHR* = object | |
45 sType*: VkStructureType | |
46 pNext*: pointer | |
47 memory*: VkDeviceMemory | |
48 handleType*: VkExternalMemoryHandleTypeFlagBits | |
49 VkWin32KeyedMutexAcquireReleaseInfoKHR* = object | |
50 sType*: VkStructureType | |
51 pNext*: pointer | |
52 acquireCount*: uint32 | |
53 pAcquireSyncs*: ptr VkDeviceMemory | |
54 pAcquireKeys*: ptr uint64 | |
55 pAcquireTimeouts*: ptr uint32 | |
56 releaseCount*: uint32 | |
57 pReleaseSyncs*: ptr VkDeviceMemory | |
58 pReleaseKeys*: ptr uint64 | |
59 VkImportSemaphoreWin32HandleInfoKHR* = object | |
60 sType*: VkStructureType | |
61 pNext*: pointer | |
62 semaphore*: VkSemaphore | |
63 flags*: VkSemaphoreImportFlags | |
64 handleType*: VkExternalSemaphoreHandleTypeFlagBits | |
65 handle*: HANDLE | |
66 name*: LPCWSTR | |
67 VkExportSemaphoreWin32HandleInfoKHR* = object | |
68 sType*: VkStructureType | |
69 pNext*: pointer | |
70 pAttributes*: ptr SECURITY_ATTRIBUTES | |
71 dwAccess*: DWORD | |
72 name*: LPCWSTR | |
73 VkD3D12FenceSubmitInfoKHR* = object | |
74 sType*: VkStructureType | |
75 pNext*: pointer | |
76 waitSemaphoreValuesCount*: uint32 | |
77 pWaitSemaphoreValues*: ptr uint64 | |
78 signalSemaphoreValuesCount*: uint32 | |
79 pSignalSemaphoreValues*: ptr uint64 | |
80 VkSemaphoreGetWin32HandleInfoKHR* = object | |
81 sType*: VkStructureType | |
82 pNext*: pointer | |
83 semaphore*: VkSemaphore | |
84 handleType*: VkExternalSemaphoreHandleTypeFlagBits | |
85 VkImportFenceWin32HandleInfoKHR* = object | |
86 sType*: VkStructureType | |
87 pNext*: pointer | |
88 fence*: VkFence | |
89 flags*: VkFenceImportFlags | |
90 handleType*: VkExternalFenceHandleTypeFlagBits | |
91 handle*: HANDLE | |
92 name*: LPCWSTR | |
93 VkExportFenceWin32HandleInfoKHR* = object | |
94 sType*: VkStructureType | |
95 pNext*: pointer | |
96 pAttributes*: ptr SECURITY_ATTRIBUTES | |
97 dwAccess*: DWORD | |
98 name*: LPCWSTR | |
99 VkFenceGetWin32HandleInfoKHR* = object | |
100 sType*: VkStructureType | |
101 pNext*: pointer | |
102 fence*: VkFence | |
103 handleType*: VkExternalFenceHandleTypeFlagBits | |
104 VkSurfaceFullScreenExclusiveInfoEXT* = object | |
105 sType*: VkStructureType | |
106 pNext*: pointer | |
107 fullScreenExclusive*: VkFullScreenExclusiveEXT | |
108 VkSurfaceFullScreenExclusiveWin32InfoEXT* = object | |
109 sType*: VkStructureType | |
110 pNext*: pointer | |
111 hmonitor*: HMONITOR | |
112 VkSurfaceCapabilitiesFullScreenExclusiveEXT* = object | |
113 sType*: VkStructureType | |
114 pNext*: pointer | |
115 fullScreenExclusiveSupported*: VkBool32 | |
1207
804ff842d377
fix: problems with include-structure on windows
sam@sambook-windows.localdomain
parents:
1199
diff
changeset
|
116 HINSTANCE {.header: "windows.h".} = int |
804ff842d377
fix: problems with include-structure on windows
sam@sambook-windows.localdomain
parents:
1199
diff
changeset
|
117 HWND {.header: "windows.h".} = int |
804ff842d377
fix: problems with include-structure on windows
sam@sambook-windows.localdomain
parents:
1199
diff
changeset
|
118 HMONITOR {.header: "windows.h".} = int |
804ff842d377
fix: problems with include-structure on windows
sam@sambook-windows.localdomain
parents:
1199
diff
changeset
|
119 HANDLE {.header: "windows.h".} = int |
804ff842d377
fix: problems with include-structure on windows
sam@sambook-windows.localdomain
parents:
1199
diff
changeset
|
120 SECURITY_ATTRIBUTES {.header: "windows.h".} = object |
804ff842d377
fix: problems with include-structure on windows
sam@sambook-windows.localdomain
parents:
1199
diff
changeset
|
121 DWORD {.header: "windows.h".} = int32 |
804ff842d377
fix: problems with include-structure on windows
sam@sambook-windows.localdomain
parents:
1199
diff
changeset
|
122 LPCWSTR {.header: "windows.h".} = ptr uint16 |
1199 | 123 # extension VK_KHR_external_semaphore_win32 |
124 var | |
125 vkImportSemaphoreWin32HandleKHR*: proc(device: VkDevice, pImportSemaphoreWin32HandleInfo: ptr VkImportSemaphoreWin32HandleInfoKHR): VkResult {.stdcall.} | |
126 vkGetSemaphoreWin32HandleKHR*: proc(device: VkDevice, pGetWin32HandleInfo: ptr VkSemaphoreGetWin32HandleInfoKHR, pHandle: ptr HANDLE): VkResult {.stdcall.} | |
127 proc loadVK_KHR_external_semaphore_win32*(instance: VkInstance) = | |
128 loadVK_VERSION_1_1(instance) | |
129 vkImportSemaphoreWin32HandleKHR = cast[proc(device: VkDevice, pImportSemaphoreWin32HandleInfo: ptr VkImportSemaphoreWin32HandleInfoKHR): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkImportSemaphoreWin32HandleKHR")) | |
130 vkGetSemaphoreWin32HandleKHR = cast[proc(device: VkDevice, pGetWin32HandleInfo: ptr VkSemaphoreGetWin32HandleInfoKHR, pHandle: ptr HANDLE): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkGetSemaphoreWin32HandleKHR")) | |
131 | |
132 # extension VK_KHR_external_memory_win32 | |
133 var | |
134 vkGetMemoryWin32HandleKHR*: proc(device: VkDevice, pGetWin32HandleInfo: ptr VkMemoryGetWin32HandleInfoKHR, pHandle: ptr HANDLE): VkResult {.stdcall.} | |
135 vkGetMemoryWin32HandlePropertiesKHR*: proc(device: VkDevice, handleType: VkExternalMemoryHandleTypeFlagBits, handle: HANDLE, pMemoryWin32HandleProperties: ptr VkMemoryWin32HandlePropertiesKHR): VkResult {.stdcall.} | |
136 proc loadVK_KHR_external_memory_win32*(instance: VkInstance) = | |
137 loadVK_VERSION_1_1(instance) | |
138 vkGetMemoryWin32HandleKHR = cast[proc(device: VkDevice, pGetWin32HandleInfo: ptr VkMemoryGetWin32HandleInfoKHR, pHandle: ptr HANDLE): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkGetMemoryWin32HandleKHR")) | |
139 vkGetMemoryWin32HandlePropertiesKHR = cast[proc(device: VkDevice, handleType: VkExternalMemoryHandleTypeFlagBits, handle: HANDLE, pMemoryWin32HandleProperties: ptr VkMemoryWin32HandlePropertiesKHR): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkGetMemoryWin32HandlePropertiesKHR")) | |
140 | |
141 # extension VK_KHR_external_fence_win32 | |
142 var | |
143 vkImportFenceWin32HandleKHR*: proc(device: VkDevice, pImportFenceWin32HandleInfo: ptr VkImportFenceWin32HandleInfoKHR): VkResult {.stdcall.} | |
144 vkGetFenceWin32HandleKHR*: proc(device: VkDevice, pGetWin32HandleInfo: ptr VkFenceGetWin32HandleInfoKHR, pHandle: ptr HANDLE): VkResult {.stdcall.} | |
145 proc loadVK_KHR_external_fence_win32*(instance: VkInstance) = | |
146 loadVK_VERSION_1_1(instance) | |
147 vkImportFenceWin32HandleKHR = cast[proc(device: VkDevice, pImportFenceWin32HandleInfo: ptr VkImportFenceWin32HandleInfoKHR): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkImportFenceWin32HandleKHR")) | |
148 vkGetFenceWin32HandleKHR = cast[proc(device: VkDevice, pGetWin32HandleInfo: ptr VkFenceGetWin32HandleInfoKHR, pHandle: ptr HANDLE): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkGetFenceWin32HandleKHR")) | |
149 | |
150 proc loadVK_KHR_win32_keyed_mutex*(instance: VkInstance) = | |
151 loadVK_KHR_external_memory_win32(instance) | |
152 | |
153 # extension VK_NV_external_memory_win32 | |
154 var | |
155 vkGetMemoryWin32HandleNV*: proc(device: VkDevice, memory: VkDeviceMemory, handleType: VkExternalMemoryHandleTypeFlagsNV, pHandle: ptr HANDLE): VkResult {.stdcall.} | |
156 proc loadVK_NV_external_memory_win32*(instance: VkInstance) = | |
157 loadVK_NV_external_memory(instance) | |
158 vkGetMemoryWin32HandleNV = cast[proc(device: VkDevice, memory: VkDeviceMemory, handleType: VkExternalMemoryHandleTypeFlagsNV, pHandle: ptr HANDLE): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkGetMemoryWin32HandleNV")) | |
159 | |
160 # extension VK_EXT_full_screen_exclusive | |
161 var | |
162 vkGetPhysicalDeviceSurfacePresentModes2EXT*: proc(physicalDevice: VkPhysicalDevice, pSurfaceInfo: ptr VkPhysicalDeviceSurfaceInfo2KHR, pPresentModeCount: ptr uint32, pPresentModes: ptr VkPresentModeKHR): VkResult {.stdcall.} | |
163 vkAcquireFullScreenExclusiveModeEXT*: proc(device: VkDevice, swapchain: VkSwapchainKHR): VkResult {.stdcall.} | |
164 vkReleaseFullScreenExclusiveModeEXT*: proc(device: VkDevice, swapchain: VkSwapchainKHR): VkResult {.stdcall.} | |
165 vkGetDeviceGroupSurfacePresentModes2EXT*: proc(device: VkDevice, pSurfaceInfo: ptr VkPhysicalDeviceSurfaceInfo2KHR, pModes: ptr VkDeviceGroupPresentModeFlagsKHR): VkResult {.stdcall.} | |
166 proc loadVK_EXT_full_screen_exclusive*(instance: VkInstance) = | |
167 loadVK_VERSION_1_1(instance) | |
168 loadVK_KHR_surface(instance) | |
169 loadVK_KHR_get_surface_capabilities2(instance) | |
170 loadVK_KHR_swapchain(instance) | |
171 vkGetPhysicalDeviceSurfacePresentModes2EXT = cast[proc(physicalDevice: VkPhysicalDevice, pSurfaceInfo: ptr VkPhysicalDeviceSurfaceInfo2KHR, pPresentModeCount: ptr uint32, pPresentModes: ptr VkPresentModeKHR): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceSurfacePresentModes2EXT")) | |
172 vkAcquireFullScreenExclusiveModeEXT = cast[proc(device: VkDevice, swapchain: VkSwapchainKHR): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkAcquireFullScreenExclusiveModeEXT")) | |
173 vkReleaseFullScreenExclusiveModeEXT = cast[proc(device: VkDevice, swapchain: VkSwapchainKHR): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkReleaseFullScreenExclusiveModeEXT")) | |
174 vkGetDeviceGroupSurfacePresentModes2EXT = cast[proc(device: VkDevice, pSurfaceInfo: ptr VkPhysicalDeviceSurfaceInfo2KHR, pModes: ptr VkDeviceGroupPresentModeFlagsKHR): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkGetDeviceGroupSurfacePresentModes2EXT")) | |
175 vkGetDeviceGroupSurfacePresentModes2EXT = cast[proc(device: VkDevice, pSurfaceInfo: ptr VkPhysicalDeviceSurfaceInfo2KHR, pModes: ptr VkDeviceGroupPresentModeFlagsKHR): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkGetDeviceGroupSurfacePresentModes2EXT")) | |
176 | |
177 # extension VK_KHR_win32_surface | |
178 var | |
179 vkCreateWin32SurfaceKHR*: proc(instance: VkInstance, pCreateInfo: ptr VkWin32SurfaceCreateInfoKHR, pAllocator: ptr VkAllocationCallbacks, pSurface: ptr VkSurfaceKHR): VkResult {.stdcall.} | |
180 vkGetPhysicalDeviceWin32PresentationSupportKHR*: proc(physicalDevice: VkPhysicalDevice, queueFamilyIndex: uint32): VkBool32 {.stdcall.} | |
181 proc loadVK_KHR_win32_surface*(instance: VkInstance) = | |
182 loadVK_KHR_surface(instance) | |
183 vkCreateWin32SurfaceKHR = cast[proc(instance: VkInstance, pCreateInfo: ptr VkWin32SurfaceCreateInfoKHR, pAllocator: ptr VkAllocationCallbacks, pSurface: ptr VkSurfaceKHR): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCreateWin32SurfaceKHR")) | |
184 vkGetPhysicalDeviceWin32PresentationSupportKHR = cast[proc(physicalDevice: VkPhysicalDevice, queueFamilyIndex: uint32): VkBool32 {.stdcall.}](vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceWin32PresentationSupportKHR")) | |
185 | |
186 # extension VK_NV_acquire_winrt_display | |
187 var | |
188 vkAcquireWinrtDisplayNV*: proc(physicalDevice: VkPhysicalDevice, display: VkDisplayKHR): VkResult {.stdcall.} | |
189 vkGetWinrtDisplayNV*: proc(physicalDevice: VkPhysicalDevice, deviceRelativeId: uint32, pDisplay: ptr VkDisplayKHR): VkResult {.stdcall.} | |
190 proc loadVK_NV_acquire_winrt_display*(instance: VkInstance) = | |
191 loadVK_EXT_direct_mode_display(instance) | |
192 vkAcquireWinrtDisplayNV = cast[proc(physicalDevice: VkPhysicalDevice, display: VkDisplayKHR): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkAcquireWinrtDisplayNV")) | |
193 vkGetWinrtDisplayNV = cast[proc(physicalDevice: VkPhysicalDevice, deviceRelativeId: uint32, pDisplay: ptr VkDisplayKHR): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkGetWinrtDisplayNV")) |