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