blob: 8538eecc7ea91d255cc7416dfeca9049e4356a82 [file] [log] [blame]
Karl Schultz37419ed2016-02-02 12:32:50 -07001//
2// File: vk_layer.h
3//
4/*
5 * Copyright (c) 2015-2016 The Khronos Group Inc.
6 * Copyright (c) 2015-2016 Valve Corporation
7 * Copyright (c) 2015-2016 LunarG, Inc.
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a copy
10 * of this software and/or associated documentation files (the "Materials"), to
11 * deal in the Materials without restriction, including without limitation the
12 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
13 * sell copies of the Materials, and to permit persons to whom the Materials are
14 * furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice(s) and this permission notice shall be included in
17 * all copies or substantial portions of the Materials.
18 *
Karl Schultz37419ed2016-02-02 12:32:50 -070019 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22 *
23 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
24 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
25 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE
26 * USE OR OTHER DEALINGS IN THE MATERIALS.
27 *
28 */
29
Courtney Goeltzenleuchter64d1a712015-04-08 18:04:29 -060030/* Need to define dispatch table
31 * Core struct can then have ptr to dispatch table at the top
32 * Along with object ptrs for current and next OBJ
33 */
34#pragma once
35
Karl Schultz1aec29c2016-02-10 15:41:43 -070036#include "vulkan.h"
Courtney Goeltzenleuchter64d1a712015-04-08 18:04:29 -060037#if defined(__GNUC__) && __GNUC__ >= 4
Karl Schultz37419ed2016-02-02 12:32:50 -070038#define VK_LAYER_EXPORT __attribute__((visibility("default")))
Courtney Goeltzenleuchter64d1a712015-04-08 18:04:29 -060039#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
Karl Schultz37419ed2016-02-02 12:32:50 -070040#define VK_LAYER_EXPORT __attribute__((visibility("default")))
Courtney Goeltzenleuchter64d1a712015-04-08 18:04:29 -060041#else
Karl Schultz37419ed2016-02-02 12:32:50 -070042#define VK_LAYER_EXPORT
Courtney Goeltzenleuchter64d1a712015-04-08 18:04:29 -060043#endif
44
Karl Schultz37419ed2016-02-02 12:32:50 -070045typedef struct VkLayerDispatchTable_ {
Jon Ashburn8d1b0b52015-05-18 13:20:15 -060046 PFN_vkGetDeviceProcAddr GetDeviceProcAddr;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -060047 PFN_vkDestroyDevice DestroyDevice;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -060048 PFN_vkGetDeviceQueue GetDeviceQueue;
49 PFN_vkQueueSubmit QueueSubmit;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -060050 PFN_vkQueueWaitIdle QueueWaitIdle;
51 PFN_vkDeviceWaitIdle DeviceWaitIdle;
Chia-I Wu3432a0c2015-10-27 18:04:07 +080052 PFN_vkAllocateMemory AllocateMemory;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -060053 PFN_vkFreeMemory FreeMemory;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -060054 PFN_vkMapMemory MapMemory;
55 PFN_vkUnmapMemory UnmapMemory;
Courtney Goeltzenleuchterf69f8a22015-04-29 17:16:21 -060056 PFN_vkFlushMappedMemoryRanges FlushMappedMemoryRanges;
57 PFN_vkInvalidateMappedMemoryRanges InvalidateMappedMemoryRanges;
Courtney Goeltzenleuchterfb71f222015-07-09 21:57:28 -060058 PFN_vkGetDeviceMemoryCommitment GetDeviceMemoryCommitment;
Mark Lobodzinski16e8bef2015-07-03 15:58:09 -060059 PFN_vkGetImageSparseMemoryRequirements GetImageSparseMemoryRequirements;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -060060 PFN_vkGetImageMemoryRequirements GetImageMemoryRequirements;
61 PFN_vkGetBufferMemoryRequirements GetBufferMemoryRequirements;
62 PFN_vkBindImageMemory BindImageMemory;
63 PFN_vkBindBufferMemory BindBufferMemory;
Chia-I Wu1ff4c3d2015-10-26 16:55:27 +080064 PFN_vkQueueBindSparse QueueBindSparse;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -060065 PFN_vkCreateFence CreateFence;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -060066 PFN_vkDestroyFence DestroyFence;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -060067 PFN_vkGetFenceStatus GetFenceStatus;
68 PFN_vkResetFences ResetFences;
69 PFN_vkWaitForFences WaitForFences;
70 PFN_vkCreateSemaphore CreateSemaphore;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -060071 PFN_vkDestroySemaphore DestroySemaphore;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -060072 PFN_vkCreateEvent CreateEvent;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -060073 PFN_vkDestroyEvent DestroyEvent;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -060074 PFN_vkGetEventStatus GetEventStatus;
75 PFN_vkSetEvent SetEvent;
76 PFN_vkResetEvent ResetEvent;
77 PFN_vkCreateQueryPool CreateQueryPool;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -060078 PFN_vkDestroyQueryPool DestroyQueryPool;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -060079 PFN_vkGetQueryPoolResults GetQueryPoolResults;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -060080 PFN_vkCreateBuffer CreateBuffer;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -060081 PFN_vkDestroyBuffer DestroyBuffer;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -060082 PFN_vkCreateBufferView CreateBufferView;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -060083 PFN_vkDestroyBufferView DestroyBufferView;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -060084 PFN_vkCreateImage CreateImage;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -060085 PFN_vkDestroyImage DestroyImage;
Tony Barbour59a47322015-06-24 16:06:58 -060086 PFN_vkGetImageSubresourceLayout GetImageSubresourceLayout;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -060087 PFN_vkCreateImageView CreateImageView;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -060088 PFN_vkDestroyImageView DestroyImageView;
Courtney Goeltzenleuchter2d2cb682015-06-24 18:24:19 -060089 PFN_vkCreateShaderModule CreateShaderModule;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -060090 PFN_vkDestroyShaderModule DestroyShaderModule;
Jon Ashburnc669cc62015-07-09 15:02:25 -060091 PFN_vkCreatePipelineCache CreatePipelineCache;
92 PFN_vkDestroyPipelineCache DestroyPipelineCache;
Jon Ashburnc669cc62015-07-09 15:02:25 -060093 PFN_vkGetPipelineCacheData GetPipelineCacheData;
94 PFN_vkMergePipelineCaches MergePipelineCaches;
95 PFN_vkCreateGraphicsPipelines CreateGraphicsPipelines;
96 PFN_vkCreateComputePipelines CreateComputePipelines;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -060097 PFN_vkDestroyPipeline DestroyPipeline;
Mark Lobodzinski0fadf5f2015-04-17 14:11:39 -050098 PFN_vkCreatePipelineLayout CreatePipelineLayout;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -060099 PFN_vkDestroyPipelineLayout DestroyPipelineLayout;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600100 PFN_vkCreateSampler CreateSampler;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600101 PFN_vkDestroySampler DestroySampler;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600102 PFN_vkCreateDescriptorSetLayout CreateDescriptorSetLayout;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600103 PFN_vkDestroyDescriptorSetLayout DestroyDescriptorSetLayout;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600104 PFN_vkCreateDescriptorPool CreateDescriptorPool;
Tony Barbour1d2cd3f2015-07-03 10:33:54 -0600105 PFN_vkDestroyDescriptorPool DestroyDescriptorPool;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600106 PFN_vkResetDescriptorPool ResetDescriptorPool;
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800107 PFN_vkAllocateDescriptorSets AllocateDescriptorSets;
Tony Barbour34ec6922015-07-10 10:50:45 -0600108 PFN_vkFreeDescriptorSets FreeDescriptorSets;
Chia-I Wu9d00ed72015-05-25 16:27:55 +0800109 PFN_vkUpdateDescriptorSets UpdateDescriptorSets;
Jon Ashburn42540ef2015-07-23 18:48:20 -0600110 PFN_vkCreateFramebuffer CreateFramebuffer;
111 PFN_vkDestroyFramebuffer DestroyFramebuffer;
112 PFN_vkCreateRenderPass CreateRenderPass;
113 PFN_vkDestroyRenderPass DestroyRenderPass;
114 PFN_vkGetRenderAreaGranularity GetRenderAreaGranularity;
Cody Northrope62183e2015-07-09 18:08:05 -0600115 PFN_vkCreateCommandPool CreateCommandPool;
116 PFN_vkDestroyCommandPool DestroyCommandPool;
117 PFN_vkResetCommandPool ResetCommandPool;
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800118 PFN_vkAllocateCommandBuffers AllocateCommandBuffers;
Courtney Goeltzenleuchterbee18a92015-10-23 14:21:05 -0600119 PFN_vkFreeCommandBuffers FreeCommandBuffers;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600120 PFN_vkBeginCommandBuffer BeginCommandBuffer;
121 PFN_vkEndCommandBuffer EndCommandBuffer;
122 PFN_vkResetCommandBuffer ResetCommandBuffer;
123 PFN_vkCmdBindPipeline CmdBindPipeline;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600124 PFN_vkCmdBindDescriptorSets CmdBindDescriptorSets;
Courtney Goeltzenleuchterf68ad722015-04-16 13:38:46 -0600125 PFN_vkCmdBindVertexBuffers CmdBindVertexBuffers;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600126 PFN_vkCmdBindIndexBuffer CmdBindIndexBuffer;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600127 PFN_vkCmdSetViewport CmdSetViewport;
Courtney Goeltzenleuchter078f8172015-09-21 11:44:06 -0600128 PFN_vkCmdSetScissor CmdSetScissor;
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600129 PFN_vkCmdSetLineWidth CmdSetLineWidth;
130 PFN_vkCmdSetDepthBias CmdSetDepthBias;
131 PFN_vkCmdSetBlendConstants CmdSetBlendConstants;
132 PFN_vkCmdSetDepthBounds CmdSetDepthBounds;
133 PFN_vkCmdSetStencilCompareMask CmdSetStencilCompareMask;
134 PFN_vkCmdSetStencilWriteMask CmdSetStencilWriteMask;
135 PFN_vkCmdSetStencilReference CmdSetStencilReference;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600136 PFN_vkCmdDraw CmdDraw;
137 PFN_vkCmdDrawIndexed CmdDrawIndexed;
138 PFN_vkCmdDrawIndirect CmdDrawIndirect;
139 PFN_vkCmdDrawIndexedIndirect CmdDrawIndexedIndirect;
140 PFN_vkCmdDispatch CmdDispatch;
141 PFN_vkCmdDispatchIndirect CmdDispatchIndirect;
142 PFN_vkCmdCopyBuffer CmdCopyBuffer;
143 PFN_vkCmdCopyImage CmdCopyImage;
144 PFN_vkCmdBlitImage CmdBlitImage;
145 PFN_vkCmdCopyBufferToImage CmdCopyBufferToImage;
146 PFN_vkCmdCopyImageToBuffer CmdCopyImageToBuffer;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600147 PFN_vkCmdUpdateBuffer CmdUpdateBuffer;
148 PFN_vkCmdFillBuffer CmdFillBuffer;
149 PFN_vkCmdClearColorImage CmdClearColorImage;
Chris Forbesd9be82b2015-06-22 17:21:59 +1200150 PFN_vkCmdClearDepthStencilImage CmdClearDepthStencilImage;
Courtney Goeltzenleuchterc9323e02015-10-15 16:51:05 -0600151 PFN_vkCmdClearAttachments CmdClearAttachments;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600152 PFN_vkCmdResolveImage CmdResolveImage;
153 PFN_vkCmdSetEvent CmdSetEvent;
154 PFN_vkCmdResetEvent CmdResetEvent;
155 PFN_vkCmdWaitEvents CmdWaitEvents;
156 PFN_vkCmdPipelineBarrier CmdPipelineBarrier;
157 PFN_vkCmdBeginQuery CmdBeginQuery;
158 PFN_vkCmdEndQuery CmdEndQuery;
159 PFN_vkCmdResetQueryPool CmdResetQueryPool;
160 PFN_vkCmdWriteTimestamp CmdWriteTimestamp;
Courtney Goeltzenleuchter1dbc8e22015-04-15 18:21:13 -0600161 PFN_vkCmdCopyQueryPoolResults CmdCopyQueryPoolResults;
Jon Ashburn42540ef2015-07-23 18:48:20 -0600162 PFN_vkCmdPushConstants CmdPushConstants;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600163 PFN_vkCmdBeginRenderPass CmdBeginRenderPass;
Chia-I Wu08accc62015-07-07 11:50:03 +0800164 PFN_vkCmdNextSubpass CmdNextSubpass;
Courtney Goeltzenleuchterfb4efc62015-04-10 08:34:15 -0600165 PFN_vkCmdEndRenderPass CmdEndRenderPass;
Chia-I Wu0b50a1c2015-06-26 15:34:39 +0800166 PFN_vkCmdExecuteCommands CmdExecuteCommands;
Ian Elliott7e40db92015-08-21 15:09:33 -0600167 PFN_vkCreateSwapchainKHR CreateSwapchainKHR;
168 PFN_vkDestroySwapchainKHR DestroySwapchainKHR;
169 PFN_vkGetSwapchainImagesKHR GetSwapchainImagesKHR;
170 PFN_vkAcquireNextImageKHR AcquireNextImageKHR;
171 PFN_vkQueuePresentKHR QueuePresentKHR;
Jon Ashburnbacb0f52015-04-06 10:58:22 -0600172} VkLayerDispatchTable;
Courtney Goeltzenleuchter64d1a712015-04-08 18:04:29 -0600173
Karl Schultz37419ed2016-02-02 12:32:50 -0700174typedef struct VkLayerInstanceDispatchTable_ {
Jon Ashburnfbb4e252015-05-04 16:27:53 -0600175 PFN_vkGetInstanceProcAddr GetInstanceProcAddr;
Jon Ashburnfbb4e252015-05-04 16:27:53 -0600176 PFN_vkDestroyInstance DestroyInstance;
177 PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices;
Chris Forbesbc0bb772015-06-21 22:55:02 +1200178 PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures;
Karl Schultz37419ed2016-02-02 12:32:50 -0700179 PFN_vkGetPhysicalDeviceImageFormatProperties
180 GetPhysicalDeviceImageFormatProperties;
Courtney Goeltzenleuchter2caec862015-07-12 12:52:09 -0600181 PFN_vkGetPhysicalDeviceFormatProperties GetPhysicalDeviceFormatProperties;
Karl Schultz37419ed2016-02-02 12:32:50 -0700182 PFN_vkGetPhysicalDeviceSparseImageFormatProperties
183 GetPhysicalDeviceSparseImageFormatProperties;
Tony Barbour59a47322015-06-24 16:06:58 -0600184 PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties;
Karl Schultz37419ed2016-02-02 12:32:50 -0700185 PFN_vkGetPhysicalDeviceQueueFamilyProperties
186 GetPhysicalDeviceQueueFamilyProperties;
Tony Barbour59a47322015-06-24 16:06:58 -0600187 PFN_vkGetPhysicalDeviceMemoryProperties GetPhysicalDeviceMemoryProperties;
Courtney Goeltzenleuchter35985f62015-09-14 17:22:16 -0600188 PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties;
189 PFN_vkEnumerateDeviceLayerProperties EnumerateDeviceLayerProperties;
Jon Ashburn2a1ec502015-11-23 18:55:15 -0700190 PFN_vkDestroySurfaceKHR DestroySurfaceKHR;
Ian Elliott7e40db92015-08-21 15:09:33 -0600191 PFN_vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR;
Karl Schultz37419ed2016-02-02 12:32:50 -0700192 PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR
193 GetPhysicalDeviceSurfaceCapabilitiesKHR;
Ian Elliott33ed8482015-11-18 15:20:45 -0700194 PFN_vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR;
Karl Schultz37419ed2016-02-02 12:32:50 -0700195 PFN_vkGetPhysicalDeviceSurfacePresentModesKHR
196 GetPhysicalDeviceSurfacePresentModesKHR;
Courtney Goeltzenleuchter7415d5a2015-12-09 15:48:16 -0700197 PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallbackEXT;
198 PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallbackEXT;
199 PFN_vkDebugReportMessageEXT DebugReportMessageEXT;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700200#ifdef VK_USE_PLATFORM_MIR_KHR
201 PFN_vkCreateMirSurfaceKHR CreateMirSurfaceKHR;
Karl Schultz37419ed2016-02-02 12:32:50 -0700202 PFN_vkGetPhysicalDeviceMirPresentationSupportKHR
203 GetPhysicalDeviceMirPresentationSupportKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700204#endif
205#ifdef VK_USE_PLATFORM_WAYLAND_KHR
206 PFN_vkCreateWaylandSurfaceKHR CreateWaylandSurfaceKHR;
Karl Schultz37419ed2016-02-02 12:32:50 -0700207 PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR
208 GetPhysicalDeviceWaylandPresentationSupportKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700209#endif
210#ifdef VK_USE_PLATFORM_WIN32_KHR
211 PFN_vkCreateWin32SurfaceKHR CreateWin32SurfaceKHR;
Karl Schultz37419ed2016-02-02 12:32:50 -0700212 PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR
213 GetPhysicalDeviceWin32PresentationSupportKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700214#endif
215#ifdef VK_USE_PLATFORM_XCB_KHR
216 PFN_vkCreateXcbSurfaceKHR CreateXcbSurfaceKHR;
Karl Schultz37419ed2016-02-02 12:32:50 -0700217 PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR
218 GetPhysicalDeviceXcbPresentationSupportKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700219#endif
220#ifdef VK_USE_PLATFORM_XLIB_KHR
221 PFN_vkCreateXlibSurfaceKHR CreateXlibSurfaceKHR;
Karl Schultz37419ed2016-02-02 12:32:50 -0700222 PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR
223 GetPhysicalDeviceXlibPresentationSupportKHR;
Ian Elliottdb4300a2015-11-23 10:17:23 -0700224#endif
Mark Lobodzinskia8a5f852015-12-10 16:25:21 -0700225#ifdef VK_USE_PLATFORM_ANDROID_KHR
226 PFN_vkCreateAndroidSurfaceKHR CreateAndroidSurfaceKHR;
227#endif
Jon Ashburnc7d3e732016-03-08 09:30:30 -0700228 PFN_vkGetPhysicalDeviceDisplayPropertiesKHR
229 GetPhysicalDeviceDisplayPropertiesKHR;
230 PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR
231 GetPhysicalDeviceDisplayPlanePropertiesKHR;
232 PFN_vkGetDisplayPlaneSupportedDisplaysKHR
233 GetDisplayPlaneSupportedDisplaysKHR;
234 PFN_vkGetDisplayModePropertiesKHR
235 GetDisplayModePropertiesKHR;
236 PFN_vkCreateDisplayModeKHR
237 CreateDisplayModeKHR;
238 PFN_vkGetDisplayPlaneCapabilitiesKHR
239 GetDisplayPlaneCapabilitiesKHR;
240 PFN_vkCreateDisplayPlaneSurfaceKHR
241 CreateDisplayPlaneSurfaceKHR;
Jon Ashburnfbb4e252015-05-04 16:27:53 -0600242} VkLayerInstanceDispatchTable;
243
Courtney Goeltzenleuchter64d1a712015-04-08 18:04:29 -0600244// LL node for tree of dbg callback functions
Karl Schultz37419ed2016-02-02 12:32:50 -0700245typedef struct VkLayerDbgFunctionNode_ {
Courtney Goeltzenleuchter7415d5a2015-12-09 15:48:16 -0700246 VkDebugReportCallbackEXT msgCallback;
247 PFN_vkDebugReportCallbackEXT pfnMsgCallback;
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600248 VkFlags msgFlags;
Courtney Goeltzenleuchter23cc9132016-01-18 17:42:08 -0700249 void *pUserData;
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600250 struct VkLayerDbgFunctionNode_ *pNext;
251} VkLayerDbgFunctionNode;
Courtney Goeltzenleuchter64d1a712015-04-08 18:04:29 -0600252
Karl Schultz37419ed2016-02-02 12:32:50 -0700253typedef enum VkLayerDbgAction_ {
Courtney Goeltzenleuchter64d1a712015-04-08 18:04:29 -0600254 VK_DBG_LAYER_ACTION_IGNORE = 0x0,
255 VK_DBG_LAYER_ACTION_CALLBACK = 0x1,
256 VK_DBG_LAYER_ACTION_LOG_MSG = 0x2,
Courtney Goeltzenleuchter5907ac42015-10-05 14:41:34 -0600257 VK_DBG_LAYER_ACTION_BREAK = 0x4,
258 VK_DBG_LAYER_ACTION_DEBUG_OUTPUT = 0x8,
Courtney Goeltzenleuchterf579fa62015-06-10 17:39:03 -0600259} VkLayerDbgAction;
Courtney Goeltzenleuchter64d1a712015-04-08 18:04:29 -0600260
Courtney Goeltzenleuchter64d1a712015-04-08 18:04:29 -0600261// ------------------------------------------------------------------------------------------------
Courtney Goeltzenleuchter8286acc2016-01-08 11:40:27 -0700262// CreateInstance and CreateDevice support structures
Courtney Goeltzenleuchter00150eb2016-01-08 12:18:43 -0700263
Jon Ashburnc3c58772016-03-29 11:16:01 -0600264/* Sub type of structure for instance and device loader ext of CreateInfo.
265 * When sType == VK_STRUCTURE_TYPE_LAYER_INSTANCE_CREATE_INFO
266 * or sType == VK_STRUCTURE_TYPE_LAYER_DEVICE_CREATE_INFO
267 * then VkLayerFunction indicates struct type pointed to by pNext
268 */
Karl Schultz37419ed2016-02-02 12:32:50 -0700269typedef enum VkLayerFunction_ {
Courtney Goeltzenleuchter00150eb2016-01-08 12:18:43 -0700270 VK_LAYER_LINK_INFO = 0,
Jon Ashburnc3c58772016-03-29 11:16:01 -0600271 VK_LAYER_DEVICE_INFO = 1,
272 VK_LOADER_DISPATCH_CALLBACK = 2
Courtney Goeltzenleuchter00150eb2016-01-08 12:18:43 -0700273} VkLayerFunction;
274
Courtney Goeltzenleuchter8286acc2016-01-08 11:40:27 -0700275typedef struct VkLayerInstanceLink_ {
Karl Schultz37419ed2016-02-02 12:32:50 -0700276 struct VkLayerInstanceLink_ *pNext;
Courtney Goeltzenleuchter8286acc2016-01-08 11:40:27 -0700277 PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr;
278} VkLayerInstanceLink;
279
Courtney Goeltzenleuchter00150eb2016-01-08 12:18:43 -0700280/*
281 * When creating the device chain the loader needs to pass
282 * down information about it's device structure needed at
283 * the end of the chain. Passing the data via the
284 * VkLayerDeviceInfo avoids issues with finding the
285 * exact instance being used.
286 */
287typedef struct VkLayerDeviceInfo_ {
288 void *device_info;
289 PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr;
290} VkLayerDeviceInfo;
291
Jon Ashburnc3c58772016-03-29 11:16:01 -0600292typedef VkResult (VKAPI_PTR *PFN_vkSetInstanceLoaderData)(VkInstance instance,
293 void *object);
294
Courtney Goeltzenleuchter8286acc2016-01-08 11:40:27 -0700295typedef struct {
296 VkStructureType sType; // VK_STRUCTURE_TYPE_LAYER_INSTANCE_CREATE_INFO
Karl Schultz37419ed2016-02-02 12:32:50 -0700297 const void *pNext;
Courtney Goeltzenleuchter00150eb2016-01-08 12:18:43 -0700298 VkLayerFunction function;
299 union {
Karl Schultz37419ed2016-02-02 12:32:50 -0700300 VkLayerInstanceLink *pLayerInfo;
Jon Ashburnc3c58772016-03-29 11:16:01 -0600301 PFN_vkSetInstanceLoaderData pfnSetInstanceLoaderData;
Courtney Goeltzenleuchter00150eb2016-01-08 12:18:43 -0700302 } u;
Courtney Goeltzenleuchter8286acc2016-01-08 11:40:27 -0700303} VkLayerInstanceCreateInfo;
304
305typedef struct VkLayerDeviceLink_ {
Karl Schultz37419ed2016-02-02 12:32:50 -0700306 struct VkLayerDeviceLink_ *pNext;
Courtney Goeltzenleuchter8286acc2016-01-08 11:40:27 -0700307 PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr;
308 PFN_vkGetDeviceProcAddr pfnNextGetDeviceProcAddr;
309} VkLayerDeviceLink;
310
311typedef struct {
312 VkStructureType sType; // VK_STRUCTURE_TYPE_LAYER_DEVICE_CREATE_INFO
Karl Schultz37419ed2016-02-02 12:32:50 -0700313 const void *pNext;
Courtney Goeltzenleuchter00150eb2016-01-08 12:18:43 -0700314 VkLayerFunction function;
315 union {
Karl Schultz37419ed2016-02-02 12:32:50 -0700316 VkLayerDeviceLink *pLayerInfo;
Courtney Goeltzenleuchter00150eb2016-01-08 12:18:43 -0700317 VkLayerDeviceInfo deviceInfo;
318 } u;
Courtney Goeltzenleuchter8286acc2016-01-08 11:40:27 -0700319} VkLayerDeviceCreateInfo;
320
321// ------------------------------------------------------------------------------------------------
Courtney Goeltzenleuchter64d1a712015-04-08 18:04:29 -0600322// API functions