blob: cf16b2b7b139f61d15da4686936cd7eb25a5e879 [file] [log] [blame]
Karl Schultz673df322016-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 *
Jon Ashburn43b53e82016-04-19 11:30:31 -06009 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
Karl Schultz673df322016-02-02 12:32:50 -070012 *
Jon Ashburn43b53e82016-04-19 11:30:31 -060013 * http://www.apache.org/licenses/LICENSE-2.0
Karl Schultz673df322016-02-02 12:32:50 -070014 *
Jon Ashburn43b53e82016-04-19 11:30:31 -060015 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
Karl Schultz673df322016-02-02 12:32:50 -070020 *
21 */
22
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -060023/* Need to define dispatch table
24 * Core struct can then have ptr to dispatch table at the top
25 * Along with object ptrs for current and next OBJ
26 */
27#pragma once
28
Karl Schultz78b0dd42016-02-10 15:41:43 -070029#include "vulkan.h"
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -060030#if defined(__GNUC__) && __GNUC__ >= 4
Karl Schultz673df322016-02-02 12:32:50 -070031#define VK_LAYER_EXPORT __attribute__((visibility("default")))
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -060032#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
Karl Schultz673df322016-02-02 12:32:50 -070033#define VK_LAYER_EXPORT __attribute__((visibility("default")))
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -060034#else
Karl Schultz673df322016-02-02 12:32:50 -070035#define VK_LAYER_EXPORT
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -060036#endif
37
Karl Schultz673df322016-02-02 12:32:50 -070038typedef struct VkLayerDispatchTable_ {
Jon Ashburn1245cec2015-05-18 13:20:15 -060039 PFN_vkGetDeviceProcAddr GetDeviceProcAddr;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060040 PFN_vkDestroyDevice DestroyDevice;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060041 PFN_vkGetDeviceQueue GetDeviceQueue;
42 PFN_vkQueueSubmit QueueSubmit;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060043 PFN_vkQueueWaitIdle QueueWaitIdle;
44 PFN_vkDeviceWaitIdle DeviceWaitIdle;
Chia-I Wu1f851912015-10-27 18:04:07 +080045 PFN_vkAllocateMemory AllocateMemory;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060046 PFN_vkFreeMemory FreeMemory;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060047 PFN_vkMapMemory MapMemory;
48 PFN_vkUnmapMemory UnmapMemory;
Courtney Goeltzenleuchtera569a502015-04-29 17:16:21 -060049 PFN_vkFlushMappedMemoryRanges FlushMappedMemoryRanges;
50 PFN_vkInvalidateMappedMemoryRanges InvalidateMappedMemoryRanges;
Courtney Goeltzenleuchterd040c5c2015-07-09 21:57:28 -060051 PFN_vkGetDeviceMemoryCommitment GetDeviceMemoryCommitment;
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -060052 PFN_vkGetImageSparseMemoryRequirements GetImageSparseMemoryRequirements;
Tony Barbourde4124d2015-07-03 10:33:54 -060053 PFN_vkGetImageMemoryRequirements GetImageMemoryRequirements;
54 PFN_vkGetBufferMemoryRequirements GetBufferMemoryRequirements;
55 PFN_vkBindImageMemory BindImageMemory;
56 PFN_vkBindBufferMemory BindBufferMemory;
Chia-I Wu06809d52015-10-26 16:55:27 +080057 PFN_vkQueueBindSparse QueueBindSparse;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060058 PFN_vkCreateFence CreateFence;
Tony Barbourde4124d2015-07-03 10:33:54 -060059 PFN_vkDestroyFence DestroyFence;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060060 PFN_vkGetFenceStatus GetFenceStatus;
61 PFN_vkResetFences ResetFences;
62 PFN_vkWaitForFences WaitForFences;
63 PFN_vkCreateSemaphore CreateSemaphore;
Tony Barbourde4124d2015-07-03 10:33:54 -060064 PFN_vkDestroySemaphore DestroySemaphore;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060065 PFN_vkCreateEvent CreateEvent;
Tony Barbourde4124d2015-07-03 10:33:54 -060066 PFN_vkDestroyEvent DestroyEvent;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060067 PFN_vkGetEventStatus GetEventStatus;
68 PFN_vkSetEvent SetEvent;
69 PFN_vkResetEvent ResetEvent;
70 PFN_vkCreateQueryPool CreateQueryPool;
Tony Barbourde4124d2015-07-03 10:33:54 -060071 PFN_vkDestroyQueryPool DestroyQueryPool;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060072 PFN_vkGetQueryPoolResults GetQueryPoolResults;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060073 PFN_vkCreateBuffer CreateBuffer;
Tony Barbourde4124d2015-07-03 10:33:54 -060074 PFN_vkDestroyBuffer DestroyBuffer;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060075 PFN_vkCreateBufferView CreateBufferView;
Tony Barbourde4124d2015-07-03 10:33:54 -060076 PFN_vkDestroyBufferView DestroyBufferView;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060077 PFN_vkCreateImage CreateImage;
Tony Barbourde4124d2015-07-03 10:33:54 -060078 PFN_vkDestroyImage DestroyImage;
Tony Barbour426b9052015-06-24 16:06:58 -060079 PFN_vkGetImageSubresourceLayout GetImageSubresourceLayout;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060080 PFN_vkCreateImageView CreateImageView;
Tony Barbourde4124d2015-07-03 10:33:54 -060081 PFN_vkDestroyImageView DestroyImageView;
Courtney Goeltzenleuchter0b29b0d2015-06-24 18:24:19 -060082 PFN_vkCreateShaderModule CreateShaderModule;
Tony Barbourde4124d2015-07-03 10:33:54 -060083 PFN_vkDestroyShaderModule DestroyShaderModule;
Jon Ashburn0d60d272015-07-09 15:02:25 -060084 PFN_vkCreatePipelineCache CreatePipelineCache;
85 PFN_vkDestroyPipelineCache DestroyPipelineCache;
Jon Ashburn0d60d272015-07-09 15:02:25 -060086 PFN_vkGetPipelineCacheData GetPipelineCacheData;
87 PFN_vkMergePipelineCaches MergePipelineCaches;
88 PFN_vkCreateGraphicsPipelines CreateGraphicsPipelines;
89 PFN_vkCreateComputePipelines CreateComputePipelines;
Tony Barbourde4124d2015-07-03 10:33:54 -060090 PFN_vkDestroyPipeline DestroyPipeline;
Mark Lobodzinski556f7212015-04-17 14:11:39 -050091 PFN_vkCreatePipelineLayout CreatePipelineLayout;
Tony Barbourde4124d2015-07-03 10:33:54 -060092 PFN_vkDestroyPipelineLayout DestroyPipelineLayout;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060093 PFN_vkCreateSampler CreateSampler;
Tony Barbourde4124d2015-07-03 10:33:54 -060094 PFN_vkDestroySampler DestroySampler;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060095 PFN_vkCreateDescriptorSetLayout CreateDescriptorSetLayout;
Tony Barbourde4124d2015-07-03 10:33:54 -060096 PFN_vkDestroyDescriptorSetLayout DestroyDescriptorSetLayout;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060097 PFN_vkCreateDescriptorPool CreateDescriptorPool;
Tony Barbourde4124d2015-07-03 10:33:54 -060098 PFN_vkDestroyDescriptorPool DestroyDescriptorPool;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060099 PFN_vkResetDescriptorPool ResetDescriptorPool;
Chia-I Wu1f851912015-10-27 18:04:07 +0800100 PFN_vkAllocateDescriptorSets AllocateDescriptorSets;
Tony Barbourb857d312015-07-10 10:50:45 -0600101 PFN_vkFreeDescriptorSets FreeDescriptorSets;
Chia-I Wu8cd8ecd2015-05-25 16:27:55 +0800102 PFN_vkUpdateDescriptorSets UpdateDescriptorSets;
Jon Ashburna25465c2015-07-23 18:48:20 -0600103 PFN_vkCreateFramebuffer CreateFramebuffer;
104 PFN_vkDestroyFramebuffer DestroyFramebuffer;
105 PFN_vkCreateRenderPass CreateRenderPass;
106 PFN_vkDestroyRenderPass DestroyRenderPass;
107 PFN_vkGetRenderAreaGranularity GetRenderAreaGranularity;
Cody Northropf02f9f82015-07-09 18:08:05 -0600108 PFN_vkCreateCommandPool CreateCommandPool;
109 PFN_vkDestroyCommandPool DestroyCommandPool;
110 PFN_vkResetCommandPool ResetCommandPool;
Chia-I Wu1f851912015-10-27 18:04:07 +0800111 PFN_vkAllocateCommandBuffers AllocateCommandBuffers;
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -0600112 PFN_vkFreeCommandBuffers FreeCommandBuffers;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600113 PFN_vkBeginCommandBuffer BeginCommandBuffer;
114 PFN_vkEndCommandBuffer EndCommandBuffer;
115 PFN_vkResetCommandBuffer ResetCommandBuffer;
116 PFN_vkCmdBindPipeline CmdBindPipeline;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600117 PFN_vkCmdBindDescriptorSets CmdBindDescriptorSets;
Courtney Goeltzenleuchter46962942015-04-16 13:38:46 -0600118 PFN_vkCmdBindVertexBuffers CmdBindVertexBuffers;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600119 PFN_vkCmdBindIndexBuffer CmdBindIndexBuffer;
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -0600120 PFN_vkCmdSetViewport CmdSetViewport;
Courtney Goeltzenleuchter932cdb52015-09-21 11:44:06 -0600121 PFN_vkCmdSetScissor CmdSetScissor;
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -0600122 PFN_vkCmdSetLineWidth CmdSetLineWidth;
123 PFN_vkCmdSetDepthBias CmdSetDepthBias;
124 PFN_vkCmdSetBlendConstants CmdSetBlendConstants;
125 PFN_vkCmdSetDepthBounds CmdSetDepthBounds;
126 PFN_vkCmdSetStencilCompareMask CmdSetStencilCompareMask;
127 PFN_vkCmdSetStencilWriteMask CmdSetStencilWriteMask;
128 PFN_vkCmdSetStencilReference CmdSetStencilReference;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600129 PFN_vkCmdDraw CmdDraw;
130 PFN_vkCmdDrawIndexed CmdDrawIndexed;
131 PFN_vkCmdDrawIndirect CmdDrawIndirect;
132 PFN_vkCmdDrawIndexedIndirect CmdDrawIndexedIndirect;
133 PFN_vkCmdDispatch CmdDispatch;
134 PFN_vkCmdDispatchIndirect CmdDispatchIndirect;
135 PFN_vkCmdCopyBuffer CmdCopyBuffer;
136 PFN_vkCmdCopyImage CmdCopyImage;
137 PFN_vkCmdBlitImage CmdBlitImage;
138 PFN_vkCmdCopyBufferToImage CmdCopyBufferToImage;
139 PFN_vkCmdCopyImageToBuffer CmdCopyImageToBuffer;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600140 PFN_vkCmdUpdateBuffer CmdUpdateBuffer;
141 PFN_vkCmdFillBuffer CmdFillBuffer;
142 PFN_vkCmdClearColorImage CmdClearColorImage;
Chris Forbes2951d7d2015-06-22 17:21:59 +1200143 PFN_vkCmdClearDepthStencilImage CmdClearDepthStencilImage;
Courtney Goeltzenleuchter9feb0732015-10-15 16:51:05 -0600144 PFN_vkCmdClearAttachments CmdClearAttachments;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600145 PFN_vkCmdResolveImage CmdResolveImage;
146 PFN_vkCmdSetEvent CmdSetEvent;
147 PFN_vkCmdResetEvent CmdResetEvent;
148 PFN_vkCmdWaitEvents CmdWaitEvents;
149 PFN_vkCmdPipelineBarrier CmdPipelineBarrier;
150 PFN_vkCmdBeginQuery CmdBeginQuery;
151 PFN_vkCmdEndQuery CmdEndQuery;
152 PFN_vkCmdResetQueryPool CmdResetQueryPool;
153 PFN_vkCmdWriteTimestamp CmdWriteTimestamp;
Courtney Goeltzenleuchter98049062015-04-15 18:21:13 -0600154 PFN_vkCmdCopyQueryPoolResults CmdCopyQueryPoolResults;
Jon Ashburna25465c2015-07-23 18:48:20 -0600155 PFN_vkCmdPushConstants CmdPushConstants;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600156 PFN_vkCmdBeginRenderPass CmdBeginRenderPass;
Chia-I Wuc278df82015-07-07 11:50:03 +0800157 PFN_vkCmdNextSubpass CmdNextSubpass;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600158 PFN_vkCmdEndRenderPass CmdEndRenderPass;
Chia-I Wu88eaa3b2015-06-26 15:34:39 +0800159 PFN_vkCmdExecuteCommands CmdExecuteCommands;
Ian Elliott338dedb2015-08-21 15:09:33 -0600160 PFN_vkCreateSwapchainKHR CreateSwapchainKHR;
161 PFN_vkDestroySwapchainKHR DestroySwapchainKHR;
162 PFN_vkGetSwapchainImagesKHR GetSwapchainImagesKHR;
163 PFN_vkAcquireNextImageKHR AcquireNextImageKHR;
164 PFN_vkQueuePresentKHR QueuePresentKHR;
Jon Ashburn301c5f02015-04-06 10:58:22 -0600165} VkLayerDispatchTable;
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -0600166
Karl Schultz673df322016-02-02 12:32:50 -0700167typedef struct VkLayerInstanceDispatchTable_ {
Jon Ashburn9a9bb642015-05-04 16:27:53 -0600168 PFN_vkGetInstanceProcAddr GetInstanceProcAddr;
Jon Ashburn9a9bb642015-05-04 16:27:53 -0600169 PFN_vkDestroyInstance DestroyInstance;
170 PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices;
Chris Forbesd7576302015-06-21 22:55:02 +1200171 PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures;
Karl Schultz673df322016-02-02 12:32:50 -0700172 PFN_vkGetPhysicalDeviceImageFormatProperties
173 GetPhysicalDeviceImageFormatProperties;
Courtney Goeltzenleuchter4da96aa2015-07-12 12:52:09 -0600174 PFN_vkGetPhysicalDeviceFormatProperties GetPhysicalDeviceFormatProperties;
Karl Schultz673df322016-02-02 12:32:50 -0700175 PFN_vkGetPhysicalDeviceSparseImageFormatProperties
176 GetPhysicalDeviceSparseImageFormatProperties;
Tony Barbour426b9052015-06-24 16:06:58 -0600177 PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties;
Karl Schultz673df322016-02-02 12:32:50 -0700178 PFN_vkGetPhysicalDeviceQueueFamilyProperties
179 GetPhysicalDeviceQueueFamilyProperties;
Tony Barbour426b9052015-06-24 16:06:58 -0600180 PFN_vkGetPhysicalDeviceMemoryProperties GetPhysicalDeviceMemoryProperties;
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -0600181 PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties;
182 PFN_vkEnumerateDeviceLayerProperties EnumerateDeviceLayerProperties;
Jon Ashburn6911e8c2015-11-23 18:55:15 -0700183 PFN_vkDestroySurfaceKHR DestroySurfaceKHR;
Ian Elliott338dedb2015-08-21 15:09:33 -0600184 PFN_vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR;
Karl Schultz673df322016-02-02 12:32:50 -0700185 PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR
186 GetPhysicalDeviceSurfaceCapabilitiesKHR;
Ian Elliottbb03f402015-11-18 15:20:45 -0700187 PFN_vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR;
Karl Schultz673df322016-02-02 12:32:50 -0700188 PFN_vkGetPhysicalDeviceSurfacePresentModesKHR
189 GetPhysicalDeviceSurfacePresentModesKHR;
Courtney Goeltzenleuchteracb13592015-12-09 15:48:16 -0700190 PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallbackEXT;
191 PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallbackEXT;
192 PFN_vkDebugReportMessageEXT DebugReportMessageEXT;
Ian Elliott40c4a1f2015-11-23 10:17:23 -0700193#ifdef VK_USE_PLATFORM_MIR_KHR
194 PFN_vkCreateMirSurfaceKHR CreateMirSurfaceKHR;
Karl Schultz673df322016-02-02 12:32:50 -0700195 PFN_vkGetPhysicalDeviceMirPresentationSupportKHR
196 GetPhysicalDeviceMirPresentationSupportKHR;
Ian Elliott40c4a1f2015-11-23 10:17:23 -0700197#endif
198#ifdef VK_USE_PLATFORM_WAYLAND_KHR
199 PFN_vkCreateWaylandSurfaceKHR CreateWaylandSurfaceKHR;
Karl Schultz673df322016-02-02 12:32:50 -0700200 PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR
201 GetPhysicalDeviceWaylandPresentationSupportKHR;
Ian Elliott40c4a1f2015-11-23 10:17:23 -0700202#endif
203#ifdef VK_USE_PLATFORM_WIN32_KHR
204 PFN_vkCreateWin32SurfaceKHR CreateWin32SurfaceKHR;
Karl Schultz673df322016-02-02 12:32:50 -0700205 PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR
206 GetPhysicalDeviceWin32PresentationSupportKHR;
Ian Elliott40c4a1f2015-11-23 10:17:23 -0700207#endif
208#ifdef VK_USE_PLATFORM_XCB_KHR
209 PFN_vkCreateXcbSurfaceKHR CreateXcbSurfaceKHR;
Karl Schultz673df322016-02-02 12:32:50 -0700210 PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR
211 GetPhysicalDeviceXcbPresentationSupportKHR;
Ian Elliott40c4a1f2015-11-23 10:17:23 -0700212#endif
213#ifdef VK_USE_PLATFORM_XLIB_KHR
214 PFN_vkCreateXlibSurfaceKHR CreateXlibSurfaceKHR;
Karl Schultz673df322016-02-02 12:32:50 -0700215 PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR
216 GetPhysicalDeviceXlibPresentationSupportKHR;
Ian Elliott40c4a1f2015-11-23 10:17:23 -0700217#endif
Mark Lobodzinskib3e934d2015-12-10 16:25:21 -0700218#ifdef VK_USE_PLATFORM_ANDROID_KHR
219 PFN_vkCreateAndroidSurfaceKHR CreateAndroidSurfaceKHR;
220#endif
Jon Ashburn00df0452016-03-08 09:30:30 -0700221 PFN_vkGetPhysicalDeviceDisplayPropertiesKHR
222 GetPhysicalDeviceDisplayPropertiesKHR;
223 PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR
224 GetPhysicalDeviceDisplayPlanePropertiesKHR;
225 PFN_vkGetDisplayPlaneSupportedDisplaysKHR
226 GetDisplayPlaneSupportedDisplaysKHR;
227 PFN_vkGetDisplayModePropertiesKHR
228 GetDisplayModePropertiesKHR;
229 PFN_vkCreateDisplayModeKHR
230 CreateDisplayModeKHR;
231 PFN_vkGetDisplayPlaneCapabilitiesKHR
232 GetDisplayPlaneCapabilitiesKHR;
233 PFN_vkCreateDisplayPlaneSurfaceKHR
234 CreateDisplayPlaneSurfaceKHR;
Jon Ashburn9a9bb642015-05-04 16:27:53 -0600235} VkLayerInstanceDispatchTable;
236
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -0600237// LL node for tree of dbg callback functions
Karl Schultz673df322016-02-02 12:32:50 -0700238typedef struct VkLayerDbgFunctionNode_ {
Courtney Goeltzenleuchteracb13592015-12-09 15:48:16 -0700239 VkDebugReportCallbackEXT msgCallback;
240 PFN_vkDebugReportCallbackEXT pfnMsgCallback;
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600241 VkFlags msgFlags;
Courtney Goeltzenleuchter240fb9f2016-01-18 17:42:08 -0700242 void *pUserData;
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600243 struct VkLayerDbgFunctionNode_ *pNext;
244} VkLayerDbgFunctionNode;
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -0600245
Karl Schultz673df322016-02-02 12:32:50 -0700246typedef enum VkLayerDbgAction_ {
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -0600247 VK_DBG_LAYER_ACTION_IGNORE = 0x0,
248 VK_DBG_LAYER_ACTION_CALLBACK = 0x1,
249 VK_DBG_LAYER_ACTION_LOG_MSG = 0x2,
Courtney Goeltzenleuchterb94f0512015-10-05 14:41:34 -0600250 VK_DBG_LAYER_ACTION_BREAK = 0x4,
251 VK_DBG_LAYER_ACTION_DEBUG_OUTPUT = 0x8,
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600252} VkLayerDbgAction;
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -0600253
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -0600254// ------------------------------------------------------------------------------------------------
Courtney Goeltzenleuchter2ff4e1d2016-01-08 11:40:27 -0700255// CreateInstance and CreateDevice support structures
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700256
Jon Ashburn7ec8ec82016-03-29 11:16:01 -0600257/* Sub type of structure for instance and device loader ext of CreateInfo.
ttyiof6493a12016-04-10 22:07:28 +0800258 * When sType == VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO
259 * or sType == VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO
Jon Ashburn7ec8ec82016-03-29 11:16:01 -0600260 * then VkLayerFunction indicates struct type pointed to by pNext
261 */
Karl Schultz673df322016-02-02 12:32:50 -0700262typedef enum VkLayerFunction_ {
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700263 VK_LAYER_LINK_INFO = 0,
Jon Ashburn94d58ea2016-03-31 10:52:22 -0600264 VK_LOADER_DATA_CALLBACK = 1
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700265} VkLayerFunction;
266
Courtney Goeltzenleuchter2ff4e1d2016-01-08 11:40:27 -0700267typedef struct VkLayerInstanceLink_ {
Karl Schultz673df322016-02-02 12:32:50 -0700268 struct VkLayerInstanceLink_ *pNext;
Courtney Goeltzenleuchter2ff4e1d2016-01-08 11:40:27 -0700269 PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr;
270} VkLayerInstanceLink;
271
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700272/*
273 * When creating the device chain the loader needs to pass
274 * down information about it's device structure needed at
275 * the end of the chain. Passing the data via the
276 * VkLayerDeviceInfo avoids issues with finding the
277 * exact instance being used.
278 */
279typedef struct VkLayerDeviceInfo_ {
280 void *device_info;
281 PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr;
282} VkLayerDeviceInfo;
283
Jon Ashburn7ec8ec82016-03-29 11:16:01 -0600284typedef VkResult (VKAPI_PTR *PFN_vkSetInstanceLoaderData)(VkInstance instance,
285 void *object);
Jon Ashburn94d58ea2016-03-31 10:52:22 -0600286typedef VkResult (VKAPI_PTR *PFN_vkSetDeviceLoaderData)(VkDevice device,
287 void *object);
Jon Ashburn7ec8ec82016-03-29 11:16:01 -0600288
Courtney Goeltzenleuchter2ff4e1d2016-01-08 11:40:27 -0700289typedef struct {
Vinjn Zhangdc1ebf02016-04-06 15:38:24 +0800290 VkStructureType sType; // VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO
Karl Schultz673df322016-02-02 12:32:50 -0700291 const void *pNext;
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700292 VkLayerFunction function;
293 union {
Karl Schultz673df322016-02-02 12:32:50 -0700294 VkLayerInstanceLink *pLayerInfo;
Jon Ashburn7ec8ec82016-03-29 11:16:01 -0600295 PFN_vkSetInstanceLoaderData pfnSetInstanceLoaderData;
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700296 } u;
Courtney Goeltzenleuchter2ff4e1d2016-01-08 11:40:27 -0700297} VkLayerInstanceCreateInfo;
298
299typedef struct VkLayerDeviceLink_ {
Karl Schultz673df322016-02-02 12:32:50 -0700300 struct VkLayerDeviceLink_ *pNext;
Courtney Goeltzenleuchter2ff4e1d2016-01-08 11:40:27 -0700301 PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr;
302 PFN_vkGetDeviceProcAddr pfnNextGetDeviceProcAddr;
303} VkLayerDeviceLink;
304
305typedef struct {
Vinjn Zhangdc1ebf02016-04-06 15:38:24 +0800306 VkStructureType sType; // VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO
Karl Schultz673df322016-02-02 12:32:50 -0700307 const void *pNext;
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700308 VkLayerFunction function;
309 union {
Karl Schultz673df322016-02-02 12:32:50 -0700310 VkLayerDeviceLink *pLayerInfo;
Jon Ashburn94d58ea2016-03-31 10:52:22 -0600311 PFN_vkSetDeviceLoaderData pfnSetDeviceLoaderData;
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700312 } u;
Courtney Goeltzenleuchter2ff4e1d2016-01-08 11:40:27 -0700313} VkLayerDeviceCreateInfo;
314