| Jon Ashburn | d43f9b6 | 2014-10-14 19:15:22 -0600 | [diff] [blame] | 1 | /* 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" |
| Ian Elliott | e977a6c | 2015-02-26 14:34:52 -0700 | [diff] [blame] | 9 | #if defined(__linux__) || defined(XCB_NVIDIA) |
| Jon Ashburn | d43f9b6 | 2014-10-14 19:15:22 -0600 | [diff] [blame] | 10 | #include "xglWsiX11Ext.h" |
| Piers Daniell | e2bca48 | 2015-02-24 13:58:47 -0700 | [diff] [blame] | 11 | #endif |
| Jon Ashburn | d43f9b6 | 2014-10-14 19:15:22 -0600 | [diff] [blame] | 12 | #if defined(__GNUC__) && __GNUC__ >= 4 |
| 13 | # define XGL_LAYER_EXPORT __attribute__((visibility("default"))) |
| 14 | #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) |
| 15 | # define XGL_LAYER_EXPORT __attribute__((visibility("default"))) |
| 16 | #else |
| 17 | # define XGL_LAYER_EXPORT |
| 18 | #endif |
| 19 | |
| Jon Ashburn | d43f9b6 | 2014-10-14 19:15:22 -0600 | [diff] [blame] | 20 | |
| 21 | typedef struct _XGL_BASE_LAYER_OBJECT |
| 22 | { |
| Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 23 | xglGetProcAddrType pGPA; |
| Jon Ashburn | d43f9b6 | 2014-10-14 19:15:22 -0600 | [diff] [blame] | 24 | XGL_BASE_OBJECT nextObject; |
| 25 | XGL_BASE_OBJECT baseObject; |
| 26 | } XGL_BASE_LAYER_OBJECT; |
| 27 | |
| 28 | typedef struct _XGL_LAYER_DISPATCH_TABLE |
| 29 | { |
| Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 30 | xglGetProcAddrType GetProcAddr; |
| Jon Ashburn | 349508d | 2015-01-26 14:51:40 -0700 | [diff] [blame] | 31 | xglCreateInstanceType CreateInstance; |
| 32 | xglDestroyInstanceType DestroyInstance; |
| 33 | xglEnumerateGpusType EnumerateGpus; |
| Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 34 | xglGetGpuInfoType GetGpuInfo; |
| 35 | xglCreateDeviceType CreateDevice; |
| 36 | xglDestroyDeviceType DestroyDevice; |
| 37 | xglGetExtensionSupportType GetExtensionSupport; |
| 38 | xglEnumerateLayersType EnumerateLayers; |
| 39 | xglGetDeviceQueueType GetDeviceQueue; |
| 40 | xglQueueSubmitType QueueSubmit; |
| 41 | xglQueueSetGlobalMemReferencesType QueueSetGlobalMemReferences; |
| 42 | xglQueueWaitIdleType QueueWaitIdle; |
| 43 | xglDeviceWaitIdleType DeviceWaitIdle; |
| Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 44 | xglAllocMemoryType AllocMemory; |
| 45 | xglFreeMemoryType FreeMemory; |
| 46 | xglSetMemoryPriorityType SetMemoryPriority; |
| 47 | xglMapMemoryType MapMemory; |
| 48 | xglUnmapMemoryType UnmapMemory; |
| 49 | xglPinSystemMemoryType PinSystemMemory; |
| Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 50 | xglGetMultiGpuCompatibilityType GetMultiGpuCompatibility; |
| 51 | xglOpenSharedMemoryType OpenSharedMemory; |
| Courtney Goeltzenleuchter | 0d2efef | 2015-03-25 17:14:29 -0600 | [diff] [blame] | 52 | xglOpenSharedSemaphoreType OpenSharedSemaphore; |
| Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 53 | xglOpenPeerMemoryType OpenPeerMemory; |
| 54 | xglOpenPeerImageType OpenPeerImage; |
| 55 | xglDestroyObjectType DestroyObject; |
| 56 | xglGetObjectInfoType GetObjectInfo; |
| 57 | xglBindObjectMemoryType BindObjectMemory; |
| Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 58 | xglBindObjectMemoryRangeType BindObjectMemoryRange; |
| 59 | xglBindImageMemoryRangeType BindImageMemoryRange; |
| Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 60 | xglCreateFenceType CreateFence; |
| 61 | xglGetFenceStatusType GetFenceStatus; |
| 62 | xglWaitForFencesType WaitForFences; |
| Courtney Goeltzenleuchter | 0d2efef | 2015-03-25 17:14:29 -0600 | [diff] [blame] | 63 | xglCreateSemaphoreType CreateSemaphore; |
| 64 | xglQueueSignalSemaphoreType QueueSignalSemaphore; |
| 65 | xglQueueWaitSemaphoreType QueueWaitSemaphore; |
| Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 66 | xglCreateEventType CreateEvent; |
| 67 | xglGetEventStatusType GetEventStatus; |
| 68 | xglSetEventType SetEvent; |
| 69 | xglResetEventType ResetEvent; |
| 70 | xglCreateQueryPoolType CreateQueryPool; |
| 71 | xglGetQueryPoolResultsType GetQueryPoolResults; |
| 72 | xglGetFormatInfoType GetFormatInfo; |
| Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 73 | xglCreateBufferType CreateBuffer; |
| 74 | xglCreateBufferViewType CreateBufferView; |
| Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 75 | xglCreateImageType CreateImage; |
| 76 | xglGetImageSubresourceInfoType GetImageSubresourceInfo; |
| 77 | xglCreateImageViewType CreateImageView; |
| 78 | xglCreateColorAttachmentViewType CreateColorAttachmentView; |
| 79 | xglCreateDepthStencilViewType CreateDepthStencilView; |
| 80 | xglCreateShaderType CreateShader; |
| 81 | xglCreateGraphicsPipelineType CreateGraphicsPipeline; |
| Courtney Goeltzenleuchter | 32876a1 | 2015-03-25 15:37:49 -0600 | [diff] [blame] | 82 | xglCreateGraphicsPipelineDerivativeType CreateGraphicsPipelineDerivative; |
| Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 83 | xglCreateComputePipelineType CreateComputePipeline; |
| 84 | xglStorePipelineType StorePipeline; |
| 85 | xglLoadPipelineType LoadPipeline; |
| Courtney Goeltzenleuchter | 32876a1 | 2015-03-25 15:37:49 -0600 | [diff] [blame] | 86 | xglLoadPipelineDerivativeType LoadPipelineDerivative; |
| Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 87 | xglCreateSamplerType CreateSampler; |
| Chia-I Wu | f838506 | 2015-01-04 16:27:24 +0800 | [diff] [blame] | 88 | xglCreateDescriptorSetLayoutType CreateDescriptorSetLayout; |
| Chia-I Wu | 8d24b3b | 2015-03-26 13:14:16 +0800 | [diff] [blame^] | 89 | xglBeginDescriptorPoolUpdateType BeginDescriptorPoolUpdate; |
| 90 | xglEndDescriptorPoolUpdateType EndDescriptorPoolUpdate; |
| 91 | xglCreateDescriptorPoolType CreateDescriptorPool; |
| 92 | xglClearDescriptorPoolType ClearDescriptorPool; |
| Chia-I Wu | f838506 | 2015-01-04 16:27:24 +0800 | [diff] [blame] | 93 | xglAllocDescriptorSetsType AllocDescriptorSets; |
| 94 | xglClearDescriptorSetsType ClearDescriptorSets; |
| 95 | xglUpdateDescriptorsType UpdateDescriptors; |
| Tony Barbour | fa6cac7 | 2015-01-16 14:27:35 -0700 | [diff] [blame] | 96 | xglCreateDynamicViewportStateType CreateDynamicViewportState; |
| 97 | xglCreateDynamicRasterStateType CreateDynamicRasterState; |
| 98 | xglCreateDynamicColorBlendStateType CreateDynamicColorBlendState; |
| 99 | xglCreateDynamicDepthStencilStateType CreateDynamicDepthStencilState; |
| Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 100 | xglCreateCommandBufferType CreateCommandBuffer; |
| 101 | xglBeginCommandBufferType BeginCommandBuffer; |
| 102 | xglEndCommandBufferType EndCommandBuffer; |
| 103 | xglResetCommandBufferType ResetCommandBuffer; |
| 104 | xglCmdBindPipelineType CmdBindPipeline; |
| Tony Barbour | fa6cac7 | 2015-01-16 14:27:35 -0700 | [diff] [blame] | 105 | xglCmdBindDynamicStateObjectType CmdBindDynamicStateObject; |
| Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 106 | xglCmdBindDescriptorSetType CmdBindDescriptorSet; |
| Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 107 | xglCmdBindVertexBufferType CmdBindVertexBuffer; |
| 108 | xglCmdBindIndexBufferType CmdBindIndexBuffer; |
| Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 109 | xglCmdDrawType CmdDraw; |
| 110 | xglCmdDrawIndexedType CmdDrawIndexed; |
| 111 | xglCmdDrawIndirectType CmdDrawIndirect; |
| 112 | xglCmdDrawIndexedIndirectType CmdDrawIndexedIndirect; |
| 113 | xglCmdDispatchType CmdDispatch; |
| 114 | xglCmdDispatchIndirectType CmdDispatchIndirect; |
| Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 115 | xglCmdCopyBufferType CmdCopyBuffer; |
| Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 116 | xglCmdCopyImageType CmdCopyImage; |
| Courtney Goeltzenleuchter | b787a1e | 2015-03-08 17:02:18 -0600 | [diff] [blame] | 117 | xglCmdBlitImageType CmdBlitImage; |
| Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 118 | xglCmdCopyBufferToImageType CmdCopyBufferToImage; |
| 119 | xglCmdCopyImageToBufferType CmdCopyImageToBuffer; |
| Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 120 | xglCmdCloneImageDataType CmdCloneImageData; |
| Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 121 | xglCmdUpdateBufferType CmdUpdateBuffer; |
| 122 | xglCmdFillBufferType CmdFillBuffer; |
| Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 123 | xglCmdClearColorImageType CmdClearColorImage; |
| Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 124 | xglCmdClearDepthStencilType CmdClearDepthStencil; |
| 125 | xglCmdResolveImageType CmdResolveImage; |
| 126 | xglCmdSetEventType CmdSetEvent; |
| 127 | xglCmdResetEventType CmdResetEvent; |
| Mike Stroyan | 55658c2 | 2014-12-04 11:08:39 +0000 | [diff] [blame] | 128 | xglCmdWaitEventsType CmdWaitEvents; |
| 129 | xglCmdPipelineBarrierType CmdPipelineBarrier; |
| Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 130 | xglCmdBeginQueryType CmdBeginQuery; |
| 131 | xglCmdEndQueryType CmdEndQuery; |
| 132 | xglCmdResetQueryPoolType CmdResetQueryPool; |
| 133 | xglCmdWriteTimestampType CmdWriteTimestamp; |
| 134 | xglCmdInitAtomicCountersType CmdInitAtomicCounters; |
| 135 | xglCmdLoadAtomicCountersType CmdLoadAtomicCounters; |
| 136 | xglCmdSaveAtomicCountersType CmdSaveAtomicCounters; |
| Jeremy Hayes | e0c3b22 | 2015-01-14 16:17:08 -0700 | [diff] [blame] | 137 | xglCreateFramebufferType CreateFramebuffer; |
| 138 | xglCreateRenderPassType CreateRenderPass; |
| Jon Ashburn | b1dbb37 | 2015-02-02 09:58:11 -0700 | [diff] [blame] | 139 | xglCmdBeginRenderPassType CmdBeginRenderPass; |
| 140 | xglCmdEndRenderPassType CmdEndRenderPass; |
| Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 141 | xglDbgSetValidationLevelType DbgSetValidationLevel; |
| 142 | xglDbgRegisterMsgCallbackType DbgRegisterMsgCallback; |
| 143 | xglDbgUnregisterMsgCallbackType DbgUnregisterMsgCallback; |
| 144 | xglDbgSetMessageFilterType DbgSetMessageFilter; |
| 145 | xglDbgSetObjectTagType DbgSetObjectTag; |
| 146 | xglDbgSetGlobalOptionType DbgSetGlobalOption; |
| 147 | xglDbgSetDeviceOptionType DbgSetDeviceOption; |
| 148 | xglCmdDbgMarkerBeginType CmdDbgMarkerBegin; |
| 149 | xglCmdDbgMarkerEndType CmdDbgMarkerEnd; |
| Ian Elliott | e977a6c | 2015-02-26 14:34:52 -0700 | [diff] [blame] | 150 | #if defined(__linux__) || defined(XCB_NVIDIA) |
| Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 151 | xglWsiX11AssociateConnectionType WsiX11AssociateConnection; |
| 152 | xglWsiX11GetMSCType WsiX11GetMSC; |
| 153 | xglWsiX11CreatePresentableImageType WsiX11CreatePresentableImage; |
| 154 | xglWsiX11QueuePresentType WsiX11QueuePresent; |
| Ian Elliott | 81ac44c | 2015-01-13 17:52:38 -0700 | [diff] [blame] | 155 | #endif // WIN32 |
| Jon Ashburn | d43f9b6 | 2014-10-14 19:15:22 -0600 | [diff] [blame] | 156 | } XGL_LAYER_DISPATCH_TABLE; |
| 157 | |
| Tobin Ehlis | acab888 | 2014-11-14 13:01:02 -0700 | [diff] [blame] | 158 | // LL node for tree of dbg callback functions |
| 159 | typedef struct _XGL_LAYER_DBG_FUNCTION_NODE |
| 160 | { |
| 161 | XGL_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback; |
| Mark Lobodzinski | e2d07a5 | 2015-01-29 08:55:56 -0600 | [diff] [blame] | 162 | void *pUserData; |
| Tobin Ehlis | acab888 | 2014-11-14 13:01:02 -0700 | [diff] [blame] | 163 | struct _XGL_LAYER_DBG_FUNCTION_NODE *pNext; |
| 164 | } XGL_LAYER_DBG_FUNCTION_NODE; |
| 165 | |
| Jon Ashburn | 47e9289 | 2014-12-22 12:04:40 -0700 | [diff] [blame] | 166 | typedef enum _XGL_LAYER_DBG_ACTION |
| 167 | { |
| 168 | XGL_DBG_LAYER_ACTION_IGNORE = 0x0, |
| 169 | XGL_DBG_LAYER_ACTION_CALLBACK = 0x1, |
| 170 | XGL_DBG_LAYER_ACTION_LOG_MSG = 0x2, |
| 171 | XGL_DBG_LAYER_ACTION_BREAK = 0x4 |
| 172 | } XGL_LAYER_DBG_ACTION; |
| 173 | |
| 174 | typedef enum _XGL_LAYER_DBG_REPORT_LEVEL |
| 175 | { |
| 176 | |
| 177 | XGL_DBG_LAYER_LEVEL_INFO = 0, |
| 178 | XGL_DBG_LAYER_LEVEL_WARN, |
| 179 | XGL_DBG_LAYER_LEVEL_PERF_WARN, |
| 180 | XGL_DBG_LAYER_LEVEL_ERROR, |
| 181 | XGL_DBG_LAYER_LEVEL_NONE, |
| 182 | } XGL_LAYER_DBG_REPORT_LEVEL; |
| Jon Ashburn | d43f9b6 | 2014-10-14 19:15:22 -0600 | [diff] [blame] | 183 | // ------------------------------------------------------------------------------------------------ |
| 184 | // API functions |