| Courtney Goeltzenleuchter | 89e99e6 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 1 | /* Need to define dispatch table | 
|  | 2 | * Core struct can then have ptr to dispatch table at the top | 
|  | 3 | * Along with object ptrs for current and next OBJ | 
|  | 4 | */ | 
|  | 5 | #pragma once | 
|  | 6 |  | 
|  | 7 | #include "vulkan.h" | 
| Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 8 | #include "vk_debug_report_lunarg.h" | 
|  | 9 | #include "vk_debug_marker_lunarg.h" | 
|  | 10 | #include "vk_wsi_lunarg.h" | 
| Chia-I Wu | 5b66aa5 | 2015-04-16 22:02:10 +0800 | [diff] [blame] | 11 | #include "vk_wsi_lunarg.h" | 
| Courtney Goeltzenleuchter | 89e99e6 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 12 | #if defined(__GNUC__) && __GNUC__ >= 4 | 
|  | 13 | #  define VK_LAYER_EXPORT __attribute__((visibility("default"))) | 
|  | 14 | #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) | 
|  | 15 | #  define VK_LAYER_EXPORT __attribute__((visibility("default"))) | 
|  | 16 | #else | 
|  | 17 | #  define VK_LAYER_EXPORT | 
|  | 18 | #endif | 
|  | 19 |  | 
|  | 20 |  | 
| Jon Ashburn | 79b78ac | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 21 | typedef void * (*PFN_vkGPA)(VkObject obj, const char * pName); | 
| Jon Ashburn | 301c5f0 | 2015-04-06 10:58:22 -0600 | [diff] [blame] | 22 | typedef struct VkBaseLayerObject_ | 
| Courtney Goeltzenleuchter | 89e99e6 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 23 | { | 
| Jon Ashburn | 79b78ac | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 24 | PFN_vkGPA pGPA; | 
| Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 25 | VkObject nextObject; | 
|  | 26 | VkObject baseObject; | 
| Jon Ashburn | 301c5f0 | 2015-04-06 10:58:22 -0600 | [diff] [blame] | 27 | } VkBaseLayerObject; | 
| Courtney Goeltzenleuchter | 89e99e6 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 28 |  | 
| Jon Ashburn | 301c5f0 | 2015-04-06 10:58:22 -0600 | [diff] [blame] | 29 | typedef struct VkLayerDispatchTable_ | 
| Courtney Goeltzenleuchter | 89e99e6 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 30 | { | 
| Jon Ashburn | 1245cec | 2015-05-18 13:20:15 -0600 | [diff] [blame] | 31 | PFN_vkGetDeviceProcAddr GetDeviceProcAddr; | 
| Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 32 | PFN_vkDestroyDevice DestroyDevice; | 
| Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 33 | PFN_vkGetDeviceQueue GetDeviceQueue; | 
|  | 34 | PFN_vkQueueSubmit QueueSubmit; | 
| Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 35 | PFN_vkQueueWaitIdle QueueWaitIdle; | 
|  | 36 | PFN_vkDeviceWaitIdle DeviceWaitIdle; | 
|  | 37 | PFN_vkAllocMemory AllocMemory; | 
|  | 38 | PFN_vkFreeMemory FreeMemory; | 
| Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 39 | PFN_vkMapMemory MapMemory; | 
|  | 40 | PFN_vkUnmapMemory UnmapMemory; | 
| Courtney Goeltzenleuchter | a569a50 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 41 | PFN_vkFlushMappedMemoryRanges FlushMappedMemoryRanges; | 
|  | 42 | PFN_vkInvalidateMappedMemoryRanges InvalidateMappedMemoryRanges; | 
| Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 43 | PFN_vkDestroyObject DestroyObject; | 
|  | 44 | PFN_vkGetObjectInfo GetObjectInfo; | 
| Mark Lobodzinski | fb9f564 | 2015-05-11 17:21:15 -0500 | [diff] [blame] | 45 | PFN_vkBindObjectMemory BindObjectMemory; | 
|  | 46 | PFN_vkQueueBindSparseBufferMemory QueueBindSparseBufferMemory; | 
|  | 47 | PFN_vkQueueBindSparseImageMemory QueueBindSparseImageMemory; | 
| Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 48 | PFN_vkCreateFence CreateFence; | 
|  | 49 | PFN_vkGetFenceStatus GetFenceStatus; | 
|  | 50 | PFN_vkResetFences ResetFences; | 
|  | 51 | PFN_vkWaitForFences WaitForFences; | 
|  | 52 | PFN_vkCreateSemaphore CreateSemaphore; | 
|  | 53 | PFN_vkQueueSignalSemaphore QueueSignalSemaphore; | 
|  | 54 | PFN_vkQueueWaitSemaphore QueueWaitSemaphore; | 
|  | 55 | PFN_vkCreateEvent CreateEvent; | 
|  | 56 | PFN_vkGetEventStatus GetEventStatus; | 
|  | 57 | PFN_vkSetEvent SetEvent; | 
|  | 58 | PFN_vkResetEvent ResetEvent; | 
|  | 59 | PFN_vkCreateQueryPool CreateQueryPool; | 
|  | 60 | PFN_vkGetQueryPoolResults GetQueryPoolResults; | 
| Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 61 | PFN_vkCreateBuffer CreateBuffer; | 
|  | 62 | PFN_vkCreateBufferView CreateBufferView; | 
|  | 63 | PFN_vkCreateImage CreateImage; | 
|  | 64 | PFN_vkGetImageSubresourceInfo GetImageSubresourceInfo; | 
|  | 65 | PFN_vkCreateImageView CreateImageView; | 
|  | 66 | PFN_vkCreateColorAttachmentView CreateColorAttachmentView; | 
|  | 67 | PFN_vkCreateDepthStencilView CreateDepthStencilView; | 
|  | 68 | PFN_vkCreateShader CreateShader; | 
|  | 69 | PFN_vkCreateGraphicsPipeline CreateGraphicsPipeline; | 
|  | 70 | PFN_vkCreateGraphicsPipelineDerivative CreateGraphicsPipelineDerivative; | 
|  | 71 | PFN_vkCreateComputePipeline CreateComputePipeline; | 
|  | 72 | PFN_vkStorePipeline StorePipeline; | 
|  | 73 | PFN_vkLoadPipeline LoadPipeline; | 
|  | 74 | PFN_vkLoadPipelineDerivative LoadPipelineDerivative; | 
| Mark Lobodzinski | 556f721 | 2015-04-17 14:11:39 -0500 | [diff] [blame] | 75 | PFN_vkCreatePipelineLayout CreatePipelineLayout; | 
| Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 76 | PFN_vkCreateSampler CreateSampler; | 
|  | 77 | PFN_vkCreateDescriptorSetLayout CreateDescriptorSetLayout; | 
| Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 78 | PFN_vkCreateDescriptorPool CreateDescriptorPool; | 
|  | 79 | PFN_vkResetDescriptorPool ResetDescriptorPool; | 
|  | 80 | PFN_vkAllocDescriptorSets AllocDescriptorSets; | 
| Chia-I Wu | 8cd8ecd | 2015-05-25 16:27:55 +0800 | [diff] [blame] | 81 | PFN_vkUpdateDescriptorSets UpdateDescriptorSets; | 
| Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 82 | PFN_vkCreateDynamicViewportState CreateDynamicViewportState; | 
|  | 83 | PFN_vkCreateDynamicRasterState CreateDynamicRasterState; | 
|  | 84 | PFN_vkCreateDynamicColorBlendState CreateDynamicColorBlendState; | 
|  | 85 | PFN_vkCreateDynamicDepthStencilState CreateDynamicDepthStencilState; | 
|  | 86 | PFN_vkCreateCommandBuffer CreateCommandBuffer; | 
|  | 87 | PFN_vkBeginCommandBuffer BeginCommandBuffer; | 
|  | 88 | PFN_vkEndCommandBuffer EndCommandBuffer; | 
|  | 89 | PFN_vkResetCommandBuffer ResetCommandBuffer; | 
|  | 90 | PFN_vkCmdBindPipeline CmdBindPipeline; | 
|  | 91 | PFN_vkCmdBindDynamicStateObject CmdBindDynamicStateObject; | 
|  | 92 | PFN_vkCmdBindDescriptorSets CmdBindDescriptorSets; | 
| Courtney Goeltzenleuchter | 4696294 | 2015-04-16 13:38:46 -0600 | [diff] [blame] | 93 | PFN_vkCmdBindVertexBuffers CmdBindVertexBuffers; | 
| Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 94 | PFN_vkCmdBindIndexBuffer CmdBindIndexBuffer; | 
|  | 95 | PFN_vkCmdDraw CmdDraw; | 
|  | 96 | PFN_vkCmdDrawIndexed CmdDrawIndexed; | 
|  | 97 | PFN_vkCmdDrawIndirect CmdDrawIndirect; | 
|  | 98 | PFN_vkCmdDrawIndexedIndirect CmdDrawIndexedIndirect; | 
|  | 99 | PFN_vkCmdDispatch CmdDispatch; | 
|  | 100 | PFN_vkCmdDispatchIndirect CmdDispatchIndirect; | 
|  | 101 | PFN_vkCmdCopyBuffer CmdCopyBuffer; | 
|  | 102 | PFN_vkCmdCopyImage CmdCopyImage; | 
|  | 103 | PFN_vkCmdBlitImage CmdBlitImage; | 
|  | 104 | PFN_vkCmdCopyBufferToImage CmdCopyBufferToImage; | 
|  | 105 | PFN_vkCmdCopyImageToBuffer CmdCopyImageToBuffer; | 
| Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 106 | PFN_vkCmdUpdateBuffer CmdUpdateBuffer; | 
|  | 107 | PFN_vkCmdFillBuffer CmdFillBuffer; | 
|  | 108 | PFN_vkCmdClearColorImage CmdClearColorImage; | 
|  | 109 | PFN_vkCmdClearDepthStencil CmdClearDepthStencil; | 
|  | 110 | PFN_vkCmdResolveImage CmdResolveImage; | 
|  | 111 | PFN_vkCmdSetEvent CmdSetEvent; | 
|  | 112 | PFN_vkCmdResetEvent CmdResetEvent; | 
|  | 113 | PFN_vkCmdWaitEvents CmdWaitEvents; | 
|  | 114 | PFN_vkCmdPipelineBarrier CmdPipelineBarrier; | 
|  | 115 | PFN_vkCmdBeginQuery CmdBeginQuery; | 
|  | 116 | PFN_vkCmdEndQuery CmdEndQuery; | 
|  | 117 | PFN_vkCmdResetQueryPool CmdResetQueryPool; | 
|  | 118 | PFN_vkCmdWriteTimestamp CmdWriteTimestamp; | 
| Courtney Goeltzenleuchter | 9804906 | 2015-04-15 18:21:13 -0600 | [diff] [blame] | 119 | PFN_vkCmdCopyQueryPoolResults CmdCopyQueryPoolResults; | 
| Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 120 | PFN_vkCmdInitAtomicCounters CmdInitAtomicCounters; | 
|  | 121 | PFN_vkCmdLoadAtomicCounters CmdLoadAtomicCounters; | 
|  | 122 | PFN_vkCmdSaveAtomicCounters CmdSaveAtomicCounters; | 
|  | 123 | PFN_vkCreateFramebuffer CreateFramebuffer; | 
|  | 124 | PFN_vkCreateRenderPass CreateRenderPass; | 
|  | 125 | PFN_vkCmdBeginRenderPass CmdBeginRenderPass; | 
|  | 126 | PFN_vkCmdEndRenderPass CmdEndRenderPass; | 
| Chia-I Wu | 5b66aa5 | 2015-04-16 22:02:10 +0800 | [diff] [blame] | 127 | PFN_vkCreateSwapChainWSI CreateSwapChainWSI; | 
|  | 128 | PFN_vkDestroySwapChainWSI DestroySwapChainWSI; | 
|  | 129 | PFN_vkGetSwapChainInfoWSI GetSwapChainInfoWSI; | 
|  | 130 | PFN_vkQueuePresentWSI QueuePresentWSI; | 
| Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 131 | PFN_vkDbgCreateMsgCallback DbgCreateMsgCallback; | 
|  | 132 | PFN_vkDbgDestroyMsgCallback DbgDestroyMsgCallback; | 
|  | 133 | PFN_vkDbgStringCallback DbgStringCallback; | 
|  | 134 | PFN_vkDbgStdioCallback DbgStdioCallback; | 
|  | 135 | PFN_vkDbgBreakCallback DbgBreakCallback; | 
| Jon Ashburn | 301c5f0 | 2015-04-06 10:58:22 -0600 | [diff] [blame] | 136 | } VkLayerDispatchTable; | 
| Courtney Goeltzenleuchter | 89e99e6 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 137 |  | 
| Jon Ashburn | 9a9bb64 | 2015-05-04 16:27:53 -0600 | [diff] [blame] | 138 | typedef struct VkLayerInstanceDispatchTable_ | 
|  | 139 | { | 
|  | 140 | PFN_vkGetInstanceProcAddr GetInstanceProcAddr; | 
| Jon Ashburn | 52c1d73 | 2015-05-12 17:23:55 -0600 | [diff] [blame] | 141 | PFN_vkCreateInstance CreateInstance; | 
| Jon Ashburn | 9a9bb64 | 2015-05-04 16:27:53 -0600 | [diff] [blame] | 142 | PFN_vkDestroyInstance DestroyInstance; | 
|  | 143 | PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices; | 
|  | 144 | PFN_vkGetPhysicalDeviceInfo GetPhysicalDeviceInfo; | 
| Chris Forbes | d757630 | 2015-06-21 22:55:02 +1200 | [diff] [blame^] | 145 | PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures; | 
|  | 146 | PFN_vkGetPhysicalDeviceFormatInfo GetPhysicalDeviceFormatInfo; | 
|  | 147 | PFN_vkGetPhysicalDeviceLimits GetPhysicalDeviceLimits; | 
| Jon Ashburn | 9a9bb64 | 2015-05-04 16:27:53 -0600 | [diff] [blame] | 148 | PFN_vkCreateDevice CreateDevice; | 
| Jon Ashburn | cc4dfcf | 2015-06-08 14:38:28 -0600 | [diff] [blame] | 149 | /* PFN_vkGetGlobalExtensionInfo GetGlobalExtensionInfo; non-dispatchable */ | 
| Jon Ashburn | 9a9bb64 | 2015-05-04 16:27:53 -0600 | [diff] [blame] | 150 | PFN_vkGetPhysicalDeviceExtensionInfo GetPhysicalDeviceExtensionInfo; | 
| Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 151 | PFN_vkDbgCreateMsgCallback DbgCreateMsgCallback; | 
|  | 152 | PFN_vkDbgDestroyMsgCallback DbgDestroyMsgCallback; | 
|  | 153 | PFN_vkDbgStringCallback DbgStringCallback; | 
|  | 154 | PFN_vkDbgStdioCallback DbgStdioCallback; | 
|  | 155 | PFN_vkDbgBreakCallback DbgBreakCallback; | 
| Jon Ashburn | 9a9bb64 | 2015-05-04 16:27:53 -0600 | [diff] [blame] | 156 | } VkLayerInstanceDispatchTable; | 
|  | 157 |  | 
| Courtney Goeltzenleuchter | 89e99e6 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 158 | // LL node for tree of dbg callback functions | 
| Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 159 | typedef struct VkLayerDbgFunctionNode_ | 
| Courtney Goeltzenleuchter | 89e99e6 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 160 | { | 
| Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 161 | VkDbgMsgCallback msgCallback; | 
|  | 162 | PFN_vkDbgMsgCallback pfnMsgCallback; | 
|  | 163 | VkFlags msgFlags; | 
|  | 164 | const void *pUserData; | 
|  | 165 | struct VkLayerDbgFunctionNode_ *pNext; | 
|  | 166 | } VkLayerDbgFunctionNode; | 
| Courtney Goeltzenleuchter | 89e99e6 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 167 |  | 
| Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 168 | typedef enum VkLayerDbgAction_ | 
| Courtney Goeltzenleuchter | 89e99e6 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 169 | { | 
|  | 170 | VK_DBG_LAYER_ACTION_IGNORE = 0x0, | 
|  | 171 | VK_DBG_LAYER_ACTION_CALLBACK = 0x1, | 
|  | 172 | VK_DBG_LAYER_ACTION_LOG_MSG = 0x2, | 
|  | 173 | VK_DBG_LAYER_ACTION_BREAK = 0x4 | 
| Courtney Goeltzenleuchter | 1c7c65d | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 174 | } VkLayerDbgAction; | 
| Courtney Goeltzenleuchter | 89e99e6 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 175 |  | 
| Courtney Goeltzenleuchter | 89e99e6 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 176 | // ------------------------------------------------------------------------------------------------ | 
|  | 177 | // API functions |