Courtney Goeltzenleuchter | 64d1a71 | 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 | f579fa6 | 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 | f869338 | 2015-04-16 22:02:10 +0800 | [diff] [blame] | 11 | #include "vk_wsi_lunarg.h" |
Courtney Goeltzenleuchter | 64d1a71 | 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 | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 21 | typedef void * (*PFN_vkGPA)(VkObject obj, const char * pName); |
Jon Ashburn | bacb0f5 | 2015-04-06 10:58:22 -0600 | [diff] [blame] | 22 | typedef struct VkBaseLayerObject_ |
Courtney Goeltzenleuchter | 64d1a71 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 23 | { |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 24 | PFN_vkGPA pGPA; |
Mike Stroyan | b050c68 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 25 | VkObject nextObject; |
| 26 | VkObject baseObject; |
Jon Ashburn | bacb0f5 | 2015-04-06 10:58:22 -0600 | [diff] [blame] | 27 | } VkBaseLayerObject; |
Courtney Goeltzenleuchter | 64d1a71 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 28 | |
Jon Ashburn | bacb0f5 | 2015-04-06 10:58:22 -0600 | [diff] [blame] | 29 | typedef struct VkLayerDispatchTable_ |
Courtney Goeltzenleuchter | 64d1a71 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 30 | { |
Jon Ashburn | 8d1b0b5 | 2015-05-18 13:20:15 -0600 | [diff] [blame] | 31 | PFN_vkGetDeviceProcAddr GetDeviceProcAddr; |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 32 | PFN_vkDestroyDevice DestroyDevice; |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 33 | PFN_vkGetDeviceQueue GetDeviceQueue; |
| 34 | PFN_vkQueueSubmit QueueSubmit; |
Courtney Goeltzenleuchter | fb4efc6 | 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; |
| 39 | PFN_vkSetMemoryPriority SetMemoryPriority; |
| 40 | PFN_vkMapMemory MapMemory; |
| 41 | PFN_vkUnmapMemory UnmapMemory; |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 42 | PFN_vkFlushMappedMemoryRanges FlushMappedMemoryRanges; |
| 43 | PFN_vkInvalidateMappedMemoryRanges InvalidateMappedMemoryRanges; |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 44 | PFN_vkPinSystemMemory PinSystemMemory; |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 45 | PFN_vkOpenSharedMemory OpenSharedMemory; |
| 46 | PFN_vkOpenSharedSemaphore OpenSharedSemaphore; |
| 47 | PFN_vkOpenPeerMemory OpenPeerMemory; |
| 48 | PFN_vkOpenPeerImage OpenPeerImage; |
| 49 | PFN_vkDestroyObject DestroyObject; |
| 50 | PFN_vkGetObjectInfo GetObjectInfo; |
Mark Lobodzinski | 942b172 | 2015-05-11 17:21:15 -0500 | [diff] [blame] | 51 | PFN_vkBindObjectMemory BindObjectMemory; |
| 52 | PFN_vkQueueBindSparseBufferMemory QueueBindSparseBufferMemory; |
| 53 | PFN_vkQueueBindSparseImageMemory QueueBindSparseImageMemory; |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 54 | PFN_vkCreateFence CreateFence; |
| 55 | PFN_vkGetFenceStatus GetFenceStatus; |
| 56 | PFN_vkResetFences ResetFences; |
| 57 | PFN_vkWaitForFences WaitForFences; |
| 58 | PFN_vkCreateSemaphore CreateSemaphore; |
| 59 | PFN_vkQueueSignalSemaphore QueueSignalSemaphore; |
| 60 | PFN_vkQueueWaitSemaphore QueueWaitSemaphore; |
| 61 | PFN_vkCreateEvent CreateEvent; |
| 62 | PFN_vkGetEventStatus GetEventStatus; |
| 63 | PFN_vkSetEvent SetEvent; |
| 64 | PFN_vkResetEvent ResetEvent; |
| 65 | PFN_vkCreateQueryPool CreateQueryPool; |
| 66 | PFN_vkGetQueryPoolResults GetQueryPoolResults; |
| 67 | PFN_vkGetFormatInfo GetFormatInfo; |
| 68 | PFN_vkCreateBuffer CreateBuffer; |
| 69 | PFN_vkCreateBufferView CreateBufferView; |
| 70 | PFN_vkCreateImage CreateImage; |
| 71 | PFN_vkGetImageSubresourceInfo GetImageSubresourceInfo; |
| 72 | PFN_vkCreateImageView CreateImageView; |
| 73 | PFN_vkCreateColorAttachmentView CreateColorAttachmentView; |
| 74 | PFN_vkCreateDepthStencilView CreateDepthStencilView; |
| 75 | PFN_vkCreateShader CreateShader; |
| 76 | PFN_vkCreateGraphicsPipeline CreateGraphicsPipeline; |
| 77 | PFN_vkCreateGraphicsPipelineDerivative CreateGraphicsPipelineDerivative; |
| 78 | PFN_vkCreateComputePipeline CreateComputePipeline; |
| 79 | PFN_vkStorePipeline StorePipeline; |
| 80 | PFN_vkLoadPipeline LoadPipeline; |
| 81 | PFN_vkLoadPipelineDerivative LoadPipelineDerivative; |
Mark Lobodzinski | 0fadf5f | 2015-04-17 14:11:39 -0500 | [diff] [blame] | 82 | PFN_vkCreatePipelineLayout CreatePipelineLayout; |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 83 | PFN_vkCreateSampler CreateSampler; |
| 84 | PFN_vkCreateDescriptorSetLayout CreateDescriptorSetLayout; |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 85 | PFN_vkCreateDescriptorPool CreateDescriptorPool; |
| 86 | PFN_vkResetDescriptorPool ResetDescriptorPool; |
| 87 | PFN_vkAllocDescriptorSets AllocDescriptorSets; |
| 88 | PFN_vkClearDescriptorSets ClearDescriptorSets; |
Chia-I Wu | 9d00ed7 | 2015-05-25 16:27:55 +0800 | [diff] [blame] | 89 | PFN_vkUpdateDescriptorSets UpdateDescriptorSets; |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 90 | PFN_vkCreateDynamicViewportState CreateDynamicViewportState; |
| 91 | PFN_vkCreateDynamicRasterState CreateDynamicRasterState; |
| 92 | PFN_vkCreateDynamicColorBlendState CreateDynamicColorBlendState; |
| 93 | PFN_vkCreateDynamicDepthStencilState CreateDynamicDepthStencilState; |
| 94 | PFN_vkCreateCommandBuffer CreateCommandBuffer; |
| 95 | PFN_vkBeginCommandBuffer BeginCommandBuffer; |
| 96 | PFN_vkEndCommandBuffer EndCommandBuffer; |
| 97 | PFN_vkResetCommandBuffer ResetCommandBuffer; |
| 98 | PFN_vkCmdBindPipeline CmdBindPipeline; |
| 99 | PFN_vkCmdBindDynamicStateObject CmdBindDynamicStateObject; |
| 100 | PFN_vkCmdBindDescriptorSets CmdBindDescriptorSets; |
Courtney Goeltzenleuchter | f68ad72 | 2015-04-16 13:38:46 -0600 | [diff] [blame] | 101 | PFN_vkCmdBindVertexBuffers CmdBindVertexBuffers; |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 102 | PFN_vkCmdBindIndexBuffer CmdBindIndexBuffer; |
| 103 | PFN_vkCmdDraw CmdDraw; |
| 104 | PFN_vkCmdDrawIndexed CmdDrawIndexed; |
| 105 | PFN_vkCmdDrawIndirect CmdDrawIndirect; |
| 106 | PFN_vkCmdDrawIndexedIndirect CmdDrawIndexedIndirect; |
| 107 | PFN_vkCmdDispatch CmdDispatch; |
| 108 | PFN_vkCmdDispatchIndirect CmdDispatchIndirect; |
| 109 | PFN_vkCmdCopyBuffer CmdCopyBuffer; |
| 110 | PFN_vkCmdCopyImage CmdCopyImage; |
| 111 | PFN_vkCmdBlitImage CmdBlitImage; |
| 112 | PFN_vkCmdCopyBufferToImage CmdCopyBufferToImage; |
| 113 | PFN_vkCmdCopyImageToBuffer CmdCopyImageToBuffer; |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 114 | PFN_vkCmdUpdateBuffer CmdUpdateBuffer; |
| 115 | PFN_vkCmdFillBuffer CmdFillBuffer; |
| 116 | PFN_vkCmdClearColorImage CmdClearColorImage; |
| 117 | PFN_vkCmdClearDepthStencil CmdClearDepthStencil; |
| 118 | PFN_vkCmdResolveImage CmdResolveImage; |
| 119 | PFN_vkCmdSetEvent CmdSetEvent; |
| 120 | PFN_vkCmdResetEvent CmdResetEvent; |
| 121 | PFN_vkCmdWaitEvents CmdWaitEvents; |
| 122 | PFN_vkCmdPipelineBarrier CmdPipelineBarrier; |
| 123 | PFN_vkCmdBeginQuery CmdBeginQuery; |
| 124 | PFN_vkCmdEndQuery CmdEndQuery; |
| 125 | PFN_vkCmdResetQueryPool CmdResetQueryPool; |
| 126 | PFN_vkCmdWriteTimestamp CmdWriteTimestamp; |
Courtney Goeltzenleuchter | 1dbc8e2 | 2015-04-15 18:21:13 -0600 | [diff] [blame] | 127 | PFN_vkCmdCopyQueryPoolResults CmdCopyQueryPoolResults; |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 128 | PFN_vkCmdInitAtomicCounters CmdInitAtomicCounters; |
| 129 | PFN_vkCmdLoadAtomicCounters CmdLoadAtomicCounters; |
| 130 | PFN_vkCmdSaveAtomicCounters CmdSaveAtomicCounters; |
| 131 | PFN_vkCreateFramebuffer CreateFramebuffer; |
| 132 | PFN_vkCreateRenderPass CreateRenderPass; |
| 133 | PFN_vkCmdBeginRenderPass CmdBeginRenderPass; |
| 134 | PFN_vkCmdEndRenderPass CmdEndRenderPass; |
Chia-I Wu | f869338 | 2015-04-16 22:02:10 +0800 | [diff] [blame] | 135 | PFN_vkCreateSwapChainWSI CreateSwapChainWSI; |
| 136 | PFN_vkDestroySwapChainWSI DestroySwapChainWSI; |
| 137 | PFN_vkGetSwapChainInfoWSI GetSwapChainInfoWSI; |
| 138 | PFN_vkQueuePresentWSI QueuePresentWSI; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 139 | PFN_vkDbgCreateMsgCallback DbgCreateMsgCallback; |
| 140 | PFN_vkDbgDestroyMsgCallback DbgDestroyMsgCallback; |
| 141 | PFN_vkDbgStringCallback DbgStringCallback; |
| 142 | PFN_vkDbgStdioCallback DbgStdioCallback; |
| 143 | PFN_vkDbgBreakCallback DbgBreakCallback; |
Jon Ashburn | bacb0f5 | 2015-04-06 10:58:22 -0600 | [diff] [blame] | 144 | } VkLayerDispatchTable; |
Courtney Goeltzenleuchter | 64d1a71 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 145 | |
Jon Ashburn | fbb4e25 | 2015-05-04 16:27:53 -0600 | [diff] [blame] | 146 | typedef struct VkLayerInstanceDispatchTable_ |
| 147 | { |
| 148 | PFN_vkGetInstanceProcAddr GetInstanceProcAddr; |
Jon Ashburn | 71836d9 | 2015-05-12 17:23:55 -0600 | [diff] [blame] | 149 | PFN_vkCreateInstance CreateInstance; |
Jon Ashburn | fbb4e25 | 2015-05-04 16:27:53 -0600 | [diff] [blame] | 150 | PFN_vkDestroyInstance DestroyInstance; |
| 151 | PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices; |
| 152 | PFN_vkGetPhysicalDeviceInfo GetPhysicalDeviceInfo; |
| 153 | PFN_vkCreateDevice CreateDevice; |
Jon Ashburn | 71836d9 | 2015-05-12 17:23:55 -0600 | [diff] [blame] | 154 | PFN_vkGetGlobalExtensionInfo GetGlobalExtensionInfo; |
Jon Ashburn | fbb4e25 | 2015-05-04 16:27:53 -0600 | [diff] [blame] | 155 | PFN_vkGetPhysicalDeviceExtensionInfo GetPhysicalDeviceExtensionInfo; |
Jon Ashburn | fbb4e25 | 2015-05-04 16:27:53 -0600 | [diff] [blame] | 156 | PFN_vkGetMultiDeviceCompatibility GetMultiDeviceCompatibility; |
Jon Ashburn | 95a77ba | 2015-05-15 15:09:35 -0600 | [diff] [blame] | 157 | PFN_vkGetDisplayInfoWSI GetDisplayInfoWSI; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 158 | PFN_vkDbgCreateMsgCallback DbgCreateMsgCallback; |
| 159 | PFN_vkDbgDestroyMsgCallback DbgDestroyMsgCallback; |
| 160 | PFN_vkDbgStringCallback DbgStringCallback; |
| 161 | PFN_vkDbgStdioCallback DbgStdioCallback; |
| 162 | PFN_vkDbgBreakCallback DbgBreakCallback; |
Jon Ashburn | fbb4e25 | 2015-05-04 16:27:53 -0600 | [diff] [blame] | 163 | } VkLayerInstanceDispatchTable; |
| 164 | |
Courtney Goeltzenleuchter | 64d1a71 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 165 | // LL node for tree of dbg callback functions |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 166 | typedef struct VkLayerDbgFunctionNode_ |
Courtney Goeltzenleuchter | 64d1a71 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 167 | { |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 168 | VkDbgMsgCallback msgCallback; |
| 169 | PFN_vkDbgMsgCallback pfnMsgCallback; |
| 170 | VkFlags msgFlags; |
| 171 | const void *pUserData; |
| 172 | struct VkLayerDbgFunctionNode_ *pNext; |
| 173 | } VkLayerDbgFunctionNode; |
Courtney Goeltzenleuchter | 64d1a71 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 174 | |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 175 | typedef enum VkLayerDbgAction_ |
Courtney Goeltzenleuchter | 64d1a71 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 176 | { |
| 177 | VK_DBG_LAYER_ACTION_IGNORE = 0x0, |
| 178 | VK_DBG_LAYER_ACTION_CALLBACK = 0x1, |
| 179 | VK_DBG_LAYER_ACTION_LOG_MSG = 0x2, |
| 180 | VK_DBG_LAYER_ACTION_BREAK = 0x4 |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 181 | } VkLayerDbgAction; |
Courtney Goeltzenleuchter | 64d1a71 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 182 | |
Courtney Goeltzenleuchter | 64d1a71 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 183 | // ------------------------------------------------------------------------------------------------ |
| 184 | // API functions |