blob: c3679a0051c98e3391e36311f4ca2b8f728a16f3 [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
7#include "vulkan.h"
8#include "vkDbg.h"
9#if defined(__linux__) || defined(XCB_NVIDIA)
10#include "vkWsiX11Ext.h"
11#endif
12#if defined(__GNUC__) && __GNUC__ >= 4
13# define VK_LAYER_EXPORT __attribute__((visibility("default")))
14#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
15# define VK_LAYER_EXPORT __attribute__((visibility("default")))
16#else
17# define VK_LAYER_EXPORT
18#endif
19
20
21typedef struct _VK_BASE_LAYER_OBJECT
22{
23 vkGetProcAddrType pGPA;
24 VK_BASE_OBJECT nextObject;
25 VK_BASE_OBJECT baseObject;
26} VK_BASE_LAYER_OBJECT;
27
28typedef struct _VK_LAYER_DISPATCH_TABLE
29{
30 vkGetProcAddrType GetProcAddr;
31 vkCreateInstanceType CreateInstance;
32 vkDestroyInstanceType DestroyInstance;
33 vkEnumerateGpusType EnumerateGpus;
34 vkGetGpuInfoType GetGpuInfo;
35 vkCreateDeviceType CreateDevice;
36 vkDestroyDeviceType DestroyDevice;
37 vkGetExtensionSupportType GetExtensionSupport;
38 vkEnumerateLayersType EnumerateLayers;
39 vkGetDeviceQueueType GetDeviceQueue;
40 vkQueueSubmitType QueueSubmit;
41 vkQueueAddMemReferenceType QueueAddMemReference;
42 vkQueueRemoveMemReferenceType QueueRemoveMemReference;
43 vkQueueWaitIdleType QueueWaitIdle;
44 vkDeviceWaitIdleType DeviceWaitIdle;
45 vkAllocMemoryType AllocMemory;
46 vkFreeMemoryType FreeMemory;
47 vkSetMemoryPriorityType SetMemoryPriority;
48 vkMapMemoryType MapMemory;
49 vkUnmapMemoryType UnmapMemory;
50 vkPinSystemMemoryType PinSystemMemory;
51 vkGetMultiGpuCompatibilityType GetMultiGpuCompatibility;
52 vkOpenSharedMemoryType OpenSharedMemory;
53 vkOpenSharedSemaphoreType OpenSharedSemaphore;
54 vkOpenPeerMemoryType OpenPeerMemory;
55 vkOpenPeerImageType OpenPeerImage;
56 vkDestroyObjectType DestroyObject;
57 vkGetObjectInfoType GetObjectInfo;
58 vkBindObjectMemoryType BindObjectMemory;
59 vkBindObjectMemoryRangeType BindObjectMemoryRange;
60 vkBindImageMemoryRangeType BindImageMemoryRange;
61 vkCreateFenceType CreateFence;
62 vkGetFenceStatusType GetFenceStatus;
63 vkResetFencesType ResetFences;
64 vkWaitForFencesType WaitForFences;
65 vkCreateSemaphoreType CreateSemaphore;
66 vkQueueSignalSemaphoreType QueueSignalSemaphore;
67 vkQueueWaitSemaphoreType QueueWaitSemaphore;
68 vkCreateEventType CreateEvent;
69 vkGetEventStatusType GetEventStatus;
70 vkSetEventType SetEvent;
71 vkResetEventType ResetEvent;
72 vkCreateQueryPoolType CreateQueryPool;
73 vkGetQueryPoolResultsType GetQueryPoolResults;
74 vkGetFormatInfoType GetFormatInfo;
75 vkCreateBufferType CreateBuffer;
76 vkCreateBufferViewType CreateBufferView;
77 vkCreateImageType CreateImage;
78 vkGetImageSubresourceInfoType GetImageSubresourceInfo;
79 vkCreateImageViewType CreateImageView;
80 vkCreateColorAttachmentViewType CreateColorAttachmentView;
81 vkCreateDepthStencilViewType CreateDepthStencilView;
82 vkCreateShaderType CreateShader;
83 vkCreateGraphicsPipelineType CreateGraphicsPipeline;
84 vkCreateGraphicsPipelineDerivativeType CreateGraphicsPipelineDerivative;
85 vkCreateComputePipelineType CreateComputePipeline;
86 vkStorePipelineType StorePipeline;
87 vkLoadPipelineType LoadPipeline;
88 vkLoadPipelineDerivativeType LoadPipelineDerivative;
89 vkCreateSamplerType CreateSampler;
90 vkCreateDescriptorSetLayoutType CreateDescriptorSetLayout;
91 vkCreateDescriptorSetLayoutChainType CreateDescriptorSetLayoutChain;
92 vkBeginDescriptorPoolUpdateType BeginDescriptorPoolUpdate;
93 vkEndDescriptorPoolUpdateType EndDescriptorPoolUpdate;
94 vkCreateDescriptorPoolType CreateDescriptorPool;
95 vkResetDescriptorPoolType ResetDescriptorPool;
96 vkAllocDescriptorSetsType AllocDescriptorSets;
97 vkClearDescriptorSetsType ClearDescriptorSets;
98 vkUpdateDescriptorsType UpdateDescriptors;
99 vkCreateDynamicViewportStateType CreateDynamicViewportState;
100 vkCreateDynamicRasterStateType CreateDynamicRasterState;
101 vkCreateDynamicColorBlendStateType CreateDynamicColorBlendState;
102 vkCreateDynamicDepthStencilStateType CreateDynamicDepthStencilState;
103 vkCreateCommandBufferType CreateCommandBuffer;
104 vkBeginCommandBufferType BeginCommandBuffer;
105 vkEndCommandBufferType EndCommandBuffer;
106 vkResetCommandBufferType ResetCommandBuffer;
107 vkCmdBindPipelineType CmdBindPipeline;
108 vkCmdBindDynamicStateObjectType CmdBindDynamicStateObject;
109 vkCmdBindDescriptorSetsType CmdBindDescriptorSets;
110 vkCmdBindVertexBufferType CmdBindVertexBuffer;
111 vkCmdBindIndexBufferType CmdBindIndexBuffer;
112 vkCmdDrawType CmdDraw;
113 vkCmdDrawIndexedType CmdDrawIndexed;
114 vkCmdDrawIndirectType CmdDrawIndirect;
115 vkCmdDrawIndexedIndirectType CmdDrawIndexedIndirect;
116 vkCmdDispatchType CmdDispatch;
117 vkCmdDispatchIndirectType CmdDispatchIndirect;
118 vkCmdCopyBufferType CmdCopyBuffer;
119 vkCmdCopyImageType CmdCopyImage;
120 vkCmdBlitImageType CmdBlitImage;
121 vkCmdCopyBufferToImageType CmdCopyBufferToImage;
122 vkCmdCopyImageToBufferType CmdCopyImageToBuffer;
123 vkCmdCloneImageDataType CmdCloneImageData;
124 vkCmdUpdateBufferType CmdUpdateBuffer;
125 vkCmdFillBufferType CmdFillBuffer;
126 vkCmdClearColorImageType CmdClearColorImage;
127 vkCmdClearDepthStencilType CmdClearDepthStencil;
128 vkCmdResolveImageType CmdResolveImage;
129 vkCmdSetEventType CmdSetEvent;
130 vkCmdResetEventType CmdResetEvent;
131 vkCmdWaitEventsType CmdWaitEvents;
132 vkCmdPipelineBarrierType CmdPipelineBarrier;
133 vkCmdBeginQueryType CmdBeginQuery;
134 vkCmdEndQueryType CmdEndQuery;
135 vkCmdResetQueryPoolType CmdResetQueryPool;
136 vkCmdWriteTimestampType CmdWriteTimestamp;
137 vkCmdInitAtomicCountersType CmdInitAtomicCounters;
138 vkCmdLoadAtomicCountersType CmdLoadAtomicCounters;
139 vkCmdSaveAtomicCountersType CmdSaveAtomicCounters;
140 vkCreateFramebufferType CreateFramebuffer;
141 vkCreateRenderPassType CreateRenderPass;
142 vkCmdBeginRenderPassType CmdBeginRenderPass;
143 vkCmdEndRenderPassType CmdEndRenderPass;
144 vkDbgSetValidationLevelType DbgSetValidationLevel;
145 vkDbgRegisterMsgCallbackType DbgRegisterMsgCallback;
146 vkDbgUnregisterMsgCallbackType DbgUnregisterMsgCallback;
147 vkDbgSetMessageFilterType DbgSetMessageFilter;
148 vkDbgSetObjectTagType DbgSetObjectTag;
149 vkDbgSetGlobalOptionType DbgSetGlobalOption;
150 vkDbgSetDeviceOptionType DbgSetDeviceOption;
151 vkCmdDbgMarkerBeginType CmdDbgMarkerBegin;
152 vkCmdDbgMarkerEndType CmdDbgMarkerEnd;
153#if defined(__linux__) || defined(XCB_NVIDIA)
154 vkWsiX11AssociateConnectionType WsiX11AssociateConnection;
155 vkWsiX11GetMSCType WsiX11GetMSC;
156 vkWsiX11CreatePresentableImageType WsiX11CreatePresentableImage;
157 vkWsiX11QueuePresentType WsiX11QueuePresent;
158#endif // WIN32
159} VK_LAYER_DISPATCH_TABLE;
160
161// LL node for tree of dbg callback functions
162typedef struct _VK_LAYER_DBG_FUNCTION_NODE
163{
164 VK_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback;
165 void *pUserData;
166 struct _VK_LAYER_DBG_FUNCTION_NODE *pNext;
167} VK_LAYER_DBG_FUNCTION_NODE;
168
169typedef enum _VK_LAYER_DBG_ACTION
170{
171 VK_DBG_LAYER_ACTION_IGNORE = 0x0,
172 VK_DBG_LAYER_ACTION_CALLBACK = 0x1,
173 VK_DBG_LAYER_ACTION_LOG_MSG = 0x2,
174 VK_DBG_LAYER_ACTION_BREAK = 0x4
175} VK_LAYER_DBG_ACTION;
176
177typedef enum _VK_LAYER_DBG_REPORT_LEVEL
178{
179
180 VK_DBG_LAYER_LEVEL_INFO = 0,
181 VK_DBG_LAYER_LEVEL_WARN,
182 VK_DBG_LAYER_LEVEL_PERF_WARN,
183 VK_DBG_LAYER_LEVEL_ERROR,
184 VK_DBG_LAYER_LEVEL_NONE,
185} VK_LAYER_DBG_REPORT_LEVEL;
186// ------------------------------------------------------------------------------------------------
187// API functions