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" |
| 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 Ashburn | d43f9b6 | 2014-10-14 19:15:22 -0600 | [diff] [blame] | 18 | |
| 19 | typedef struct _XGL_BASE_LAYER_OBJECT |
| 20 | { |
Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 21 | xglGetProcAddrType pGPA; |
Jon Ashburn | d43f9b6 | 2014-10-14 19:15:22 -0600 | [diff] [blame] | 22 | XGL_BASE_OBJECT nextObject; |
| 23 | XGL_BASE_OBJECT baseObject; |
| 24 | } XGL_BASE_LAYER_OBJECT; |
| 25 | |
| 26 | typedef struct _XGL_LAYER_DISPATCH_TABLE |
| 27 | { |
Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 28 | 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; |
Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 40 | xglAllocMemoryType AllocMemory; |
| 41 | xglFreeMemoryType FreeMemory; |
| 42 | xglSetMemoryPriorityType SetMemoryPriority; |
| 43 | xglMapMemoryType MapMemory; |
| 44 | xglUnmapMemoryType UnmapMemory; |
| 45 | xglPinSystemMemoryType PinSystemMemory; |
Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 46 | xglGetMultiGpuCompatibilityType GetMultiGpuCompatibility; |
| 47 | xglOpenSharedMemoryType OpenSharedMemory; |
| 48 | xglOpenSharedQueueSemaphoreType OpenSharedQueueSemaphore; |
| 49 | xglOpenPeerMemoryType OpenPeerMemory; |
| 50 | xglOpenPeerImageType OpenPeerImage; |
| 51 | xglDestroyObjectType DestroyObject; |
| 52 | xglGetObjectInfoType GetObjectInfo; |
| 53 | xglBindObjectMemoryType BindObjectMemory; |
Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 54 | xglBindObjectMemoryRangeType BindObjectMemoryRange; |
| 55 | xglBindImageMemoryRangeType BindImageMemoryRange; |
Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 56 | xglCreateFenceType CreateFence; |
| 57 | xglGetFenceStatusType GetFenceStatus; |
| 58 | xglWaitForFencesType WaitForFences; |
| 59 | xglCreateQueueSemaphoreType CreateQueueSemaphore; |
| 60 | xglSignalQueueSemaphoreType SignalQueueSemaphore; |
| 61 | xglWaitQueueSemaphoreType WaitQueueSemaphore; |
| 62 | xglCreateEventType CreateEvent; |
| 63 | xglGetEventStatusType GetEventStatus; |
| 64 | xglSetEventType SetEvent; |
| 65 | xglResetEventType ResetEvent; |
| 66 | xglCreateQueryPoolType CreateQueryPool; |
| 67 | xglGetQueryPoolResultsType GetQueryPoolResults; |
| 68 | xglGetFormatInfoType GetFormatInfo; |
Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 69 | xglCreateBufferType CreateBuffer; |
| 70 | xglCreateBufferViewType CreateBufferView; |
Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 71 | xglCreateImageType CreateImage; |
| 72 | xglGetImageSubresourceInfoType GetImageSubresourceInfo; |
| 73 | xglCreateImageViewType CreateImageView; |
| 74 | xglCreateColorAttachmentViewType CreateColorAttachmentView; |
| 75 | xglCreateDepthStencilViewType CreateDepthStencilView; |
| 76 | xglCreateShaderType CreateShader; |
| 77 | xglCreateGraphicsPipelineType CreateGraphicsPipeline; |
| 78 | xglCreateComputePipelineType CreateComputePipeline; |
| 79 | xglStorePipelineType StorePipeline; |
| 80 | xglLoadPipelineType LoadPipeline; |
| 81 | xglCreatePipelineDeltaType CreatePipelineDelta; |
| 82 | xglCreateSamplerType CreateSampler; |
Chia-I Wu | f838506 | 2015-01-04 16:27:24 +0800 | [diff] [blame] | 83 | xglCreateDescriptorSetLayoutType CreateDescriptorSetLayout; |
| 84 | xglBeginDescriptorRegionUpdateType BeginDescriptorRegionUpdate; |
| 85 | xglEndDescriptorRegionUpdateType EndDescriptorRegionUpdate; |
| 86 | xglCreateDescriptorRegionType CreateDescriptorRegion; |
| 87 | xglClearDescriptorRegionType ClearDescriptorRegion; |
| 88 | xglAllocDescriptorSetsType AllocDescriptorSets; |
| 89 | xglClearDescriptorSetsType ClearDescriptorSets; |
| 90 | xglUpdateDescriptorsType UpdateDescriptors; |
Tony Barbour | fa6cac7 | 2015-01-16 14:27:35 -0700 | [diff] [blame] | 91 | xglCreateDynamicViewportStateType CreateDynamicViewportState; |
| 92 | xglCreateDynamicRasterStateType CreateDynamicRasterState; |
| 93 | xglCreateDynamicColorBlendStateType CreateDynamicColorBlendState; |
| 94 | xglCreateDynamicDepthStencilStateType CreateDynamicDepthStencilState; |
Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 95 | xglCreateCommandBufferType CreateCommandBuffer; |
| 96 | xglBeginCommandBufferType BeginCommandBuffer; |
| 97 | xglEndCommandBufferType EndCommandBuffer; |
| 98 | xglResetCommandBufferType ResetCommandBuffer; |
| 99 | xglCmdBindPipelineType CmdBindPipeline; |
| 100 | xglCmdBindPipelineDeltaType CmdBindPipelineDelta; |
Tony Barbour | fa6cac7 | 2015-01-16 14:27:35 -0700 | [diff] [blame] | 101 | xglCmdBindDynamicStateObjectType CmdBindDynamicStateObject; |
Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 102 | xglCmdBindDescriptorSetType CmdBindDescriptorSet; |
Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 103 | xglCmdBindVertexBufferType CmdBindVertexBuffer; |
| 104 | xglCmdBindIndexBufferType CmdBindIndexBuffer; |
Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 105 | xglCmdDrawType CmdDraw; |
| 106 | xglCmdDrawIndexedType CmdDrawIndexed; |
| 107 | xglCmdDrawIndirectType CmdDrawIndirect; |
| 108 | xglCmdDrawIndexedIndirectType CmdDrawIndexedIndirect; |
| 109 | xglCmdDispatchType CmdDispatch; |
| 110 | xglCmdDispatchIndirectType CmdDispatchIndirect; |
Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 111 | xglCmdCopyBufferType CmdCopyBuffer; |
Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 112 | xglCmdCopyImageType CmdCopyImage; |
Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 113 | xglCmdCopyBufferToImageType CmdCopyBufferToImage; |
| 114 | xglCmdCopyImageToBufferType CmdCopyImageToBuffer; |
Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 115 | xglCmdCloneImageDataType CmdCloneImageData; |
Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 116 | xglCmdUpdateBufferType CmdUpdateBuffer; |
| 117 | xglCmdFillBufferType CmdFillBuffer; |
Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 118 | xglCmdClearColorImageType CmdClearColorImage; |
| 119 | xglCmdClearColorImageRawType CmdClearColorImageRaw; |
| 120 | xglCmdClearDepthStencilType CmdClearDepthStencil; |
| 121 | xglCmdResolveImageType CmdResolveImage; |
| 122 | xglCmdSetEventType CmdSetEvent; |
| 123 | xglCmdResetEventType CmdResetEvent; |
Mike Stroyan | 55658c2 | 2014-12-04 11:08:39 +0000 | [diff] [blame] | 124 | xglCmdWaitEventsType CmdWaitEvents; |
| 125 | xglCmdPipelineBarrierType CmdPipelineBarrier; |
Chia-I Wu | 714df45 | 2015-01-01 07:55:04 +0800 | [diff] [blame] | 126 | xglCmdBufferAtomicType CmdBufferAtomic; |
Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 127 | xglCmdBeginQueryType CmdBeginQuery; |
| 128 | xglCmdEndQueryType CmdEndQuery; |
| 129 | xglCmdResetQueryPoolType CmdResetQueryPool; |
| 130 | xglCmdWriteTimestampType CmdWriteTimestamp; |
| 131 | xglCmdInitAtomicCountersType CmdInitAtomicCounters; |
| 132 | xglCmdLoadAtomicCountersType CmdLoadAtomicCounters; |
| 133 | xglCmdSaveAtomicCountersType CmdSaveAtomicCounters; |
Jeremy Hayes | e0c3b22 | 2015-01-14 16:17:08 -0700 | [diff] [blame] | 134 | xglCreateFramebufferType CreateFramebuffer; |
| 135 | xglCreateRenderPassType CreateRenderPass; |
Mark Lobodzinski | 953a169 | 2015-01-09 15:12:03 -0600 | [diff] [blame] | 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 Ashburn | d43f9b6 | 2014-10-14 19:15:22 -0600 | [diff] [blame] | 149 | } XGL_LAYER_DISPATCH_TABLE; |
| 150 | |
Tobin Ehlis | acab888 | 2014-11-14 13:01:02 -0700 | [diff] [blame] | 151 | // LL node for tree of dbg callback functions |
| 152 | typedef 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 Ashburn | 47e9289 | 2014-12-22 12:04:40 -0700 | [diff] [blame] | 159 | typedef 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 | |
| 167 | typedef 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 Ashburn | d43f9b6 | 2014-10-14 19:15:22 -0600 | [diff] [blame] | 176 | // ------------------------------------------------------------------------------------------------ |
| 177 | // API functions |