Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 1 | /* |
| 2 | * XGL |
| 3 | * |
| 4 | * Copyright (C) 2014 LunarG, Inc. |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 7 | * copy of this software and associated documentation files (the "Software"), |
| 8 | * to deal in the Software without restriction, including without limitation |
| 9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 10 | * and/or sell copies of the Software, and to permit persons to whom the |
| 11 | * Software is furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included |
| 14 | * in all copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 22 | * DEALINGS IN THE SOFTWARE. |
| 23 | * |
| 24 | */ |
| 25 | |
| 26 | #include <string.h> |
| 27 | #include <stdlib.h> |
| 28 | #include <assert.h> |
| 29 | #include <unordered_map> |
| 30 | #include "xglLayer.h" |
| 31 | |
| 32 | static void initLayerTable(const XGL_BASE_LAYER_OBJECT *gpuw, XGL_LAYER_DISPATCH_TABLE *pTable, const unsigned int layerNum); |
| 33 | |
| 34 | /******************************** Layer multi1 functions **************************/ |
| 35 | static std::unordered_map<XGL_VOID *, XGL_LAYER_DISPATCH_TABLE *> tableMap1; |
| 36 | static bool layer1_first_activated = false; |
| 37 | |
| 38 | static XGL_LAYER_DISPATCH_TABLE * getLayer1Table(const XGL_BASE_LAYER_OBJECT *gpuw) |
| 39 | { |
| 40 | XGL_LAYER_DISPATCH_TABLE *pTable; |
| 41 | |
| 42 | assert(gpuw); |
| 43 | std::unordered_map<XGL_VOID *, XGL_LAYER_DISPATCH_TABLE *>::const_iterator it = tableMap1.find((XGL_VOID *) gpuw); |
| 44 | if (it == tableMap1.end()) |
| 45 | { |
| 46 | pTable = new XGL_LAYER_DISPATCH_TABLE; |
| 47 | tableMap1[(XGL_VOID *) gpuw] = pTable; |
| 48 | initLayerTable(gpuw, pTable, 1); |
| 49 | return pTable; |
| 50 | } else |
| 51 | { |
| 52 | return it->second; |
| 53 | } |
| 54 | } |
| 55 | #ifdef __cplusplus |
| 56 | extern "C" { |
| 57 | #endif |
| 58 | |
| 59 | |
| 60 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI multi1CreateDevice(XGL_PHYSICAL_GPU gpu, const XGL_DEVICE_CREATE_INFO* pCreateInfo, |
| 61 | XGL_DEVICE* pDevice) |
| 62 | { |
| 63 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 64 | XGL_LAYER_DISPATCH_TABLE* pTable = getLayer1Table(gpuw); |
| 65 | |
| 66 | printf("At start of multi1 layer xglCreateDevice()\n"); |
| 67 | XGL_RESULT result = pTable->CreateDevice((XGL_PHYSICAL_GPU)gpuw->nextObject, pCreateInfo, pDevice); |
| 68 | // create a mapping for the device object into the dispatch table |
| 69 | tableMap1.emplace(*pDevice, pTable); |
| 70 | printf("Completed multi1 layer xglCreateDevice()\n"); |
| 71 | return result; |
| 72 | } |
| 73 | |
| 74 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI multi1CreateGraphicsPipeline(XGL_DEVICE device, const XGL_GRAPHICS_PIPELINE_CREATE_INFO* pCreateInfo, |
| 75 | XGL_PIPELINE* pPipeline) |
| 76 | { |
| 77 | XGL_LAYER_DISPATCH_TABLE* pTable = tableMap1[device]; |
| 78 | |
| 79 | printf("At start of multi1 layer xglCreateGraphicsPipeline()\n"); |
| 80 | XGL_RESULT result = pTable->CreateGraphicsPipeline(device, pCreateInfo, pPipeline); |
| 81 | // create a mapping for the pipeline object into the dispatch table |
| 82 | tableMap1.emplace(*pPipeline, pTable); |
| 83 | printf("Completed multi1 layer xglCreateGraphicsPipeline()\n"); |
| 84 | return result; |
| 85 | } |
| 86 | |
| 87 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI multi1StorePipeline(XGL_PIPELINE pipeline, XGL_SIZE* pDataSize, XGL_VOID* pData) |
| 88 | { |
| 89 | XGL_LAYER_DISPATCH_TABLE* pTable = tableMap1[pipeline]; |
| 90 | |
| 91 | printf("At start of multi1 layer xglStorePipeline()\n"); |
| 92 | XGL_RESULT result = pTable->StorePipeline(pipeline, pDataSize, pData); |
| 93 | printf("Completed multi1 layer xglStorePipeline()\n"); |
| 94 | return result; |
| 95 | } |
| 96 | |
| 97 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI multi1EnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, |
| 98 | XGL_CHAR* const* pOutLayers, XGL_SIZE * pOutLayerCount, |
| 99 | XGL_VOID* pReserved) |
| 100 | { |
| 101 | if (gpu == NULL) |
| 102 | return xglEnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayers, pOutLayerCount, pReserved); |
| 103 | |
| 104 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 105 | XGL_LAYER_DISPATCH_TABLE* pTable = getLayer1Table(gpuw); |
| 106 | |
| 107 | printf("At start of multi1 layer xglEnumerateLayers()\n"); |
| 108 | XGL_RESULT result = pTable->EnumerateLayers((XGL_PHYSICAL_GPU)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayers, pOutLayerCount, pReserved); |
| 109 | printf("Completed multi1 layer xglEnumerateLayers()\n"); |
| 110 | return result; |
| 111 | } |
| 112 | |
| 113 | XGL_LAYER_EXPORT XGL_VOID * XGLAPI multi1GetProcAddr(XGL_PHYSICAL_GPU gpu, const XGL_CHAR* pName) |
| 114 | { |
| 115 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 116 | if (gpu == NULL) |
| 117 | return NULL; |
| 118 | XGL_LAYER_DISPATCH_TABLE* pTable; |
| 119 | pTable = getLayer1Table(gpuw); |
| 120 | if (!strncmp("xglInitAndEnumerateGpus", (const char *) pName, sizeof("xglInitAndEnumerateGpus"))) |
| 121 | return (XGL_VOID *) pTable->InitAndEnumerateGpus; |
| 122 | else if (!strncmp("xglGetGpuInfo", (const char *) pName, sizeof ("xglGetGpuInfo"))) |
| 123 | return (XGL_VOID *) pTable->GetGpuInfo; |
| 124 | else if (!strncmp("xglCreateDevice", (const char *) pName, sizeof ("xglCreateDevice"))) |
| 125 | return (XGL_VOID *) multi1CreateDevice; |
| 126 | else if (!strncmp("xglDestroyDevice", (const char *) pName, sizeof ("xglDestroyDevice"))) |
| 127 | return (XGL_VOID *) pTable->DestroyDevice; |
| 128 | else if (!strncmp("xglGetExtensionSupport", (const char *) pName, sizeof ("xglGetExtensionSupport"))) |
| 129 | return (XGL_VOID *) pTable->GetExtensionSupport; |
| 130 | else if (!strncmp("xglEnumerateLayers", (const char *) pName, sizeof ("xglEnumerateLayers"))) |
| 131 | return (XGL_VOID *) multi1EnumerateLayers; |
| 132 | else if (!strncmp("xglGetDeviceQueue", (const char *) pName, sizeof ("xglGetDeviceQueue"))) |
| 133 | return (XGL_VOID *) pTable->GetDeviceQueue; |
| 134 | else if (!strncmp("xglQueueSubmit", (const char *) pName, sizeof ("xglQueueSubmit"))) |
| 135 | return (XGL_VOID *) pTable->QueueSubmit; |
| 136 | else if (!strncmp("xglQueueSetGlobalMemReferences", (const char *) pName, sizeof ("xglQueueSetGlobalMemReferences"))) |
| 137 | return (XGL_VOID *) pTable->QueueSetGlobalMemReferences; |
| 138 | else if (!strncmp("xglQueueWaitIdle", (const char *) pName, sizeof ("xglQueueWaitIdle"))) |
| 139 | return (XGL_VOID *) pTable->QueueWaitIdle; |
| 140 | else if (!strncmp("xglDeviceWaitIdle", (const char *) pName, sizeof ("xglDeviceWaitIdle"))) |
| 141 | return (XGL_VOID *) pTable->DeviceWaitIdle; |
| 142 | else if (!strncmp("xglGetMemoryHeapCount", (const char *) pName, sizeof ("xglGetMemoryHeapCount"))) |
| 143 | return (XGL_VOID *) pTable->GetMemoryHeapCount; |
| 144 | else if (!strncmp("xglGetMemoryHeapInfo", (const char *) pName, sizeof ("xglGetMemoryHeapInfo"))) |
| 145 | return (XGL_VOID *) pTable->GetMemoryHeapInfo; |
| 146 | else if (!strncmp("xglAllocMemory", (const char *) pName, sizeof ("xglAllocMemory"))) |
| 147 | return (XGL_VOID *) pTable->AllocMemory; |
| 148 | else if (!strncmp("xglFreeMemory", (const char *) pName, sizeof ("xglFreeMemory"))) |
| 149 | return (XGL_VOID *) pTable->FreeMemory; |
| 150 | else if (!strncmp("xglSetMemoryPriority", (const char *) pName, sizeof ("xglSetMemoryPriority"))) |
| 151 | return (XGL_VOID *) pTable->SetMemoryPriority; |
| 152 | else if (!strncmp("xglMapMemory", (const char *) pName, sizeof ("xglMapMemory"))) |
| 153 | return (XGL_VOID *) pTable->MapMemory; |
| 154 | else if (!strncmp("xglUnmapMemory", (const char *) pName, sizeof ("xglUnmapMemory"))) |
| 155 | return (XGL_VOID *) pTable->UnmapMemory; |
| 156 | else if (!strncmp("xglPinSystemMemory", (const char *) pName, sizeof ("xglPinSystemMemory"))) |
| 157 | return (XGL_VOID *) pTable->PinSystemMemory; |
| 158 | else if (!strncmp("xglRemapVirtualMemoryPages", (const char *) pName, sizeof ("xglRemapVirtualMemoryPages"))) |
| 159 | return (XGL_VOID *) pTable->RemapVirtualMemoryPages; |
| 160 | else if (!strncmp("xglGetMultiGpuCompatibility", (const char *) pName, sizeof ("xglGetMultiGpuCompatibility"))) |
| 161 | return (XGL_VOID *) pTable->GetMultiGpuCompatibility; |
| 162 | else if (!strncmp("xglOpenSharedMemory", (const char *) pName, sizeof ("xglOpenSharedMemory"))) |
| 163 | return (XGL_VOID *) pTable->OpenSharedMemory; |
| 164 | else if (!strncmp("xglOpenSharedQueueSemaphore", (const char *) pName, sizeof ("xglOpenSharedQueueSemaphore"))) |
| 165 | return (XGL_VOID *) pTable->OpenSharedQueueSemaphore; |
| 166 | else if (!strncmp("xglOpenPeerMemory", (const char *) pName, sizeof ("xglOpenPeerMemory"))) |
| 167 | return (XGL_VOID *) pTable->OpenPeerMemory; |
| 168 | else if (!strncmp("xglOpenPeerImage", (const char *) pName, sizeof ("xglOpenPeerImage"))) |
| 169 | return (XGL_VOID *) pTable->OpenPeerImage; |
| 170 | else if (!strncmp("xglDestroyObject", (const char *) pName, sizeof ("xglDestroyObject"))) |
| 171 | return (XGL_VOID *) pTable->DestroyObject; |
| 172 | else if (!strncmp("xglGetObjectInfo", (const char *) pName, sizeof ("xglGetObjectInfo"))) |
| 173 | return (XGL_VOID *) pTable->GetObjectInfo; |
| 174 | else if (!strncmp("xglBindObjectMemory", (const char *) pName, sizeof ("xglBindObjectMemory"))) |
| 175 | return (XGL_VOID *) pTable->BindObjectMemory; |
| 176 | else if (!strncmp("xglCreateFence", (const char *) pName, sizeof ("xgllCreateFence"))) |
| 177 | return (XGL_VOID *) pTable->CreateFence; |
| 178 | else if (!strncmp("xglGetFenceStatus", (const char *) pName, sizeof ("xglGetFenceStatus"))) |
| 179 | return (XGL_VOID *) pTable->GetFenceStatus; |
| 180 | else if (!strncmp("xglWaitForFences", (const char *) pName, sizeof ("xglWaitForFences"))) |
| 181 | return (XGL_VOID *) pTable->WaitForFences; |
| 182 | else if (!strncmp("xglCreateQueueSemaphore", (const char *) pName, sizeof ("xgllCreateQueueSemaphore"))) |
| 183 | return (XGL_VOID *) pTable->CreateQueueSemaphore; |
| 184 | else if (!strncmp("xglSignalQueueSemaphore", (const char *) pName, sizeof ("xglSignalQueueSemaphore"))) |
| 185 | return (XGL_VOID *) pTable->SignalQueueSemaphore; |
| 186 | else if (!strncmp("xglWaitQueueSemaphore", (const char *) pName, sizeof ("xglWaitQueueSemaphore"))) |
| 187 | return (XGL_VOID *) pTable->WaitQueueSemaphore; |
| 188 | else if (!strncmp("xglCreateEvent", (const char *) pName, sizeof ("xgllCreateEvent"))) |
| 189 | return (XGL_VOID *) pTable->CreateEvent; |
| 190 | else if (!strncmp("xglGetEventStatus", (const char *) pName, sizeof ("xglGetEventStatus"))) |
| 191 | return (XGL_VOID *) pTable->GetEventStatus; |
| 192 | else if (!strncmp("xglSetEvent", (const char *) pName, sizeof ("xglSetEvent"))) |
| 193 | return (XGL_VOID *) pTable->SetEvent; |
| 194 | else if (!strncmp("xglResetEvent", (const char *) pName, sizeof ("xgllResetEvent"))) |
| 195 | return (XGL_VOID *) pTable->ResetEvent; |
| 196 | else if (!strncmp("xglCreateQueryPool", (const char *) pName, sizeof ("xglCreateQueryPool"))) |
| 197 | return (XGL_VOID *) pTable->CreateQueryPool; |
| 198 | else if (!strncmp("xglGetQueryPoolResults", (const char *) pName, sizeof ("xglGetQueryPoolResults"))) |
| 199 | return (XGL_VOID *) pTable->GetQueryPoolResults; |
| 200 | else if (!strncmp("xglGetFormatInfo", (const char *) pName, sizeof ("xglGetFormatInfo"))) |
| 201 | return (XGL_VOID *) pTable->GetFormatInfo; |
| 202 | else if (!strncmp("xglCreateImage", (const char *) pName, sizeof ("xglCreateImage"))) |
| 203 | return (XGL_VOID *) pTable->CreateImage; |
| 204 | else if (!strncmp("xglGetImageSubresourceInfo", (const char *) pName, sizeof ("xglGetImageSubresourceInfo"))) |
| 205 | return (XGL_VOID *) pTable->GetImageSubresourceInfo; |
| 206 | else if (!strncmp("xglCreateImageView", (const char *) pName, sizeof ("xglCreateImageView"))) |
| 207 | return (XGL_VOID *) pTable->CreateImageView; |
| 208 | else if (!strncmp("xglCreateColorAttachmentView", (const char *) pName, sizeof ("xglCreateColorAttachmentView"))) |
| 209 | return (XGL_VOID *) pTable->CreateColorAttachmentView; |
| 210 | else if (!strncmp("xglCreateDepthStencilView", (const char *) pName, sizeof ("xglCreateDepthStencilView"))) |
| 211 | return (XGL_VOID *) pTable->CreateDepthStencilView; |
| 212 | else if (!strncmp("xglCreateShader", (const char *) pName, sizeof ("xglCreateShader"))) |
| 213 | return (XGL_VOID *) pTable->CreateShader; |
| 214 | else if (!strncmp("xglCreateGraphicsPipeline", (const char *) pName, sizeof ("xglCreateGraphicsPipeline"))) |
| 215 | return (XGL_VOID *) multi1CreateGraphicsPipeline; |
| 216 | else if (!strncmp("xglCreateComputePipeline", (const char *) pName, sizeof ("xglCreateComputePipeline"))) |
| 217 | return (XGL_VOID *) pTable->CreateComputePipeline; |
| 218 | else if (!strncmp("xglStorePipeline", (const char *) pName, sizeof ("xglStorePipeline"))) |
| 219 | return (XGL_VOID *) multi1StorePipeline; |
| 220 | else if (!strncmp("xglLoadPipeline", (const char *) pName, sizeof ("xglLoadPipeline"))) |
| 221 | return (XGL_VOID *) pTable->LoadPipeline; |
| 222 | else if (!strncmp("xglCreatePipelineDelta", (const char *) pName, sizeof ("xglCreatePipelineDelta"))) |
| 223 | return (XGL_VOID *) pTable->CreatePipelineDelta; |
| 224 | else if (!strncmp("xglCreateSampler", (const char *) pName, sizeof ("xglCreateSampler"))) |
| 225 | return (XGL_VOID *) pTable->CreateSampler; |
| 226 | else if (!strncmp("xglCreateDescriptorSet", (const char *) pName, sizeof ("xglCreateDescriptorSet"))) |
| 227 | return (XGL_VOID *) pTable->CreateDescriptorSet; |
| 228 | else if (!strncmp("xglBeginDescriptorSetUpdate", (const char *) pName, sizeof ("xglBeginDescriptorSetUpdate"))) |
| 229 | return (XGL_VOID *) pTable->BeginDescriptorSetUpdate; |
| 230 | else if (!strncmp("xglEndDescriptorSetUpdate", (const char *) pName, sizeof ("xglEndDescriptorSetUpdate"))) |
| 231 | return (XGL_VOID *) pTable->EndDescriptorSetUpdate; |
| 232 | else if (!strncmp("xglAttachSamplerDescriptors", (const char *) pName, sizeof ("xglAttachSamplerDescriptors"))) |
| 233 | return (XGL_VOID *) pTable->AttachSamplerDescriptors; |
| 234 | else if (!strncmp("xglAttachImageViewDescriptors", (const char *) pName, sizeof ("xglAttachImageViewDescriptors"))) |
| 235 | return (XGL_VOID *) pTable->AttachImageViewDescriptors; |
| 236 | else if (!strncmp("xglAttachMemoryViewDescriptors", (const char *) pName, sizeof ("xglAttachMemoryViewDescriptors"))) |
| 237 | return (XGL_VOID *) pTable->AttachMemoryViewDescriptors; |
| 238 | else if (!strncmp("xglAttachNestedDescriptors", (const char *) pName, sizeof ("xglAttachNestedDescriptors"))) |
| 239 | return (XGL_VOID *) pTable->AttachNestedDescriptors; |
| 240 | else if (!strncmp("xglClearDescriptorSetSlots", (const char *) pName, sizeof ("xglClearDescriptorSetSlots"))) |
| 241 | return (XGL_VOID *) pTable->ClearDescriptorSetSlots; |
| 242 | else if (!strncmp("xglCreateViewportState", (const char *) pName, sizeof ("xglCreateViewportState"))) |
| 243 | return (XGL_VOID *) pTable->CreateViewportState; |
| 244 | else if (!strncmp("xglCreateRasterState", (const char *) pName, sizeof ("xglCreateRasterState"))) |
| 245 | return (XGL_VOID *) pTable->CreateRasterState; |
| 246 | else if (!strncmp("xglCreateMsaaState", (const char *) pName, sizeof ("xglCreateMsaaState"))) |
| 247 | return (XGL_VOID *) pTable->CreateMsaaState; |
| 248 | else if (!strncmp("xglCreateColorBlendState", (const char *) pName, sizeof ("xglCreateColorBlendState"))) |
| 249 | return (XGL_VOID *) pTable->CreateColorBlendState; |
| 250 | else if (!strncmp("xglCreateDepthStencilState", (const char *) pName, sizeof ("xglCreateDepthStencilState"))) |
| 251 | return (XGL_VOID *) pTable->CreateDepthStencilState; |
| 252 | else if (!strncmp("xglCreateCommandBuffer", (const char *) pName, sizeof ("xglCreateCommandBuffer"))) |
| 253 | return (XGL_VOID *) pTable->CreateCommandBuffer; |
| 254 | else if (!strncmp("xglBeginCommandBuffer", (const char *) pName, sizeof ("xglBeginCommandBuffer"))) |
| 255 | return (XGL_VOID *) pTable->BeginCommandBuffer; |
| 256 | else if (!strncmp("xglEndCommandBuffer", (const char *) pName, sizeof ("xglEndCommandBuffer"))) |
| 257 | return (XGL_VOID *) pTable->EndCommandBuffer; |
| 258 | else if (!strncmp("xglResetCommandBuffer", (const char *) pName, sizeof ("xglResetCommandBuffer"))) |
| 259 | return (XGL_VOID *) pTable->ResetCommandBuffer; |
| 260 | else if (!strncmp("xglCmdBindPipeline", (const char *) pName, sizeof ("xglCmdBindPipeline"))) |
| 261 | return (XGL_VOID *) pTable->CmdBindPipeline; |
| 262 | else if (!strncmp("xglCmdBindPipelineDelta", (const char *) pName, sizeof ("xglCmdBindPipelineDelta"))) |
| 263 | return (XGL_VOID *) pTable->CmdBindPipelineDelta; |
| 264 | else if (!strncmp("xglCmdBindStateObject", (const char *) pName, sizeof ("xglCmdBindStateObject"))) |
| 265 | return (XGL_VOID *) pTable->CmdBindStateObject; |
| 266 | else if (!strncmp("xglCmdBindDescriptorSet", (const char *) pName, sizeof ("xglCmdBindDescriptorSet"))) |
| 267 | return (XGL_VOID *) pTable->CmdBindDescriptorSet; |
| 268 | else if (!strncmp("xglCmdBindDynamicMemoryView", (const char *) pName, sizeof ("xglCmdBindDynamicMemoryView"))) |
| 269 | return (XGL_VOID *) pTable->CmdBindDynamicMemoryView; |
| 270 | else if (!strncmp("xglCmdBindVertexData", (const char *) pName, sizeof ("xglCmdBindVertexData"))) |
| 271 | return (XGL_VOID *) pTable->CmdBindVertexData; |
| 272 | else if (!strncmp("xglCmdBindIndexData", (const char *) pName, sizeof ("xglCmdBindIndexData"))) |
| 273 | return (XGL_VOID *) pTable->CmdBindIndexData; |
| 274 | else if (!strncmp("xglCmdBindAttachments", (const char *) pName, sizeof ("xglCmdBindAttachments"))) |
| 275 | return (XGL_VOID *) pTable->CmdBindAttachments; |
| 276 | else if (!strncmp("xglCmdPrepareMemoryRegions", (const char *) pName, sizeof ("xglCmdPrepareMemoryRegions"))) |
| 277 | return (XGL_VOID *) pTable->CmdPrepareMemoryRegions; |
| 278 | else if (!strncmp("xglCmdPrepareImages", (const char *) pName, sizeof ("xglCmdPrepareImages"))) |
| 279 | return (XGL_VOID *) pTable->CmdPrepareImages; |
| 280 | else if (!strncmp("xglCmdDraw", (const char *) pName, sizeof ("xglCmdDraw"))) |
| 281 | return (XGL_VOID *) pTable->CmdDraw; |
| 282 | else if (!strncmp("xglCmdDrawIndexed", (const char *) pName, sizeof ("xglCmdDrawIndexed"))) |
| 283 | return (XGL_VOID *) pTable->CmdDrawIndexed; |
| 284 | else if (!strncmp("xglCmdDrawIndirect", (const char *) pName, sizeof ("xglCmdDrawIndirect"))) |
| 285 | return (XGL_VOID *) pTable->CmdDrawIndirect; |
| 286 | else if (!strncmp("xglCmdDrawIndexedIndirect", (const char *) pName, sizeof ("xglCmdDrawIndexedIndirect"))) |
| 287 | return (XGL_VOID *) pTable->CmdDrawIndexedIndirect; |
| 288 | else if (!strncmp("xglCmdDispatch", (const char *) pName, sizeof ("xglCmdDispatch"))) |
| 289 | return (XGL_VOID *) pTable->CmdDispatch; |
| 290 | else if (!strncmp("xglCmdDispatchIndirect", (const char *) pName, sizeof ("xglCmdDispatchIndirect"))) |
| 291 | return (XGL_VOID *) pTable->CmdDispatchIndirect; |
| 292 | else if (!strncmp("xglCmdCopyMemory", (const char *) pName, sizeof ("xglCmdCopyMemory"))) |
| 293 | return (XGL_VOID *) pTable->CmdCopyMemory; |
| 294 | else if (!strncmp("xglCmdCopyImage", (const char *) pName, sizeof ("xglCmdCopyImage"))) |
| 295 | return (XGL_VOID *) pTable->CmdCopyImage; |
| 296 | else if (!strncmp("xglCmdCopyMemoryToImage", (const char *) pName, sizeof ("xglCmdCopyMemoryToImage"))) |
| 297 | return (XGL_VOID *) pTable->CmdCopyMemoryToImage; |
| 298 | else if (!strncmp("xglCmdCopyImageToMemory", (const char *) pName, sizeof ("xglCmdCopyImageToMemory"))) |
| 299 | return (XGL_VOID *) pTable->CmdCopyImageToMemory; |
| 300 | else if (!strncmp("xglCmdCloneImageData", (const char *) pName, sizeof ("xglCmdCloneImageData"))) |
| 301 | return (XGL_VOID *) pTable->CmdCloneImageData; |
| 302 | else if (!strncmp("xglCmdUpdateMemory", (const char *) pName, sizeof ("xglCmdUpdateMemory"))) |
| 303 | return (XGL_VOID *) pTable->CmdUpdateMemory; |
| 304 | else if (!strncmp("xglCmdFillMemory", (const char *) pName, sizeof ("xglCmdFillMemory"))) |
| 305 | return (XGL_VOID *) pTable->CmdFillMemory; |
| 306 | else if (!strncmp("xglCmdClearColorImage", (const char *) pName, sizeof ("xglCmdClearColorImage"))) |
| 307 | return (XGL_VOID *) pTable->CmdClearColorImage; |
| 308 | else if (!strncmp("xglCmdClearColorImageRaw", (const char *) pName, sizeof ("xglCmdClearColorImageRaw"))) |
| 309 | return (XGL_VOID *) pTable->CmdClearColorImageRaw; |
| 310 | else if (!strncmp("xglCmdClearDepthStencil", (const char *) pName, sizeof ("xglCmdClearDepthStencil"))) |
| 311 | return (XGL_VOID *) pTable->CmdClearDepthStencil; |
| 312 | else if (!strncmp("xglCmdResolveImage", (const char *) pName, sizeof ("xglCmdResolveImage"))) |
| 313 | return (XGL_VOID *) pTable->CmdResolveImage; |
| 314 | else if (!strncmp("xglCmdSetEvent", (const char *) pName, sizeof ("xglCmdSetEvent"))) |
| 315 | return (XGL_VOID *) pTable->CmdSetEvent; |
| 316 | else if (!strncmp("xglCmdResetEvent", (const char *) pName, sizeof ("xglCmdResetEvent"))) |
| 317 | return (XGL_VOID *) pTable->CmdResetEvent; |
| 318 | else if (!strncmp("xglCmdMemoryAtomic", (const char *) pName, sizeof ("xglCmdMemoryAtomic"))) |
| 319 | return (XGL_VOID *) pTable->CmdMemoryAtomic; |
| 320 | else if (!strncmp("xglCmdBeginQuery", (const char *) pName, sizeof ("xglCmdBeginQuery"))) |
| 321 | return (XGL_VOID *) pTable->CmdBeginQuery; |
| 322 | else if (!strncmp("xglCmdEndQuery", (const char *) pName, sizeof ("xglCmdEndQuery"))) |
| 323 | return (XGL_VOID *) pTable->CmdEndQuery; |
| 324 | else if (!strncmp("xglCmdResetQueryPool", (const char *) pName, sizeof ("xglCmdResetQueryPool"))) |
| 325 | return (XGL_VOID *) pTable->CmdResetQueryPool; |
| 326 | else if (!strncmp("xglCmdWriteTimestamp", (const char *) pName, sizeof ("xglCmdWriteTimestamp"))) |
| 327 | return (XGL_VOID *) pTable->CmdWriteTimestamp; |
| 328 | else if (!strncmp("xglCmdInitAtomicCounters", (const char *) pName, sizeof ("xglCmdInitAtomicCounters"))) |
| 329 | return (XGL_VOID *) pTable->CmdInitAtomicCounters; |
| 330 | else if (!strncmp("xglCmdLoadAtomicCounters", (const char *) pName, sizeof ("xglCmdLoadAtomicCounters"))) |
| 331 | return (XGL_VOID *) pTable->CmdLoadAtomicCounters; |
| 332 | else if (!strncmp("xglCmdSaveAtomicCounters", (const char *) pName, sizeof ("xglCmdSaveAtomicCounters"))) |
| 333 | return (XGL_VOID *) pTable->CmdSaveAtomicCounters; |
| 334 | else if (!strncmp("xglDbgSetValidationLevel", (const char *) pName, sizeof ("xglDbgSetValidationLevel"))) |
| 335 | return (XGL_VOID *) pTable->DbgSetValidationLevel; |
| 336 | else if (!strncmp("xglDbgRegisterMsgCallback", (const char *) pName, sizeof ("xglDbgRegisterMsgCallback"))) |
| 337 | return (XGL_VOID *) pTable->DbgRegisterMsgCallback; |
| 338 | else if (!strncmp("xglDbgUnregisterMsgCallback", (const char *) pName, sizeof ("xglDbgUnregisterMsgCallback"))) |
| 339 | return (XGL_VOID *) pTable->DbgUnregisterMsgCallback; |
| 340 | else if (!strncmp("xglDbgSetMessageFilter", (const char *) pName, sizeof ("xglDbgSetMessageFilter"))) |
| 341 | return (XGL_VOID *) pTable->DbgSetMessageFilter; |
| 342 | else if (!strncmp("xglDbgSetObjectTag", (const char *) pName, sizeof ("xglDbgSetObjectTag"))) |
| 343 | return (XGL_VOID *) pTable->DbgSetObjectTag; |
| 344 | else if (!strncmp("xglDbgSetGlobalOption", (const char *) pName, sizeof ("xglDbgSetGlobalOption"))) |
| 345 | return (XGL_VOID *) pTable->DbgSetGlobalOption; |
| 346 | else if (!strncmp("xglDbgSetDeviceOption", (const char *) pName, sizeof ("xglDbgSetDeviceOption"))) |
| 347 | return (XGL_VOID *) pTable->DbgSetDeviceOption; |
| 348 | else if (!strncmp("xglCmdDbgMarkerBegin", (const char *) pName, sizeof ("xglCmdDbgMarkerBegin"))) |
| 349 | return (XGL_VOID *) pTable->CmdDbgMarkerBegin; |
| 350 | else if (!strncmp("xglCmdDbgMarkerEnd", (const char *) pName, sizeof ("xglCmdDbgMarkerEnd"))) |
| 351 | return (XGL_VOID *) pTable->CmdDbgMarkerEnd; |
| 352 | else if (!strncmp("xglWsiX11AssociateConnection", (const char *) pName, sizeof("xglWsiX11AssociateConnection"))) |
| 353 | return (XGL_VOID *) pTable->WsiX11AssociateConnection; |
| 354 | else if (!strncmp("xglWsiX11GetMSC", (const char *) pName, sizeof("xglWsiX11GetMSC"))) |
| 355 | return (XGL_VOID *) pTable->WsiX11GetMSC; |
| 356 | else if (!strncmp("xglWsiX11CreatePresentableImage", (const char *) pName, sizeof("xglWsiX11CreatePresentableImage"))) |
| 357 | return (XGL_VOID *) pTable->WsiX11CreatePresentableImage; |
| 358 | else if (!strncmp("xglWsiX11QueuePresent", (const char *) pName, sizeof("xglWsiX11QueuePresent"))) |
| 359 | return (XGL_VOID *) pTable->WsiX11QueuePresent; |
| 360 | else { |
| 361 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 362 | if (gpuw->pGPA == NULL) |
| 363 | return NULL; |
| 364 | return gpuw->pGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, pName); |
| 365 | } |
| 366 | |
| 367 | } |
| 368 | |
| 369 | /******************************** Layer multi2 functions **************************/ |
| 370 | static std::unordered_map<XGL_VOID *, XGL_LAYER_DISPATCH_TABLE *> tableMap2; |
| 371 | static bool layer2_first_activated = false; |
| 372 | |
| 373 | static XGL_LAYER_DISPATCH_TABLE * getLayer2Table(const XGL_BASE_LAYER_OBJECT *gpuw) |
| 374 | { |
| 375 | XGL_LAYER_DISPATCH_TABLE *pTable; |
| 376 | |
| 377 | assert(gpuw); |
| 378 | std::unordered_map<XGL_VOID *, XGL_LAYER_DISPATCH_TABLE *>::const_iterator it = tableMap2.find((XGL_VOID *) gpuw); |
| 379 | if (it == tableMap2.end()) |
| 380 | { |
| 381 | pTable = new XGL_LAYER_DISPATCH_TABLE; |
| 382 | tableMap2[(XGL_VOID *) gpuw] = pTable; |
| 383 | initLayerTable(gpuw, pTable, 2); |
| 384 | return pTable; |
| 385 | } else |
| 386 | { |
| 387 | return it->second; |
| 388 | } |
| 389 | } |
| 390 | |
| 391 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI multi2CreateDevice(XGL_PHYSICAL_GPU gpu, const XGL_DEVICE_CREATE_INFO* pCreateInfo, |
| 392 | XGL_DEVICE* pDevice) |
| 393 | { |
| 394 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 395 | XGL_LAYER_DISPATCH_TABLE* pTable = getLayer2Table(gpuw); |
| 396 | |
| 397 | printf("At start of multi2 xglCreateDevice()\n"); |
| 398 | XGL_RESULT result = pTable->CreateDevice((XGL_PHYSICAL_GPU)gpuw->nextObject, pCreateInfo, pDevice); |
| 399 | // create a mapping for the device object into the dispatch table for layer2 |
| 400 | tableMap2.emplace(*pDevice, pTable); |
| 401 | printf("Completed multi2 layer xglCreateDevice()\n"); |
| 402 | return result; |
| 403 | } |
| 404 | |
| 405 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI multi2CreateCommandBuffer(XGL_DEVICE device, const XGL_CMD_BUFFER_CREATE_INFO* pCreateInfo, |
| 406 | XGL_CMD_BUFFER* pCmdBuffer) |
| 407 | { |
| 408 | XGL_LAYER_DISPATCH_TABLE* pTable = tableMap2[device]; |
| 409 | |
| 410 | printf("At start of multi2 layer xglCreateCommandBuffer()\n"); |
| 411 | XGL_RESULT result = pTable->CreateCommandBuffer(device, pCreateInfo, pCmdBuffer); |
| 412 | // create a mapping for CmdBuffer object into the dispatch table for layer 2 |
| 413 | tableMap2.emplace(*pCmdBuffer, pTable); |
| 414 | printf("Completed multi2 layer xglCreateCommandBuffer()\n"); |
| 415 | return result; |
| 416 | } |
| 417 | |
| 418 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI multi2BeginCommandBuffer( XGL_CMD_BUFFER cmdBuffer, XGL_FLAGS flags) |
| 419 | { |
| 420 | XGL_LAYER_DISPATCH_TABLE* pTable = tableMap2[cmdBuffer]; |
| 421 | |
| 422 | printf("At start of multi2 layer xglBeginCommandBuffer()\n"); |
| 423 | XGL_RESULT result = pTable->BeginCommandBuffer(cmdBuffer, flags); |
| 424 | printf("Completed multi2 layer xglBeginCommandBuffer()\n"); |
| 425 | return result; |
| 426 | |
| 427 | } |
| 428 | |
| 429 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI multi2EnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, |
| 430 | XGL_CHAR* const* pOutLayers, XGL_SIZE * pOutLayerCount, |
| 431 | XGL_VOID* pReserved) |
| 432 | { |
| 433 | if (gpu == NULL) |
| 434 | return xglEnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayers, pOutLayerCount, pReserved); |
| 435 | |
| 436 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 437 | XGL_LAYER_DISPATCH_TABLE* pTable = getLayer2Table(gpuw); |
| 438 | |
| 439 | printf("At start of multi2 layer xglEnumerateLayers()\n"); |
| 440 | XGL_RESULT result = pTable->EnumerateLayers((XGL_PHYSICAL_GPU)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayers, pOutLayerCount, pReserved); |
| 441 | printf("Completed multi2 layer xglEnumerateLayers()\n"); |
| 442 | return result; |
| 443 | } |
| 444 | |
| 445 | XGL_LAYER_EXPORT XGL_VOID * XGLAPI multi2GetProcAddr(XGL_PHYSICAL_GPU gpu, const XGL_CHAR* pName) |
| 446 | { |
| 447 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 448 | if (gpu == NULL) |
| 449 | return NULL; |
| 450 | XGL_LAYER_DISPATCH_TABLE* pTable; |
| 451 | pTable = getLayer2Table(gpuw); |
| 452 | if (!strncmp("xglInitAndEnumerateGpus", (const char *) pName, sizeof("xglInitAndEnumerateGpus"))) |
| 453 | return (XGL_VOID *) pTable->InitAndEnumerateGpus; |
| 454 | else if (!strncmp("xglGetGpuInfo", (const char *) pName, sizeof ("xglGetGpuInfo"))) |
| 455 | return (XGL_VOID *) pTable->GetGpuInfo; |
| 456 | else if (!strncmp("xglCreateDevice", (const char *) pName, sizeof ("xglCreateDevice"))) |
| 457 | return (XGL_VOID *) multi2CreateDevice; |
| 458 | else if (!strncmp("xglDestroyDevice", (const char *) pName, sizeof ("xglDestroyDevice"))) |
| 459 | return (XGL_VOID *) pTable->DestroyDevice; |
| 460 | else if (!strncmp("xglGetExtensionSupport", (const char *) pName, sizeof ("xglGetExtensionSupport"))) |
| 461 | return (XGL_VOID *) pTable->GetExtensionSupport; |
| 462 | else if (!strncmp("xglEnumerateLayers", (const char *) pName, sizeof ("xglEnumerateLayers"))) |
| 463 | return (XGL_VOID *) multi2EnumerateLayers; |
| 464 | else if (!strncmp("xglGetDeviceQueue", (const char *) pName, sizeof ("xglGetDeviceQueue"))) |
| 465 | return (XGL_VOID *) pTable->GetDeviceQueue; |
| 466 | else if (!strncmp("xglQueueSubmit", (const char *) pName, sizeof ("xglQueueSubmit"))) |
| 467 | return (XGL_VOID *) pTable->QueueSubmit; |
| 468 | else if (!strncmp("xglQueueSetGlobalMemReferences", (const char *) pName, sizeof ("xglQueueSetGlobalMemReferences"))) |
| 469 | return (XGL_VOID *) pTable->QueueSetGlobalMemReferences; |
| 470 | else if (!strncmp("xglQueueWaitIdle", (const char *) pName, sizeof ("xglQueueWaitIdle"))) |
| 471 | return (XGL_VOID *) pTable->QueueWaitIdle; |
| 472 | else if (!strncmp("xglDeviceWaitIdle", (const char *) pName, sizeof ("xglDeviceWaitIdle"))) |
| 473 | return (XGL_VOID *) pTable->DeviceWaitIdle; |
| 474 | else if (!strncmp("xglGetMemoryHeapCount", (const char *) pName, sizeof ("xglGetMemoryHeapCount"))) |
| 475 | return (XGL_VOID *) pTable->GetMemoryHeapCount; |
| 476 | else if (!strncmp("xglGetMemoryHeapInfo", (const char *) pName, sizeof ("xglGetMemoryHeapInfo"))) |
| 477 | return (XGL_VOID *) pTable->GetMemoryHeapInfo; |
| 478 | else if (!strncmp("xglAllocMemory", (const char *) pName, sizeof ("xglAllocMemory"))) |
| 479 | return (XGL_VOID *) pTable->AllocMemory; |
| 480 | else if (!strncmp("xglFreeMemory", (const char *) pName, sizeof ("xglFreeMemory"))) |
| 481 | return (XGL_VOID *) pTable->FreeMemory; |
| 482 | else if (!strncmp("xglSetMemoryPriority", (const char *) pName, sizeof ("xglSetMemoryPriority"))) |
| 483 | return (XGL_VOID *) pTable->SetMemoryPriority; |
| 484 | else if (!strncmp("xglMapMemory", (const char *) pName, sizeof ("xglMapMemory"))) |
| 485 | return (XGL_VOID *) pTable->MapMemory; |
| 486 | else if (!strncmp("xglUnmapMemory", (const char *) pName, sizeof ("xglUnmapMemory"))) |
| 487 | return (XGL_VOID *) pTable->UnmapMemory; |
| 488 | else if (!strncmp("xglPinSystemMemory", (const char *) pName, sizeof ("xglPinSystemMemory"))) |
| 489 | return (XGL_VOID *) pTable->PinSystemMemory; |
| 490 | else if (!strncmp("xglRemapVirtualMemoryPages", (const char *) pName, sizeof ("xglRemapVirtualMemoryPages"))) |
| 491 | return (XGL_VOID *) pTable->RemapVirtualMemoryPages; |
| 492 | else if (!strncmp("xglGetMultiGpuCompatibility", (const char *) pName, sizeof ("xglGetMultiGpuCompatibility"))) |
| 493 | return (XGL_VOID *) pTable->GetMultiGpuCompatibility; |
| 494 | else if (!strncmp("xglOpenSharedMemory", (const char *) pName, sizeof ("xglOpenSharedMemory"))) |
| 495 | return (XGL_VOID *) pTable->OpenSharedMemory; |
| 496 | else if (!strncmp("xglOpenSharedQueueSemaphore", (const char *) pName, sizeof ("xglOpenSharedQueueSemaphore"))) |
| 497 | return (XGL_VOID *) pTable->OpenSharedQueueSemaphore; |
| 498 | else if (!strncmp("xglOpenPeerMemory", (const char *) pName, sizeof ("xglOpenPeerMemory"))) |
| 499 | return (XGL_VOID *) pTable->OpenPeerMemory; |
| 500 | else if (!strncmp("xglOpenPeerImage", (const char *) pName, sizeof ("xglOpenPeerImage"))) |
| 501 | return (XGL_VOID *) pTable->OpenPeerImage; |
| 502 | else if (!strncmp("xglDestroyObject", (const char *) pName, sizeof ("xglDestroyObject"))) |
| 503 | return (XGL_VOID *) pTable->DestroyObject; |
| 504 | else if (!strncmp("xglGetObjectInfo", (const char *) pName, sizeof ("xglGetObjectInfo"))) |
| 505 | return (XGL_VOID *) pTable->GetObjectInfo; |
| 506 | else if (!strncmp("xglBindObjectMemory", (const char *) pName, sizeof ("xglBindObjectMemory"))) |
| 507 | return (XGL_VOID *) pTable->BindObjectMemory; |
| 508 | else if (!strncmp("xglCreateFence", (const char *) pName, sizeof ("xgllCreateFence"))) |
| 509 | return (XGL_VOID *) pTable->CreateFence; |
| 510 | else if (!strncmp("xglGetFenceStatus", (const char *) pName, sizeof ("xglGetFenceStatus"))) |
| 511 | return (XGL_VOID *) pTable->GetFenceStatus; |
| 512 | else if (!strncmp("xglWaitForFences", (const char *) pName, sizeof ("xglWaitForFences"))) |
| 513 | return (XGL_VOID *) pTable->WaitForFences; |
| 514 | else if (!strncmp("xglCreateQueueSemaphore", (const char *) pName, sizeof ("xgllCreateQueueSemaphore"))) |
| 515 | return (XGL_VOID *) pTable->CreateQueueSemaphore; |
| 516 | else if (!strncmp("xglSignalQueueSemaphore", (const char *) pName, sizeof ("xglSignalQueueSemaphore"))) |
| 517 | return (XGL_VOID *) pTable->SignalQueueSemaphore; |
| 518 | else if (!strncmp("xglWaitQueueSemaphore", (const char *) pName, sizeof ("xglWaitQueueSemaphore"))) |
| 519 | return (XGL_VOID *) pTable->WaitQueueSemaphore; |
| 520 | else if (!strncmp("xglCreateEvent", (const char *) pName, sizeof ("xgllCreateEvent"))) |
| 521 | return (XGL_VOID *) pTable->CreateEvent; |
| 522 | else if (!strncmp("xglGetEventStatus", (const char *) pName, sizeof ("xglGetEventStatus"))) |
| 523 | return (XGL_VOID *) pTable->GetEventStatus; |
| 524 | else if (!strncmp("xglSetEvent", (const char *) pName, sizeof ("xglSetEvent"))) |
| 525 | return (XGL_VOID *) pTable->SetEvent; |
| 526 | else if (!strncmp("xglResetEvent", (const char *) pName, sizeof ("xgllResetEvent"))) |
| 527 | return (XGL_VOID *) pTable->ResetEvent; |
| 528 | else if (!strncmp("xglCreateQueryPool", (const char *) pName, sizeof ("xglCreateQueryPool"))) |
| 529 | return (XGL_VOID *) pTable->CreateQueryPool; |
| 530 | else if (!strncmp("xglGetQueryPoolResults", (const char *) pName, sizeof ("xglGetQueryPoolResults"))) |
| 531 | return (XGL_VOID *) pTable->GetQueryPoolResults; |
| 532 | else if (!strncmp("xglGetFormatInfo", (const char *) pName, sizeof ("xglGetFormatInfo"))) |
| 533 | return (XGL_VOID *) pTable->GetFormatInfo; |
| 534 | else if (!strncmp("xglCreateImage", (const char *) pName, sizeof ("xglCreateImage"))) |
| 535 | return (XGL_VOID *) pTable->CreateImage; |
| 536 | else if (!strncmp("xglGetImageSubresourceInfo", (const char *) pName, sizeof ("xglGetImageSubresourceInfo"))) |
| 537 | return (XGL_VOID *) pTable->GetImageSubresourceInfo; |
| 538 | else if (!strncmp("xglCreateImageView", (const char *) pName, sizeof ("xglCreateImageView"))) |
| 539 | return (XGL_VOID *) pTable->CreateImageView; |
| 540 | else if (!strncmp("xglCreateColorAttachmentView", (const char *) pName, sizeof ("xglCreateColorAttachmentView"))) |
| 541 | return (XGL_VOID *) pTable->CreateColorAttachmentView; |
| 542 | else if (!strncmp("xglCreateDepthStencilView", (const char *) pName, sizeof ("xglCreateDepthStencilView"))) |
| 543 | return (XGL_VOID *) pTable->CreateDepthStencilView; |
| 544 | else if (!strncmp("xglCreateShader", (const char *) pName, sizeof ("xglCreateShader"))) |
| 545 | return (XGL_VOID *) pTable->CreateShader; |
| 546 | else if (!strncmp("xglCreateGraphicsPipeline", (const char *) pName, sizeof ("xglCreateGraphicsPipeline"))) |
| 547 | return (XGL_VOID *) pTable->CreateGraphicsPipeline; |
| 548 | else if (!strncmp("xglCreateComputePipeline", (const char *) pName, sizeof ("xglCreateComputePipeline"))) |
| 549 | return (XGL_VOID *) pTable->CreateComputePipeline; |
| 550 | else if (!strncmp("xglStorePipeline", (const char *) pName, sizeof ("xglStorePipeline"))) |
| 551 | return (XGL_VOID *) pTable->StorePipeline; |
| 552 | else if (!strncmp("xglLoadPipeline", (const char *) pName, sizeof ("xglLoadPipeline"))) |
| 553 | return (XGL_VOID *) pTable->LoadPipeline; |
| 554 | else if (!strncmp("xglCreatePipelineDelta", (const char *) pName, sizeof ("xglCreatePipelineDelta"))) |
| 555 | return (XGL_VOID *) pTable->CreatePipelineDelta; |
| 556 | else if (!strncmp("xglCreateSampler", (const char *) pName, sizeof ("xglCreateSampler"))) |
| 557 | return (XGL_VOID *) pTable->CreateSampler; |
| 558 | else if (!strncmp("xglCreateDescriptorSet", (const char *) pName, sizeof ("xglCreateDescriptorSet"))) |
| 559 | return (XGL_VOID *) pTable->CreateDescriptorSet; |
| 560 | else if (!strncmp("xglBeginDescriptorSetUpdate", (const char *) pName, sizeof ("xglBeginDescriptorSetUpdate"))) |
| 561 | return (XGL_VOID *) pTable->BeginDescriptorSetUpdate; |
| 562 | else if (!strncmp("xglEndDescriptorSetUpdate", (const char *) pName, sizeof ("xglEndDescriptorSetUpdate"))) |
| 563 | return (XGL_VOID *) pTable->EndDescriptorSetUpdate; |
| 564 | else if (!strncmp("xglAttachSamplerDescriptors", (const char *) pName, sizeof ("xglAttachSamplerDescriptors"))) |
| 565 | return (XGL_VOID *) pTable->AttachSamplerDescriptors; |
| 566 | else if (!strncmp("xglAttachImageViewDescriptors", (const char *) pName, sizeof ("xglAttachImageViewDescriptors"))) |
| 567 | return (XGL_VOID *) pTable->AttachImageViewDescriptors; |
| 568 | else if (!strncmp("xglAttachMemoryViewDescriptors", (const char *) pName, sizeof ("xglAttachMemoryViewDescriptors"))) |
| 569 | return (XGL_VOID *) pTable->AttachMemoryViewDescriptors; |
| 570 | else if (!strncmp("xglAttachNestedDescriptors", (const char *) pName, sizeof ("xglAttachNestedDescriptors"))) |
| 571 | return (XGL_VOID *) pTable->AttachNestedDescriptors; |
| 572 | else if (!strncmp("xglClearDescriptorSetSlots", (const char *) pName, sizeof ("xglClearDescriptorSetSlots"))) |
| 573 | return (XGL_VOID *) pTable->ClearDescriptorSetSlots; |
| 574 | else if (!strncmp("xglCreateViewportState", (const char *) pName, sizeof ("xglCreateViewportState"))) |
| 575 | return (XGL_VOID *) pTable->CreateViewportState; |
| 576 | else if (!strncmp("xglCreateRasterState", (const char *) pName, sizeof ("xglCreateRasterState"))) |
| 577 | return (XGL_VOID *) pTable->CreateRasterState; |
| 578 | else if (!strncmp("xglCreateMsaaState", (const char *) pName, sizeof ("xglCreateMsaaState"))) |
| 579 | return (XGL_VOID *) pTable->CreateMsaaState; |
| 580 | else if (!strncmp("xglCreateColorBlendState", (const char *) pName, sizeof ("xglCreateColorBlendState"))) |
| 581 | return (XGL_VOID *) pTable->CreateColorBlendState; |
| 582 | else if (!strncmp("xglCreateDepthStencilState", (const char *) pName, sizeof ("xglCreateDepthStencilState"))) |
| 583 | return (XGL_VOID *) pTable->CreateDepthStencilState; |
| 584 | else if (!strncmp("xglCreateCommandBuffer", (const char *) pName, sizeof ("xglCreateCommandBuffer"))) |
| 585 | return (XGL_VOID *) multi2CreateCommandBuffer; |
| 586 | else if (!strncmp("xglBeginCommandBuffer", (const char *) pName, sizeof ("xglBeginCommandBuffer"))) |
| 587 | return (XGL_VOID *) multi2BeginCommandBuffer; |
| 588 | else if (!strncmp("xglEndCommandBuffer", (const char *) pName, sizeof ("xglEndCommandBuffer"))) |
| 589 | return (XGL_VOID *) pTable->EndCommandBuffer; |
| 590 | else if (!strncmp("xglResetCommandBuffer", (const char *) pName, sizeof ("xglResetCommandBuffer"))) |
| 591 | return (XGL_VOID *) pTable->ResetCommandBuffer; |
| 592 | else if (!strncmp("xglCmdBindPipeline", (const char *) pName, sizeof ("xglCmdBindPipeline"))) |
| 593 | return (XGL_VOID *) pTable->CmdBindPipeline; |
| 594 | else if (!strncmp("xglCmdBindPipelineDelta", (const char *) pName, sizeof ("xglCmdBindPipelineDelta"))) |
| 595 | return (XGL_VOID *) pTable->CmdBindPipelineDelta; |
| 596 | else if (!strncmp("xglCmdBindStateObject", (const char *) pName, sizeof ("xglCmdBindStateObject"))) |
| 597 | return (XGL_VOID *) pTable->CmdBindStateObject; |
| 598 | else if (!strncmp("xglCmdBindDescriptorSet", (const char *) pName, sizeof ("xglCmdBindDescriptorSet"))) |
| 599 | return (XGL_VOID *) pTable->CmdBindDescriptorSet; |
| 600 | else if (!strncmp("xglCmdBindDynamicMemoryView", (const char *) pName, sizeof ("xglCmdBindDynamicMemoryView"))) |
| 601 | return (XGL_VOID *) pTable->CmdBindDynamicMemoryView; |
| 602 | else if (!strncmp("xglCmdBindVertexData", (const char *) pName, sizeof ("xglCmdBindVertexData"))) |
| 603 | return (XGL_VOID *) pTable->CmdBindVertexData; |
| 604 | else if (!strncmp("xglCmdBindIndexData", (const char *) pName, sizeof ("xglCmdBindIndexData"))) |
| 605 | return (XGL_VOID *) pTable->CmdBindIndexData; |
| 606 | else if (!strncmp("xglCmdBindAttachments", (const char *) pName, sizeof ("xglCmdBindAttachments"))) |
| 607 | return (XGL_VOID *) pTable->CmdBindAttachments; |
| 608 | else if (!strncmp("xglCmdPrepareMemoryRegions", (const char *) pName, sizeof ("xglCmdPrepareMemoryRegions"))) |
| 609 | return (XGL_VOID *) pTable->CmdPrepareMemoryRegions; |
| 610 | else if (!strncmp("xglCmdPrepareImages", (const char *) pName, sizeof ("xglCmdPrepareImages"))) |
| 611 | return (XGL_VOID *) pTable->CmdPrepareImages; |
| 612 | else if (!strncmp("xglCmdDraw", (const char *) pName, sizeof ("xglCmdDraw"))) |
| 613 | return (XGL_VOID *) pTable->CmdDraw; |
| 614 | else if (!strncmp("xglCmdDrawIndexed", (const char *) pName, sizeof ("xglCmdDrawIndexed"))) |
| 615 | return (XGL_VOID *) pTable->CmdDrawIndexed; |
| 616 | else if (!strncmp("xglCmdDrawIndirect", (const char *) pName, sizeof ("xglCmdDrawIndirect"))) |
| 617 | return (XGL_VOID *) pTable->CmdDrawIndirect; |
| 618 | else if (!strncmp("xglCmdDrawIndexedIndirect", (const char *) pName, sizeof ("xglCmdDrawIndexedIndirect"))) |
| 619 | return (XGL_VOID *) pTable->CmdDrawIndexedIndirect; |
| 620 | else if (!strncmp("xglCmdDispatch", (const char *) pName, sizeof ("xglCmdDispatch"))) |
| 621 | return (XGL_VOID *) pTable->CmdDispatch; |
| 622 | else if (!strncmp("xglCmdDispatchIndirect", (const char *) pName, sizeof ("xglCmdDispatchIndirect"))) |
| 623 | return (XGL_VOID *) pTable->CmdDispatchIndirect; |
| 624 | else if (!strncmp("xglCmdCopyMemory", (const char *) pName, sizeof ("xglCmdCopyMemory"))) |
| 625 | return (XGL_VOID *) pTable->CmdCopyMemory; |
| 626 | else if (!strncmp("xglCmdCopyImage", (const char *) pName, sizeof ("xglCmdCopyImage"))) |
| 627 | return (XGL_VOID *) pTable->CmdCopyImage; |
| 628 | else if (!strncmp("xglCmdCopyMemoryToImage", (const char *) pName, sizeof ("xglCmdCopyMemoryToImage"))) |
| 629 | return (XGL_VOID *) pTable->CmdCopyMemoryToImage; |
| 630 | else if (!strncmp("xglCmdCopyImageToMemory", (const char *) pName, sizeof ("xglCmdCopyImageToMemory"))) |
| 631 | return (XGL_VOID *) pTable->CmdCopyImageToMemory; |
| 632 | else if (!strncmp("xglCmdCloneImageData", (const char *) pName, sizeof ("xglCmdCloneImageData"))) |
| 633 | return (XGL_VOID *) pTable->CmdCloneImageData; |
| 634 | else if (!strncmp("xglCmdUpdateMemory", (const char *) pName, sizeof ("xglCmdUpdateMemory"))) |
| 635 | return (XGL_VOID *) pTable->CmdUpdateMemory; |
| 636 | else if (!strncmp("xglCmdFillMemory", (const char *) pName, sizeof ("xglCmdFillMemory"))) |
| 637 | return (XGL_VOID *) pTable->CmdFillMemory; |
| 638 | else if (!strncmp("xglCmdClearColorImage", (const char *) pName, sizeof ("xglCmdClearColorImage"))) |
| 639 | return (XGL_VOID *) pTable->CmdClearColorImage; |
| 640 | else if (!strncmp("xglCmdClearColorImageRaw", (const char *) pName, sizeof ("xglCmdClearColorImageRaw"))) |
| 641 | return (XGL_VOID *) pTable->CmdClearColorImageRaw; |
| 642 | else if (!strncmp("xglCmdClearDepthStencil", (const char *) pName, sizeof ("xglCmdClearDepthStencil"))) |
| 643 | return (XGL_VOID *) pTable->CmdClearDepthStencil; |
| 644 | else if (!strncmp("xglCmdResolveImage", (const char *) pName, sizeof ("xglCmdResolveImage"))) |
| 645 | return (XGL_VOID *) pTable->CmdResolveImage; |
| 646 | else if (!strncmp("xglCmdSetEvent", (const char *) pName, sizeof ("xglCmdSetEvent"))) |
| 647 | return (XGL_VOID *) pTable->CmdSetEvent; |
| 648 | else if (!strncmp("xglCmdResetEvent", (const char *) pName, sizeof ("xglCmdResetEvent"))) |
| 649 | return (XGL_VOID *) pTable->CmdResetEvent; |
| 650 | else if (!strncmp("xglCmdMemoryAtomic", (const char *) pName, sizeof ("xglCmdMemoryAtomic"))) |
| 651 | return (XGL_VOID *) pTable->CmdMemoryAtomic; |
| 652 | else if (!strncmp("xglCmdBeginQuery", (const char *) pName, sizeof ("xglCmdBeginQuery"))) |
| 653 | return (XGL_VOID *) pTable->CmdBeginQuery; |
| 654 | else if (!strncmp("xglCmdEndQuery", (const char *) pName, sizeof ("xglCmdEndQuery"))) |
| 655 | return (XGL_VOID *) pTable->CmdEndQuery; |
| 656 | else if (!strncmp("xglCmdResetQueryPool", (const char *) pName, sizeof ("xglCmdResetQueryPool"))) |
| 657 | return (XGL_VOID *) pTable->CmdResetQueryPool; |
| 658 | else if (!strncmp("xglCmdWriteTimestamp", (const char *) pName, sizeof ("xglCmdWriteTimestamp"))) |
| 659 | return (XGL_VOID *) pTable->CmdWriteTimestamp; |
| 660 | else if (!strncmp("xglCmdInitAtomicCounters", (const char *) pName, sizeof ("xglCmdInitAtomicCounters"))) |
| 661 | return (XGL_VOID *) pTable->CmdInitAtomicCounters; |
| 662 | else if (!strncmp("xglCmdLoadAtomicCounters", (const char *) pName, sizeof ("xglCmdLoadAtomicCounters"))) |
| 663 | return (XGL_VOID *) pTable->CmdLoadAtomicCounters; |
| 664 | else if (!strncmp("xglCmdSaveAtomicCounters", (const char *) pName, sizeof ("xglCmdSaveAtomicCounters"))) |
| 665 | return (XGL_VOID *) pTable->CmdSaveAtomicCounters; |
| 666 | else if (!strncmp("xglDbgSetValidationLevel", (const char *) pName, sizeof ("xglDbgSetValidationLevel"))) |
| 667 | return (XGL_VOID *) pTable->DbgSetValidationLevel; |
| 668 | else if (!strncmp("xglDbgRegisterMsgCallback", (const char *) pName, sizeof ("xglDbgRegisterMsgCallback"))) |
| 669 | return (XGL_VOID *) pTable->DbgRegisterMsgCallback; |
| 670 | else if (!strncmp("xglDbgUnregisterMsgCallback", (const char *) pName, sizeof ("xglDbgUnregisterMsgCallback"))) |
| 671 | return (XGL_VOID *) pTable->DbgUnregisterMsgCallback; |
| 672 | else if (!strncmp("xglDbgSetMessageFilter", (const char *) pName, sizeof ("xglDbgSetMessageFilter"))) |
| 673 | return (XGL_VOID *) pTable->DbgSetMessageFilter; |
| 674 | else if (!strncmp("xglDbgSetObjectTag", (const char *) pName, sizeof ("xglDbgSetObjectTag"))) |
| 675 | return (XGL_VOID *) pTable->DbgSetObjectTag; |
| 676 | else if (!strncmp("xglDbgSetGlobalOption", (const char *) pName, sizeof ("xglDbgSetGlobalOption"))) |
| 677 | return (XGL_VOID *) pTable->DbgSetGlobalOption; |
| 678 | else if (!strncmp("xglDbgSetDeviceOption", (const char *) pName, sizeof ("xglDbgSetDeviceOption"))) |
| 679 | return (XGL_VOID *) pTable->DbgSetDeviceOption; |
| 680 | else if (!strncmp("xglCmdDbgMarkerBegin", (const char *) pName, sizeof ("xglCmdDbgMarkerBegin"))) |
| 681 | return (XGL_VOID *) pTable->CmdDbgMarkerBegin; |
| 682 | else if (!strncmp("xglCmdDbgMarkerEnd", (const char *) pName, sizeof ("xglCmdDbgMarkerEnd"))) |
| 683 | return (XGL_VOID *) pTable->CmdDbgMarkerEnd; |
| 684 | else if (!strncmp("xglWsiX11AssociateConnection", (const char *) pName, sizeof("xglWsiX11AssociateConnection"))) |
| 685 | return (XGL_VOID *) pTable->WsiX11AssociateConnection; |
| 686 | else if (!strncmp("xglWsiX11GetMSC", (const char *) pName, sizeof("xglWsiX11GetMSC"))) |
| 687 | return (XGL_VOID *) pTable->WsiX11GetMSC; |
| 688 | else if (!strncmp("xglWsiX11CreatePresentableImage", (const char *) pName, sizeof("xglWsiX11CreatePresentableImage"))) |
| 689 | return (XGL_VOID *) pTable->WsiX11CreatePresentableImage; |
| 690 | else if (!strncmp("xglWsiX11QueuePresent", (const char *) pName, sizeof("xglWsiX11QueuePresent"))) |
| 691 | return (XGL_VOID *) pTable->WsiX11QueuePresent; |
| 692 | else { |
| 693 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 694 | if (gpuw->pGPA == NULL) |
| 695 | return NULL; |
| 696 | return gpuw->pGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, pName); |
| 697 | } |
| 698 | |
| 699 | } |
| 700 | |
| 701 | /********************************* Common functions ********************************/ |
| 702 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, |
| 703 | XGL_CHAR* const* pOutLayers, XGL_SIZE * pOutLayerCount, |
| 704 | XGL_VOID* pReserved) |
| 705 | { |
| 706 | if (pOutLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL || pOutLayers[1] == NULL || pReserved == NULL) |
| 707 | return XGL_ERROR_INVALID_POINTER; |
| 708 | |
| 709 | if (maxLayerCount < 2) |
| 710 | return XGL_ERROR_INITIALIZATION_FAILED; |
| 711 | *pOutLayerCount = 2; |
| 712 | strncpy((char *) pOutLayers[0], "multi1", maxStringSize); |
| 713 | strncpy((char *) pOutLayers[1], "multi2", maxStringSize); |
| 714 | return XGL_SUCCESS; |
| 715 | } |
| 716 | |
| 717 | XGL_LAYER_EXPORT XGL_VOID * XGLAPI xglGetProcAddr(XGL_PHYSICAL_GPU gpu, const XGL_CHAR* pName) |
| 718 | { |
| 719 | // to find each layers GPA routine Loader will search via "<layerName>GetProcAddr" |
| 720 | if (!strncmp("multi1GetProcAddr", (const char *) pName, sizeof("multi1GetProcAddr"))) |
| 721 | return (XGL_VOID *) multi1GetProcAddr; |
| 722 | else if (!strncmp("multi2GetProcAddr", (const char *) pName, sizeof("multi2GetProcAddr"))) |
| 723 | return (XGL_VOID *) multi2GetProcAddr; |
| 724 | else if (!strncmp("xglGetProcAddr", (const char *) pName, sizeof("xglGetProcAddr"))) |
| 725 | return (XGL_VOID *) xglGetProcAddr; |
| 726 | |
| 727 | // use first layer activated as GPA dispatch table activation happens in order |
| 728 | else if (layer1_first_activated) |
| 729 | return multi1GetProcAddr(gpu, pName); |
| 730 | else if (layer2_first_activated) |
| 731 | return multi2GetProcAddr(gpu, pName); |
| 732 | else |
| 733 | return NULL; |
| 734 | |
| 735 | } |
| 736 | |
| 737 | #ifdef __cplusplus |
| 738 | } //extern "C" |
| 739 | #endif |
| 740 | |
| 741 | static void initLayerTable(const XGL_BASE_LAYER_OBJECT *gpuw, XGL_LAYER_DISPATCH_TABLE *pTable, const unsigned int layerNum) |
| 742 | { |
| 743 | GetProcAddrType fpGPA; |
| 744 | fpGPA = gpuw->pGPA; |
| 745 | assert(fpGPA); |
| 746 | |
| 747 | if (layerNum == 2 && layer1_first_activated == false) |
| 748 | layer2_first_activated = true; |
| 749 | if (layerNum == 1 && layer2_first_activated == false) |
| 750 | layer1_first_activated = true; |
| 751 | |
| 752 | pTable->GetProcAddr = fpGPA; |
| 753 | pTable->InitAndEnumerateGpus = (InitAndEnumerateGpusType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglInitAndEnumerateGpus"); |
| 754 | pTable->GetGpuInfo = (GetGpuInfoType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglGetGpuInfo"); |
| 755 | pTable->CreateDevice = (CreateDeviceType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCreateDevice"); |
| 756 | pTable->DestroyDevice = (DestroyDeviceType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglDestroyDevice"); |
| 757 | pTable->GetExtensionSupport = (GetExtensionSupportType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglGetExtensionSupport"); |
| 758 | pTable->EnumerateLayers = (EnumerateLayersType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglEnumerateLayers"); |
| 759 | pTable->GetDeviceQueue = (GetDeviceQueueType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglGetDeviceQueue"); |
| 760 | pTable->QueueSubmit = (QueueSubmitType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglQueueSubmit"); |
| 761 | pTable->QueueSetGlobalMemReferences = (QueueSetGlobalMemReferencesType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglQueueSetGlobalMemReferences"); |
| 762 | pTable->QueueWaitIdle = (QueueWaitIdleType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglQueueWaitIdle"); |
| 763 | pTable->DeviceWaitIdle = (DeviceWaitIdleType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglDeviceWaitIdle"); |
| 764 | pTable->GetMemoryHeapCount = (GetMemoryHeapCountType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglGetMemoryHeapCount"); |
| 765 | pTable->GetMemoryHeapInfo = (GetMemoryHeapInfoType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglGetMemoryHeapInfo"); |
| 766 | pTable->AllocMemory = (AllocMemoryType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglAllocMemory"); |
| 767 | pTable->FreeMemory = (FreeMemoryType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglFreeMemory"); |
| 768 | pTable->SetMemoryPriority = (SetMemoryPriorityType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglSetMemoryPriority"); |
| 769 | pTable->MapMemory = (MapMemoryType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglMapMemory"); |
| 770 | pTable->UnmapMemory = (UnmapMemoryType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglUnmapMemory"); |
| 771 | pTable->PinSystemMemory = (PinSystemMemoryType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglPinSystemMemory"); |
| 772 | pTable->RemapVirtualMemoryPages = (RemapVirtualMemoryPagesType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglRemapVirtualMemoryPages"); |
| 773 | pTable->GetMultiGpuCompatibility = (GetMultiGpuCompatibilityType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglGetMultiGpuCompatibility"); |
| 774 | pTable->OpenSharedMemory = (OpenSharedMemoryType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglOpenSharedMemory"); |
| 775 | pTable->OpenSharedQueueSemaphore = (OpenSharedQueueSemaphoreType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglOpenSharedQueueSemaphore"); |
| 776 | pTable->OpenPeerMemory = (OpenPeerMemoryType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglOpenPeerMemory"); |
| 777 | pTable->OpenPeerImage = (OpenPeerImageType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglOpenPeerImage"); |
| 778 | pTable->DestroyObject = (DestroyObjectType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglDestroyObject"); |
| 779 | pTable->GetObjectInfo = (GetObjectInfoType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglGetObjectInfo"); |
| 780 | pTable->BindObjectMemory = (BindObjectMemoryType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglBindObjectMemory"); |
| 781 | pTable->CreateFence = (CreateFenceType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCreateFence"); |
| 782 | pTable->GetFenceStatus = (GetFenceStatusType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglGetFenceStatus"); |
| 783 | pTable->WaitForFences = (WaitForFencesType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglWaitForFences"); |
| 784 | pTable->CreateQueueSemaphore = (CreateQueueSemaphoreType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCreateQueueSemaphore"); |
| 785 | pTable->SignalQueueSemaphore = (SignalQueueSemaphoreType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglSignalQueueSemaphore"); |
| 786 | pTable->WaitQueueSemaphore = (WaitQueueSemaphoreType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglWaitQueueSemaphore"); |
| 787 | pTable->CreateEvent = (CreateEventType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCreateEvent"); |
| 788 | pTable->GetEventStatus = (GetEventStatusType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglGetEventStatus"); |
| 789 | pTable->SetEvent = (SetEventType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglSetEvent"); |
| 790 | pTable->ResetEvent = (ResetEventType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglResetEvent"); |
| 791 | pTable->CreateQueryPool = (CreateQueryPoolType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCreateQueryPool"); |
| 792 | pTable->GetQueryPoolResults = (GetQueryPoolResultsType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglGetQueryPoolResults"); |
| 793 | pTable->GetFormatInfo = (GetFormatInfoType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglGetFormatInfo"); |
| 794 | pTable->CreateImage = (CreateImageType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCreateImage"); |
| 795 | pTable->GetImageSubresourceInfo = (GetImageSubresourceInfoType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglGetImageSubresourceInfo"); |
| 796 | pTable->CreateImageView = (CreateImageViewType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCreateImageView"); |
| 797 | pTable->CreateColorAttachmentView = (CreateColorAttachmentViewType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCreateColorAttachmentView"); |
| 798 | pTable->CreateDepthStencilView = (CreateDepthStencilViewType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCreateDepthStencilView"); |
| 799 | pTable->CreateShader = (CreateShaderType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCreateShader"); |
| 800 | pTable->CreateGraphicsPipeline = (CreateGraphicsPipelineType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCreateGraphicsPipeline"); |
| 801 | pTable->CreateComputePipeline = (CreateComputePipelineType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCreateComputePipeline"); |
| 802 | pTable->StorePipeline = (StorePipelineType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglStorePipeline"); |
| 803 | pTable->LoadPipeline = (LoadPipelineType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglLoadPipeline"); |
| 804 | pTable->CreatePipelineDelta = (CreatePipelineDeltaType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCreatePipelineDelta"); |
| 805 | pTable->CreateSampler = (CreateSamplerType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCreateSampler"); |
| 806 | pTable->CreateDescriptorSet = (CreateDescriptorSetType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCreateDescriptorSet"); |
| 807 | pTable->BeginDescriptorSetUpdate = (BeginDescriptorSetUpdateType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglBeginDescriptorSetUpdate"); |
| 808 | pTable->EndDescriptorSetUpdate = (EndDescriptorSetUpdateType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglEndDescriptorSetUpdate"); |
| 809 | pTable->AttachSamplerDescriptors = (AttachSamplerDescriptorsType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglAttachSamplerDescriptors"); |
| 810 | pTable->AttachImageViewDescriptors = (AttachImageViewDescriptorsType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglAttachImageViewDescriptors"); |
| 811 | pTable->AttachMemoryViewDescriptors = (AttachMemoryViewDescriptorsType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglAttachMemoryViewDescriptors"); |
| 812 | pTable->AttachNestedDescriptors = (AttachNestedDescriptorsType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglAttachNestedDescriptors"); |
| 813 | pTable->ClearDescriptorSetSlots = (ClearDescriptorSetSlotsType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglClearDescriptorSetSlots"); |
| 814 | pTable->CreateViewportState = (CreateViewportStateType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCreateViewportState"); |
| 815 | pTable->CreateRasterState = (CreateRasterStateType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCreateRasterState"); |
| 816 | pTable->CreateMsaaState = (CreateMsaaStateType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCreateMsaaState"); |
| 817 | pTable->CreateColorBlendState = (CreateColorBlendStateType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCreateColorBlendState"); |
| 818 | pTable->CreateDepthStencilState = (CreateDepthStencilStateType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCreateDepthStencilState"); |
| 819 | pTable->CreateCommandBuffer = (CreateCommandBufferType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCreateCommandBuffer"); |
| 820 | pTable->BeginCommandBuffer = (BeginCommandBufferType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglBeginCommandBuffer"); |
| 821 | pTable->EndCommandBuffer = (EndCommandBufferType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglEndCommandBuffer"); |
| 822 | pTable->ResetCommandBuffer = (ResetCommandBufferType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglResetCommandBuffer"); |
| 823 | pTable->CmdBindPipeline = (CmdBindPipelineType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdBindPipeline"); |
| 824 | pTable->CmdBindPipelineDelta = (CmdBindPipelineDeltaType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdBindPipelineDelta"); |
| 825 | pTable->CmdBindStateObject = (CmdBindStateObjectType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdBindStateObject"); |
| 826 | pTable->CmdBindDescriptorSet = (CmdBindDescriptorSetType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdBindDescriptorSet"); |
| 827 | pTable->CmdBindDynamicMemoryView = (CmdBindDynamicMemoryViewType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdBindDynamicMemoryView"); |
| 828 | pTable->CmdBindVertexData = (CmdBindVertexDataType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdBindVertexData"); |
| 829 | pTable->CmdBindIndexData = (CmdBindIndexDataType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdBindIndexData"); |
| 830 | pTable->CmdBindAttachments = (CmdBindAttachmentsType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdBindAttachments"); |
| 831 | pTable->CmdPrepareMemoryRegions = (CmdPrepareMemoryRegionsType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdPrepareMemoryRegions"); |
| 832 | pTable->CmdPrepareImages = (CmdPrepareImagesType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdPrepareImages"); |
| 833 | pTable->CmdDraw = (CmdDrawType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdDraw"); |
| 834 | pTable->CmdDrawIndexed = (CmdDrawIndexedType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdDrawIndexed"); |
| 835 | pTable->CmdDrawIndirect = (CmdDrawIndirectType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdDrawIndirect"); |
| 836 | pTable->CmdDrawIndexedIndirect = (CmdDrawIndexedIndirectType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdDrawIndexedIndirect"); |
| 837 | pTable->CmdDispatch = (CmdDispatchType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdDispatch"); |
| 838 | pTable->CmdDispatchIndirect = (CmdDispatchIndirectType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdDispatchIndirect"); |
| 839 | pTable->CmdCopyMemory = (CmdCopyMemoryType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdCopyMemory"); |
| 840 | pTable->CmdCopyImage = (CmdCopyImageType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdCopyImage"); |
| 841 | pTable->CmdCopyMemoryToImage = (CmdCopyMemoryToImageType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdCopyMemoryToImage"); |
| 842 | pTable->CmdCopyImageToMemory = (CmdCopyImageToMemoryType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdCopyImageToMemory"); |
| 843 | pTable->CmdCloneImageData = (CmdCloneImageDataType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdCloneImageData"); |
| 844 | pTable->CmdUpdateMemory = (CmdUpdateMemoryType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdUpdateMemory"); |
| 845 | pTable->CmdFillMemory = (CmdFillMemoryType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdFillMemory"); |
| 846 | pTable->CmdClearColorImage = (CmdClearColorImageType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdClearColorImage"); |
| 847 | pTable->CmdClearColorImageRaw = (CmdClearColorImageRawType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdClearColorImageRaw"); |
| 848 | pTable->CmdClearDepthStencil = (CmdClearDepthStencilType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdClearDepthStencil"); |
| 849 | pTable->CmdResolveImage = (CmdResolveImageType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdResolveImage"); |
| 850 | pTable->CmdSetEvent = (CmdSetEventType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdSetEvent"); |
| 851 | pTable->CmdResetEvent = (CmdResetEventType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdResetEvent"); |
| 852 | pTable->CmdMemoryAtomic = (CmdMemoryAtomicType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdMemoryAtomic"); |
| 853 | pTable->CmdBeginQuery = (CmdBeginQueryType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdBeginQuery"); |
| 854 | pTable->CmdEndQuery = (CmdEndQueryType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdEndQuery"); |
| 855 | pTable->CmdResetQueryPool = (CmdResetQueryPoolType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdResetQueryPool"); |
| 856 | pTable->CmdWriteTimestamp = (CmdWriteTimestampType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdWriteTimestamp"); |
| 857 | pTable->CmdInitAtomicCounters = (CmdInitAtomicCountersType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdInitAtomicCounters"); |
| 858 | pTable->CmdLoadAtomicCounters = (CmdLoadAtomicCountersType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdLoadAtomicCounters"); |
| 859 | pTable->CmdSaveAtomicCounters = (CmdSaveAtomicCountersType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdSaveAtomicCounters"); |
| 860 | pTable->DbgSetValidationLevel = (DbgSetValidationLevelType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglDbgSetValidationLevel"); |
| 861 | pTable->DbgRegisterMsgCallback = (DbgRegisterMsgCallbackType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglDbgRegisterMsgCallback"); |
| 862 | pTable->DbgUnregisterMsgCallback = (DbgUnregisterMsgCallbackType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglDbgUnregisterMsgCallback"); |
| 863 | pTable->DbgSetMessageFilter = (DbgSetMessageFilterType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglDbgSetMessageFilter"); |
| 864 | pTable->DbgSetObjectTag = (DbgSetObjectTagType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglDbgSetObjectTag"); |
| 865 | pTable->DbgSetGlobalOption = (DbgSetGlobalOptionType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglDbgSetGlobalOption"); |
| 866 | pTable->DbgSetDeviceOption = (DbgSetDeviceOptionType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglDbgSetDeviceOption"); |
| 867 | pTable->CmdDbgMarkerBegin = (CmdDbgMarkerBeginType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdDbgMarkerBegin"); |
| 868 | pTable->CmdDbgMarkerEnd = (CmdDbgMarkerEndType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglCmdDbgMarkerEnd"); |
| 869 | pTable->WsiX11AssociateConnection = (WsiX11AssociateConnectionType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglWsiX11AssociateConnection"); |
| 870 | pTable->WsiX11GetMSC = (WsiX11GetMSCType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglWsiX11GetMSC"); |
| 871 | pTable->WsiX11CreatePresentableImage = (WsiX11CreatePresentableImageType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglWsiX11CreatePresentableImage"); |
| 872 | pTable->WsiX11QueuePresent = (WsiX11QueuePresentType) fpGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, (const XGL_CHAR *) "xglWsiX11QueuePresent"); |
| 873 | } |