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" |
| 8 | #include "vkDbg.h" |
Chia-I Wu | 5b66aa5 | 2015-04-16 22:02:10 +0800 | [diff] [blame] | 9 | #include "vk_wsi_lunarg.h" |
Courtney Goeltzenleuchter | 89e99e6 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 10 | #if defined(__GNUC__) && __GNUC__ >= 4 |
| 11 | # define VK_LAYER_EXPORT __attribute__((visibility("default"))) |
| 12 | #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) |
| 13 | # define VK_LAYER_EXPORT __attribute__((visibility("default"))) |
| 14 | #else |
| 15 | # define VK_LAYER_EXPORT |
| 16 | #endif |
| 17 | |
| 18 | |
Jon Ashburn | 301c5f0 | 2015-04-06 10:58:22 -0600 | [diff] [blame] | 19 | typedef struct VkBaseLayerObject_ |
Courtney Goeltzenleuchter | 89e99e6 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 20 | { |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 21 | PFN_vkGetProcAddr pGPA; |
Mike Stroyan | 230e625 | 2015-04-17 12:36:38 -0600 | [diff] [blame] | 22 | VkObject nextObject; |
| 23 | VkObject baseObject; |
Jon Ashburn | 301c5f0 | 2015-04-06 10:58:22 -0600 | [diff] [blame] | 24 | } VkBaseLayerObject; |
Courtney Goeltzenleuchter | 89e99e6 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 25 | |
Jon Ashburn | 301c5f0 | 2015-04-06 10:58:22 -0600 | [diff] [blame] | 26 | typedef struct VkLayerDispatchTable_ |
Courtney Goeltzenleuchter | 89e99e6 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 27 | { |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 28 | PFN_vkGetProcAddr GetProcAddr; |
| 29 | PFN_vkCreateInstance CreateInstance; |
| 30 | PFN_vkDestroyInstance DestroyInstance; |
Jon Ashburn | 07b309a | 2015-04-15 11:31:12 -0600 | [diff] [blame] | 31 | PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices; |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 32 | PFN_vkGetPhysicalDeviceInfo GetPhysicalDeviceInfo; |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 33 | PFN_vkCreateDevice CreateDevice; |
| 34 | PFN_vkDestroyDevice DestroyDevice; |
Jon Ashburn | eb2728b | 2015-04-10 14:33:07 -0600 | [diff] [blame] | 35 | PFN_vkGetGlobalExtensionInfo GetGlobalExtensionInfo; |
Tobin Ehlis | 0ef6ec5 | 2015-04-16 12:51:37 -0600 | [diff] [blame] | 36 | PFN_vkGetPhysicalDeviceExtensionInfo GetPhysicalDeviceExtensionInfo; |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 37 | PFN_vkEnumerateLayers EnumerateLayers; |
| 38 | PFN_vkGetDeviceQueue GetDeviceQueue; |
| 39 | PFN_vkQueueSubmit QueueSubmit; |
Courtney Goeltzenleuchter | 4696294 | 2015-04-16 13:38:46 -0600 | [diff] [blame] | 40 | PFN_vkQueueAddMemReferences QueueAddMemReferences; |
| 41 | PFN_vkQueueRemoveMemReferences QueueRemoveMemReferences; |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 42 | PFN_vkQueueWaitIdle QueueWaitIdle; |
| 43 | PFN_vkDeviceWaitIdle DeviceWaitIdle; |
| 44 | PFN_vkAllocMemory AllocMemory; |
| 45 | PFN_vkFreeMemory FreeMemory; |
| 46 | PFN_vkSetMemoryPriority SetMemoryPriority; |
| 47 | PFN_vkMapMemory MapMemory; |
| 48 | PFN_vkUnmapMemory UnmapMemory; |
Courtney Goeltzenleuchter | a569a50 | 2015-04-29 17:16:21 -0600 | [diff] [blame^] | 49 | PFN_vkFlushMappedMemoryRanges FlushMappedMemoryRanges; |
| 50 | PFN_vkInvalidateMappedMemoryRanges InvalidateMappedMemoryRanges; |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 51 | PFN_vkPinSystemMemory PinSystemMemory; |
Tony Barbour | 8205d90 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 52 | PFN_vkGetMultiDeviceCompatibility GetMultiDeviceCompatibility; |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 53 | PFN_vkOpenSharedMemory OpenSharedMemory; |
| 54 | PFN_vkOpenSharedSemaphore OpenSharedSemaphore; |
| 55 | PFN_vkOpenPeerMemory OpenPeerMemory; |
| 56 | PFN_vkOpenPeerImage OpenPeerImage; |
| 57 | PFN_vkDestroyObject DestroyObject; |
| 58 | PFN_vkGetObjectInfo GetObjectInfo; |
Mark Lobodzinski | cf26e07 | 2015-04-16 11:44:05 -0500 | [diff] [blame] | 59 | PFN_vkQueueBindObjectMemory QueueBindObjectMemory; |
| 60 | PFN_vkQueueBindObjectMemoryRange QueueBindObjectMemoryRange; |
| 61 | PFN_vkQueueBindImageMemoryRange QueueBindImageMemoryRange; |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 62 | PFN_vkCreateFence CreateFence; |
| 63 | PFN_vkGetFenceStatus GetFenceStatus; |
| 64 | PFN_vkResetFences ResetFences; |
| 65 | PFN_vkWaitForFences WaitForFences; |
| 66 | PFN_vkCreateSemaphore CreateSemaphore; |
| 67 | PFN_vkQueueSignalSemaphore QueueSignalSemaphore; |
| 68 | PFN_vkQueueWaitSemaphore QueueWaitSemaphore; |
| 69 | PFN_vkCreateEvent CreateEvent; |
| 70 | PFN_vkGetEventStatus GetEventStatus; |
| 71 | PFN_vkSetEvent SetEvent; |
| 72 | PFN_vkResetEvent ResetEvent; |
| 73 | PFN_vkCreateQueryPool CreateQueryPool; |
| 74 | PFN_vkGetQueryPoolResults GetQueryPoolResults; |
| 75 | PFN_vkGetFormatInfo GetFormatInfo; |
| 76 | PFN_vkCreateBuffer CreateBuffer; |
| 77 | PFN_vkCreateBufferView CreateBufferView; |
| 78 | PFN_vkCreateImage CreateImage; |
| 79 | PFN_vkGetImageSubresourceInfo GetImageSubresourceInfo; |
| 80 | PFN_vkCreateImageView CreateImageView; |
| 81 | PFN_vkCreateColorAttachmentView CreateColorAttachmentView; |
| 82 | PFN_vkCreateDepthStencilView CreateDepthStencilView; |
| 83 | PFN_vkCreateShader CreateShader; |
| 84 | PFN_vkCreateGraphicsPipeline CreateGraphicsPipeline; |
| 85 | PFN_vkCreateGraphicsPipelineDerivative CreateGraphicsPipelineDerivative; |
| 86 | PFN_vkCreateComputePipeline CreateComputePipeline; |
| 87 | PFN_vkStorePipeline StorePipeline; |
| 88 | PFN_vkLoadPipeline LoadPipeline; |
| 89 | PFN_vkLoadPipelineDerivative LoadPipelineDerivative; |
Mark Lobodzinski | 556f721 | 2015-04-17 14:11:39 -0500 | [diff] [blame] | 90 | PFN_vkCreatePipelineLayout CreatePipelineLayout; |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 91 | PFN_vkCreateSampler CreateSampler; |
| 92 | PFN_vkCreateDescriptorSetLayout CreateDescriptorSetLayout; |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 93 | PFN_vkBeginDescriptorPoolUpdate BeginDescriptorPoolUpdate; |
| 94 | PFN_vkEndDescriptorPoolUpdate EndDescriptorPoolUpdate; |
| 95 | PFN_vkCreateDescriptorPool CreateDescriptorPool; |
| 96 | PFN_vkResetDescriptorPool ResetDescriptorPool; |
| 97 | PFN_vkAllocDescriptorSets AllocDescriptorSets; |
| 98 | PFN_vkClearDescriptorSets ClearDescriptorSets; |
| 99 | PFN_vkUpdateDescriptors UpdateDescriptors; |
| 100 | PFN_vkCreateDynamicViewportState CreateDynamicViewportState; |
| 101 | PFN_vkCreateDynamicRasterState CreateDynamicRasterState; |
| 102 | PFN_vkCreateDynamicColorBlendState CreateDynamicColorBlendState; |
| 103 | PFN_vkCreateDynamicDepthStencilState CreateDynamicDepthStencilState; |
| 104 | PFN_vkCreateCommandBuffer CreateCommandBuffer; |
| 105 | PFN_vkBeginCommandBuffer BeginCommandBuffer; |
| 106 | PFN_vkEndCommandBuffer EndCommandBuffer; |
| 107 | PFN_vkResetCommandBuffer ResetCommandBuffer; |
| 108 | PFN_vkCmdBindPipeline CmdBindPipeline; |
| 109 | PFN_vkCmdBindDynamicStateObject CmdBindDynamicStateObject; |
| 110 | PFN_vkCmdBindDescriptorSets CmdBindDescriptorSets; |
Courtney Goeltzenleuchter | 4696294 | 2015-04-16 13:38:46 -0600 | [diff] [blame] | 111 | PFN_vkCmdBindVertexBuffers CmdBindVertexBuffers; |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 112 | PFN_vkCmdBindIndexBuffer CmdBindIndexBuffer; |
| 113 | PFN_vkCmdDraw CmdDraw; |
| 114 | PFN_vkCmdDrawIndexed CmdDrawIndexed; |
| 115 | PFN_vkCmdDrawIndirect CmdDrawIndirect; |
| 116 | PFN_vkCmdDrawIndexedIndirect CmdDrawIndexedIndirect; |
| 117 | PFN_vkCmdDispatch CmdDispatch; |
| 118 | PFN_vkCmdDispatchIndirect CmdDispatchIndirect; |
| 119 | PFN_vkCmdCopyBuffer CmdCopyBuffer; |
| 120 | PFN_vkCmdCopyImage CmdCopyImage; |
| 121 | PFN_vkCmdBlitImage CmdBlitImage; |
| 122 | PFN_vkCmdCopyBufferToImage CmdCopyBufferToImage; |
| 123 | PFN_vkCmdCopyImageToBuffer CmdCopyImageToBuffer; |
| 124 | PFN_vkCmdCloneImageData CmdCloneImageData; |
| 125 | PFN_vkCmdUpdateBuffer CmdUpdateBuffer; |
| 126 | PFN_vkCmdFillBuffer CmdFillBuffer; |
| 127 | PFN_vkCmdClearColorImage CmdClearColorImage; |
| 128 | PFN_vkCmdClearDepthStencil CmdClearDepthStencil; |
| 129 | PFN_vkCmdResolveImage CmdResolveImage; |
| 130 | PFN_vkCmdSetEvent CmdSetEvent; |
| 131 | PFN_vkCmdResetEvent CmdResetEvent; |
| 132 | PFN_vkCmdWaitEvents CmdWaitEvents; |
| 133 | PFN_vkCmdPipelineBarrier CmdPipelineBarrier; |
| 134 | PFN_vkCmdBeginQuery CmdBeginQuery; |
| 135 | PFN_vkCmdEndQuery CmdEndQuery; |
| 136 | PFN_vkCmdResetQueryPool CmdResetQueryPool; |
| 137 | PFN_vkCmdWriteTimestamp CmdWriteTimestamp; |
Courtney Goeltzenleuchter | 9804906 | 2015-04-15 18:21:13 -0600 | [diff] [blame] | 138 | PFN_vkCmdCopyQueryPoolResults CmdCopyQueryPoolResults; |
Courtney Goeltzenleuchter | 382489d | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 139 | PFN_vkCmdInitAtomicCounters CmdInitAtomicCounters; |
| 140 | PFN_vkCmdLoadAtomicCounters CmdLoadAtomicCounters; |
| 141 | PFN_vkCmdSaveAtomicCounters CmdSaveAtomicCounters; |
| 142 | PFN_vkCreateFramebuffer CreateFramebuffer; |
| 143 | PFN_vkCreateRenderPass CreateRenderPass; |
| 144 | PFN_vkCmdBeginRenderPass CmdBeginRenderPass; |
| 145 | PFN_vkCmdEndRenderPass CmdEndRenderPass; |
| 146 | PFN_vkDbgSetValidationLevel DbgSetValidationLevel; |
| 147 | PFN_vkDbgRegisterMsgCallback DbgRegisterMsgCallback; |
| 148 | PFN_vkDbgUnregisterMsgCallback DbgUnregisterMsgCallback; |
| 149 | PFN_vkDbgSetMessageFilter DbgSetMessageFilter; |
| 150 | PFN_vkDbgSetObjectTag DbgSetObjectTag; |
| 151 | PFN_vkDbgSetGlobalOption DbgSetGlobalOption; |
| 152 | PFN_vkDbgSetDeviceOption DbgSetDeviceOption; |
| 153 | PFN_vkCmdDbgMarkerBegin CmdDbgMarkerBegin; |
| 154 | PFN_vkCmdDbgMarkerEnd CmdDbgMarkerEnd; |
Chia-I Wu | 5b66aa5 | 2015-04-16 22:02:10 +0800 | [diff] [blame] | 155 | PFN_vkGetDisplayInfoWSI GetDisplayInfoWSI; |
| 156 | PFN_vkCreateSwapChainWSI CreateSwapChainWSI; |
| 157 | PFN_vkDestroySwapChainWSI DestroySwapChainWSI; |
| 158 | PFN_vkGetSwapChainInfoWSI GetSwapChainInfoWSI; |
| 159 | PFN_vkQueuePresentWSI QueuePresentWSI; |
Jon Ashburn | 301c5f0 | 2015-04-06 10:58:22 -0600 | [diff] [blame] | 160 | } VkLayerDispatchTable; |
Courtney Goeltzenleuchter | 89e99e6 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 161 | |
| 162 | // LL node for tree of dbg callback functions |
| 163 | typedef struct _VK_LAYER_DBG_FUNCTION_NODE |
| 164 | { |
| 165 | VK_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback; |
| 166 | void *pUserData; |
| 167 | struct _VK_LAYER_DBG_FUNCTION_NODE *pNext; |
| 168 | } VK_LAYER_DBG_FUNCTION_NODE; |
| 169 | |
| 170 | typedef enum _VK_LAYER_DBG_ACTION |
| 171 | { |
| 172 | VK_DBG_LAYER_ACTION_IGNORE = 0x0, |
| 173 | VK_DBG_LAYER_ACTION_CALLBACK = 0x1, |
| 174 | VK_DBG_LAYER_ACTION_LOG_MSG = 0x2, |
| 175 | VK_DBG_LAYER_ACTION_BREAK = 0x4 |
| 176 | } VK_LAYER_DBG_ACTION; |
| 177 | |
| 178 | typedef enum _VK_LAYER_DBG_REPORT_LEVEL |
| 179 | { |
| 180 | |
| 181 | VK_DBG_LAYER_LEVEL_INFO = 0, |
| 182 | VK_DBG_LAYER_LEVEL_WARN, |
| 183 | VK_DBG_LAYER_LEVEL_PERF_WARN, |
| 184 | VK_DBG_LAYER_LEVEL_ERROR, |
| 185 | VK_DBG_LAYER_LEVEL_NONE, |
| 186 | } VK_LAYER_DBG_REPORT_LEVEL; |
| 187 | // ------------------------------------------------------------------------------------------------ |
| 188 | // API functions |