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