blob: 3b462b6893e340c04f0ed478ced714abffe25e1e [file] [log] [blame]
Jon Ashburnd43f9b62014-10-14 19:15:22 -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 "xgl.h"
8#include "xglDbg.h"
9#include "xglWsiX11Ext.h"
10#if defined(__GNUC__) && __GNUC__ >= 4
11# define XGL_LAYER_EXPORT __attribute__((visibility("default")))
12#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
13# define XGL_LAYER_EXPORT __attribute__((visibility("default")))
14#else
15# define XGL_LAYER_EXPORT
16#endif
17
Jon Ashburnd43f9b62014-10-14 19:15:22 -060018
19typedef struct _XGL_BASE_LAYER_OBJECT
20{
Mark Lobodzinski953a1692015-01-09 15:12:03 -060021 xglGetProcAddrType pGPA;
Jon Ashburnd43f9b62014-10-14 19:15:22 -060022 XGL_BASE_OBJECT nextObject;
23 XGL_BASE_OBJECT baseObject;
24} XGL_BASE_LAYER_OBJECT;
25
26typedef struct _XGL_LAYER_DISPATCH_TABLE
27{
Mark Lobodzinski953a1692015-01-09 15:12:03 -060028 xglGetProcAddrType GetProcAddr;
29 xglInitAndEnumerateGpusType InitAndEnumerateGpus;
30 xglGetGpuInfoType GetGpuInfo;
31 xglCreateDeviceType CreateDevice;
32 xglDestroyDeviceType DestroyDevice;
33 xglGetExtensionSupportType GetExtensionSupport;
34 xglEnumerateLayersType EnumerateLayers;
35 xglGetDeviceQueueType GetDeviceQueue;
36 xglQueueSubmitType QueueSubmit;
37 xglQueueSetGlobalMemReferencesType QueueSetGlobalMemReferences;
38 xglQueueWaitIdleType QueueWaitIdle;
39 xglDeviceWaitIdleType DeviceWaitIdle;
40 xglGetMemoryHeapCountType GetMemoryHeapCount;
41 xglGetMemoryHeapInfoType GetMemoryHeapInfo;
42 xglAllocMemoryType AllocMemory;
43 xglFreeMemoryType FreeMemory;
44 xglSetMemoryPriorityType SetMemoryPriority;
45 xglMapMemoryType MapMemory;
46 xglUnmapMemoryType UnmapMemory;
47 xglPinSystemMemoryType PinSystemMemory;
48 xglRemapVirtualMemoryPagesType RemapVirtualMemoryPages;
49 xglGetMultiGpuCompatibilityType GetMultiGpuCompatibility;
50 xglOpenSharedMemoryType OpenSharedMemory;
51 xglOpenSharedQueueSemaphoreType OpenSharedQueueSemaphore;
52 xglOpenPeerMemoryType OpenPeerMemory;
53 xglOpenPeerImageType OpenPeerImage;
54 xglDestroyObjectType DestroyObject;
55 xglGetObjectInfoType GetObjectInfo;
56 xglBindObjectMemoryType BindObjectMemory;
57 xglCreateFenceType CreateFence;
58 xglGetFenceStatusType GetFenceStatus;
59 xglWaitForFencesType WaitForFences;
60 xglCreateQueueSemaphoreType CreateQueueSemaphore;
61 xglSignalQueueSemaphoreType SignalQueueSemaphore;
62 xglWaitQueueSemaphoreType WaitQueueSemaphore;
63 xglCreateEventType CreateEvent;
64 xglGetEventStatusType GetEventStatus;
65 xglSetEventType SetEvent;
66 xglResetEventType ResetEvent;
67 xglCreateQueryPoolType CreateQueryPool;
68 xglGetQueryPoolResultsType GetQueryPoolResults;
69 xglGetFormatInfoType GetFormatInfo;
70 xglCreateImageType CreateImage;
71 xglGetImageSubresourceInfoType GetImageSubresourceInfo;
72 xglCreateImageViewType CreateImageView;
73 xglCreateColorAttachmentViewType CreateColorAttachmentView;
74 xglCreateDepthStencilViewType CreateDepthStencilView;
75 xglCreateShaderType CreateShader;
76 xglCreateGraphicsPipelineType CreateGraphicsPipeline;
77 xglCreateComputePipelineType CreateComputePipeline;
78 xglStorePipelineType StorePipeline;
79 xglLoadPipelineType LoadPipeline;
80 xglCreatePipelineDeltaType CreatePipelineDelta;
81 xglCreateSamplerType CreateSampler;
82 xglCreateDescriptorSetType CreateDescriptorSet;
83 xglBeginDescriptorSetUpdateType BeginDescriptorSetUpdate;
84 xglEndDescriptorSetUpdateType EndDescriptorSetUpdate;
85 xglAttachSamplerDescriptorsType AttachSamplerDescriptors;
86 xglAttachImageViewDescriptorsType AttachImageViewDescriptors;
87 xglAttachMemoryViewDescriptorsType AttachMemoryViewDescriptors;
88 xglAttachNestedDescriptorsType AttachNestedDescriptors;
89 xglClearDescriptorSetSlotsType ClearDescriptorSetSlots;
90 xglCreateViewportStateType CreateViewportState;
91 xglCreateRasterStateType CreateRasterState;
92 xglCreateMsaaStateType CreateMsaaState;
93 xglCreateColorBlendStateType CreateColorBlendState;
94 xglCreateDepthStencilStateType CreateDepthStencilState;
95 xglCreateCommandBufferType CreateCommandBuffer;
96 xglBeginCommandBufferType BeginCommandBuffer;
97 xglEndCommandBufferType EndCommandBuffer;
98 xglResetCommandBufferType ResetCommandBuffer;
99 xglCmdBindPipelineType CmdBindPipeline;
100 xglCmdBindPipelineDeltaType CmdBindPipelineDelta;
101 xglCmdBindStateObjectType CmdBindStateObject;
102 xglCmdBindDescriptorSetType CmdBindDescriptorSet;
103 xglCmdBindDynamicMemoryViewType CmdBindDynamicMemoryView;
104 xglCmdBindVertexDataType CmdBindVertexData;
105 xglCmdBindIndexDataType CmdBindIndexData;
106 xglCmdBindAttachmentsType CmdBindAttachments;
107 xglCmdPrepareMemoryRegionsType CmdPrepareMemoryRegions;
108 xglCmdPrepareImagesType CmdPrepareImages;
109 xglCmdDrawType CmdDraw;
110 xglCmdDrawIndexedType CmdDrawIndexed;
111 xglCmdDrawIndirectType CmdDrawIndirect;
112 xglCmdDrawIndexedIndirectType CmdDrawIndexedIndirect;
113 xglCmdDispatchType CmdDispatch;
114 xglCmdDispatchIndirectType CmdDispatchIndirect;
115 xglCmdCopyMemoryType CmdCopyMemory;
116 xglCmdCopyImageType CmdCopyImage;
117 xglCmdCopyMemoryToImageType CmdCopyMemoryToImage;
118 xglCmdCopyImageToMemoryType CmdCopyImageToMemory;
119 xglCmdCloneImageDataType CmdCloneImageData;
120 xglCmdUpdateMemoryType CmdUpdateMemory;
121 xglCmdFillMemoryType CmdFillMemory;
122 xglCmdClearColorImageType CmdClearColorImage;
123 xglCmdClearColorImageRawType CmdClearColorImageRaw;
124 xglCmdClearDepthStencilType CmdClearDepthStencil;
125 xglCmdResolveImageType CmdResolveImage;
126 xglCmdSetEventType CmdSetEvent;
127 xglCmdResetEventType CmdResetEvent;
128 xglCmdMemoryAtomicType CmdMemoryAtomic;
129 xglCmdBeginQueryType CmdBeginQuery;
130 xglCmdEndQueryType CmdEndQuery;
131 xglCmdResetQueryPoolType CmdResetQueryPool;
132 xglCmdWriteTimestampType CmdWriteTimestamp;
133 xglCmdInitAtomicCountersType CmdInitAtomicCounters;
134 xglCmdLoadAtomicCountersType CmdLoadAtomicCounters;
135 xglCmdSaveAtomicCountersType CmdSaveAtomicCounters;
136 xglDbgSetValidationLevelType DbgSetValidationLevel;
137 xglDbgRegisterMsgCallbackType DbgRegisterMsgCallback;
138 xglDbgUnregisterMsgCallbackType DbgUnregisterMsgCallback;
139 xglDbgSetMessageFilterType DbgSetMessageFilter;
140 xglDbgSetObjectTagType DbgSetObjectTag;
141 xglDbgSetGlobalOptionType DbgSetGlobalOption;
142 xglDbgSetDeviceOptionType DbgSetDeviceOption;
143 xglCmdDbgMarkerBeginType CmdDbgMarkerBegin;
144 xglCmdDbgMarkerEndType CmdDbgMarkerEnd;
145 xglWsiX11AssociateConnectionType WsiX11AssociateConnection;
146 xglWsiX11GetMSCType WsiX11GetMSC;
147 xglWsiX11CreatePresentableImageType WsiX11CreatePresentableImage;
148 xglWsiX11QueuePresentType WsiX11QueuePresent;
Jon Ashburnd43f9b62014-10-14 19:15:22 -0600149} XGL_LAYER_DISPATCH_TABLE;
150
Tobin Ehlisacab8882014-11-14 13:01:02 -0700151// LL node for tree of dbg callback functions
152typedef struct _XGL_LAYER_DBG_FUNCTION_NODE
153{
154 XGL_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback;
155 XGL_VOID *pUserData;
156 struct _XGL_LAYER_DBG_FUNCTION_NODE *pNext;
157} XGL_LAYER_DBG_FUNCTION_NODE;
158
Jon Ashburn47e92892014-12-22 12:04:40 -0700159typedef enum _XGL_LAYER_DBG_ACTION
160{
161 XGL_DBG_LAYER_ACTION_IGNORE = 0x0,
162 XGL_DBG_LAYER_ACTION_CALLBACK = 0x1,
163 XGL_DBG_LAYER_ACTION_LOG_MSG = 0x2,
164 XGL_DBG_LAYER_ACTION_BREAK = 0x4
165} XGL_LAYER_DBG_ACTION;
166
167typedef enum _XGL_LAYER_DBG_REPORT_LEVEL
168{
169
170 XGL_DBG_LAYER_LEVEL_INFO = 0,
171 XGL_DBG_LAYER_LEVEL_WARN,
172 XGL_DBG_LAYER_LEVEL_PERF_WARN,
173 XGL_DBG_LAYER_LEVEL_ERROR,
174 XGL_DBG_LAYER_LEVEL_NONE,
175} XGL_LAYER_DBG_REPORT_LEVEL;
Jon Ashburnd43f9b62014-10-14 19:15:22 -0600176// ------------------------------------------------------------------------------------------------
177// API functions