Jon Ashburn | 8d8dad0 | 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 | */ |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 24 | #include <string.h> |
| 25 | #include <stdlib.h> |
| 26 | #include <assert.h> |
| 27 | #include <unordered_map> |
Chia-I Wu | 0f65b1e | 2015-01-04 23:11:43 +0800 | [diff] [blame^] | 28 | #include "xgl_dispatch_table_helper.h" |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 29 | #include "xglLayer.h" |
| 30 | |
| 31 | static std::unordered_map<XGL_VOID *, XGL_LAYER_DISPATCH_TABLE *> tableMap; |
| 32 | |
| 33 | static XGL_LAYER_DISPATCH_TABLE * initLayerTable(const XGL_BASE_LAYER_OBJECT *gpuw) |
| 34 | { |
| 35 | GetProcAddrType fpGPA; |
| 36 | XGL_LAYER_DISPATCH_TABLE *pTable; |
| 37 | |
| 38 | assert(gpuw); |
| 39 | std::unordered_map<XGL_VOID *, XGL_LAYER_DISPATCH_TABLE *>::const_iterator it = tableMap.find((XGL_VOID *) gpuw); |
| 40 | if (it == tableMap.end()) |
| 41 | { |
| 42 | pTable = new XGL_LAYER_DISPATCH_TABLE; |
| 43 | tableMap[(XGL_VOID *) gpuw] = pTable; |
| 44 | } else |
| 45 | { |
| 46 | return it->second; |
| 47 | } |
Chia-I Wu | 0f65b1e | 2015-01-04 23:11:43 +0800 | [diff] [blame^] | 48 | |
| 49 | layer_initialize_dispatch_table(pTable, gpuw->pGPA, (XGL_PHYSICAL_GPU) gpuw->nextObject); |
| 50 | |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 51 | return pTable; |
| 52 | } |
| 53 | |
| 54 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglLayerExtension1(XGL_DEVICE device) |
| 55 | { |
| 56 | printf("In xglLayerExtension1() call w/ device: %p\n", (void*)device); |
| 57 | printf("xglLayerExtension1 returning SUCCESS\n"); |
| 58 | return XGL_SUCCESS; |
| 59 | } |
| 60 | |
| 61 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetExtensionSupport(XGL_PHYSICAL_GPU gpu, const XGL_CHAR* pExtName) |
| 62 | { |
| 63 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 64 | XGL_RESULT result; |
| 65 | XGL_LAYER_DISPATCH_TABLE* pTable = initLayerTable(gpuw); |
| 66 | |
| 67 | printf("At start of wrapped xglGetExtensionSupport() call w/ gpu: %p\n", (void*)gpu); |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 68 | if (!strncmp(pExtName, "xglLayerExtension1", strlen("xglLayerExtension1"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 69 | result = XGL_SUCCESS; |
| 70 | else |
| 71 | result = pTable->GetExtensionSupport((XGL_PHYSICAL_GPU)gpuw->nextObject, pExtName); |
| 72 | printf("Completed wrapped xglGetExtensionSupport() call w/ gpu: %p\n", (void*)gpu); |
| 73 | return result; |
| 74 | } |
| 75 | |
| 76 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateDevice(XGL_PHYSICAL_GPU gpu, const XGL_DEVICE_CREATE_INFO* pCreateInfo, XGL_DEVICE* pDevice) |
| 77 | { |
| 78 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 79 | XGL_LAYER_DISPATCH_TABLE* pTable = initLayerTable(gpuw); |
| 80 | |
| 81 | printf("At start of wrapped xglCreateDevice() call w/ gpu: %p\n", (void*)gpu); |
| 82 | XGL_RESULT result = pTable->CreateDevice((XGL_PHYSICAL_GPU)gpuw->nextObject, pCreateInfo, pDevice); |
| 83 | // create a mapping for the device object into the dispatch table |
| 84 | tableMap.emplace(*pDevice, pTable); |
| 85 | printf("Completed wrapped xglCreateDevice() call w/ pDevice, Device %p: %p\n", (void*)pDevice, (void *) *pDevice); |
| 86 | return result; |
| 87 | } |
| 88 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetFormatInfo(XGL_DEVICE device, XGL_FORMAT format, XGL_FORMAT_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData) |
| 89 | { |
| 90 | XGL_LAYER_DISPATCH_TABLE* pTable = tableMap[device]; |
| 91 | |
| 92 | printf("At start of wrapped xglGetFormatInfo() call w/ device: %p\n", (void*)device); |
| 93 | XGL_RESULT result = pTable->GetFormatInfo(device, format, infoType, pDataSize, pData); |
| 94 | printf("Completed wrapped xglGetFormatInfo() call w/ device: %p\n", (void*)device); |
| 95 | return result; |
| 96 | } |
| 97 | |
| 98 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, XGL_CHAR* const* pOutLayers, XGL_SIZE * pOutLayerCount, XGL_VOID* pReserved) |
| 99 | { |
| 100 | if (gpu != NULL) |
| 101 | { |
| 102 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 103 | XGL_LAYER_DISPATCH_TABLE* pTable = initLayerTable(gpuw); |
| 104 | |
| 105 | printf("At start of wrapped xglEnumerateLayers() call w/ gpu: %p\n", gpu); |
| 106 | XGL_RESULT result = pTable->EnumerateLayers((XGL_PHYSICAL_GPU)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayers, pOutLayerCount, pReserved); |
| 107 | return result; |
| 108 | } else |
| 109 | { |
| 110 | if (pOutLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL || pReserved == NULL) |
| 111 | return XGL_ERROR_INVALID_POINTER; |
| 112 | |
| 113 | // Example of a layer that is only compatible with Intel's GPUs |
| 114 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT*) pReserved; |
| 115 | GetGpuInfoType fpGetGpuInfo; |
| 116 | XGL_PHYSICAL_GPU_PROPERTIES gpuProps; |
| 117 | XGL_SIZE dataSize = sizeof(XGL_PHYSICAL_GPU_PROPERTIES); |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 118 | fpGetGpuInfo = (GetGpuInfoType) gpuw->pGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, "xglGetGpuInfo"); |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 119 | fpGetGpuInfo((XGL_PHYSICAL_GPU) gpuw->nextObject, XGL_INFO_TYPE_PHYSICAL_GPU_PROPERTIES, &dataSize, &gpuProps); |
| 120 | if (gpuProps.vendorId == 0x8086) |
| 121 | { |
| 122 | *pOutLayerCount = 1; |
| 123 | strncpy((char *) pOutLayers[0], "Basic", maxStringSize); |
| 124 | } else |
| 125 | { |
| 126 | *pOutLayerCount = 0; |
| 127 | } |
| 128 | return XGL_SUCCESS; |
| 129 | } |
| 130 | } |
| 131 | |
Jon Ashburn | 8d8dad0 | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 132 | XGL_LAYER_EXPORT XGL_VOID * XGLAPI xglGetProcAddr(XGL_PHYSICAL_GPU gpu, const XGL_CHAR* pName) |
| 133 | { |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 134 | XGL_LAYER_DISPATCH_TABLE* pTable; |
Jon Ashburn | 8d8dad0 | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 135 | |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 136 | if (gpu == NULL) |
| 137 | return NULL; |
Jon Ashburn | 8d8dad0 | 2014-12-01 14:22:40 -0700 | [diff] [blame] | 138 | pTable = initLayerTable((const XGL_BASE_LAYER_OBJECT *) gpu); |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 139 | if (!strncmp("xglGetProcAddr", pName, sizeof("xglGetProcAddr"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 140 | return (XGL_VOID *) xglGetProcAddr; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 141 | else if (!strncmp("xglInitAndEnumerateGpus", pName, sizeof("xglInitAndEnumerateGpus"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 142 | return (XGL_VOID *) pTable->InitAndEnumerateGpus; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 143 | if (!strncmp("xglGetGpuInfo", pName, sizeof ("xglGetGpuInfo"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 144 | return (XGL_VOID *) pTable->GetGpuInfo; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 145 | else if (!strncmp("xglCreateDevice", pName, sizeof ("xglCreateDevice"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 146 | return (XGL_VOID *) xglCreateDevice; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 147 | else if (!strncmp("xglDestroyDevice", pName, sizeof ("xglDestroyDevice"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 148 | return (XGL_VOID *) pTable->DestroyDevice; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 149 | else if (!strncmp("xglGetExtensionSupport", pName, sizeof ("xglGetExtensionSupport"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 150 | return (XGL_VOID *) xglGetExtensionSupport; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 151 | else if (!strncmp("xglEnumerateLayers", pName, sizeof ("xglEnumerateLayers"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 152 | return (XGL_VOID *) xglEnumerateLayers; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 153 | else if (!strncmp("xglGetDeviceQueue", pName, sizeof ("xglGetDeviceQueue"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 154 | return (XGL_VOID *) pTable->GetDeviceQueue; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 155 | else if (!strncmp("xglQueueSubmit", pName, sizeof ("xglQueueSubmit"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 156 | return (XGL_VOID *) pTable->QueueSubmit; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 157 | else if (!strncmp("xglQueueSetGlobalMemReferences", pName, sizeof ("xglQueueSetGlobalMemReferences"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 158 | return (XGL_VOID *) pTable->QueueSetGlobalMemReferences; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 159 | else if (!strncmp("xglQueueWaitIdle", pName, sizeof ("xglQueueWaitIdle"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 160 | return (XGL_VOID *) pTable->QueueWaitIdle; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 161 | else if (!strncmp("xglDeviceWaitIdle", pName, sizeof ("xglDeviceWaitIdle"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 162 | return (XGL_VOID *) pTable->DeviceWaitIdle; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 163 | else if (!strncmp("xglGetMemoryHeapCount", pName, sizeof ("xglGetMemoryHeapCount"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 164 | return (XGL_VOID *) pTable->GetMemoryHeapCount; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 165 | else if (!strncmp("xglGetMemoryHeapInfo", pName, sizeof ("xglGetMemoryHeapInfo"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 166 | return (XGL_VOID *) pTable->GetMemoryHeapInfo; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 167 | else if (!strncmp("xglAllocMemory", pName, sizeof ("xglAllocMemory"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 168 | return (XGL_VOID *) pTable->AllocMemory; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 169 | else if (!strncmp("xglFreeMemory", pName, sizeof ("xglFreeMemory"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 170 | return (XGL_VOID *) pTable->FreeMemory; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 171 | else if (!strncmp("xglSetMemoryPriority", pName, sizeof ("xglSetMemoryPriority"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 172 | return (XGL_VOID *) pTable->SetMemoryPriority; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 173 | else if (!strncmp("xglMapMemory", pName, sizeof ("xglMapMemory"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 174 | return (XGL_VOID *) pTable->MapMemory; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 175 | else if (!strncmp("xglUnmapMemory", pName, sizeof ("xglUnmapMemory"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 176 | return (XGL_VOID *) pTable->UnmapMemory; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 177 | else if (!strncmp("xglPinSystemMemory", pName, sizeof ("xglPinSystemMemory"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 178 | return (XGL_VOID *) pTable->PinSystemMemory; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 179 | else if (!strncmp("xglRemapVirtualMemoryPages", pName, sizeof ("xglRemapVirtualMemoryPages"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 180 | return (XGL_VOID *) pTable->RemapVirtualMemoryPages; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 181 | else if (!strncmp("xglGetMultiGpuCompatibility", pName, sizeof ("xglGetMultiGpuCompatibility"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 182 | return (XGL_VOID *) pTable->GetMultiGpuCompatibility; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 183 | else if (!strncmp("xglOpenSharedMemory", pName, sizeof ("xglOpenSharedMemory"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 184 | return (XGL_VOID *) pTable->OpenSharedMemory; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 185 | else if (!strncmp("xglOpenSharedQueueSemaphore", pName, sizeof ("xglOpenSharedQueueSemaphore"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 186 | return (XGL_VOID *) pTable->OpenSharedQueueSemaphore; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 187 | else if (!strncmp("xglOpenPeerMemory", pName, sizeof ("xglOpenPeerMemory"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 188 | return (XGL_VOID *) pTable->OpenPeerMemory; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 189 | else if (!strncmp("xglOpenPeerImage", pName, sizeof ("xglOpenPeerImage"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 190 | return (XGL_VOID *) pTable->OpenPeerImage; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 191 | else if (!strncmp("xglDestroyObject", pName, sizeof ("xglDestroyObject"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 192 | return (XGL_VOID *) pTable->DestroyObject; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 193 | else if (!strncmp("xglGetObjectInfo", pName, sizeof ("xglGetObjectInfo"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 194 | return (XGL_VOID *) pTable->GetObjectInfo; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 195 | else if (!strncmp("xglBindObjectMemory", pName, sizeof ("xglBindObjectMemory"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 196 | return (XGL_VOID *) pTable->BindObjectMemory; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 197 | else if (!strncmp("xglCreateFence", pName, sizeof ("xgllCreateFence"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 198 | return (XGL_VOID *) pTable->CreateFence; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 199 | else if (!strncmp("xglGetFenceStatus", pName, sizeof ("xglGetFenceStatus"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 200 | return (XGL_VOID *) pTable->GetFenceStatus; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 201 | else if (!strncmp("xglWaitForFences", pName, sizeof ("xglWaitForFences"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 202 | return (XGL_VOID *) pTable->WaitForFences; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 203 | else if (!strncmp("xglCreateQueueSemaphore", pName, sizeof ("xgllCreateQueueSemaphore"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 204 | return (XGL_VOID *) pTable->CreateQueueSemaphore; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 205 | else if (!strncmp("xglSignalQueueSemaphore", pName, sizeof ("xglSignalQueueSemaphore"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 206 | return (XGL_VOID *) pTable->SignalQueueSemaphore; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 207 | else if (!strncmp("xglWaitQueueSemaphore", pName, sizeof ("xglWaitQueueSemaphore"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 208 | return (XGL_VOID *) pTable->WaitQueueSemaphore; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 209 | else if (!strncmp("xglCreateEvent", pName, sizeof ("xgllCreateEvent"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 210 | return (XGL_VOID *) pTable->CreateEvent; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 211 | else if (!strncmp("xglGetEventStatus", pName, sizeof ("xglGetEventStatus"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 212 | return (XGL_VOID *) pTable->GetEventStatus; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 213 | else if (!strncmp("xglSetEvent", pName, sizeof ("xglSetEvent"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 214 | return (XGL_VOID *) pTable->SetEvent; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 215 | else if (!strncmp("xglResetEvent", pName, sizeof ("xgllResetEvent"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 216 | return (XGL_VOID *) pTable->ResetEvent; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 217 | else if (!strncmp("xglCreateQueryPool", pName, sizeof ("xglCreateQueryPool"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 218 | return (XGL_VOID *) pTable->CreateQueryPool; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 219 | else if (!strncmp("xglGetQueryPoolResults", pName, sizeof ("xglGetQueryPoolResults"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 220 | return (XGL_VOID *) pTable->GetQueryPoolResults; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 221 | else if (!strncmp("xglGetFormatInfo", pName, sizeof ("xglGetFormatInfo"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 222 | return (XGL_VOID *) xglGetFormatInfo; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 223 | else if (!strncmp("xglCreateImage", pName, sizeof ("xglCreateImage"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 224 | return (XGL_VOID *) pTable->CreateImage; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 225 | else if (!strncmp("xglGetImageSubresourceInfo", pName, sizeof ("xglGetImageSubresourceInfo"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 226 | return (XGL_VOID *) pTable->GetImageSubresourceInfo; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 227 | else if (!strncmp("xglCreateImageView", pName, sizeof ("xglCreateImageView"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 228 | return (XGL_VOID *) pTable->CreateImageView; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 229 | else if (!strncmp("xglCreateColorAttachmentView", pName, sizeof ("xglCreateColorAttachmentView"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 230 | return (XGL_VOID *) pTable->CreateColorAttachmentView; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 231 | else if (!strncmp("xglCreateDepthStencilView", pName, sizeof ("xglCreateDepthStencilView"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 232 | return (XGL_VOID *) pTable->CreateDepthStencilView; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 233 | else if (!strncmp("xglCreateShader", pName, sizeof ("xglCreateShader"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 234 | return (XGL_VOID *) pTable->CreateShader; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 235 | else if (!strncmp("xglCreateGraphicsPipeline", pName, sizeof ("xglCreateGraphicsPipeline"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 236 | return (XGL_VOID *) pTable->CreateGraphicsPipeline; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 237 | else if (!strncmp("xglCreateComputePipeline", pName, sizeof ("xglCreateComputePipeline"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 238 | return (XGL_VOID *) pTable->CreateComputePipeline; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 239 | else if (!strncmp("xglStorePipeline", pName, sizeof ("xglStorePipeline"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 240 | return (XGL_VOID *) pTable->StorePipeline; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 241 | else if (!strncmp("xglLoadPipeline", pName, sizeof ("xglLoadPipeline"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 242 | return (XGL_VOID *) pTable->LoadPipeline; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 243 | else if (!strncmp("xglCreatePipelineDelta", pName, sizeof ("xglCreatePipelineDelta"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 244 | return (XGL_VOID *) pTable->CreatePipelineDelta; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 245 | else if (!strncmp("xglCreateSampler", pName, sizeof ("xglCreateSampler"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 246 | return (XGL_VOID *) pTable->CreateSampler; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 247 | else if (!strncmp("xglCreateDescriptorSet", pName, sizeof ("xglCreateDescriptorSet"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 248 | return (XGL_VOID *) pTable->CreateDescriptorSet; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 249 | else if (!strncmp("xglBeginDescriptorSetUpdate", pName, sizeof ("xglBeginDescriptorSetUpdate"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 250 | return (XGL_VOID *) pTable->BeginDescriptorSetUpdate; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 251 | else if (!strncmp("xglEndDescriptorSetUpdate", pName, sizeof ("xglEndDescriptorSetUpdate"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 252 | return (XGL_VOID *) pTable->EndDescriptorSetUpdate; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 253 | else if (!strncmp("xglAttachSamplerDescriptors", pName, sizeof ("xglAttachSamplerDescriptors"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 254 | return (XGL_VOID *) pTable->AttachSamplerDescriptors; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 255 | else if (!strncmp("xglAttachImageViewDescriptors", pName, sizeof ("xglAttachImageViewDescriptors"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 256 | return (XGL_VOID *) pTable->AttachImageViewDescriptors; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 257 | else if (!strncmp("xglAttachMemoryViewDescriptors", pName, sizeof ("xglAttachMemoryViewDescriptors"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 258 | return (XGL_VOID *) pTable->AttachMemoryViewDescriptors; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 259 | else if (!strncmp("xglAttachNestedDescriptors", pName, sizeof ("xglAttachNestedDescriptors"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 260 | return (XGL_VOID *) pTable->AttachNestedDescriptors; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 261 | else if (!strncmp("xglClearDescriptorSetSlots", pName, sizeof ("xglClearDescriptorSetSlots"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 262 | return (XGL_VOID *) pTable->ClearDescriptorSetSlots; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 263 | else if (!strncmp("xglCreateViewportState", pName, sizeof ("xglCreateViewportState"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 264 | return (XGL_VOID *) pTable->CreateViewportState; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 265 | else if (!strncmp("xglCreateRasterState", pName, sizeof ("xglCreateRasterState"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 266 | return (XGL_VOID *) pTable->CreateRasterState; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 267 | else if (!strncmp("xglCreateMsaaState", pName, sizeof ("xglCreateMsaaState"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 268 | return (XGL_VOID *) pTable->CreateMsaaState; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 269 | else if (!strncmp("xglCreateColorBlendState", pName, sizeof ("xglCreateColorBlendState"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 270 | return (XGL_VOID *) pTable->CreateColorBlendState; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 271 | else if (!strncmp("xglCreateDepthStencilState", pName, sizeof ("xglCreateDepthStencilState"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 272 | return (XGL_VOID *) pTable->CreateDepthStencilState; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 273 | else if (!strncmp("xglCreateCommandBuffer", pName, sizeof ("xglCreateCommandBuffer"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 274 | return (XGL_VOID *) pTable->CreateCommandBuffer; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 275 | else if (!strncmp("xglBeginCommandBuffer", pName, sizeof ("xglBeginCommandBuffer"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 276 | return (XGL_VOID *) pTable->BeginCommandBuffer; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 277 | else if (!strncmp("xglEndCommandBuffer", pName, sizeof ("xglEndCommandBuffer"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 278 | return (XGL_VOID *) pTable->EndCommandBuffer; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 279 | else if (!strncmp("xglResetCommandBuffer", pName, sizeof ("xglResetCommandBuffer"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 280 | return (XGL_VOID *) pTable->ResetCommandBuffer; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 281 | else if (!strncmp("xglCmdBindPipeline", pName, sizeof ("xglCmdBindPipeline"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 282 | return (XGL_VOID *) pTable->CmdBindPipeline; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 283 | else if (!strncmp("xglCmdBindPipelineDelta", pName, sizeof ("xglCmdBindPipelineDelta"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 284 | return (XGL_VOID *) pTable->CmdBindPipelineDelta; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 285 | else if (!strncmp("xglCmdBindStateObject", pName, sizeof ("xglCmdBindStateObject"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 286 | return (XGL_VOID *) pTable->CmdBindStateObject; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 287 | else if (!strncmp("xglCmdBindDescriptorSet", pName, sizeof ("xglCmdBindDescriptorSet"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 288 | return (XGL_VOID *) pTable->CmdBindDescriptorSet; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 289 | else if (!strncmp("xglCmdBindDynamicMemoryView", pName, sizeof ("xglCmdBindDynamicMemoryView"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 290 | return (XGL_VOID *) pTable->CmdBindDynamicMemoryView; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 291 | else if (!strncmp("xglCmdBindVertexData", pName, sizeof ("xglCmdBindVertexData"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 292 | return (XGL_VOID *) pTable->CmdBindVertexData; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 293 | else if (!strncmp("xglCmdBindIndexData", pName, sizeof ("xglCmdBindIndexData"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 294 | return (XGL_VOID *) pTable->CmdBindIndexData; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 295 | else if (!strncmp("xglCmdBindAttachments", pName, sizeof ("xglCmdBindAttachments"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 296 | return (XGL_VOID *) pTable->CmdBindAttachments; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 297 | else if (!strncmp("xglCmdPrepareMemoryRegions", pName, sizeof ("xglCmdPrepareMemoryRegions"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 298 | return (XGL_VOID *) pTable->CmdPrepareMemoryRegions; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 299 | else if (!strncmp("xglCmdPrepareImages", pName, sizeof ("xglCmdPrepareImages"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 300 | return (XGL_VOID *) pTable->CmdPrepareImages; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 301 | else if (!strncmp("xglCmdDraw", pName, sizeof ("xglCmdDraw"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 302 | return (XGL_VOID *) pTable->CmdDraw; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 303 | else if (!strncmp("xglCmdDrawIndexed", pName, sizeof ("xglCmdDrawIndexed"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 304 | return (XGL_VOID *) pTable->CmdDrawIndexed; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 305 | else if (!strncmp("xglCmdDrawIndirect", pName, sizeof ("xglCmdDrawIndirect"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 306 | return (XGL_VOID *) pTable->CmdDrawIndirect; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 307 | else if (!strncmp("xglCmdDrawIndexedIndirect", pName, sizeof ("xglCmdDrawIndexedIndirect"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 308 | return (XGL_VOID *) pTable->CmdDrawIndexedIndirect; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 309 | else if (!strncmp("xglCmdDispatch", pName, sizeof ("xglCmdDispatch"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 310 | return (XGL_VOID *) pTable->CmdDispatch; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 311 | else if (!strncmp("xglCmdDispatchIndirect", pName, sizeof ("xglCmdDispatchIndirect"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 312 | return (XGL_VOID *) pTable->CmdDispatchIndirect; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 313 | else if (!strncmp("xglCmdCopyMemory", pName, sizeof ("xglCmdCopyMemory"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 314 | return (XGL_VOID *) pTable->CmdCopyMemory; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 315 | else if (!strncmp("xglCmdCopyImage", pName, sizeof ("xglCmdCopyImage"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 316 | return (XGL_VOID *) pTable->CmdCopyImage; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 317 | else if (!strncmp("xglCmdCopyMemoryToImage", pName, sizeof ("xglCmdCopyMemoryToImage"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 318 | return (XGL_VOID *) pTable->CmdCopyMemoryToImage; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 319 | else if (!strncmp("xglCmdCopyImageToMemory", pName, sizeof ("xglCmdCopyImageToMemory"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 320 | return (XGL_VOID *) pTable->CmdCopyImageToMemory; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 321 | else if (!strncmp("xglCmdCloneImageData", pName, sizeof ("xglCmdCloneImageData"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 322 | return (XGL_VOID *) pTable->CmdCloneImageData; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 323 | else if (!strncmp("xglCmdUpdateMemory", pName, sizeof ("xglCmdUpdateMemory"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 324 | return (XGL_VOID *) pTable->CmdUpdateMemory; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 325 | else if (!strncmp("xglCmdFillMemory", pName, sizeof ("xglCmdFillMemory"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 326 | return (XGL_VOID *) pTable->CmdFillMemory; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 327 | else if (!strncmp("xglCmdClearColorImage", pName, sizeof ("xglCmdClearColorImage"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 328 | return (XGL_VOID *) pTable->CmdClearColorImage; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 329 | else if (!strncmp("xglCmdClearColorImageRaw", pName, sizeof ("xglCmdClearColorImageRaw"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 330 | return (XGL_VOID *) pTable->CmdClearColorImageRaw; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 331 | else if (!strncmp("xglCmdClearDepthStencil", pName, sizeof ("xglCmdClearDepthStencil"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 332 | return (XGL_VOID *) pTable->CmdClearDepthStencil; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 333 | else if (!strncmp("xglCmdResolveImage", pName, sizeof ("xglCmdResolveImage"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 334 | return (XGL_VOID *) pTable->CmdResolveImage; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 335 | else if (!strncmp("xglCmdSetEvent", pName, sizeof ("xglCmdSetEvent"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 336 | return (XGL_VOID *) pTable->CmdSetEvent; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 337 | else if (!strncmp("xglCmdResetEvent", pName, sizeof ("xglCmdResetEvent"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 338 | return (XGL_VOID *) pTable->CmdResetEvent; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 339 | else if (!strncmp("xglCmdMemoryAtomic", pName, sizeof ("xglCmdMemoryAtomic"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 340 | return (XGL_VOID *) pTable->CmdMemoryAtomic; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 341 | else if (!strncmp("xglCmdBeginQuery", pName, sizeof ("xglCmdBeginQuery"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 342 | return (XGL_VOID *) pTable->CmdBeginQuery; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 343 | else if (!strncmp("xglCmdEndQuery", pName, sizeof ("xglCmdEndQuery"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 344 | return (XGL_VOID *) pTable->CmdEndQuery; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 345 | else if (!strncmp("xglCmdResetQueryPool", pName, sizeof ("xglCmdResetQueryPool"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 346 | return (XGL_VOID *) pTable->CmdResetQueryPool; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 347 | else if (!strncmp("xglCmdWriteTimestamp", pName, sizeof ("xglCmdWriteTimestamp"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 348 | return (XGL_VOID *) pTable->CmdWriteTimestamp; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 349 | else if (!strncmp("xglCmdInitAtomicCounters", pName, sizeof ("xglCmdInitAtomicCounters"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 350 | return (XGL_VOID *) pTable->CmdInitAtomicCounters; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 351 | else if (!strncmp("xglCmdLoadAtomicCounters", pName, sizeof ("xglCmdLoadAtomicCounters"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 352 | return (XGL_VOID *) pTable->CmdLoadAtomicCounters; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 353 | else if (!strncmp("xglCmdSaveAtomicCounters", pName, sizeof ("xglCmdSaveAtomicCounters"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 354 | return (XGL_VOID *) pTable->CmdSaveAtomicCounters; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 355 | else if (!strncmp("xglDbgSetValidationLevel", pName, sizeof ("xglDbgSetValidationLevel"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 356 | return (XGL_VOID *) pTable->DbgSetValidationLevel; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 357 | else if (!strncmp("xglDbgRegisterMsgCallback", pName, sizeof ("xglDbgRegisterMsgCallback"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 358 | return (XGL_VOID *) pTable->DbgRegisterMsgCallback; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 359 | else if (!strncmp("xglDbgUnregisterMsgCallback", pName, sizeof ("xglDbgUnregisterMsgCallback"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 360 | return (XGL_VOID *) pTable->DbgUnregisterMsgCallback; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 361 | else if (!strncmp("xglDbgSetMessageFilter", pName, sizeof ("xglDbgSetMessageFilter"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 362 | return (XGL_VOID *) pTable->DbgSetMessageFilter; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 363 | else if (!strncmp("xglDbgSetObjectTag", pName, sizeof ("xglDbgSetObjectTag"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 364 | return (XGL_VOID *) pTable->DbgSetObjectTag; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 365 | else if (!strncmp("xglDbgSetGlobalOption", pName, sizeof ("xglDbgSetGlobalOption"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 366 | return (XGL_VOID *) pTable->DbgSetGlobalOption; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 367 | else if (!strncmp("xglDbgSetDeviceOption", pName, sizeof ("xglDbgSetDeviceOption"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 368 | return (XGL_VOID *) pTable->DbgSetDeviceOption; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 369 | else if (!strncmp("xglCmdDbgMarkerBegin", pName, sizeof ("xglCmdDbgMarkerBegin"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 370 | return (XGL_VOID *) pTable->CmdDbgMarkerBegin; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 371 | else if (!strncmp("xglCmdDbgMarkerEnd", pName, sizeof ("xglCmdDbgMarkerEnd"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 372 | return (XGL_VOID *) pTable->CmdDbgMarkerEnd; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 373 | else if (!strncmp("xglWsiX11AssociateConnection", pName, sizeof("xglWsiX11AssociateConnection"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 374 | return (XGL_VOID *) pTable->WsiX11AssociateConnection; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 375 | else if (!strncmp("xglWsiX11GetMSC", pName, sizeof("xglWsiX11GetMSC"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 376 | return (XGL_VOID *) pTable->WsiX11GetMSC; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 377 | else if (!strncmp("xglWsiX11CreatePresentableImage", pName, sizeof("xglWsiX11CreatePresentableImage"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 378 | return (XGL_VOID *) pTable->WsiX11CreatePresentableImage; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 379 | else if (!strncmp("xglWsiX11QueuePresent", pName, sizeof("xglWsiX11QueuePresent"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 380 | return (XGL_VOID *) pTable->WsiX11QueuePresent; |
Chia-I Wu | 7461fcf | 2014-12-27 15:16:07 +0800 | [diff] [blame] | 381 | else if (!strncmp("xglLayerExtension1", pName, sizeof("xglLayerExtension1"))) |
Jon Ashburn | 227a942 | 2014-11-26 11:10:26 -0700 | [diff] [blame] | 382 | return (XGL_VOID *) xglLayerExtension1; |
| 383 | else { |
| 384 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 385 | if (gpuw->pGPA == NULL) |
| 386 | return NULL; |
| 387 | return gpuw->pGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, pName); |
| 388 | } |
| 389 | } |