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> |
Chia-I Wu | aa4121f | 2015-01-04 23:11:43 +0800 | [diff] [blame^] | 30 | #include "xgl_dispatch_table_helper.h" |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 31 | #include "xglLayer.h" |
| 32 | |
| 33 | static void initLayerTable(const XGL_BASE_LAYER_OBJECT *gpuw, XGL_LAYER_DISPATCH_TABLE *pTable, const unsigned int layerNum); |
| 34 | |
| 35 | /******************************** Layer multi1 functions **************************/ |
| 36 | static std::unordered_map<XGL_VOID *, XGL_LAYER_DISPATCH_TABLE *> tableMap1; |
| 37 | static bool layer1_first_activated = false; |
| 38 | |
| 39 | static XGL_LAYER_DISPATCH_TABLE * getLayer1Table(const XGL_BASE_LAYER_OBJECT *gpuw) |
| 40 | { |
| 41 | XGL_LAYER_DISPATCH_TABLE *pTable; |
| 42 | |
| 43 | assert(gpuw); |
| 44 | std::unordered_map<XGL_VOID *, XGL_LAYER_DISPATCH_TABLE *>::const_iterator it = tableMap1.find((XGL_VOID *) gpuw); |
| 45 | if (it == tableMap1.end()) |
| 46 | { |
| 47 | pTable = new XGL_LAYER_DISPATCH_TABLE; |
| 48 | tableMap1[(XGL_VOID *) gpuw] = pTable; |
| 49 | initLayerTable(gpuw, pTable, 1); |
| 50 | return pTable; |
| 51 | } else |
| 52 | { |
| 53 | return it->second; |
| 54 | } |
| 55 | } |
| 56 | #ifdef __cplusplus |
| 57 | extern "C" { |
| 58 | #endif |
| 59 | |
| 60 | |
| 61 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI multi1CreateDevice(XGL_PHYSICAL_GPU gpu, const XGL_DEVICE_CREATE_INFO* pCreateInfo, |
| 62 | XGL_DEVICE* pDevice) |
| 63 | { |
| 64 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 65 | XGL_LAYER_DISPATCH_TABLE* pTable = getLayer1Table(gpuw); |
| 66 | |
| 67 | printf("At start of multi1 layer xglCreateDevice()\n"); |
| 68 | XGL_RESULT result = pTable->CreateDevice((XGL_PHYSICAL_GPU)gpuw->nextObject, pCreateInfo, pDevice); |
| 69 | // create a mapping for the device object into the dispatch table |
| 70 | tableMap1.emplace(*pDevice, pTable); |
| 71 | printf("Completed multi1 layer xglCreateDevice()\n"); |
| 72 | return result; |
| 73 | } |
| 74 | |
| 75 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI multi1CreateGraphicsPipeline(XGL_DEVICE device, const XGL_GRAPHICS_PIPELINE_CREATE_INFO* pCreateInfo, |
| 76 | XGL_PIPELINE* pPipeline) |
| 77 | { |
| 78 | XGL_LAYER_DISPATCH_TABLE* pTable = tableMap1[device]; |
| 79 | |
| 80 | printf("At start of multi1 layer xglCreateGraphicsPipeline()\n"); |
| 81 | XGL_RESULT result = pTable->CreateGraphicsPipeline(device, pCreateInfo, pPipeline); |
| 82 | // create a mapping for the pipeline object into the dispatch table |
| 83 | tableMap1.emplace(*pPipeline, pTable); |
| 84 | printf("Completed multi1 layer xglCreateGraphicsPipeline()\n"); |
| 85 | return result; |
| 86 | } |
| 87 | |
| 88 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI multi1StorePipeline(XGL_PIPELINE pipeline, XGL_SIZE* pDataSize, XGL_VOID* pData) |
| 89 | { |
| 90 | XGL_LAYER_DISPATCH_TABLE* pTable = tableMap1[pipeline]; |
| 91 | |
| 92 | printf("At start of multi1 layer xglStorePipeline()\n"); |
| 93 | XGL_RESULT result = pTable->StorePipeline(pipeline, pDataSize, pData); |
| 94 | printf("Completed multi1 layer xglStorePipeline()\n"); |
| 95 | return result; |
| 96 | } |
| 97 | |
| 98 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI multi1EnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, |
| 99 | XGL_CHAR* const* pOutLayers, XGL_SIZE * pOutLayerCount, |
| 100 | XGL_VOID* pReserved) |
| 101 | { |
| 102 | if (gpu == NULL) |
| 103 | return xglEnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayers, pOutLayerCount, pReserved); |
| 104 | |
| 105 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 106 | XGL_LAYER_DISPATCH_TABLE* pTable = getLayer1Table(gpuw); |
| 107 | |
| 108 | printf("At start of multi1 layer xglEnumerateLayers()\n"); |
| 109 | XGL_RESULT result = pTable->EnumerateLayers((XGL_PHYSICAL_GPU)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayers, pOutLayerCount, pReserved); |
| 110 | printf("Completed multi1 layer xglEnumerateLayers()\n"); |
| 111 | return result; |
| 112 | } |
| 113 | |
| 114 | XGL_LAYER_EXPORT XGL_VOID * XGLAPI multi1GetProcAddr(XGL_PHYSICAL_GPU gpu, const XGL_CHAR* pName) |
| 115 | { |
| 116 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 117 | if (gpu == NULL) |
| 118 | return NULL; |
| 119 | XGL_LAYER_DISPATCH_TABLE* pTable; |
| 120 | pTable = getLayer1Table(gpuw); |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 121 | if (!strncmp("xglInitAndEnumerateGpus", pName, sizeof("xglInitAndEnumerateGpus"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 122 | return (XGL_VOID *) pTable->InitAndEnumerateGpus; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 123 | else if (!strncmp("xglGetGpuInfo", pName, sizeof ("xglGetGpuInfo"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 124 | return (XGL_VOID *) pTable->GetGpuInfo; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 125 | else if (!strncmp("xglCreateDevice", pName, sizeof ("xglCreateDevice"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 126 | return (XGL_VOID *) multi1CreateDevice; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 127 | else if (!strncmp("xglDestroyDevice", pName, sizeof ("xglDestroyDevice"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 128 | return (XGL_VOID *) pTable->DestroyDevice; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 129 | else if (!strncmp("xglGetExtensionSupport", pName, sizeof ("xglGetExtensionSupport"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 130 | return (XGL_VOID *) pTable->GetExtensionSupport; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 131 | else if (!strncmp("xglEnumerateLayers", pName, sizeof ("xglEnumerateLayers"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 132 | return (XGL_VOID *) multi1EnumerateLayers; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 133 | else if (!strncmp("xglGetDeviceQueue", pName, sizeof ("xglGetDeviceQueue"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 134 | return (XGL_VOID *) pTable->GetDeviceQueue; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 135 | else if (!strncmp("xglQueueSubmit", pName, sizeof ("xglQueueSubmit"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 136 | return (XGL_VOID *) pTable->QueueSubmit; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 137 | else if (!strncmp("xglQueueSetGlobalMemReferences", pName, sizeof ("xglQueueSetGlobalMemReferences"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 138 | return (XGL_VOID *) pTable->QueueSetGlobalMemReferences; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 139 | else if (!strncmp("xglQueueWaitIdle", pName, sizeof ("xglQueueWaitIdle"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 140 | return (XGL_VOID *) pTable->QueueWaitIdle; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 141 | else if (!strncmp("xglDeviceWaitIdle", pName, sizeof ("xglDeviceWaitIdle"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 142 | return (XGL_VOID *) pTable->DeviceWaitIdle; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 143 | else if (!strncmp("xglGetMemoryHeapCount", pName, sizeof ("xglGetMemoryHeapCount"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 144 | return (XGL_VOID *) pTable->GetMemoryHeapCount; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 145 | else if (!strncmp("xglGetMemoryHeapInfo", pName, sizeof ("xglGetMemoryHeapInfo"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 146 | return (XGL_VOID *) pTable->GetMemoryHeapInfo; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 147 | else if (!strncmp("xglAllocMemory", pName, sizeof ("xglAllocMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 148 | return (XGL_VOID *) pTable->AllocMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 149 | else if (!strncmp("xglFreeMemory", pName, sizeof ("xglFreeMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 150 | return (XGL_VOID *) pTable->FreeMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 151 | else if (!strncmp("xglSetMemoryPriority", pName, sizeof ("xglSetMemoryPriority"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 152 | return (XGL_VOID *) pTable->SetMemoryPriority; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 153 | else if (!strncmp("xglMapMemory", pName, sizeof ("xglMapMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 154 | return (XGL_VOID *) pTable->MapMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 155 | else if (!strncmp("xglUnmapMemory", pName, sizeof ("xglUnmapMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 156 | return (XGL_VOID *) pTable->UnmapMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 157 | else if (!strncmp("xglPinSystemMemory", pName, sizeof ("xglPinSystemMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 158 | return (XGL_VOID *) pTable->PinSystemMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 159 | else if (!strncmp("xglRemapVirtualMemoryPages", pName, sizeof ("xglRemapVirtualMemoryPages"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 160 | return (XGL_VOID *) pTable->RemapVirtualMemoryPages; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 161 | else if (!strncmp("xglGetMultiGpuCompatibility", pName, sizeof ("xglGetMultiGpuCompatibility"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 162 | return (XGL_VOID *) pTable->GetMultiGpuCompatibility; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 163 | else if (!strncmp("xglOpenSharedMemory", pName, sizeof ("xglOpenSharedMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 164 | return (XGL_VOID *) pTable->OpenSharedMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 165 | else if (!strncmp("xglOpenSharedQueueSemaphore", pName, sizeof ("xglOpenSharedQueueSemaphore"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 166 | return (XGL_VOID *) pTable->OpenSharedQueueSemaphore; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 167 | else if (!strncmp("xglOpenPeerMemory", pName, sizeof ("xglOpenPeerMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 168 | return (XGL_VOID *) pTable->OpenPeerMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 169 | else if (!strncmp("xglOpenPeerImage", pName, sizeof ("xglOpenPeerImage"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 170 | return (XGL_VOID *) pTable->OpenPeerImage; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 171 | else if (!strncmp("xglDestroyObject", pName, sizeof ("xglDestroyObject"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 172 | return (XGL_VOID *) pTable->DestroyObject; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 173 | else if (!strncmp("xglGetObjectInfo", pName, sizeof ("xglGetObjectInfo"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 174 | return (XGL_VOID *) pTable->GetObjectInfo; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 175 | else if (!strncmp("xglBindObjectMemory", pName, sizeof ("xglBindObjectMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 176 | return (XGL_VOID *) pTable->BindObjectMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 177 | else if (!strncmp("xglCreateFence", pName, sizeof ("xgllCreateFence"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 178 | return (XGL_VOID *) pTable->CreateFence; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 179 | else if (!strncmp("xglGetFenceStatus", pName, sizeof ("xglGetFenceStatus"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 180 | return (XGL_VOID *) pTable->GetFenceStatus; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 181 | else if (!strncmp("xglWaitForFences", pName, sizeof ("xglWaitForFences"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 182 | return (XGL_VOID *) pTable->WaitForFences; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 183 | else if (!strncmp("xglCreateQueueSemaphore", pName, sizeof ("xgllCreateQueueSemaphore"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 184 | return (XGL_VOID *) pTable->CreateQueueSemaphore; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 185 | else if (!strncmp("xglSignalQueueSemaphore", pName, sizeof ("xglSignalQueueSemaphore"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 186 | return (XGL_VOID *) pTable->SignalQueueSemaphore; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 187 | else if (!strncmp("xglWaitQueueSemaphore", pName, sizeof ("xglWaitQueueSemaphore"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 188 | return (XGL_VOID *) pTable->WaitQueueSemaphore; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 189 | else if (!strncmp("xglCreateEvent", pName, sizeof ("xgllCreateEvent"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 190 | return (XGL_VOID *) pTable->CreateEvent; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 191 | else if (!strncmp("xglGetEventStatus", pName, sizeof ("xglGetEventStatus"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 192 | return (XGL_VOID *) pTable->GetEventStatus; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 193 | else if (!strncmp("xglSetEvent", pName, sizeof ("xglSetEvent"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 194 | return (XGL_VOID *) pTable->SetEvent; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 195 | else if (!strncmp("xglResetEvent", pName, sizeof ("xgllResetEvent"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 196 | return (XGL_VOID *) pTable->ResetEvent; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 197 | else if (!strncmp("xglCreateQueryPool", pName, sizeof ("xglCreateQueryPool"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 198 | return (XGL_VOID *) pTable->CreateQueryPool; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 199 | else if (!strncmp("xglGetQueryPoolResults", pName, sizeof ("xglGetQueryPoolResults"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 200 | return (XGL_VOID *) pTable->GetQueryPoolResults; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 201 | else if (!strncmp("xglGetFormatInfo", pName, sizeof ("xglGetFormatInfo"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 202 | return (XGL_VOID *) pTable->GetFormatInfo; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 203 | else if (!strncmp("xglCreateImage", pName, sizeof ("xglCreateImage"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 204 | return (XGL_VOID *) pTable->CreateImage; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 205 | else if (!strncmp("xglGetImageSubresourceInfo", pName, sizeof ("xglGetImageSubresourceInfo"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 206 | return (XGL_VOID *) pTable->GetImageSubresourceInfo; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 207 | else if (!strncmp("xglCreateImageView", pName, sizeof ("xglCreateImageView"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 208 | return (XGL_VOID *) pTable->CreateImageView; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 209 | else if (!strncmp("xglCreateColorAttachmentView", pName, sizeof ("xglCreateColorAttachmentView"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 210 | return (XGL_VOID *) pTable->CreateColorAttachmentView; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 211 | else if (!strncmp("xglCreateDepthStencilView", pName, sizeof ("xglCreateDepthStencilView"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 212 | return (XGL_VOID *) pTable->CreateDepthStencilView; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 213 | else if (!strncmp("xglCreateShader", pName, sizeof ("xglCreateShader"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 214 | return (XGL_VOID *) pTable->CreateShader; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 215 | else if (!strncmp("xglCreateGraphicsPipeline", pName, sizeof ("xglCreateGraphicsPipeline"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 216 | return (XGL_VOID *) multi1CreateGraphicsPipeline; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 217 | else if (!strncmp("xglCreateComputePipeline", pName, sizeof ("xglCreateComputePipeline"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 218 | return (XGL_VOID *) pTable->CreateComputePipeline; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 219 | else if (!strncmp("xglStorePipeline", pName, sizeof ("xglStorePipeline"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 220 | return (XGL_VOID *) multi1StorePipeline; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 221 | else if (!strncmp("xglLoadPipeline", pName, sizeof ("xglLoadPipeline"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 222 | return (XGL_VOID *) pTable->LoadPipeline; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 223 | else if (!strncmp("xglCreatePipelineDelta", pName, sizeof ("xglCreatePipelineDelta"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 224 | return (XGL_VOID *) pTable->CreatePipelineDelta; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 225 | else if (!strncmp("xglCreateSampler", pName, sizeof ("xglCreateSampler"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 226 | return (XGL_VOID *) pTable->CreateSampler; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 227 | else if (!strncmp("xglCreateDescriptorSet", pName, sizeof ("xglCreateDescriptorSet"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 228 | return (XGL_VOID *) pTable->CreateDescriptorSet; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 229 | else if (!strncmp("xglBeginDescriptorSetUpdate", pName, sizeof ("xglBeginDescriptorSetUpdate"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 230 | return (XGL_VOID *) pTable->BeginDescriptorSetUpdate; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 231 | else if (!strncmp("xglEndDescriptorSetUpdate", pName, sizeof ("xglEndDescriptorSetUpdate"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 232 | return (XGL_VOID *) pTable->EndDescriptorSetUpdate; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 233 | else if (!strncmp("xglAttachSamplerDescriptors", pName, sizeof ("xglAttachSamplerDescriptors"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 234 | return (XGL_VOID *) pTable->AttachSamplerDescriptors; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 235 | else if (!strncmp("xglAttachImageViewDescriptors", pName, sizeof ("xglAttachImageViewDescriptors"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 236 | return (XGL_VOID *) pTable->AttachImageViewDescriptors; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 237 | else if (!strncmp("xglAttachMemoryViewDescriptors", pName, sizeof ("xglAttachMemoryViewDescriptors"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 238 | return (XGL_VOID *) pTable->AttachMemoryViewDescriptors; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 239 | else if (!strncmp("xglAttachNestedDescriptors", pName, sizeof ("xglAttachNestedDescriptors"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 240 | return (XGL_VOID *) pTable->AttachNestedDescriptors; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 241 | else if (!strncmp("xglClearDescriptorSetSlots", pName, sizeof ("xglClearDescriptorSetSlots"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 242 | return (XGL_VOID *) pTable->ClearDescriptorSetSlots; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 243 | else if (!strncmp("xglCreateViewportState", pName, sizeof ("xglCreateViewportState"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 244 | return (XGL_VOID *) pTable->CreateViewportState; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 245 | else if (!strncmp("xglCreateRasterState", pName, sizeof ("xglCreateRasterState"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 246 | return (XGL_VOID *) pTable->CreateRasterState; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 247 | else if (!strncmp("xglCreateMsaaState", pName, sizeof ("xglCreateMsaaState"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 248 | return (XGL_VOID *) pTable->CreateMsaaState; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 249 | else if (!strncmp("xglCreateColorBlendState", pName, sizeof ("xglCreateColorBlendState"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 250 | return (XGL_VOID *) pTable->CreateColorBlendState; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 251 | else if (!strncmp("xglCreateDepthStencilState", pName, sizeof ("xglCreateDepthStencilState"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 252 | return (XGL_VOID *) pTable->CreateDepthStencilState; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 253 | else if (!strncmp("xglCreateCommandBuffer", pName, sizeof ("xglCreateCommandBuffer"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 254 | return (XGL_VOID *) pTable->CreateCommandBuffer; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 255 | else if (!strncmp("xglBeginCommandBuffer", pName, sizeof ("xglBeginCommandBuffer"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 256 | return (XGL_VOID *) pTable->BeginCommandBuffer; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 257 | else if (!strncmp("xglEndCommandBuffer", pName, sizeof ("xglEndCommandBuffer"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 258 | return (XGL_VOID *) pTable->EndCommandBuffer; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 259 | else if (!strncmp("xglResetCommandBuffer", pName, sizeof ("xglResetCommandBuffer"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 260 | return (XGL_VOID *) pTable->ResetCommandBuffer; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 261 | else if (!strncmp("xglCmdBindPipeline", pName, sizeof ("xglCmdBindPipeline"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 262 | return (XGL_VOID *) pTable->CmdBindPipeline; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 263 | else if (!strncmp("xglCmdBindPipelineDelta", pName, sizeof ("xglCmdBindPipelineDelta"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 264 | return (XGL_VOID *) pTable->CmdBindPipelineDelta; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 265 | else if (!strncmp("xglCmdBindStateObject", pName, sizeof ("xglCmdBindStateObject"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 266 | return (XGL_VOID *) pTable->CmdBindStateObject; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 267 | else if (!strncmp("xglCmdBindDescriptorSet", pName, sizeof ("xglCmdBindDescriptorSet"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 268 | return (XGL_VOID *) pTable->CmdBindDescriptorSet; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 269 | else if (!strncmp("xglCmdBindDynamicMemoryView", pName, sizeof ("xglCmdBindDynamicMemoryView"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 270 | return (XGL_VOID *) pTable->CmdBindDynamicMemoryView; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 271 | else if (!strncmp("xglCmdBindVertexData", pName, sizeof ("xglCmdBindVertexData"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 272 | return (XGL_VOID *) pTable->CmdBindVertexData; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 273 | else if (!strncmp("xglCmdBindIndexData", pName, sizeof ("xglCmdBindIndexData"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 274 | return (XGL_VOID *) pTable->CmdBindIndexData; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 275 | else if (!strncmp("xglCmdBindAttachments", pName, sizeof ("xglCmdBindAttachments"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 276 | return (XGL_VOID *) pTable->CmdBindAttachments; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 277 | else if (!strncmp("xglCmdPrepareMemoryRegions", pName, sizeof ("xglCmdPrepareMemoryRegions"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 278 | return (XGL_VOID *) pTable->CmdPrepareMemoryRegions; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 279 | else if (!strncmp("xglCmdPrepareImages", pName, sizeof ("xglCmdPrepareImages"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 280 | return (XGL_VOID *) pTable->CmdPrepareImages; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 281 | else if (!strncmp("xglCmdDraw", pName, sizeof ("xglCmdDraw"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 282 | return (XGL_VOID *) pTable->CmdDraw; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 283 | else if (!strncmp("xglCmdDrawIndexed", pName, sizeof ("xglCmdDrawIndexed"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 284 | return (XGL_VOID *) pTable->CmdDrawIndexed; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 285 | else if (!strncmp("xglCmdDrawIndirect", pName, sizeof ("xglCmdDrawIndirect"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 286 | return (XGL_VOID *) pTable->CmdDrawIndirect; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 287 | else if (!strncmp("xglCmdDrawIndexedIndirect", pName, sizeof ("xglCmdDrawIndexedIndirect"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 288 | return (XGL_VOID *) pTable->CmdDrawIndexedIndirect; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 289 | else if (!strncmp("xglCmdDispatch", pName, sizeof ("xglCmdDispatch"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 290 | return (XGL_VOID *) pTable->CmdDispatch; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 291 | else if (!strncmp("xglCmdDispatchIndirect", pName, sizeof ("xglCmdDispatchIndirect"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 292 | return (XGL_VOID *) pTable->CmdDispatchIndirect; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 293 | else if (!strncmp("xglCmdCopyMemory", pName, sizeof ("xglCmdCopyMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 294 | return (XGL_VOID *) pTable->CmdCopyMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 295 | else if (!strncmp("xglCmdCopyImage", pName, sizeof ("xglCmdCopyImage"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 296 | return (XGL_VOID *) pTable->CmdCopyImage; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 297 | else if (!strncmp("xglCmdCopyMemoryToImage", pName, sizeof ("xglCmdCopyMemoryToImage"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 298 | return (XGL_VOID *) pTable->CmdCopyMemoryToImage; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 299 | else if (!strncmp("xglCmdCopyImageToMemory", pName, sizeof ("xglCmdCopyImageToMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 300 | return (XGL_VOID *) pTable->CmdCopyImageToMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 301 | else if (!strncmp("xglCmdCloneImageData", pName, sizeof ("xglCmdCloneImageData"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 302 | return (XGL_VOID *) pTable->CmdCloneImageData; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 303 | else if (!strncmp("xglCmdUpdateMemory", pName, sizeof ("xglCmdUpdateMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 304 | return (XGL_VOID *) pTable->CmdUpdateMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 305 | else if (!strncmp("xglCmdFillMemory", pName, sizeof ("xglCmdFillMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 306 | return (XGL_VOID *) pTable->CmdFillMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 307 | else if (!strncmp("xglCmdClearColorImage", pName, sizeof ("xglCmdClearColorImage"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 308 | return (XGL_VOID *) pTable->CmdClearColorImage; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 309 | else if (!strncmp("xglCmdClearColorImageRaw", pName, sizeof ("xglCmdClearColorImageRaw"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 310 | return (XGL_VOID *) pTable->CmdClearColorImageRaw; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 311 | else if (!strncmp("xglCmdClearDepthStencil", pName, sizeof ("xglCmdClearDepthStencil"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 312 | return (XGL_VOID *) pTable->CmdClearDepthStencil; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 313 | else if (!strncmp("xglCmdResolveImage", pName, sizeof ("xglCmdResolveImage"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 314 | return (XGL_VOID *) pTable->CmdResolveImage; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 315 | else if (!strncmp("xglCmdSetEvent", pName, sizeof ("xglCmdSetEvent"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 316 | return (XGL_VOID *) pTable->CmdSetEvent; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 317 | else if (!strncmp("xglCmdResetEvent", pName, sizeof ("xglCmdResetEvent"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 318 | return (XGL_VOID *) pTable->CmdResetEvent; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 319 | else if (!strncmp("xglCmdMemoryAtomic", pName, sizeof ("xglCmdMemoryAtomic"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 320 | return (XGL_VOID *) pTable->CmdMemoryAtomic; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 321 | else if (!strncmp("xglCmdBeginQuery", pName, sizeof ("xglCmdBeginQuery"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 322 | return (XGL_VOID *) pTable->CmdBeginQuery; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 323 | else if (!strncmp("xglCmdEndQuery", pName, sizeof ("xglCmdEndQuery"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 324 | return (XGL_VOID *) pTable->CmdEndQuery; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 325 | else if (!strncmp("xglCmdResetQueryPool", pName, sizeof ("xglCmdResetQueryPool"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 326 | return (XGL_VOID *) pTable->CmdResetQueryPool; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 327 | else if (!strncmp("xglCmdWriteTimestamp", pName, sizeof ("xglCmdWriteTimestamp"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 328 | return (XGL_VOID *) pTable->CmdWriteTimestamp; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 329 | else if (!strncmp("xglCmdInitAtomicCounters", pName, sizeof ("xglCmdInitAtomicCounters"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 330 | return (XGL_VOID *) pTable->CmdInitAtomicCounters; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 331 | else if (!strncmp("xglCmdLoadAtomicCounters", pName, sizeof ("xglCmdLoadAtomicCounters"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 332 | return (XGL_VOID *) pTable->CmdLoadAtomicCounters; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 333 | else if (!strncmp("xglCmdSaveAtomicCounters", pName, sizeof ("xglCmdSaveAtomicCounters"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 334 | return (XGL_VOID *) pTable->CmdSaveAtomicCounters; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 335 | else if (!strncmp("xglDbgSetValidationLevel", pName, sizeof ("xglDbgSetValidationLevel"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 336 | return (XGL_VOID *) pTable->DbgSetValidationLevel; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 337 | else if (!strncmp("xglDbgRegisterMsgCallback", pName, sizeof ("xglDbgRegisterMsgCallback"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 338 | return (XGL_VOID *) pTable->DbgRegisterMsgCallback; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 339 | else if (!strncmp("xglDbgUnregisterMsgCallback", pName, sizeof ("xglDbgUnregisterMsgCallback"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 340 | return (XGL_VOID *) pTable->DbgUnregisterMsgCallback; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 341 | else if (!strncmp("xglDbgSetMessageFilter", pName, sizeof ("xglDbgSetMessageFilter"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 342 | return (XGL_VOID *) pTable->DbgSetMessageFilter; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 343 | else if (!strncmp("xglDbgSetObjectTag", pName, sizeof ("xglDbgSetObjectTag"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 344 | return (XGL_VOID *) pTable->DbgSetObjectTag; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 345 | else if (!strncmp("xglDbgSetGlobalOption", pName, sizeof ("xglDbgSetGlobalOption"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 346 | return (XGL_VOID *) pTable->DbgSetGlobalOption; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 347 | else if (!strncmp("xglDbgSetDeviceOption", pName, sizeof ("xglDbgSetDeviceOption"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 348 | return (XGL_VOID *) pTable->DbgSetDeviceOption; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 349 | else if (!strncmp("xglCmdDbgMarkerBegin", pName, sizeof ("xglCmdDbgMarkerBegin"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 350 | return (XGL_VOID *) pTable->CmdDbgMarkerBegin; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 351 | else if (!strncmp("xglCmdDbgMarkerEnd", pName, sizeof ("xglCmdDbgMarkerEnd"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 352 | return (XGL_VOID *) pTable->CmdDbgMarkerEnd; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 353 | else if (!strncmp("xglWsiX11AssociateConnection", pName, sizeof("xglWsiX11AssociateConnection"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 354 | return (XGL_VOID *) pTable->WsiX11AssociateConnection; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 355 | else if (!strncmp("xglWsiX11GetMSC", pName, sizeof("xglWsiX11GetMSC"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 356 | return (XGL_VOID *) pTable->WsiX11GetMSC; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 357 | else if (!strncmp("xglWsiX11CreatePresentableImage", pName, sizeof("xglWsiX11CreatePresentableImage"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 358 | return (XGL_VOID *) pTable->WsiX11CreatePresentableImage; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 359 | else if (!strncmp("xglWsiX11QueuePresent", pName, sizeof("xglWsiX11QueuePresent"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 360 | return (XGL_VOID *) pTable->WsiX11QueuePresent; |
| 361 | else { |
| 362 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 363 | if (gpuw->pGPA == NULL) |
| 364 | return NULL; |
| 365 | return gpuw->pGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, pName); |
| 366 | } |
| 367 | |
| 368 | } |
| 369 | |
| 370 | /******************************** Layer multi2 functions **************************/ |
| 371 | static std::unordered_map<XGL_VOID *, XGL_LAYER_DISPATCH_TABLE *> tableMap2; |
| 372 | static bool layer2_first_activated = false; |
| 373 | |
| 374 | static XGL_LAYER_DISPATCH_TABLE * getLayer2Table(const XGL_BASE_LAYER_OBJECT *gpuw) |
| 375 | { |
| 376 | XGL_LAYER_DISPATCH_TABLE *pTable; |
| 377 | |
| 378 | assert(gpuw); |
| 379 | std::unordered_map<XGL_VOID *, XGL_LAYER_DISPATCH_TABLE *>::const_iterator it = tableMap2.find((XGL_VOID *) gpuw); |
| 380 | if (it == tableMap2.end()) |
| 381 | { |
| 382 | pTable = new XGL_LAYER_DISPATCH_TABLE; |
| 383 | tableMap2[(XGL_VOID *) gpuw] = pTable; |
| 384 | initLayerTable(gpuw, pTable, 2); |
| 385 | return pTable; |
| 386 | } else |
| 387 | { |
| 388 | return it->second; |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI multi2CreateDevice(XGL_PHYSICAL_GPU gpu, const XGL_DEVICE_CREATE_INFO* pCreateInfo, |
| 393 | XGL_DEVICE* pDevice) |
| 394 | { |
| 395 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 396 | XGL_LAYER_DISPATCH_TABLE* pTable = getLayer2Table(gpuw); |
| 397 | |
| 398 | printf("At start of multi2 xglCreateDevice()\n"); |
| 399 | XGL_RESULT result = pTable->CreateDevice((XGL_PHYSICAL_GPU)gpuw->nextObject, pCreateInfo, pDevice); |
| 400 | // create a mapping for the device object into the dispatch table for layer2 |
| 401 | tableMap2.emplace(*pDevice, pTable); |
| 402 | printf("Completed multi2 layer xglCreateDevice()\n"); |
| 403 | return result; |
| 404 | } |
| 405 | |
| 406 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI multi2CreateCommandBuffer(XGL_DEVICE device, const XGL_CMD_BUFFER_CREATE_INFO* pCreateInfo, |
| 407 | XGL_CMD_BUFFER* pCmdBuffer) |
| 408 | { |
| 409 | XGL_LAYER_DISPATCH_TABLE* pTable = tableMap2[device]; |
| 410 | |
| 411 | printf("At start of multi2 layer xglCreateCommandBuffer()\n"); |
| 412 | XGL_RESULT result = pTable->CreateCommandBuffer(device, pCreateInfo, pCmdBuffer); |
| 413 | // create a mapping for CmdBuffer object into the dispatch table for layer 2 |
| 414 | tableMap2.emplace(*pCmdBuffer, pTable); |
| 415 | printf("Completed multi2 layer xglCreateCommandBuffer()\n"); |
| 416 | return result; |
| 417 | } |
| 418 | |
| 419 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI multi2BeginCommandBuffer( XGL_CMD_BUFFER cmdBuffer, XGL_FLAGS flags) |
| 420 | { |
| 421 | XGL_LAYER_DISPATCH_TABLE* pTable = tableMap2[cmdBuffer]; |
| 422 | |
| 423 | printf("At start of multi2 layer xglBeginCommandBuffer()\n"); |
| 424 | XGL_RESULT result = pTable->BeginCommandBuffer(cmdBuffer, flags); |
| 425 | printf("Completed multi2 layer xglBeginCommandBuffer()\n"); |
| 426 | return result; |
| 427 | |
| 428 | } |
| 429 | |
| 430 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI multi2EnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, |
| 431 | XGL_CHAR* const* pOutLayers, XGL_SIZE * pOutLayerCount, |
| 432 | XGL_VOID* pReserved) |
| 433 | { |
| 434 | if (gpu == NULL) |
| 435 | return xglEnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayers, pOutLayerCount, pReserved); |
| 436 | |
| 437 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 438 | XGL_LAYER_DISPATCH_TABLE* pTable = getLayer2Table(gpuw); |
| 439 | |
| 440 | printf("At start of multi2 layer xglEnumerateLayers()\n"); |
| 441 | XGL_RESULT result = pTable->EnumerateLayers((XGL_PHYSICAL_GPU)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayers, pOutLayerCount, pReserved); |
| 442 | printf("Completed multi2 layer xglEnumerateLayers()\n"); |
| 443 | return result; |
| 444 | } |
| 445 | |
| 446 | XGL_LAYER_EXPORT XGL_VOID * XGLAPI multi2GetProcAddr(XGL_PHYSICAL_GPU gpu, const XGL_CHAR* pName) |
| 447 | { |
| 448 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 449 | if (gpu == NULL) |
| 450 | return NULL; |
| 451 | XGL_LAYER_DISPATCH_TABLE* pTable; |
| 452 | pTable = getLayer2Table(gpuw); |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 453 | if (!strncmp("xglInitAndEnumerateGpus", pName, sizeof("xglInitAndEnumerateGpus"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 454 | return (XGL_VOID *) pTable->InitAndEnumerateGpus; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 455 | else if (!strncmp("xglGetGpuInfo", pName, sizeof ("xglGetGpuInfo"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 456 | return (XGL_VOID *) pTable->GetGpuInfo; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 457 | else if (!strncmp("xglCreateDevice", pName, sizeof ("xglCreateDevice"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 458 | return (XGL_VOID *) multi2CreateDevice; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 459 | else if (!strncmp("xglDestroyDevice", pName, sizeof ("xglDestroyDevice"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 460 | return (XGL_VOID *) pTable->DestroyDevice; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 461 | else if (!strncmp("xglGetExtensionSupport", pName, sizeof ("xglGetExtensionSupport"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 462 | return (XGL_VOID *) pTable->GetExtensionSupport; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 463 | else if (!strncmp("xglEnumerateLayers", pName, sizeof ("xglEnumerateLayers"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 464 | return (XGL_VOID *) multi2EnumerateLayers; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 465 | else if (!strncmp("xglGetDeviceQueue", pName, sizeof ("xglGetDeviceQueue"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 466 | return (XGL_VOID *) pTable->GetDeviceQueue; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 467 | else if (!strncmp("xglQueueSubmit", pName, sizeof ("xglQueueSubmit"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 468 | return (XGL_VOID *) pTable->QueueSubmit; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 469 | else if (!strncmp("xglQueueSetGlobalMemReferences", pName, sizeof ("xglQueueSetGlobalMemReferences"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 470 | return (XGL_VOID *) pTable->QueueSetGlobalMemReferences; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 471 | else if (!strncmp("xglQueueWaitIdle", pName, sizeof ("xglQueueWaitIdle"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 472 | return (XGL_VOID *) pTable->QueueWaitIdle; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 473 | else if (!strncmp("xglDeviceWaitIdle", pName, sizeof ("xglDeviceWaitIdle"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 474 | return (XGL_VOID *) pTable->DeviceWaitIdle; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 475 | else if (!strncmp("xglGetMemoryHeapCount", pName, sizeof ("xglGetMemoryHeapCount"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 476 | return (XGL_VOID *) pTable->GetMemoryHeapCount; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 477 | else if (!strncmp("xglGetMemoryHeapInfo", pName, sizeof ("xglGetMemoryHeapInfo"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 478 | return (XGL_VOID *) pTable->GetMemoryHeapInfo; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 479 | else if (!strncmp("xglAllocMemory", pName, sizeof ("xglAllocMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 480 | return (XGL_VOID *) pTable->AllocMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 481 | else if (!strncmp("xglFreeMemory", pName, sizeof ("xglFreeMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 482 | return (XGL_VOID *) pTable->FreeMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 483 | else if (!strncmp("xglSetMemoryPriority", pName, sizeof ("xglSetMemoryPriority"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 484 | return (XGL_VOID *) pTable->SetMemoryPriority; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 485 | else if (!strncmp("xglMapMemory", pName, sizeof ("xglMapMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 486 | return (XGL_VOID *) pTable->MapMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 487 | else if (!strncmp("xglUnmapMemory", pName, sizeof ("xglUnmapMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 488 | return (XGL_VOID *) pTable->UnmapMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 489 | else if (!strncmp("xglPinSystemMemory", pName, sizeof ("xglPinSystemMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 490 | return (XGL_VOID *) pTable->PinSystemMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 491 | else if (!strncmp("xglRemapVirtualMemoryPages", pName, sizeof ("xglRemapVirtualMemoryPages"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 492 | return (XGL_VOID *) pTable->RemapVirtualMemoryPages; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 493 | else if (!strncmp("xglGetMultiGpuCompatibility", pName, sizeof ("xglGetMultiGpuCompatibility"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 494 | return (XGL_VOID *) pTable->GetMultiGpuCompatibility; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 495 | else if (!strncmp("xglOpenSharedMemory", pName, sizeof ("xglOpenSharedMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 496 | return (XGL_VOID *) pTable->OpenSharedMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 497 | else if (!strncmp("xglOpenSharedQueueSemaphore", pName, sizeof ("xglOpenSharedQueueSemaphore"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 498 | return (XGL_VOID *) pTable->OpenSharedQueueSemaphore; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 499 | else if (!strncmp("xglOpenPeerMemory", pName, sizeof ("xglOpenPeerMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 500 | return (XGL_VOID *) pTable->OpenPeerMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 501 | else if (!strncmp("xglOpenPeerImage", pName, sizeof ("xglOpenPeerImage"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 502 | return (XGL_VOID *) pTable->OpenPeerImage; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 503 | else if (!strncmp("xglDestroyObject", pName, sizeof ("xglDestroyObject"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 504 | return (XGL_VOID *) pTable->DestroyObject; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 505 | else if (!strncmp("xglGetObjectInfo", pName, sizeof ("xglGetObjectInfo"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 506 | return (XGL_VOID *) pTable->GetObjectInfo; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 507 | else if (!strncmp("xglBindObjectMemory", pName, sizeof ("xglBindObjectMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 508 | return (XGL_VOID *) pTable->BindObjectMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 509 | else if (!strncmp("xglCreateFence", pName, sizeof ("xgllCreateFence"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 510 | return (XGL_VOID *) pTable->CreateFence; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 511 | else if (!strncmp("xglGetFenceStatus", pName, sizeof ("xglGetFenceStatus"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 512 | return (XGL_VOID *) pTable->GetFenceStatus; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 513 | else if (!strncmp("xglWaitForFences", pName, sizeof ("xglWaitForFences"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 514 | return (XGL_VOID *) pTable->WaitForFences; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 515 | else if (!strncmp("xglCreateQueueSemaphore", pName, sizeof ("xgllCreateQueueSemaphore"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 516 | return (XGL_VOID *) pTable->CreateQueueSemaphore; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 517 | else if (!strncmp("xglSignalQueueSemaphore", pName, sizeof ("xglSignalQueueSemaphore"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 518 | return (XGL_VOID *) pTable->SignalQueueSemaphore; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 519 | else if (!strncmp("xglWaitQueueSemaphore", pName, sizeof ("xglWaitQueueSemaphore"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 520 | return (XGL_VOID *) pTable->WaitQueueSemaphore; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 521 | else if (!strncmp("xglCreateEvent", pName, sizeof ("xgllCreateEvent"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 522 | return (XGL_VOID *) pTable->CreateEvent; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 523 | else if (!strncmp("xglGetEventStatus", pName, sizeof ("xglGetEventStatus"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 524 | return (XGL_VOID *) pTable->GetEventStatus; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 525 | else if (!strncmp("xglSetEvent", pName, sizeof ("xglSetEvent"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 526 | return (XGL_VOID *) pTable->SetEvent; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 527 | else if (!strncmp("xglResetEvent", pName, sizeof ("xgllResetEvent"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 528 | return (XGL_VOID *) pTable->ResetEvent; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 529 | else if (!strncmp("xglCreateQueryPool", pName, sizeof ("xglCreateQueryPool"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 530 | return (XGL_VOID *) pTable->CreateQueryPool; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 531 | else if (!strncmp("xglGetQueryPoolResults", pName, sizeof ("xglGetQueryPoolResults"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 532 | return (XGL_VOID *) pTable->GetQueryPoolResults; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 533 | else if (!strncmp("xglGetFormatInfo", pName, sizeof ("xglGetFormatInfo"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 534 | return (XGL_VOID *) pTable->GetFormatInfo; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 535 | else if (!strncmp("xglCreateImage", pName, sizeof ("xglCreateImage"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 536 | return (XGL_VOID *) pTable->CreateImage; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 537 | else if (!strncmp("xglGetImageSubresourceInfo", pName, sizeof ("xglGetImageSubresourceInfo"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 538 | return (XGL_VOID *) pTable->GetImageSubresourceInfo; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 539 | else if (!strncmp("xglCreateImageView", pName, sizeof ("xglCreateImageView"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 540 | return (XGL_VOID *) pTable->CreateImageView; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 541 | else if (!strncmp("xglCreateColorAttachmentView", pName, sizeof ("xglCreateColorAttachmentView"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 542 | return (XGL_VOID *) pTable->CreateColorAttachmentView; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 543 | else if (!strncmp("xglCreateDepthStencilView", pName, sizeof ("xglCreateDepthStencilView"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 544 | return (XGL_VOID *) pTable->CreateDepthStencilView; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 545 | else if (!strncmp("xglCreateShader", pName, sizeof ("xglCreateShader"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 546 | return (XGL_VOID *) pTable->CreateShader; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 547 | else if (!strncmp("xglCreateGraphicsPipeline", pName, sizeof ("xglCreateGraphicsPipeline"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 548 | return (XGL_VOID *) pTable->CreateGraphicsPipeline; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 549 | else if (!strncmp("xglCreateComputePipeline", pName, sizeof ("xglCreateComputePipeline"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 550 | return (XGL_VOID *) pTable->CreateComputePipeline; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 551 | else if (!strncmp("xglStorePipeline", pName, sizeof ("xglStorePipeline"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 552 | return (XGL_VOID *) pTable->StorePipeline; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 553 | else if (!strncmp("xglLoadPipeline", pName, sizeof ("xglLoadPipeline"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 554 | return (XGL_VOID *) pTable->LoadPipeline; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 555 | else if (!strncmp("xglCreatePipelineDelta", pName, sizeof ("xglCreatePipelineDelta"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 556 | return (XGL_VOID *) pTable->CreatePipelineDelta; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 557 | else if (!strncmp("xglCreateSampler", pName, sizeof ("xglCreateSampler"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 558 | return (XGL_VOID *) pTable->CreateSampler; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 559 | else if (!strncmp("xglCreateDescriptorSet", pName, sizeof ("xglCreateDescriptorSet"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 560 | return (XGL_VOID *) pTable->CreateDescriptorSet; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 561 | else if (!strncmp("xglBeginDescriptorSetUpdate", pName, sizeof ("xglBeginDescriptorSetUpdate"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 562 | return (XGL_VOID *) pTable->BeginDescriptorSetUpdate; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 563 | else if (!strncmp("xglEndDescriptorSetUpdate", pName, sizeof ("xglEndDescriptorSetUpdate"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 564 | return (XGL_VOID *) pTable->EndDescriptorSetUpdate; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 565 | else if (!strncmp("xglAttachSamplerDescriptors", pName, sizeof ("xglAttachSamplerDescriptors"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 566 | return (XGL_VOID *) pTable->AttachSamplerDescriptors; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 567 | else if (!strncmp("xglAttachImageViewDescriptors", pName, sizeof ("xglAttachImageViewDescriptors"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 568 | return (XGL_VOID *) pTable->AttachImageViewDescriptors; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 569 | else if (!strncmp("xglAttachMemoryViewDescriptors", pName, sizeof ("xglAttachMemoryViewDescriptors"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 570 | return (XGL_VOID *) pTable->AttachMemoryViewDescriptors; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 571 | else if (!strncmp("xglAttachNestedDescriptors", pName, sizeof ("xglAttachNestedDescriptors"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 572 | return (XGL_VOID *) pTable->AttachNestedDescriptors; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 573 | else if (!strncmp("xglClearDescriptorSetSlots", pName, sizeof ("xglClearDescriptorSetSlots"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 574 | return (XGL_VOID *) pTable->ClearDescriptorSetSlots; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 575 | else if (!strncmp("xglCreateViewportState", pName, sizeof ("xglCreateViewportState"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 576 | return (XGL_VOID *) pTable->CreateViewportState; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 577 | else if (!strncmp("xglCreateRasterState", pName, sizeof ("xglCreateRasterState"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 578 | return (XGL_VOID *) pTable->CreateRasterState; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 579 | else if (!strncmp("xglCreateMsaaState", pName, sizeof ("xglCreateMsaaState"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 580 | return (XGL_VOID *) pTable->CreateMsaaState; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 581 | else if (!strncmp("xglCreateColorBlendState", pName, sizeof ("xglCreateColorBlendState"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 582 | return (XGL_VOID *) pTable->CreateColorBlendState; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 583 | else if (!strncmp("xglCreateDepthStencilState", pName, sizeof ("xglCreateDepthStencilState"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 584 | return (XGL_VOID *) pTable->CreateDepthStencilState; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 585 | else if (!strncmp("xglCreateCommandBuffer", pName, sizeof ("xglCreateCommandBuffer"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 586 | return (XGL_VOID *) multi2CreateCommandBuffer; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 587 | else if (!strncmp("xglBeginCommandBuffer", pName, sizeof ("xglBeginCommandBuffer"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 588 | return (XGL_VOID *) multi2BeginCommandBuffer; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 589 | else if (!strncmp("xglEndCommandBuffer", pName, sizeof ("xglEndCommandBuffer"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 590 | return (XGL_VOID *) pTable->EndCommandBuffer; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 591 | else if (!strncmp("xglResetCommandBuffer", pName, sizeof ("xglResetCommandBuffer"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 592 | return (XGL_VOID *) pTable->ResetCommandBuffer; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 593 | else if (!strncmp("xglCmdBindPipeline", pName, sizeof ("xglCmdBindPipeline"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 594 | return (XGL_VOID *) pTable->CmdBindPipeline; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 595 | else if (!strncmp("xglCmdBindPipelineDelta", pName, sizeof ("xglCmdBindPipelineDelta"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 596 | return (XGL_VOID *) pTable->CmdBindPipelineDelta; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 597 | else if (!strncmp("xglCmdBindStateObject", pName, sizeof ("xglCmdBindStateObject"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 598 | return (XGL_VOID *) pTable->CmdBindStateObject; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 599 | else if (!strncmp("xglCmdBindDescriptorSet", pName, sizeof ("xglCmdBindDescriptorSet"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 600 | return (XGL_VOID *) pTable->CmdBindDescriptorSet; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 601 | else if (!strncmp("xglCmdBindDynamicMemoryView", pName, sizeof ("xglCmdBindDynamicMemoryView"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 602 | return (XGL_VOID *) pTable->CmdBindDynamicMemoryView; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 603 | else if (!strncmp("xglCmdBindVertexData", pName, sizeof ("xglCmdBindVertexData"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 604 | return (XGL_VOID *) pTable->CmdBindVertexData; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 605 | else if (!strncmp("xglCmdBindIndexData", pName, sizeof ("xglCmdBindIndexData"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 606 | return (XGL_VOID *) pTable->CmdBindIndexData; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 607 | else if (!strncmp("xglCmdBindAttachments", pName, sizeof ("xglCmdBindAttachments"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 608 | return (XGL_VOID *) pTable->CmdBindAttachments; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 609 | else if (!strncmp("xglCmdPrepareMemoryRegions", pName, sizeof ("xglCmdPrepareMemoryRegions"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 610 | return (XGL_VOID *) pTable->CmdPrepareMemoryRegions; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 611 | else if (!strncmp("xglCmdPrepareImages", pName, sizeof ("xglCmdPrepareImages"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 612 | return (XGL_VOID *) pTable->CmdPrepareImages; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 613 | else if (!strncmp("xglCmdDraw", pName, sizeof ("xglCmdDraw"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 614 | return (XGL_VOID *) pTable->CmdDraw; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 615 | else if (!strncmp("xglCmdDrawIndexed", pName, sizeof ("xglCmdDrawIndexed"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 616 | return (XGL_VOID *) pTable->CmdDrawIndexed; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 617 | else if (!strncmp("xglCmdDrawIndirect", pName, sizeof ("xglCmdDrawIndirect"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 618 | return (XGL_VOID *) pTable->CmdDrawIndirect; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 619 | else if (!strncmp("xglCmdDrawIndexedIndirect", pName, sizeof ("xglCmdDrawIndexedIndirect"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 620 | return (XGL_VOID *) pTable->CmdDrawIndexedIndirect; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 621 | else if (!strncmp("xglCmdDispatch", pName, sizeof ("xglCmdDispatch"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 622 | return (XGL_VOID *) pTable->CmdDispatch; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 623 | else if (!strncmp("xglCmdDispatchIndirect", pName, sizeof ("xglCmdDispatchIndirect"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 624 | return (XGL_VOID *) pTable->CmdDispatchIndirect; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 625 | else if (!strncmp("xglCmdCopyMemory", pName, sizeof ("xglCmdCopyMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 626 | return (XGL_VOID *) pTable->CmdCopyMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 627 | else if (!strncmp("xglCmdCopyImage", pName, sizeof ("xglCmdCopyImage"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 628 | return (XGL_VOID *) pTable->CmdCopyImage; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 629 | else if (!strncmp("xglCmdCopyMemoryToImage", pName, sizeof ("xglCmdCopyMemoryToImage"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 630 | return (XGL_VOID *) pTable->CmdCopyMemoryToImage; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 631 | else if (!strncmp("xglCmdCopyImageToMemory", pName, sizeof ("xglCmdCopyImageToMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 632 | return (XGL_VOID *) pTable->CmdCopyImageToMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 633 | else if (!strncmp("xglCmdCloneImageData", pName, sizeof ("xglCmdCloneImageData"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 634 | return (XGL_VOID *) pTable->CmdCloneImageData; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 635 | else if (!strncmp("xglCmdUpdateMemory", pName, sizeof ("xglCmdUpdateMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 636 | return (XGL_VOID *) pTable->CmdUpdateMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 637 | else if (!strncmp("xglCmdFillMemory", pName, sizeof ("xglCmdFillMemory"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 638 | return (XGL_VOID *) pTable->CmdFillMemory; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 639 | else if (!strncmp("xglCmdClearColorImage", pName, sizeof ("xglCmdClearColorImage"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 640 | return (XGL_VOID *) pTable->CmdClearColorImage; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 641 | else if (!strncmp("xglCmdClearColorImageRaw", pName, sizeof ("xglCmdClearColorImageRaw"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 642 | return (XGL_VOID *) pTable->CmdClearColorImageRaw; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 643 | else if (!strncmp("xglCmdClearDepthStencil", pName, sizeof ("xglCmdClearDepthStencil"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 644 | return (XGL_VOID *) pTable->CmdClearDepthStencil; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 645 | else if (!strncmp("xglCmdResolveImage", pName, sizeof ("xglCmdResolveImage"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 646 | return (XGL_VOID *) pTable->CmdResolveImage; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 647 | else if (!strncmp("xglCmdSetEvent", pName, sizeof ("xglCmdSetEvent"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 648 | return (XGL_VOID *) pTable->CmdSetEvent; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 649 | else if (!strncmp("xglCmdResetEvent", pName, sizeof ("xglCmdResetEvent"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 650 | return (XGL_VOID *) pTable->CmdResetEvent; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 651 | else if (!strncmp("xglCmdMemoryAtomic", pName, sizeof ("xglCmdMemoryAtomic"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 652 | return (XGL_VOID *) pTable->CmdMemoryAtomic; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 653 | else if (!strncmp("xglCmdBeginQuery", pName, sizeof ("xglCmdBeginQuery"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 654 | return (XGL_VOID *) pTable->CmdBeginQuery; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 655 | else if (!strncmp("xglCmdEndQuery", pName, sizeof ("xglCmdEndQuery"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 656 | return (XGL_VOID *) pTable->CmdEndQuery; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 657 | else if (!strncmp("xglCmdResetQueryPool", pName, sizeof ("xglCmdResetQueryPool"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 658 | return (XGL_VOID *) pTable->CmdResetQueryPool; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 659 | else if (!strncmp("xglCmdWriteTimestamp", pName, sizeof ("xglCmdWriteTimestamp"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 660 | return (XGL_VOID *) pTable->CmdWriteTimestamp; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 661 | else if (!strncmp("xglCmdInitAtomicCounters", pName, sizeof ("xglCmdInitAtomicCounters"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 662 | return (XGL_VOID *) pTable->CmdInitAtomicCounters; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 663 | else if (!strncmp("xglCmdLoadAtomicCounters", pName, sizeof ("xglCmdLoadAtomicCounters"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 664 | return (XGL_VOID *) pTable->CmdLoadAtomicCounters; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 665 | else if (!strncmp("xglCmdSaveAtomicCounters", pName, sizeof ("xglCmdSaveAtomicCounters"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 666 | return (XGL_VOID *) pTable->CmdSaveAtomicCounters; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 667 | else if (!strncmp("xglDbgSetValidationLevel", pName, sizeof ("xglDbgSetValidationLevel"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 668 | return (XGL_VOID *) pTable->DbgSetValidationLevel; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 669 | else if (!strncmp("xglDbgRegisterMsgCallback", pName, sizeof ("xglDbgRegisterMsgCallback"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 670 | return (XGL_VOID *) pTable->DbgRegisterMsgCallback; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 671 | else if (!strncmp("xglDbgUnregisterMsgCallback", pName, sizeof ("xglDbgUnregisterMsgCallback"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 672 | return (XGL_VOID *) pTable->DbgUnregisterMsgCallback; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 673 | else if (!strncmp("xglDbgSetMessageFilter", pName, sizeof ("xglDbgSetMessageFilter"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 674 | return (XGL_VOID *) pTable->DbgSetMessageFilter; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 675 | else if (!strncmp("xglDbgSetObjectTag", pName, sizeof ("xglDbgSetObjectTag"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 676 | return (XGL_VOID *) pTable->DbgSetObjectTag; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 677 | else if (!strncmp("xglDbgSetGlobalOption", pName, sizeof ("xglDbgSetGlobalOption"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 678 | return (XGL_VOID *) pTable->DbgSetGlobalOption; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 679 | else if (!strncmp("xglDbgSetDeviceOption", pName, sizeof ("xglDbgSetDeviceOption"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 680 | return (XGL_VOID *) pTable->DbgSetDeviceOption; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 681 | else if (!strncmp("xglCmdDbgMarkerBegin", pName, sizeof ("xglCmdDbgMarkerBegin"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 682 | return (XGL_VOID *) pTable->CmdDbgMarkerBegin; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 683 | else if (!strncmp("xglCmdDbgMarkerEnd", pName, sizeof ("xglCmdDbgMarkerEnd"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 684 | return (XGL_VOID *) pTable->CmdDbgMarkerEnd; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 685 | else if (!strncmp("xglWsiX11AssociateConnection", pName, sizeof("xglWsiX11AssociateConnection"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 686 | return (XGL_VOID *) pTable->WsiX11AssociateConnection; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 687 | else if (!strncmp("xglWsiX11GetMSC", pName, sizeof("xglWsiX11GetMSC"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 688 | return (XGL_VOID *) pTable->WsiX11GetMSC; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 689 | else if (!strncmp("xglWsiX11CreatePresentableImage", pName, sizeof("xglWsiX11CreatePresentableImage"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 690 | return (XGL_VOID *) pTable->WsiX11CreatePresentableImage; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 691 | else if (!strncmp("xglWsiX11QueuePresent", pName, sizeof("xglWsiX11QueuePresent"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 692 | return (XGL_VOID *) pTable->WsiX11QueuePresent; |
| 693 | else { |
| 694 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 695 | if (gpuw->pGPA == NULL) |
| 696 | return NULL; |
| 697 | return gpuw->pGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, pName); |
| 698 | } |
| 699 | |
| 700 | } |
| 701 | |
| 702 | /********************************* Common functions ********************************/ |
| 703 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, |
| 704 | XGL_CHAR* const* pOutLayers, XGL_SIZE * pOutLayerCount, |
| 705 | XGL_VOID* pReserved) |
| 706 | { |
| 707 | if (pOutLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL || pOutLayers[1] == NULL || pReserved == NULL) |
| 708 | return XGL_ERROR_INVALID_POINTER; |
| 709 | |
| 710 | if (maxLayerCount < 2) |
| 711 | return XGL_ERROR_INITIALIZATION_FAILED; |
| 712 | *pOutLayerCount = 2; |
| 713 | strncpy((char *) pOutLayers[0], "multi1", maxStringSize); |
| 714 | strncpy((char *) pOutLayers[1], "multi2", maxStringSize); |
| 715 | return XGL_SUCCESS; |
| 716 | } |
| 717 | |
| 718 | XGL_LAYER_EXPORT XGL_VOID * XGLAPI xglGetProcAddr(XGL_PHYSICAL_GPU gpu, const XGL_CHAR* pName) |
| 719 | { |
| 720 | // to find each layers GPA routine Loader will search via "<layerName>GetProcAddr" |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 721 | if (!strncmp("multi1GetProcAddr", pName, sizeof("multi1GetProcAddr"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 722 | return (XGL_VOID *) multi1GetProcAddr; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 723 | else if (!strncmp("multi2GetProcAddr", pName, sizeof("multi2GetProcAddr"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 724 | return (XGL_VOID *) multi2GetProcAddr; |
Chia-I Wu | f1a5a74 | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 725 | else if (!strncmp("xglGetProcAddr", pName, sizeof("xglGetProcAddr"))) |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 726 | return (XGL_VOID *) xglGetProcAddr; |
| 727 | |
| 728 | // use first layer activated as GPA dispatch table activation happens in order |
| 729 | else if (layer1_first_activated) |
| 730 | return multi1GetProcAddr(gpu, pName); |
| 731 | else if (layer2_first_activated) |
| 732 | return multi2GetProcAddr(gpu, pName); |
| 733 | else |
| 734 | return NULL; |
| 735 | |
| 736 | } |
| 737 | |
| 738 | #ifdef __cplusplus |
| 739 | } //extern "C" |
| 740 | #endif |
| 741 | |
| 742 | static void initLayerTable(const XGL_BASE_LAYER_OBJECT *gpuw, XGL_LAYER_DISPATCH_TABLE *pTable, const unsigned int layerNum) |
| 743 | { |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 744 | if (layerNum == 2 && layer1_first_activated == false) |
| 745 | layer2_first_activated = true; |
| 746 | if (layerNum == 1 && layer2_first_activated == false) |
| 747 | layer1_first_activated = true; |
| 748 | |
Chia-I Wu | aa4121f | 2015-01-04 23:11:43 +0800 | [diff] [blame^] | 749 | layer_initialize_dispatch_table(pTable, gpuw->pGPA, (XGL_PHYSICAL_GPU) gpuw->nextObject); |
Jon Ashburn | 79113cc | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 750 | } |