comparison src/vulkan.nim @ 463:91544fc1afe5

did: hello world triangle, a bit of code organization
author Sam <sam@basx.dev>
date Mon, 19 Dec 2022 10:41:20 +0700
parents 0bc8643cfe25
children af9183acb173
comparison
equal deleted inserted replaced
462:0bc8643cfe25 463:91544fc1afe5
89 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 4 89 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 4
90 VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 5 90 VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 5
91 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 6 91 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 6
92 VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 7 92 VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 7
93 VK_IMAGE_LAYOUT_PREINITIALIZED = 8 93 VK_IMAGE_LAYOUT_PREINITIALIZED = 8
94 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
94 VkAttachmentLoadOp* {.size: int32.sizeof.} = enum 95 VkAttachmentLoadOp* {.size: int32.sizeof.} = enum
95 VK_ATTACHMENT_LOAD_OP_LOAD = 0 96 VK_ATTACHMENT_LOAD_OP_LOAD = 0
96 VK_ATTACHMENT_LOAD_OP_CLEAR = 1 97 VK_ATTACHMENT_LOAD_OP_CLEAR = 1
97 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 2 98 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 2
98 VkAttachmentStoreOp* {.size: int32.sizeof.} = enum 99 VkAttachmentStoreOp* {.size: int32.sizeof.} = enum
506 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45 507 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45
507 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46 508 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46
508 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47 509 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47
509 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48 510 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48
510 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000 # added by sam 511 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000 # added by sam
512 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001 # added by sam
511 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000 # added by sam 513 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000 # added by sam
514 VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT = 1000128004 # added by sam
512 VkSubpassContents* {.size: int32.sizeof.} = enum 515 VkSubpassContents* {.size: int32.sizeof.} = enum
513 VK_SUBPASS_CONTENTS_INLINE = 0 516 VK_SUBPASS_CONTENTS_INLINE = 0
514 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 1 517 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 1
515 VkResult* {.size: int32.sizeof.} = enum 518 VkResult* {.size: int32.sizeof.} = enum
516 VK_ERROR_UNKNOWN = -13 519 VK_ERROR_UNKNOWN = -13
10633 # Load VK_MVK_macos_surface 10636 # Load VK_MVK_macos_surface
10634 proc loadVK_MVK_macos_surface*() = 10637 proc loadVK_MVK_macos_surface*() =
10635 vkCreateMacOSSurfaceMVK = cast[proc(instance: VkInstance, pCreateInfo: ptr VkMacOSSurfaceCreateInfoMVK , pAllocator: ptr VkAllocationCallbacks , pSurface: ptr VkSurfaceKHR ): VkResult {.stdcall.}](vkGetProc("vkCreateMacOSSurfaceMVK")) 10638 vkCreateMacOSSurfaceMVK = cast[proc(instance: VkInstance, pCreateInfo: ptr VkMacOSSurfaceCreateInfoMVK , pAllocator: ptr VkAllocationCallbacks , pSurface: ptr VkSurfaceKHR ): VkResult {.stdcall.}](vkGetProc("vkCreateMacOSSurfaceMVK"))
10636 10639
10637 # Load VK_EXT_debug_utils 10640 # Load VK_EXT_debug_utils
10638 proc loadVK_EXT_debug_utils*() = 10641 proc loadVK_EXT_debug_utils*(instance: VkInstance) =
10639 vkSetDebugUtilsObjectNameEXT = cast[proc(device: VkDevice, pNameInfo: ptr VkDebugUtilsObjectNameInfoEXT ): VkResult {.stdcall.}](vkGetProc("vkSetDebugUtilsObjectNameEXT")) 10642 vkSetDebugUtilsObjectNameEXT = cast[proc(device: VkDevice, pNameInfo: ptr VkDebugUtilsObjectNameInfoEXT ): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkSetDebugUtilsObjectNameEXT"))
10640 vkSetDebugUtilsObjectTagEXT = cast[proc(device: VkDevice, pTagInfo: ptr VkDebugUtilsObjectTagInfoEXT ): VkResult {.stdcall.}](vkGetProc("vkSetDebugUtilsObjectTagEXT")) 10643 vkSetDebugUtilsObjectTagEXT = cast[proc(device: VkDevice, pTagInfo: ptr VkDebugUtilsObjectTagInfoEXT ): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkSetDebugUtilsObjectTagEXT"))
10641 vkQueueBeginDebugUtilsLabelEXT = cast[proc(queue: VkQueue, pLabelInfo: ptr VkDebugUtilsLabelEXT ): void {.stdcall.}](vkGetProc("vkQueueBeginDebugUtilsLabelEXT")) 10644 vkQueueBeginDebugUtilsLabelEXT = cast[proc(queue: VkQueue, pLabelInfo: ptr VkDebugUtilsLabelEXT ): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkQueueBeginDebugUtilsLabelEXT"))
10642 vkQueueEndDebugUtilsLabelEXT = cast[proc(queue: VkQueue): void {.stdcall.}](vkGetProc("vkQueueEndDebugUtilsLabelEXT")) 10645 vkQueueEndDebugUtilsLabelEXT = cast[proc(queue: VkQueue): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkQueueEndDebugUtilsLabelEXT"))
10643 vkQueueInsertDebugUtilsLabelEXT = cast[proc(queue: VkQueue, pLabelInfo: ptr VkDebugUtilsLabelEXT ): void {.stdcall.}](vkGetProc("vkQueueInsertDebugUtilsLabelEXT")) 10646 vkQueueInsertDebugUtilsLabelEXT = cast[proc(queue: VkQueue, pLabelInfo: ptr VkDebugUtilsLabelEXT ): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkQueueInsertDebugUtilsLabelEXT"))
10644 vkCmdBeginDebugUtilsLabelEXT = cast[proc(commandBuffer: VkCommandBuffer, pLabelInfo: ptr VkDebugUtilsLabelEXT ): void {.stdcall.}](vkGetProc("vkCmdBeginDebugUtilsLabelEXT")) 10647 vkCmdBeginDebugUtilsLabelEXT = cast[proc(commandBuffer: VkCommandBuffer, pLabelInfo: ptr VkDebugUtilsLabelEXT ): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCmdBeginDebugUtilsLabelEXT"))
10645 vkCmdEndDebugUtilsLabelEXT = cast[proc(commandBuffer: VkCommandBuffer): void {.stdcall.}](vkGetProc("vkCmdEndDebugUtilsLabelEXT")) 10648 vkCmdEndDebugUtilsLabelEXT = cast[proc(commandBuffer: VkCommandBuffer): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCmdEndDebugUtilsLabelEXT"))
10646 vkCmdInsertDebugUtilsLabelEXT = cast[proc(commandBuffer: VkCommandBuffer, pLabelInfo: ptr VkDebugUtilsLabelEXT ): void {.stdcall.}](vkGetProc("vkCmdInsertDebugUtilsLabelEXT")) 10649 vkCmdInsertDebugUtilsLabelEXT = cast[proc(commandBuffer: VkCommandBuffer, pLabelInfo: ptr VkDebugUtilsLabelEXT ): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCmdInsertDebugUtilsLabelEXT"))
10647 vkCreateDebugUtilsMessengerEXT = cast[proc(instance: VkInstance, pCreateInfo: ptr VkDebugUtilsMessengerCreateInfoEXT , pAllocator: ptr VkAllocationCallbacks , pMessenger: ptr VkDebugUtilsMessengerEXT ): VkResult {.stdcall.}](vkGetProc("vkCreateDebugUtilsMessengerEXT")) 10650 vkCreateDebugUtilsMessengerEXT = cast[proc(instance: VkInstance, pCreateInfo: ptr VkDebugUtilsMessengerCreateInfoEXT , pAllocator: ptr VkAllocationCallbacks , pMessenger: ptr VkDebugUtilsMessengerEXT ): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCreateDebugUtilsMessengerEXT"))
10648 vkDestroyDebugUtilsMessengerEXT = cast[proc(instance: VkInstance, messenger: VkDebugUtilsMessengerEXT, pAllocator: ptr VkAllocationCallbacks ): void {.stdcall.}](vkGetProc("vkDestroyDebugUtilsMessengerEXT")) 10651 vkDestroyDebugUtilsMessengerEXT = cast[proc(instance: VkInstance, messenger: VkDebugUtilsMessengerEXT, pAllocator: ptr VkAllocationCallbacks ): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkDestroyDebugUtilsMessengerEXT"))
10649 vkSubmitDebugUtilsMessageEXT = cast[proc(instance: VkInstance, messageSeverity: VkDebugUtilsMessageSeverityFlagBitsEXT, messageTypes: VkDebugUtilsMessageTypeFlagsEXT, pCallbackData: ptr VkDebugUtilsMessengerCallbackDataEXT ): void {.stdcall.}](vkGetProc("vkSubmitDebugUtilsMessageEXT")) 10652 vkSubmitDebugUtilsMessageEXT = cast[proc(instance: VkInstance, messageSeverity: VkDebugUtilsMessageSeverityFlagBitsEXT, messageTypes: VkDebugUtilsMessageTypeFlagsEXT, pCallbackData: ptr VkDebugUtilsMessengerCallbackDataEXT ): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkSubmitDebugUtilsMessageEXT"))
10650 10653
10651 # Load VK_ANDROID_external_memory_android_hardware_buffer 10654 # Load VK_ANDROID_external_memory_android_hardware_buffer
10652 proc loadVK_ANDROID_external_memory_android_hardware_buffer*() = 10655 proc loadVK_ANDROID_external_memory_android_hardware_buffer*() =
10653 vkGetAndroidHardwareBufferPropertiesANDROID = cast[proc(device: VkDevice, buffer: ptr AHardwareBuffer , pProperties: ptr VkAndroidHardwareBufferPropertiesANDROID ): VkResult {.stdcall.}](vkGetProc("vkGetAndroidHardwareBufferPropertiesANDROID")) 10656 vkGetAndroidHardwareBufferPropertiesANDROID = cast[proc(device: VkDevice, buffer: ptr AHardwareBuffer , pProperties: ptr VkAndroidHardwareBufferPropertiesANDROID ): VkResult {.stdcall.}](vkGetProc("vkGetAndroidHardwareBufferPropertiesANDROID"))
10654 vkGetMemoryAndroidHardwareBufferANDROID = cast[proc(device: VkDevice, pInfo: ptr VkMemoryGetAndroidHardwareBufferInfoANDROID , pBuffer: ptr ptr AHardwareBuffer ): VkResult {.stdcall.}](vkGetProc("vkGetMemoryAndroidHardwareBufferANDROID")) 10657 vkGetMemoryAndroidHardwareBufferANDROID = cast[proc(device: VkDevice, pInfo: ptr VkMemoryGetAndroidHardwareBufferInfoANDROID , pBuffer: ptr ptr AHardwareBuffer ): VkResult {.stdcall.}](vkGetProc("vkGetMemoryAndroidHardwareBufferANDROID"))