blob: 6b774c8f332c08d7eba9aca5e7223d212421cce4 [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 *
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 *
19 * The Materials are Confidential Information as defined by the Khronos
20 * Membership Agreement until designated non-confidential by Khronos, at which
21 * point this condition clause shall be removed.
22 *
23 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
26 *
27 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
28 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
29 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE
30 * USE OR OTHER DEALINGS IN THE MATERIALS.
31 *
32 */
33
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -060034/* Need to define dispatch table
35 * Core struct can then have ptr to dispatch table at the top
36 * Along with object ptrs for current and next OBJ
37 */
38#pragma once
39
David Pinedo329ca9e2015-11-06 12:54:48 -070040#include "vulkan/vulkan.h"
Courtney Goeltzenleuchteracb13592015-12-09 15:48:16 -070041#include <vulkan/vk_ext_debug_report.h>
David Pinedoa31fe0b2015-11-24 09:00:24 -070042#include "vulkan/vk_lunarg_debug_marker.h"
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -060043#if defined(__GNUC__) && __GNUC__ >= 4
Karl Schultz673df322016-02-02 12:32:50 -070044#define VK_LAYER_EXPORT __attribute__((visibility("default")))
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -060045#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
Karl Schultz673df322016-02-02 12:32:50 -070046#define VK_LAYER_EXPORT __attribute__((visibility("default")))
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -060047#else
Karl Schultz673df322016-02-02 12:32:50 -070048#define VK_LAYER_EXPORT
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -060049#endif
50
Karl Schultz673df322016-02-02 12:32:50 -070051typedef struct VkLayerDispatchTable_ {
Jon Ashburn1245cec2015-05-18 13:20:15 -060052 PFN_vkGetDeviceProcAddr GetDeviceProcAddr;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060053 PFN_vkDestroyDevice DestroyDevice;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060054 PFN_vkGetDeviceQueue GetDeviceQueue;
55 PFN_vkQueueSubmit QueueSubmit;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060056 PFN_vkQueueWaitIdle QueueWaitIdle;
57 PFN_vkDeviceWaitIdle DeviceWaitIdle;
Chia-I Wu1f851912015-10-27 18:04:07 +080058 PFN_vkAllocateMemory AllocateMemory;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060059 PFN_vkFreeMemory FreeMemory;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060060 PFN_vkMapMemory MapMemory;
61 PFN_vkUnmapMemory UnmapMemory;
Courtney Goeltzenleuchtera569a502015-04-29 17:16:21 -060062 PFN_vkFlushMappedMemoryRanges FlushMappedMemoryRanges;
63 PFN_vkInvalidateMappedMemoryRanges InvalidateMappedMemoryRanges;
Courtney Goeltzenleuchterd040c5c2015-07-09 21:57:28 -060064 PFN_vkGetDeviceMemoryCommitment GetDeviceMemoryCommitment;
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -060065 PFN_vkGetImageSparseMemoryRequirements GetImageSparseMemoryRequirements;
Tony Barbourde4124d2015-07-03 10:33:54 -060066 PFN_vkGetImageMemoryRequirements GetImageMemoryRequirements;
67 PFN_vkGetBufferMemoryRequirements GetBufferMemoryRequirements;
68 PFN_vkBindImageMemory BindImageMemory;
69 PFN_vkBindBufferMemory BindBufferMemory;
Chia-I Wu06809d52015-10-26 16:55:27 +080070 PFN_vkQueueBindSparse QueueBindSparse;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060071 PFN_vkCreateFence CreateFence;
Tony Barbourde4124d2015-07-03 10:33:54 -060072 PFN_vkDestroyFence DestroyFence;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060073 PFN_vkGetFenceStatus GetFenceStatus;
74 PFN_vkResetFences ResetFences;
75 PFN_vkWaitForFences WaitForFences;
76 PFN_vkCreateSemaphore CreateSemaphore;
Tony Barbourde4124d2015-07-03 10:33:54 -060077 PFN_vkDestroySemaphore DestroySemaphore;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060078 PFN_vkCreateEvent CreateEvent;
Tony Barbourde4124d2015-07-03 10:33:54 -060079 PFN_vkDestroyEvent DestroyEvent;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060080 PFN_vkGetEventStatus GetEventStatus;
81 PFN_vkSetEvent SetEvent;
82 PFN_vkResetEvent ResetEvent;
83 PFN_vkCreateQueryPool CreateQueryPool;
Tony Barbourde4124d2015-07-03 10:33:54 -060084 PFN_vkDestroyQueryPool DestroyQueryPool;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060085 PFN_vkGetQueryPoolResults GetQueryPoolResults;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060086 PFN_vkCreateBuffer CreateBuffer;
Tony Barbourde4124d2015-07-03 10:33:54 -060087 PFN_vkDestroyBuffer DestroyBuffer;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060088 PFN_vkCreateBufferView CreateBufferView;
Tony Barbourde4124d2015-07-03 10:33:54 -060089 PFN_vkDestroyBufferView DestroyBufferView;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060090 PFN_vkCreateImage CreateImage;
Tony Barbourde4124d2015-07-03 10:33:54 -060091 PFN_vkDestroyImage DestroyImage;
Tony Barbour426b9052015-06-24 16:06:58 -060092 PFN_vkGetImageSubresourceLayout GetImageSubresourceLayout;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060093 PFN_vkCreateImageView CreateImageView;
Tony Barbourde4124d2015-07-03 10:33:54 -060094 PFN_vkDestroyImageView DestroyImageView;
Courtney Goeltzenleuchter0b29b0d2015-06-24 18:24:19 -060095 PFN_vkCreateShaderModule CreateShaderModule;
Tony Barbourde4124d2015-07-03 10:33:54 -060096 PFN_vkDestroyShaderModule DestroyShaderModule;
Jon Ashburn0d60d272015-07-09 15:02:25 -060097 PFN_vkCreatePipelineCache CreatePipelineCache;
98 PFN_vkDestroyPipelineCache DestroyPipelineCache;
Jon Ashburn0d60d272015-07-09 15:02:25 -060099 PFN_vkGetPipelineCacheData GetPipelineCacheData;
100 PFN_vkMergePipelineCaches MergePipelineCaches;
101 PFN_vkCreateGraphicsPipelines CreateGraphicsPipelines;
102 PFN_vkCreateComputePipelines CreateComputePipelines;
Tony Barbourde4124d2015-07-03 10:33:54 -0600103 PFN_vkDestroyPipeline DestroyPipeline;
Mark Lobodzinski556f7212015-04-17 14:11:39 -0500104 PFN_vkCreatePipelineLayout CreatePipelineLayout;
Tony Barbourde4124d2015-07-03 10:33:54 -0600105 PFN_vkDestroyPipelineLayout DestroyPipelineLayout;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600106 PFN_vkCreateSampler CreateSampler;
Tony Barbourde4124d2015-07-03 10:33:54 -0600107 PFN_vkDestroySampler DestroySampler;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600108 PFN_vkCreateDescriptorSetLayout CreateDescriptorSetLayout;
Tony Barbourde4124d2015-07-03 10:33:54 -0600109 PFN_vkDestroyDescriptorSetLayout DestroyDescriptorSetLayout;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600110 PFN_vkCreateDescriptorPool CreateDescriptorPool;
Tony Barbourde4124d2015-07-03 10:33:54 -0600111 PFN_vkDestroyDescriptorPool DestroyDescriptorPool;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600112 PFN_vkResetDescriptorPool ResetDescriptorPool;
Chia-I Wu1f851912015-10-27 18:04:07 +0800113 PFN_vkAllocateDescriptorSets AllocateDescriptorSets;
Tony Barbourb857d312015-07-10 10:50:45 -0600114 PFN_vkFreeDescriptorSets FreeDescriptorSets;
Chia-I Wu8cd8ecd2015-05-25 16:27:55 +0800115 PFN_vkUpdateDescriptorSets UpdateDescriptorSets;
Jon Ashburna25465c2015-07-23 18:48:20 -0600116 PFN_vkCreateFramebuffer CreateFramebuffer;
117 PFN_vkDestroyFramebuffer DestroyFramebuffer;
118 PFN_vkCreateRenderPass CreateRenderPass;
119 PFN_vkDestroyRenderPass DestroyRenderPass;
120 PFN_vkGetRenderAreaGranularity GetRenderAreaGranularity;
Cody Northropf02f9f82015-07-09 18:08:05 -0600121 PFN_vkCreateCommandPool CreateCommandPool;
122 PFN_vkDestroyCommandPool DestroyCommandPool;
123 PFN_vkResetCommandPool ResetCommandPool;
Chia-I Wu1f851912015-10-27 18:04:07 +0800124 PFN_vkAllocateCommandBuffers AllocateCommandBuffers;
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -0600125 PFN_vkFreeCommandBuffers FreeCommandBuffers;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600126 PFN_vkBeginCommandBuffer BeginCommandBuffer;
127 PFN_vkEndCommandBuffer EndCommandBuffer;
128 PFN_vkResetCommandBuffer ResetCommandBuffer;
129 PFN_vkCmdBindPipeline CmdBindPipeline;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600130 PFN_vkCmdBindDescriptorSets CmdBindDescriptorSets;
Courtney Goeltzenleuchter46962942015-04-16 13:38:46 -0600131 PFN_vkCmdBindVertexBuffers CmdBindVertexBuffers;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600132 PFN_vkCmdBindIndexBuffer CmdBindIndexBuffer;
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -0600133 PFN_vkCmdSetViewport CmdSetViewport;
Courtney Goeltzenleuchter932cdb52015-09-21 11:44:06 -0600134 PFN_vkCmdSetScissor CmdSetScissor;
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -0600135 PFN_vkCmdSetLineWidth CmdSetLineWidth;
136 PFN_vkCmdSetDepthBias CmdSetDepthBias;
137 PFN_vkCmdSetBlendConstants CmdSetBlendConstants;
138 PFN_vkCmdSetDepthBounds CmdSetDepthBounds;
139 PFN_vkCmdSetStencilCompareMask CmdSetStencilCompareMask;
140 PFN_vkCmdSetStencilWriteMask CmdSetStencilWriteMask;
141 PFN_vkCmdSetStencilReference CmdSetStencilReference;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600142 PFN_vkCmdDraw CmdDraw;
143 PFN_vkCmdDrawIndexed CmdDrawIndexed;
144 PFN_vkCmdDrawIndirect CmdDrawIndirect;
145 PFN_vkCmdDrawIndexedIndirect CmdDrawIndexedIndirect;
146 PFN_vkCmdDispatch CmdDispatch;
147 PFN_vkCmdDispatchIndirect CmdDispatchIndirect;
148 PFN_vkCmdCopyBuffer CmdCopyBuffer;
149 PFN_vkCmdCopyImage CmdCopyImage;
150 PFN_vkCmdBlitImage CmdBlitImage;
151 PFN_vkCmdCopyBufferToImage CmdCopyBufferToImage;
152 PFN_vkCmdCopyImageToBuffer CmdCopyImageToBuffer;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600153 PFN_vkCmdUpdateBuffer CmdUpdateBuffer;
154 PFN_vkCmdFillBuffer CmdFillBuffer;
155 PFN_vkCmdClearColorImage CmdClearColorImage;
Chris Forbes2951d7d2015-06-22 17:21:59 +1200156 PFN_vkCmdClearDepthStencilImage CmdClearDepthStencilImage;
Courtney Goeltzenleuchter9feb0732015-10-15 16:51:05 -0600157 PFN_vkCmdClearAttachments CmdClearAttachments;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600158 PFN_vkCmdResolveImage CmdResolveImage;
159 PFN_vkCmdSetEvent CmdSetEvent;
160 PFN_vkCmdResetEvent CmdResetEvent;
161 PFN_vkCmdWaitEvents CmdWaitEvents;
162 PFN_vkCmdPipelineBarrier CmdPipelineBarrier;
163 PFN_vkCmdBeginQuery CmdBeginQuery;
164 PFN_vkCmdEndQuery CmdEndQuery;
165 PFN_vkCmdResetQueryPool CmdResetQueryPool;
166 PFN_vkCmdWriteTimestamp CmdWriteTimestamp;
Courtney Goeltzenleuchter98049062015-04-15 18:21:13 -0600167 PFN_vkCmdCopyQueryPoolResults CmdCopyQueryPoolResults;
Jon Ashburna25465c2015-07-23 18:48:20 -0600168 PFN_vkCmdPushConstants CmdPushConstants;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600169 PFN_vkCmdBeginRenderPass CmdBeginRenderPass;
Chia-I Wuc278df82015-07-07 11:50:03 +0800170 PFN_vkCmdNextSubpass CmdNextSubpass;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600171 PFN_vkCmdEndRenderPass CmdEndRenderPass;
Chia-I Wu88eaa3b2015-06-26 15:34:39 +0800172 PFN_vkCmdExecuteCommands CmdExecuteCommands;
Ian Elliott338dedb2015-08-21 15:09:33 -0600173 PFN_vkCreateSwapchainKHR CreateSwapchainKHR;
174 PFN_vkDestroySwapchainKHR DestroySwapchainKHR;
175 PFN_vkGetSwapchainImagesKHR GetSwapchainImagesKHR;
176 PFN_vkAcquireNextImageKHR AcquireNextImageKHR;
177 PFN_vkQueuePresentKHR QueuePresentKHR;
Jon Ashburn301c5f02015-04-06 10:58:22 -0600178} VkLayerDispatchTable;
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -0600179
Karl Schultz673df322016-02-02 12:32:50 -0700180typedef struct VkLayerInstanceDispatchTable_ {
Jon Ashburn9a9bb642015-05-04 16:27:53 -0600181 PFN_vkGetInstanceProcAddr GetInstanceProcAddr;
Jon Ashburn9a9bb642015-05-04 16:27:53 -0600182 PFN_vkDestroyInstance DestroyInstance;
183 PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices;
Chris Forbesd7576302015-06-21 22:55:02 +1200184 PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures;
Karl Schultz673df322016-02-02 12:32:50 -0700185 PFN_vkGetPhysicalDeviceImageFormatProperties
186 GetPhysicalDeviceImageFormatProperties;
Courtney Goeltzenleuchter4da96aa2015-07-12 12:52:09 -0600187 PFN_vkGetPhysicalDeviceFormatProperties GetPhysicalDeviceFormatProperties;
Karl Schultz673df322016-02-02 12:32:50 -0700188 PFN_vkGetPhysicalDeviceSparseImageFormatProperties
189 GetPhysicalDeviceSparseImageFormatProperties;
Tony Barbour426b9052015-06-24 16:06:58 -0600190 PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties;
Karl Schultz673df322016-02-02 12:32:50 -0700191 PFN_vkGetPhysicalDeviceQueueFamilyProperties
192 GetPhysicalDeviceQueueFamilyProperties;
Tony Barbour426b9052015-06-24 16:06:58 -0600193 PFN_vkGetPhysicalDeviceMemoryProperties GetPhysicalDeviceMemoryProperties;
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -0600194 PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties;
195 PFN_vkEnumerateDeviceLayerProperties EnumerateDeviceLayerProperties;
Jon Ashburn6911e8c2015-11-23 18:55:15 -0700196 PFN_vkDestroySurfaceKHR DestroySurfaceKHR;
Ian Elliott338dedb2015-08-21 15:09:33 -0600197 PFN_vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR;
Karl Schultz673df322016-02-02 12:32:50 -0700198 PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR
199 GetPhysicalDeviceSurfaceCapabilitiesKHR;
Ian Elliottbb03f402015-11-18 15:20:45 -0700200 PFN_vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR;
Karl Schultz673df322016-02-02 12:32:50 -0700201 PFN_vkGetPhysicalDeviceSurfacePresentModesKHR
202 GetPhysicalDeviceSurfacePresentModesKHR;
Courtney Goeltzenleuchteracb13592015-12-09 15:48:16 -0700203 PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallbackEXT;
204 PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallbackEXT;
205 PFN_vkDebugReportMessageEXT DebugReportMessageEXT;
Ian Elliott40c4a1f2015-11-23 10:17:23 -0700206#ifdef VK_USE_PLATFORM_MIR_KHR
207 PFN_vkCreateMirSurfaceKHR CreateMirSurfaceKHR;
Karl Schultz673df322016-02-02 12:32:50 -0700208 PFN_vkGetPhysicalDeviceMirPresentationSupportKHR
209 GetPhysicalDeviceMirPresentationSupportKHR;
Ian Elliott40c4a1f2015-11-23 10:17:23 -0700210#endif
211#ifdef VK_USE_PLATFORM_WAYLAND_KHR
212 PFN_vkCreateWaylandSurfaceKHR CreateWaylandSurfaceKHR;
Karl Schultz673df322016-02-02 12:32:50 -0700213 PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR
214 GetPhysicalDeviceWaylandPresentationSupportKHR;
Ian Elliott40c4a1f2015-11-23 10:17:23 -0700215#endif
216#ifdef VK_USE_PLATFORM_WIN32_KHR
217 PFN_vkCreateWin32SurfaceKHR CreateWin32SurfaceKHR;
Karl Schultz673df322016-02-02 12:32:50 -0700218 PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR
219 GetPhysicalDeviceWin32PresentationSupportKHR;
Ian Elliott40c4a1f2015-11-23 10:17:23 -0700220#endif
221#ifdef VK_USE_PLATFORM_XCB_KHR
222 PFN_vkCreateXcbSurfaceKHR CreateXcbSurfaceKHR;
Karl Schultz673df322016-02-02 12:32:50 -0700223 PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR
224 GetPhysicalDeviceXcbPresentationSupportKHR;
Ian Elliott40c4a1f2015-11-23 10:17:23 -0700225#endif
226#ifdef VK_USE_PLATFORM_XLIB_KHR
227 PFN_vkCreateXlibSurfaceKHR CreateXlibSurfaceKHR;
Karl Schultz673df322016-02-02 12:32:50 -0700228 PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR
229 GetPhysicalDeviceXlibPresentationSupportKHR;
Ian Elliott40c4a1f2015-11-23 10:17:23 -0700230#endif
Mark Lobodzinskib3e934d2015-12-10 16:25:21 -0700231#ifdef VK_USE_PLATFORM_ANDROID_KHR
232 PFN_vkCreateAndroidSurfaceKHR CreateAndroidSurfaceKHR;
233#endif
Jon Ashburn9a9bb642015-05-04 16:27:53 -0600234} VkLayerInstanceDispatchTable;
235
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -0600236// LL node for tree of dbg callback functions
Karl Schultz673df322016-02-02 12:32:50 -0700237typedef struct VkLayerDbgFunctionNode_ {
Courtney Goeltzenleuchteracb13592015-12-09 15:48:16 -0700238 VkDebugReportCallbackEXT msgCallback;
239 PFN_vkDebugReportCallbackEXT pfnMsgCallback;
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600240 VkFlags msgFlags;
Courtney Goeltzenleuchter240fb9f2016-01-18 17:42:08 -0700241 void *pUserData;
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600242 struct VkLayerDbgFunctionNode_ *pNext;
243} VkLayerDbgFunctionNode;
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -0600244
Karl Schultz673df322016-02-02 12:32:50 -0700245typedef enum VkLayerDbgAction_ {
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -0600246 VK_DBG_LAYER_ACTION_IGNORE = 0x0,
247 VK_DBG_LAYER_ACTION_CALLBACK = 0x1,
248 VK_DBG_LAYER_ACTION_LOG_MSG = 0x2,
Courtney Goeltzenleuchterb94f0512015-10-05 14:41:34 -0600249 VK_DBG_LAYER_ACTION_BREAK = 0x4,
250 VK_DBG_LAYER_ACTION_DEBUG_OUTPUT = 0x8,
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600251} VkLayerDbgAction;
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -0600252
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -0600253// ------------------------------------------------------------------------------------------------
Courtney Goeltzenleuchter2ff4e1d2016-01-08 11:40:27 -0700254// CreateInstance and CreateDevice support structures
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700255
Karl Schultz673df322016-02-02 12:32:50 -0700256typedef enum VkLayerFunction_ {
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700257 VK_LAYER_LINK_INFO = 0,
258 VK_LAYER_DEVICE_INFO = 1,
259 VK_LAYER_INSTANCE_INFO = 2
260} VkLayerFunction;
261
262/*
263 * When creating the device chain the loader needs to pass
264 * down information about it's device structure needed at
265 * the end of the chain. Passing the data via the
Jon Ashburn2d81a482016-01-20 08:07:14 -0700266 * VkLayerInstanceInfo avoids issues with finding the
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700267 * exact instance being used.
268 */
269typedef struct VkLayerInstanceInfo_ {
270 void *instance_info;
271 PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr;
272} VkLayerInstanceInfo;
273
Courtney Goeltzenleuchter2ff4e1d2016-01-08 11:40:27 -0700274typedef struct VkLayerInstanceLink_ {
Karl Schultz673df322016-02-02 12:32:50 -0700275 struct VkLayerInstanceLink_ *pNext;
Courtney Goeltzenleuchter2ff4e1d2016-01-08 11:40:27 -0700276 PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr;
277} VkLayerInstanceLink;
278
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700279/*
280 * When creating the device chain the loader needs to pass
281 * down information about it's device structure needed at
282 * the end of the chain. Passing the data via the
283 * VkLayerDeviceInfo avoids issues with finding the
284 * exact instance being used.
285 */
286typedef struct VkLayerDeviceInfo_ {
287 void *device_info;
288 PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr;
289} VkLayerDeviceInfo;
290
Courtney Goeltzenleuchter2ff4e1d2016-01-08 11:40:27 -0700291typedef struct {
292 VkStructureType sType; // VK_STRUCTURE_TYPE_LAYER_INSTANCE_CREATE_INFO
Karl Schultz673df322016-02-02 12:32:50 -0700293 const void *pNext;
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700294 VkLayerFunction function;
295 union {
Karl Schultz673df322016-02-02 12:32:50 -0700296 VkLayerInstanceLink *pLayerInfo;
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700297 VkLayerInstanceInfo instanceInfo;
298 } u;
Courtney Goeltzenleuchter2ff4e1d2016-01-08 11:40:27 -0700299} VkLayerInstanceCreateInfo;
300
301typedef struct VkLayerDeviceLink_ {
Karl Schultz673df322016-02-02 12:32:50 -0700302 struct VkLayerDeviceLink_ *pNext;
Courtney Goeltzenleuchter2ff4e1d2016-01-08 11:40:27 -0700303 PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr;
304 PFN_vkGetDeviceProcAddr pfnNextGetDeviceProcAddr;
305} VkLayerDeviceLink;
306
307typedef struct {
308 VkStructureType sType; // VK_STRUCTURE_TYPE_LAYER_DEVICE_CREATE_INFO
Karl Schultz673df322016-02-02 12:32:50 -0700309 const void *pNext;
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700310 VkLayerFunction function;
311 union {
Karl Schultz673df322016-02-02 12:32:50 -0700312 VkLayerDeviceLink *pLayerInfo;
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700313 VkLayerDeviceInfo deviceInfo;
314 } u;
Courtney Goeltzenleuchter2ff4e1d2016-01-08 11:40:27 -0700315} VkLayerDeviceCreateInfo;
316
317// ------------------------------------------------------------------------------------------------
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -0600318// API functions