blob: da19dddb6889e612a645ea839a4e6261de566eab [file] [log] [blame]
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -06001/* 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
David Pinedo329ca9e2015-11-06 12:54:48 -07007#include "vulkan/vulkan.h"
Courtney Goeltzenleuchteracb13592015-12-09 15:48:16 -07008#include <vulkan/vk_ext_debug_report.h>
David Pinedoa31fe0b2015-11-24 09:00:24 -07009#include "vulkan/vk_lunarg_debug_marker.h"
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -060010#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
Jon Ashburn429e19f2015-11-17 15:31:02 -070018typedef void * (VKAPI_PTR *PFN_vkGPA)(void* obj, const char * pName);
Jon Ashburn301c5f02015-04-06 10:58:22 -060019typedef struct VkBaseLayerObject_
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -060020{
Jon Ashburn79b78ac2015-05-05 14:22:52 -060021 PFN_vkGPA pGPA;
Tony Barbourde4124d2015-07-03 10:33:54 -060022 void* nextObject;
23 void* baseObject;
Jon Ashburn301c5f02015-04-06 10:58:22 -060024} VkBaseLayerObject;
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -060025
Jon Ashburn301c5f02015-04-06 10:58:22 -060026typedef struct VkLayerDispatchTable_
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -060027{
Jon Ashburn1245cec2015-05-18 13:20:15 -060028 PFN_vkGetDeviceProcAddr GetDeviceProcAddr;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060029 PFN_vkDestroyDevice DestroyDevice;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060030 PFN_vkGetDeviceQueue GetDeviceQueue;
31 PFN_vkQueueSubmit QueueSubmit;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060032 PFN_vkQueueWaitIdle QueueWaitIdle;
33 PFN_vkDeviceWaitIdle DeviceWaitIdle;
Chia-I Wu1f851912015-10-27 18:04:07 +080034 PFN_vkAllocateMemory AllocateMemory;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060035 PFN_vkFreeMemory FreeMemory;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060036 PFN_vkMapMemory MapMemory;
37 PFN_vkUnmapMemory UnmapMemory;
Courtney Goeltzenleuchtera569a502015-04-29 17:16:21 -060038 PFN_vkFlushMappedMemoryRanges FlushMappedMemoryRanges;
39 PFN_vkInvalidateMappedMemoryRanges InvalidateMappedMemoryRanges;
Courtney Goeltzenleuchterd040c5c2015-07-09 21:57:28 -060040 PFN_vkGetDeviceMemoryCommitment GetDeviceMemoryCommitment;
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -060041 PFN_vkGetImageSparseMemoryRequirements GetImageSparseMemoryRequirements;
Tony Barbourde4124d2015-07-03 10:33:54 -060042 PFN_vkGetImageMemoryRequirements GetImageMemoryRequirements;
43 PFN_vkGetBufferMemoryRequirements GetBufferMemoryRequirements;
44 PFN_vkBindImageMemory BindImageMemory;
45 PFN_vkBindBufferMemory BindBufferMemory;
Chia-I Wu06809d52015-10-26 16:55:27 +080046 PFN_vkQueueBindSparse QueueBindSparse;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060047 PFN_vkCreateFence CreateFence;
Tony Barbourde4124d2015-07-03 10:33:54 -060048 PFN_vkDestroyFence DestroyFence;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060049 PFN_vkGetFenceStatus GetFenceStatus;
50 PFN_vkResetFences ResetFences;
51 PFN_vkWaitForFences WaitForFences;
52 PFN_vkCreateSemaphore CreateSemaphore;
Tony Barbourde4124d2015-07-03 10:33:54 -060053 PFN_vkDestroySemaphore DestroySemaphore;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060054 PFN_vkCreateEvent CreateEvent;
Tony Barbourde4124d2015-07-03 10:33:54 -060055 PFN_vkDestroyEvent DestroyEvent;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060056 PFN_vkGetEventStatus GetEventStatus;
57 PFN_vkSetEvent SetEvent;
58 PFN_vkResetEvent ResetEvent;
59 PFN_vkCreateQueryPool CreateQueryPool;
Tony Barbourde4124d2015-07-03 10:33:54 -060060 PFN_vkDestroyQueryPool DestroyQueryPool;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060061 PFN_vkGetQueryPoolResults GetQueryPoolResults;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060062 PFN_vkCreateBuffer CreateBuffer;
Tony Barbourde4124d2015-07-03 10:33:54 -060063 PFN_vkDestroyBuffer DestroyBuffer;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060064 PFN_vkCreateBufferView CreateBufferView;
Tony Barbourde4124d2015-07-03 10:33:54 -060065 PFN_vkDestroyBufferView DestroyBufferView;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060066 PFN_vkCreateImage CreateImage;
Tony Barbourde4124d2015-07-03 10:33:54 -060067 PFN_vkDestroyImage DestroyImage;
Tony Barbour426b9052015-06-24 16:06:58 -060068 PFN_vkGetImageSubresourceLayout GetImageSubresourceLayout;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060069 PFN_vkCreateImageView CreateImageView;
Tony Barbourde4124d2015-07-03 10:33:54 -060070 PFN_vkDestroyImageView DestroyImageView;
Courtney Goeltzenleuchter0b29b0d2015-06-24 18:24:19 -060071 PFN_vkCreateShaderModule CreateShaderModule;
Tony Barbourde4124d2015-07-03 10:33:54 -060072 PFN_vkDestroyShaderModule DestroyShaderModule;
Jon Ashburn0d60d272015-07-09 15:02:25 -060073 PFN_vkCreatePipelineCache CreatePipelineCache;
74 PFN_vkDestroyPipelineCache DestroyPipelineCache;
Jon Ashburn0d60d272015-07-09 15:02:25 -060075 PFN_vkGetPipelineCacheData GetPipelineCacheData;
76 PFN_vkMergePipelineCaches MergePipelineCaches;
77 PFN_vkCreateGraphicsPipelines CreateGraphicsPipelines;
78 PFN_vkCreateComputePipelines CreateComputePipelines;
Tony Barbourde4124d2015-07-03 10:33:54 -060079 PFN_vkDestroyPipeline DestroyPipeline;
Mark Lobodzinski556f7212015-04-17 14:11:39 -050080 PFN_vkCreatePipelineLayout CreatePipelineLayout;
Tony Barbourde4124d2015-07-03 10:33:54 -060081 PFN_vkDestroyPipelineLayout DestroyPipelineLayout;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060082 PFN_vkCreateSampler CreateSampler;
Tony Barbourde4124d2015-07-03 10:33:54 -060083 PFN_vkDestroySampler DestroySampler;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060084 PFN_vkCreateDescriptorSetLayout CreateDescriptorSetLayout;
Tony Barbourde4124d2015-07-03 10:33:54 -060085 PFN_vkDestroyDescriptorSetLayout DestroyDescriptorSetLayout;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060086 PFN_vkCreateDescriptorPool CreateDescriptorPool;
Tony Barbourde4124d2015-07-03 10:33:54 -060087 PFN_vkDestroyDescriptorPool DestroyDescriptorPool;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -060088 PFN_vkResetDescriptorPool ResetDescriptorPool;
Chia-I Wu1f851912015-10-27 18:04:07 +080089 PFN_vkAllocateDescriptorSets AllocateDescriptorSets;
Tony Barbourb857d312015-07-10 10:50:45 -060090 PFN_vkFreeDescriptorSets FreeDescriptorSets;
Chia-I Wu8cd8ecd2015-05-25 16:27:55 +080091 PFN_vkUpdateDescriptorSets UpdateDescriptorSets;
Jon Ashburna25465c2015-07-23 18:48:20 -060092 PFN_vkCreateFramebuffer CreateFramebuffer;
93 PFN_vkDestroyFramebuffer DestroyFramebuffer;
94 PFN_vkCreateRenderPass CreateRenderPass;
95 PFN_vkDestroyRenderPass DestroyRenderPass;
96 PFN_vkGetRenderAreaGranularity GetRenderAreaGranularity;
Cody Northropf02f9f82015-07-09 18:08:05 -060097 PFN_vkCreateCommandPool CreateCommandPool;
98 PFN_vkDestroyCommandPool DestroyCommandPool;
99 PFN_vkResetCommandPool ResetCommandPool;
Chia-I Wu1f851912015-10-27 18:04:07 +0800100 PFN_vkAllocateCommandBuffers AllocateCommandBuffers;
Courtney Goeltzenleuchter831c1832015-10-23 14:21:05 -0600101 PFN_vkFreeCommandBuffers FreeCommandBuffers;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600102 PFN_vkBeginCommandBuffer BeginCommandBuffer;
103 PFN_vkEndCommandBuffer EndCommandBuffer;
104 PFN_vkResetCommandBuffer ResetCommandBuffer;
105 PFN_vkCmdBindPipeline CmdBindPipeline;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600106 PFN_vkCmdBindDescriptorSets CmdBindDescriptorSets;
Courtney Goeltzenleuchter46962942015-04-16 13:38:46 -0600107 PFN_vkCmdBindVertexBuffers CmdBindVertexBuffers;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600108 PFN_vkCmdBindIndexBuffer CmdBindIndexBuffer;
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -0600109 PFN_vkCmdSetViewport CmdSetViewport;
Courtney Goeltzenleuchter932cdb52015-09-21 11:44:06 -0600110 PFN_vkCmdSetScissor CmdSetScissor;
Courtney Goeltzenleuchter09772bb2015-09-17 15:06:17 -0600111 PFN_vkCmdSetLineWidth CmdSetLineWidth;
112 PFN_vkCmdSetDepthBias CmdSetDepthBias;
113 PFN_vkCmdSetBlendConstants CmdSetBlendConstants;
114 PFN_vkCmdSetDepthBounds CmdSetDepthBounds;
115 PFN_vkCmdSetStencilCompareMask CmdSetStencilCompareMask;
116 PFN_vkCmdSetStencilWriteMask CmdSetStencilWriteMask;
117 PFN_vkCmdSetStencilReference CmdSetStencilReference;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600118 PFN_vkCmdDraw CmdDraw;
119 PFN_vkCmdDrawIndexed CmdDrawIndexed;
120 PFN_vkCmdDrawIndirect CmdDrawIndirect;
121 PFN_vkCmdDrawIndexedIndirect CmdDrawIndexedIndirect;
122 PFN_vkCmdDispatch CmdDispatch;
123 PFN_vkCmdDispatchIndirect CmdDispatchIndirect;
124 PFN_vkCmdCopyBuffer CmdCopyBuffer;
125 PFN_vkCmdCopyImage CmdCopyImage;
126 PFN_vkCmdBlitImage CmdBlitImage;
127 PFN_vkCmdCopyBufferToImage CmdCopyBufferToImage;
128 PFN_vkCmdCopyImageToBuffer CmdCopyImageToBuffer;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600129 PFN_vkCmdUpdateBuffer CmdUpdateBuffer;
130 PFN_vkCmdFillBuffer CmdFillBuffer;
131 PFN_vkCmdClearColorImage CmdClearColorImage;
Chris Forbes2951d7d2015-06-22 17:21:59 +1200132 PFN_vkCmdClearDepthStencilImage CmdClearDepthStencilImage;
Courtney Goeltzenleuchter9feb0732015-10-15 16:51:05 -0600133 PFN_vkCmdClearAttachments CmdClearAttachments;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600134 PFN_vkCmdResolveImage CmdResolveImage;
135 PFN_vkCmdSetEvent CmdSetEvent;
136 PFN_vkCmdResetEvent CmdResetEvent;
137 PFN_vkCmdWaitEvents CmdWaitEvents;
138 PFN_vkCmdPipelineBarrier CmdPipelineBarrier;
139 PFN_vkCmdBeginQuery CmdBeginQuery;
140 PFN_vkCmdEndQuery CmdEndQuery;
141 PFN_vkCmdResetQueryPool CmdResetQueryPool;
142 PFN_vkCmdWriteTimestamp CmdWriteTimestamp;
Courtney Goeltzenleuchter98049062015-04-15 18:21:13 -0600143 PFN_vkCmdCopyQueryPoolResults CmdCopyQueryPoolResults;
Jon Ashburna25465c2015-07-23 18:48:20 -0600144 PFN_vkCmdPushConstants CmdPushConstants;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600145 PFN_vkCmdBeginRenderPass CmdBeginRenderPass;
Chia-I Wuc278df82015-07-07 11:50:03 +0800146 PFN_vkCmdNextSubpass CmdNextSubpass;
Courtney Goeltzenleuchter382489d2015-04-10 08:34:15 -0600147 PFN_vkCmdEndRenderPass CmdEndRenderPass;
Chia-I Wu88eaa3b2015-06-26 15:34:39 +0800148 PFN_vkCmdExecuteCommands CmdExecuteCommands;
Ian Elliott338dedb2015-08-21 15:09:33 -0600149 PFN_vkCreateSwapchainKHR CreateSwapchainKHR;
150 PFN_vkDestroySwapchainKHR DestroySwapchainKHR;
151 PFN_vkGetSwapchainImagesKHR GetSwapchainImagesKHR;
152 PFN_vkAcquireNextImageKHR AcquireNextImageKHR;
153 PFN_vkQueuePresentKHR QueuePresentKHR;
Jon Ashburn301c5f02015-04-06 10:58:22 -0600154} VkLayerDispatchTable;
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -0600155
Jon Ashburn9a9bb642015-05-04 16:27:53 -0600156typedef struct VkLayerInstanceDispatchTable_
157{
158 PFN_vkGetInstanceProcAddr GetInstanceProcAddr;
Jon Ashburn52c1d732015-05-12 17:23:55 -0600159 PFN_vkCreateInstance CreateInstance;
Jon Ashburn9a9bb642015-05-04 16:27:53 -0600160 PFN_vkDestroyInstance DestroyInstance;
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700161 PFN_vkCreateDevice CreateDevice;
Jon Ashburn9a9bb642015-05-04 16:27:53 -0600162 PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices;
Chris Forbesd7576302015-06-21 22:55:02 +1200163 PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures;
Jon Ashburna25465c2015-07-23 18:48:20 -0600164 PFN_vkGetPhysicalDeviceImageFormatProperties GetPhysicalDeviceImageFormatProperties;
Courtney Goeltzenleuchter4da96aa2015-07-12 12:52:09 -0600165 PFN_vkGetPhysicalDeviceFormatProperties GetPhysicalDeviceFormatProperties;
Mark Lobodzinski83d4e6a2015-07-03 15:58:09 -0600166 PFN_vkGetPhysicalDeviceSparseImageFormatProperties GetPhysicalDeviceSparseImageFormatProperties;
Tony Barbour426b9052015-06-24 16:06:58 -0600167 PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties;
Cody Northropef72e2a2015-08-03 17:04:53 -0600168 PFN_vkGetPhysicalDeviceQueueFamilyProperties GetPhysicalDeviceQueueFamilyProperties;
Tony Barbour426b9052015-06-24 16:06:58 -0600169 PFN_vkGetPhysicalDeviceMemoryProperties GetPhysicalDeviceMemoryProperties;
Courtney Goeltzenleuchter74c4ce92015-09-14 17:22:16 -0600170 PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties;
171 PFN_vkEnumerateDeviceLayerProperties EnumerateDeviceLayerProperties;
Jon Ashburn6911e8c2015-11-23 18:55:15 -0700172 PFN_vkDestroySurfaceKHR DestroySurfaceKHR;
Ian Elliott338dedb2015-08-21 15:09:33 -0600173 PFN_vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR;
Ian Elliottbb03f402015-11-18 15:20:45 -0700174 PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR GetPhysicalDeviceSurfaceCapabilitiesKHR;
175 PFN_vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR;
176 PFN_vkGetPhysicalDeviceSurfacePresentModesKHR GetPhysicalDeviceSurfacePresentModesKHR;
Courtney Goeltzenleuchteracb13592015-12-09 15:48:16 -0700177 PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallbackEXT;
178 PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallbackEXT;
179 PFN_vkDebugReportMessageEXT DebugReportMessageEXT;
Ian Elliott40c4a1f2015-11-23 10:17:23 -0700180#ifdef VK_USE_PLATFORM_MIR_KHR
181 PFN_vkCreateMirSurfaceKHR CreateMirSurfaceKHR;
Ian Elliott4e309e92015-11-24 15:39:10 -0700182 PFN_vkGetPhysicalDeviceMirPresentationSupportKHR GetPhysicalDeviceMirPresentationSupportKHR;
Ian Elliott40c4a1f2015-11-23 10:17:23 -0700183#endif
184#ifdef VK_USE_PLATFORM_WAYLAND_KHR
185 PFN_vkCreateWaylandSurfaceKHR CreateWaylandSurfaceKHR;
Ian Elliott4e309e92015-11-24 15:39:10 -0700186 PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR GetPhysicalDeviceWaylandPresentationSupportKHR;
Ian Elliott40c4a1f2015-11-23 10:17:23 -0700187#endif
188#ifdef VK_USE_PLATFORM_WIN32_KHR
189 PFN_vkCreateWin32SurfaceKHR CreateWin32SurfaceKHR;
Ian Elliott4e309e92015-11-24 15:39:10 -0700190 PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR GetPhysicalDeviceWin32PresentationSupportKHR;
Ian Elliott40c4a1f2015-11-23 10:17:23 -0700191#endif
192#ifdef VK_USE_PLATFORM_XCB_KHR
193 PFN_vkCreateXcbSurfaceKHR CreateXcbSurfaceKHR;
Ian Elliott4e309e92015-11-24 15:39:10 -0700194 PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR GetPhysicalDeviceXcbPresentationSupportKHR;
Ian Elliott40c4a1f2015-11-23 10:17:23 -0700195#endif
196#ifdef VK_USE_PLATFORM_XLIB_KHR
197 PFN_vkCreateXlibSurfaceKHR CreateXlibSurfaceKHR;
Ian Elliott4e309e92015-11-24 15:39:10 -0700198 PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR GetPhysicalDeviceXlibPresentationSupportKHR;
Ian Elliott40c4a1f2015-11-23 10:17:23 -0700199#endif
Mark Lobodzinskib3e934d2015-12-10 16:25:21 -0700200#ifdef VK_USE_PLATFORM_ANDROID_KHR
201 PFN_vkCreateAndroidSurfaceKHR CreateAndroidSurfaceKHR;
202#endif
Jon Ashburn9a9bb642015-05-04 16:27:53 -0600203} VkLayerInstanceDispatchTable;
204
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -0600205// LL node for tree of dbg callback functions
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600206typedef struct VkLayerDbgFunctionNode_
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -0600207{
Courtney Goeltzenleuchteracb13592015-12-09 15:48:16 -0700208 VkDebugReportCallbackEXT msgCallback;
209 PFN_vkDebugReportCallbackEXT pfnMsgCallback;
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600210 VkFlags msgFlags;
Courtney Goeltzenleuchter240fb9f2016-01-18 17:42:08 -0700211 void *pUserData;
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600212 struct VkLayerDbgFunctionNode_ *pNext;
213} VkLayerDbgFunctionNode;
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -0600214
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600215typedef enum VkLayerDbgAction_
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -0600216{
217 VK_DBG_LAYER_ACTION_IGNORE = 0x0,
218 VK_DBG_LAYER_ACTION_CALLBACK = 0x1,
219 VK_DBG_LAYER_ACTION_LOG_MSG = 0x2,
Courtney Goeltzenleuchterb94f0512015-10-05 14:41:34 -0600220 VK_DBG_LAYER_ACTION_BREAK = 0x4,
221 VK_DBG_LAYER_ACTION_DEBUG_OUTPUT = 0x8,
Courtney Goeltzenleuchter1c7c65d2015-06-10 17:39:03 -0600222} VkLayerDbgAction;
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -0600223
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -0600224// ------------------------------------------------------------------------------------------------
Courtney Goeltzenleuchter2ff4e1d2016-01-08 11:40:27 -0700225// CreateInstance and CreateDevice support structures
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700226
227typedef enum VkLayerFunction_
228{
229 VK_LAYER_LINK_INFO = 0,
230 VK_LAYER_DEVICE_INFO = 1,
231 VK_LAYER_INSTANCE_INFO = 2
232} VkLayerFunction;
233
234/*
235 * When creating the device chain the loader needs to pass
236 * down information about it's device structure needed at
237 * the end of the chain. Passing the data via the
238 * VkLayerDeviceInfo avoids issues with finding the
239 * exact instance being used.
240 */
241typedef struct VkLayerInstanceInfo_ {
242 void *instance_info;
243 PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr;
244} VkLayerInstanceInfo;
245
Courtney Goeltzenleuchter2ff4e1d2016-01-08 11:40:27 -0700246typedef struct VkLayerInstanceLink_ {
247 struct VkLayerInstanceLink_* pNext;
248 PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr;
249} VkLayerInstanceLink;
250
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700251/*
252 * When creating the device chain the loader needs to pass
253 * down information about it's device structure needed at
254 * the end of the chain. Passing the data via the
255 * VkLayerDeviceInfo avoids issues with finding the
256 * exact instance being used.
257 */
258typedef struct VkLayerDeviceInfo_ {
259 void *device_info;
260 PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr;
261} VkLayerDeviceInfo;
262
Courtney Goeltzenleuchter2ff4e1d2016-01-08 11:40:27 -0700263typedef struct {
264 VkStructureType sType; // VK_STRUCTURE_TYPE_LAYER_INSTANCE_CREATE_INFO
265 const void* pNext;
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700266 VkLayerFunction function;
267 union {
268 VkLayerInstanceLink* pLayerInfo;
269 VkLayerInstanceInfo instanceInfo;
270 } u;
Courtney Goeltzenleuchter2ff4e1d2016-01-08 11:40:27 -0700271} VkLayerInstanceCreateInfo;
272
273typedef struct VkLayerDeviceLink_ {
274 struct VkLayerDeviceLink_* pNext;
275 PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr;
276 PFN_vkGetDeviceProcAddr pfnNextGetDeviceProcAddr;
277} VkLayerDeviceLink;
278
279typedef struct {
280 VkStructureType sType; // VK_STRUCTURE_TYPE_LAYER_DEVICE_CREATE_INFO
281 const void* pNext;
Courtney Goeltzenleuchter2bdf6da2016-01-08 12:18:43 -0700282 VkLayerFunction function;
283 union {
284 VkLayerDeviceLink* pLayerInfo;
285 VkLayerDeviceInfo deviceInfo;
286 } u;
Courtney Goeltzenleuchter2ff4e1d2016-01-08 11:40:27 -0700287} VkLayerDeviceCreateInfo;
288
289// ------------------------------------------------------------------------------------------------
Courtney Goeltzenleuchter89e99e62015-04-08 18:04:29 -0600290// API functions