Tobin Ehlis | 6663f49 | 2014-11-10 12:29:12 -0700 | [diff] [blame^] | 1 | /* THIS FILE IS GENERATED. DO NOT EDIT. */ |
| 2 | |
| 3 | /* |
| 4 | * XGL |
| 5 | * |
| 6 | * Copyright (C) 2014 LunarG, Inc. |
| 7 | * |
| 8 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 9 | * copy of this software and associated documentation files (the "Software"), |
| 10 | * to deal in the Software without restriction, including without limitation |
| 11 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 12 | * and/or sell copies of the Software, and to permit persons to whom the |
| 13 | * Software is furnished to do so, subject to the following conditions: |
| 14 | * |
| 15 | * The above copyright notice and this permission notice shall be included |
| 16 | * in all copies or substantial portions of the Software. |
| 17 | * |
| 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 21 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 23 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 24 | * DEALINGS IN THE SOFTWARE. |
| 25 | */ |
| 26 | |
| 27 | #include <stdio.h> |
| 28 | #include <stdlib.h> |
| 29 | #include <string.h> |
| 30 | #include <assert.h> |
| 31 | #include <pthread.h> |
| 32 | #include "xglLayer.h" |
| 33 | #include "xgl_struct_string_helper.h" |
| 34 | |
| 35 | static XGL_LAYER_DISPATCH_TABLE nextTable; |
| 36 | static XGL_BASE_LAYER_OBJECT *pCurObj; |
| 37 | static pthread_once_t tabOnce = PTHREAD_ONCE_INIT; |
| 38 | |
| 39 | /* |
| 40 | * Data Structure overview |
| 41 | * There are 3 global Linked-Lists (LLs) |
| 42 | * pGlobalCBHead points to head of Command Buffer (CB) LL |
| 43 | * Off of each node in this LL there is a separate LL of |
| 44 | * memory objects that are referenced by this CB |
| 45 | * pGlobalMemObjHead points to head of Memory Object LL |
| 46 | * Off of each node in this LL there are 2 separate LL |
| 47 | * One is a list of all CBs referencing this mem obj |
| 48 | * Two is a list of all XGL Objects that are bound to this memory |
| 49 | * pGlobalObjHead point to head of XGL Objects w/ bound mem LL |
| 50 | * Each node of this LL contains a ptr to global Mem Obj node for bound mem |
| 51 | * |
| 52 | * The "Global" nodes are for the main LLs |
| 53 | * The "mini" nodes are for ancillary LLs that are pointed to from global nodes |
| 54 | * |
| 55 | * Algorithm overview |
| 56 | * These are the primary events that should happen related to different objects |
| 57 | * 1. Command buffers |
| 58 | * CREATION - Add node to global LL |
| 59 | * CMD BIND - If mem associated, add mem reference to mini LL |
| 60 | * DESTROY - Remove from global LL, decrement (and report) mem references |
| 61 | * 2. Mem Objects |
| 62 | * CREATION - Add node to global LL |
| 63 | * OBJ BIND - Add obj node to mini LL for that mem node |
| 64 | * CMB BIND - If mem-related add CB node to mini LL for that mem node |
| 65 | * DESTROY - Flag as errors any remaining refs and Remove from global LL |
| 66 | * 3. Generic Objects |
| 67 | * MEM BIND - DESTROY any previous binding, Add global obj node w/ ref to global mem obj node, Add obj node to mini LL for that mem node |
| 68 | * DESTROY - If mem bound, remove reference from mini LL for that mem Node, remove global obj node |
| 69 | */ |
| 70 | // TODO : Is there a way to track when Cmd Buffer finishes & remove mem references at that point? |
| 71 | // TODO : Could potentially store a list of freed mem allocs to flag when they're incorrectly used |
| 72 | |
| 73 | // Generic data struct for various "mini" Linked-Lists |
| 74 | // This just wraps some type of XGL OBJ and a pNext ptr |
| 75 | // Used for xgl obj, cmd buffer, and mem obj wrapping |
| 76 | typedef struct _MINI_NODE { |
| 77 | struct _MINI_NODE* pNext; |
| 78 | union { // different objects that can be wrapped |
| 79 | XGL_OBJECT object; |
| 80 | XGL_GPU_MEMORY mem; |
| 81 | XGL_CMD_BUFFER cmdBuffer; |
| 82 | XGL_BASE_OBJECT data; // for generic handling of data |
| 83 | }; |
| 84 | } MINI_NODE; |
| 85 | |
| 86 | struct GLOBAL_MEM_OBJ_NODE; |
| 87 | |
| 88 | // Store a single LL of command buffers |
| 89 | typedef struct _GLOBAL_CB_NODE { |
| 90 | struct _GLOBAL_CB_NODE* pNextGlobalCBNode; |
| 91 | MINI_NODE* pMemObjList; // LL of Mem objs referenced by this CB |
| 92 | XGL_CMD_BUFFER cmdBuffer; |
| 93 | XGL_FENCE fence; // fence tracking this cmd buffer |
| 94 | } GLOBAL_CB_NODE; |
| 95 | |
| 96 | // Data struct for tracking memory object |
| 97 | typedef struct _GLOBAL_MEM_OBJ_NODE { |
| 98 | struct _GLOBAL_MEM_OBJ_NODE* pNextGlobalNode; // Ptr to next mem obj in global list of all objs |
| 99 | MINI_NODE* pObjBindings; // Ptr to list of objects bound to this memory |
| 100 | MINI_NODE* pCmdBufferBindings; // Ptr to list of cmd buffers that this mem object references |
| 101 | XGL_UINT refCount; // Count of references (obj bindings or CB use) |
| 102 | XGL_GPU_MEMORY mem; |
| 103 | XGL_MEMORY_ALLOC_INFO allocInfo; |
| 104 | } GLOBAL_MEM_OBJ_NODE; |
| 105 | |
| 106 | typedef struct _GLOBAL_OBJECT_NODE { |
| 107 | struct _GLOBAL_OBJECT_NODE* pNext; |
| 108 | GLOBAL_MEM_OBJ_NODE* pMemNode; |
| 109 | XGL_OBJECT object; |
| 110 | } GLOBAL_OBJECT_NODE; |
| 111 | |
| 112 | static GLOBAL_CB_NODE* pGlobalCBHead = NULL; |
| 113 | static GLOBAL_MEM_OBJ_NODE* pGlobalMemObjHead = NULL; |
| 114 | static GLOBAL_OBJECT_NODE* pGlobalObjectHead = NULL; |
| 115 | static XGL_DEVICE globalDevice = NULL; |
| 116 | |
| 117 | // Check list for data and if it's not included insert new node |
| 118 | // into HEAD of list pointed to by pHEAD & update pHEAD |
| 119 | // Set 'insert' to XGL_TRUE if new node was inserted |
| 120 | // return XGL_SUCCESS if no errors occur |
| 121 | static XGL_RESULT insertMiniNode(MINI_NODE** pHEAD, const XGL_BASE_OBJECT data, XGL_UINT* insert) |
| 122 | { |
| 123 | MINI_NODE* pTrav = *pHEAD; |
| 124 | while (pTrav && (pTrav->data != data)) { |
| 125 | pTrav = pTrav->pNext; |
| 126 | } |
| 127 | if (!pTrav) { // Add node to front of LL |
| 128 | pTrav = (MINI_NODE*)malloc(sizeof(MINI_NODE)); |
| 129 | if (!pTrav) |
| 130 | return XGL_ERROR_OUT_OF_MEMORY; |
| 131 | memset(pTrav, 0, sizeof(MINI_NODE)); |
| 132 | if (*pHEAD) |
| 133 | pTrav->pNext = *pHEAD; |
| 134 | *pHEAD = pTrav; |
| 135 | *insert += 1; |
| 136 | //pMemTrav->refCount++; |
| 137 | //printf("MEM INFO : Incremented refCount for mem obj %p to %u\n", (void*)mem, pMemTrav->refCount); |
| 138 | } |
| 139 | if (pTrav->data) { // This is just FYI |
| 140 | assert(data == pTrav->data); |
| 141 | printf("MEM INFO : Data %p is already in data LL w/ HEAD at %p\n", data, *pHEAD); |
| 142 | } |
| 143 | pTrav->data = data; |
| 144 | return XGL_SUCCESS; |
| 145 | } |
| 146 | |
| 147 | // Add new CB node for this cb at end of global CB LL |
| 148 | static void insertGlobalCB(const XGL_CMD_BUFFER cb) |
| 149 | { |
| 150 | GLOBAL_CB_NODE* pTrav = pGlobalCBHead; |
| 151 | if (!pTrav) { |
| 152 | pTrav = (GLOBAL_CB_NODE*)malloc(sizeof(GLOBAL_CB_NODE)); |
| 153 | pGlobalCBHead = pTrav; |
| 154 | } |
| 155 | else { |
| 156 | while (NULL != pTrav->pNextGlobalCBNode) |
| 157 | pTrav = pTrav->pNextGlobalCBNode; |
| 158 | pTrav->pNextGlobalCBNode = (GLOBAL_CB_NODE*)malloc(sizeof(GLOBAL_CB_NODE)); |
| 159 | pTrav = pTrav->pNextGlobalCBNode; |
| 160 | } |
| 161 | memset(pTrav, 0, sizeof(GLOBAL_CB_NODE)); |
| 162 | pTrav->cmdBuffer = cb; |
| 163 | } |
| 164 | |
| 165 | // Return ptr to node in global LL containing cb, or NULL if not found |
| 166 | static GLOBAL_CB_NODE* getGlobalCBNode(const XGL_CMD_BUFFER cb) |
| 167 | { |
| 168 | GLOBAL_CB_NODE* pTrav = pGlobalCBHead; |
| 169 | while (pTrav && (pTrav->cmdBuffer != cb)) |
| 170 | pTrav = pTrav->pNextGlobalCBNode; |
| 171 | return pTrav; |
| 172 | } |
| 173 | // Set fence for given cb in global cb node |
| 174 | static XGL_BOOL setCBFence(const XGL_CMD_BUFFER cb, const XGL_FENCE fence) |
| 175 | { |
| 176 | GLOBAL_CB_NODE* pTrav = getGlobalCBNode(cb); |
| 177 | if (!pTrav) { |
| 178 | printf("MEM ERROR : Unable to find node for CB %p in order to set fence to %p\n", (void*)cb, (void*)fence); |
| 179 | return XGL_FALSE; |
| 180 | } |
| 181 | pTrav->fence = fence; |
| 182 | return XGL_TRUE; |
| 183 | } |
| 184 | |
| 185 | static XGL_BOOL validateCBMemRef(const XGL_CMD_BUFFER cb, XGL_UINT memRefCount, const XGL_MEMORY_REF* pMemRefs) |
| 186 | { |
| 187 | GLOBAL_CB_NODE* pTrav = getGlobalCBNode(cb); |
| 188 | if (!pTrav) { |
| 189 | printf("MEM ERROR : Unable to find node for CB %p in order to check memory references\n", (void*)cb); |
| 190 | return XGL_FALSE; |
| 191 | } |
| 192 | // Validate that all actual references are accounted for in pMemRefs |
| 193 | MINI_NODE* pMemNode = pTrav->pMemObjList; |
| 194 | uint32_t i; |
| 195 | uint8_t found = 0; |
| 196 | uint64_t foundCount = 0; |
| 197 | while (pMemNode) { |
| 198 | // TODO : Improve this algorithm |
| 199 | for (i = 0; i < memRefCount; i++) { |
| 200 | if (pMemNode->mem == pMemRefs[i].mem) { |
| 201 | printf("MEM INFO : Found Mem Obj %p binding to CB %p\n", pMemNode->mem, cb); |
| 202 | found = 1; |
| 203 | foundCount++; |
| 204 | } |
| 205 | } |
| 206 | if (!found) { |
| 207 | printf("MEM ERROR : Memory reference list for Command Buffer %p is missing ref to mem obj %p\n", cb, pMemNode->mem); |
| 208 | return XGL_FALSE; |
| 209 | } |
| 210 | found = 0; |
| 211 | pMemNode = pMemNode->pNext; |
| 212 | } |
| 213 | printf("MEM INFO : Verified all %lu memory dependencies for CB %p are included in pMemRefs list\n", foundCount, cb); |
| 214 | // TODO : Could report mem refs in pMemRefs that AREN'T in mem LL, that would be primarily informational |
| 215 | // Currently just noting that there is a difference |
| 216 | if (foundCount != memRefCount) |
| 217 | printf("MEM INFO : Note that %u mem refs included in pMemRefs list, but only %lu appear to be required\n", memRefCount, foundCount); |
| 218 | return XGL_TRUE; |
| 219 | } |
| 220 | |
| 221 | static void insertGlobalMemObj(const XGL_GPU_MEMORY mem, const XGL_MEMORY_ALLOC_INFO* pAllocInfo) |
| 222 | { |
| 223 | GLOBAL_MEM_OBJ_NODE* pTrav = pGlobalMemObjHead; |
| 224 | if (!pTrav) { |
| 225 | pTrav = (GLOBAL_MEM_OBJ_NODE*)malloc(sizeof(GLOBAL_MEM_OBJ_NODE)); |
| 226 | pGlobalMemObjHead = pTrav; |
| 227 | } |
| 228 | else { |
| 229 | while (NULL != pTrav->pNextGlobalNode) |
| 230 | pTrav = pTrav->pNextGlobalNode; |
| 231 | pTrav->pNextGlobalNode = (GLOBAL_MEM_OBJ_NODE*)malloc(sizeof(GLOBAL_MEM_OBJ_NODE)); |
| 232 | pTrav = pTrav->pNextGlobalNode; |
| 233 | } |
| 234 | memset(pTrav, 0, sizeof(GLOBAL_MEM_OBJ_NODE)); |
| 235 | memcpy(&pTrav->allocInfo, pAllocInfo, sizeof(XGL_MEMORY_ALLOC_INFO)); |
| 236 | pTrav->mem = mem; |
| 237 | } |
| 238 | |
| 239 | // Return ptr to node in global LL containing mem, or NULL if not found |
| 240 | static GLOBAL_MEM_OBJ_NODE* getGlobalMemNode(const XGL_GPU_MEMORY mem) |
| 241 | { |
| 242 | GLOBAL_MEM_OBJ_NODE* pTrav = pGlobalMemObjHead; |
| 243 | while (pTrav && (pTrav->mem != mem)) |
| 244 | pTrav = pTrav->pNextGlobalNode; |
| 245 | return pTrav; |
| 246 | } |
| 247 | |
| 248 | // Find Global CB Node and add mem binding to mini LL |
| 249 | // Find Global Mem Obj Node and add CB binding to mini LL |
| 250 | static XGL_BOOL updateCBBinding(const XGL_CMD_BUFFER cb, const XGL_GPU_MEMORY mem) |
| 251 | { |
| 252 | // First update CB binding in MemObj mini CB list |
| 253 | GLOBAL_MEM_OBJ_NODE* pMemTrav = getGlobalMemNode(mem); |
| 254 | if (!pMemTrav) { |
| 255 | printf("MEM ERROR : Trying to bind mem obj %p to CB %p but no Node for that mem obj.\n", mem, cb); |
| 256 | printf(" Was it correctly allocated? Did it already get freed?\n"); |
| 257 | return XGL_FALSE; |
| 258 | } |
| 259 | |
| 260 | XGL_RESULT result = insertMiniNode(&pMemTrav->pCmdBufferBindings, cb, &pMemTrav->refCount); |
| 261 | if (XGL_SUCCESS != result) |
| 262 | return result; |
| 263 | |
| 264 | // Now update Global CB's Mini Mem binding list |
| 265 | GLOBAL_CB_NODE* pCBTrav = getGlobalCBNode(cb); |
| 266 | if (!pCBTrav) { |
| 267 | printf("MEM ERROR : Trying to bind mem obj %p to CB %p but no Node for that CB.\n", mem, cb); |
| 268 | printf(" Was it CB incorrectly destroyed?\n"); |
| 269 | return XGL_FALSE; |
| 270 | } |
| 271 | XGL_UINT dontCare; |
| 272 | result = insertMiniNode(&pCBTrav->pMemObjList, mem, &dontCare); |
| 273 | if (XGL_SUCCESS != result) |
| 274 | return result; |
| 275 | |
| 276 | return XGL_TRUE; |
| 277 | } |
| 278 | // Clear the CB Binding for mem |
| 279 | static void clearCBBinding(const XGL_CMD_BUFFER cb, const XGL_GPU_MEMORY mem) |
| 280 | { |
| 281 | GLOBAL_MEM_OBJ_NODE* pTrav = getGlobalMemNode(mem); |
| 282 | MINI_NODE* pMiniCB = pTrav->pCmdBufferBindings; |
| 283 | MINI_NODE* pPrev = pMiniCB; |
| 284 | while (pMiniCB && (cb != pMiniCB->cmdBuffer)) { |
| 285 | pPrev = pMiniCB; |
| 286 | pMiniCB = pMiniCB->pNext; |
| 287 | } |
| 288 | if (!pMiniCB) { |
| 289 | printf("MEM ERROR : Trying to clear CB binding but CB %p not in binding list for mem obj %p\n", cb, mem); |
| 290 | } |
| 291 | else { // remove node from list & decrement refCount |
| 292 | pPrev->pNext = pMiniCB->pNext; |
| 293 | if (pMiniCB == pTrav->pCmdBufferBindings) |
| 294 | pTrav->pCmdBufferBindings = NULL; |
| 295 | free(pMiniCB); |
| 296 | pTrav->refCount--; |
| 297 | } |
| 298 | } |
| 299 | // Free bindings related to CB |
| 300 | static XGL_BOOL freeCBBindings(const XGL_CMD_BUFFER cb) |
| 301 | { |
| 302 | GLOBAL_CB_NODE* pCBTrav = getGlobalCBNode(cb); |
| 303 | if (!pCBTrav) { |
| 304 | printf("MEM ERROR : Unable to find global CB node %p for deletion\n", cb); |
| 305 | return XGL_FALSE; |
| 306 | } |
| 307 | MINI_NODE* pMemTrav = pCBTrav->pMemObjList; |
| 308 | MINI_NODE* pDeleteMe = NULL; |
| 309 | // We traverse LL in order and free nodes as they're cleared |
| 310 | while (pMemTrav) { |
| 311 | pDeleteMe = pMemTrav; |
| 312 | if (pMemTrav->mem) |
| 313 | clearCBBinding(cb, pMemTrav->mem); |
| 314 | pMemTrav = pMemTrav->pNext; |
| 315 | free(pDeleteMe); |
| 316 | } |
| 317 | pCBTrav->pMemObjList = NULL; |
| 318 | return XGL_TRUE; |
| 319 | } |
| 320 | // Delete Global CB Node from list along with all of it's mini mem obj node |
| 321 | // and also clear Global mem references to CB |
| 322 | // TODO : When should this be called? There's no Destroy of CBs that I see |
| 323 | static XGL_BOOL deleteGlobalCBNode(const XGL_CMD_BUFFER cb) |
| 324 | { |
| 325 | if (XGL_FALSE == freeCBBindings(cb)) |
| 326 | return XGL_FALSE; |
| 327 | // Delete the Global CB node |
| 328 | GLOBAL_CB_NODE* pCBTrav = getGlobalCBNode(cb); |
| 329 | pCBTrav = pGlobalCBHead; |
| 330 | GLOBAL_CB_NODE* pPrev = pCBTrav; |
| 331 | while (pCBTrav && (cb != pCBTrav->cmdBuffer)) { |
| 332 | pPrev = pCBTrav; |
| 333 | pCBTrav = pCBTrav->pNextGlobalCBNode; |
| 334 | } |
| 335 | assert(cb); // We found node at start of function so it should still be here |
| 336 | pPrev->pNextGlobalCBNode = pCBTrav->pNextGlobalCBNode; |
| 337 | if (pCBTrav == pGlobalCBHead) |
| 338 | pGlobalCBHead = pCBTrav->pNextGlobalCBNode; |
| 339 | free(pCBTrav); |
| 340 | return XGL_TRUE; |
| 341 | } |
| 342 | // Delete the entire CB list |
| 343 | static XGL_BOOL deleteGlobalCBList() |
| 344 | { |
| 345 | XGL_BOOL result = XGL_TRUE; |
| 346 | GLOBAL_CB_NODE* pCBTrav = pGlobalCBHead; |
| 347 | while (pCBTrav) { |
| 348 | XGL_BOOL tmpResult = deleteGlobalCBNode(pCBTrav->cmdBuffer); |
| 349 | // If any result is FALSE, final result should be FALSE |
| 350 | if ((XGL_FALSE == tmpResult) || (XGL_FALSE == result)) |
| 351 | result = XGL_FALSE; |
| 352 | pCBTrav = pCBTrav->pNextGlobalCBNode; |
| 353 | } |
| 354 | return result; |
| 355 | } |
| 356 | |
| 357 | // For given MemObj node, report Obj & CB bindings |
| 358 | static void reportMemReferences(const GLOBAL_MEM_OBJ_NODE* pMemObjTrav) |
| 359 | { |
| 360 | XGL_UINT refCount = 0; // Count found references |
| 361 | MINI_NODE* pObjTrav = pMemObjTrav->pObjBindings; |
| 362 | MINI_NODE* pCBTrav = pMemObjTrav->pCmdBufferBindings; |
| 363 | while (pCBTrav) { |
| 364 | refCount++; |
| 365 | printf("MEM INFO : Command Buffer %p has reference to mem obj %p\n", pCBTrav->cmdBuffer, pMemObjTrav->mem); |
| 366 | pCBTrav = pCBTrav->pNext; |
| 367 | } |
| 368 | while (pObjTrav) { |
| 369 | refCount++; |
| 370 | printf("MEM INFO : XGL Object %p has reference to mem obj %p\n", pObjTrav->object, pMemObjTrav->mem); |
| 371 | pObjTrav = pObjTrav->pNext; |
| 372 | } |
| 373 | if (refCount != pMemObjTrav->refCount) { |
| 374 | printf("MEM INFO INTERNAL ERROR : Refcount of %u for Mem Obj %p does't match reported refs of %u\n", pMemObjTrav->refCount, pMemObjTrav->mem, refCount); |
| 375 | } |
| 376 | } |
| 377 | |
| 378 | static void deleteGlobalMemNode(XGL_GPU_MEMORY mem) |
| 379 | { |
| 380 | GLOBAL_MEM_OBJ_NODE* pTrav = pGlobalMemObjHead; |
| 381 | GLOBAL_MEM_OBJ_NODE* pPrev = pTrav; |
| 382 | while (pTrav && (pTrav->mem != mem)) { |
| 383 | pPrev = pTrav; |
| 384 | pTrav = pTrav->pNextGlobalNode; |
| 385 | } |
| 386 | if (pTrav) { |
| 387 | pPrev->pNextGlobalNode = pTrav->pNextGlobalNode; |
| 388 | if (pGlobalMemObjHead == pTrav) |
| 389 | pGlobalMemObjHead = pTrav->pNextGlobalNode; |
| 390 | free(pTrav); |
| 391 | } |
| 392 | else { |
| 393 | printf("MEM ERROR : Could not find global mem obj node for %p to delete!\n", mem); |
| 394 | } |
| 395 | } |
| 396 | // Check if fence for given CB is completed |
| 397 | static XGL_BOOL checkCBCompleted(const XGL_CMD_BUFFER cb) |
| 398 | { |
| 399 | GLOBAL_CB_NODE* pCBTrav = getGlobalCBNode(cb); |
| 400 | if (!pCBTrav) { |
| 401 | printf("MEM ERROR : Unable to find global CB node %p to check for completion\n", cb); |
| 402 | return XGL_FALSE; |
| 403 | } |
| 404 | if (!pCBTrav->fence) { |
| 405 | printf("MEM ERROR : No fence found for CB %p to check for completion\n", cb); |
| 406 | return XGL_FALSE; |
| 407 | } |
| 408 | if (XGL_SUCCESS != nextTable.GetFenceStatus(pCBTrav->fence)) { |
| 409 | printf("MEM INFO : Fence %p for CB %p has not completed\n", pCBTrav->fence, cb); |
| 410 | return XGL_FALSE; |
| 411 | } |
| 412 | return XGL_TRUE; |
| 413 | } |
| 414 | |
| 415 | static XGL_BOOL freeMemNode(XGL_GPU_MEMORY mem) |
| 416 | { |
| 417 | XGL_BOOL result = XGL_TRUE; |
| 418 | // Parse global list to find node w/ mem |
| 419 | GLOBAL_MEM_OBJ_NODE* pTrav = getGlobalMemNode(mem); |
| 420 | if (!pTrav) { |
| 421 | printf("MEM ERROR : Couldn't find mem node object for %p\n", (void*)mem); |
| 422 | printf("MEM ERROR : Was %p never allocated or previously freed?\n", (void*)mem); |
| 423 | return XGL_FALSE; |
| 424 | } |
| 425 | else { |
| 426 | // First clear any CB bindings for completed CBs |
| 427 | // TODO : Is there a better place to do this? |
| 428 | MINI_NODE* pMiniCB = pTrav->pCmdBufferBindings; |
| 429 | while (pMiniCB) { |
| 430 | XGL_CMD_BUFFER curCB = pMiniCB->cmdBuffer; |
| 431 | pMiniCB = pMiniCB->pNext; |
| 432 | if (XGL_TRUE == checkCBCompleted(curCB)) { |
| 433 | freeCBBindings(curCB); |
| 434 | } |
| 435 | } |
| 436 | // Now verify that no references to this mem obj remain |
| 437 | if (0 != pTrav->refCount) { |
| 438 | // If references remain, report the error and can search down CB LL to find references |
| 439 | result = XGL_FALSE; |
| 440 | printf("MEM ERROR : Freeing mem obj %p while it still has references\n", (void*)mem); |
| 441 | reportMemReferences(pTrav); |
| 442 | } |
| 443 | // Delete global node |
| 444 | deleteGlobalMemNode(mem); |
| 445 | } |
| 446 | return result; |
| 447 | } |
| 448 | |
| 449 | // Return object node for 'object' or return NULL if no node exists |
| 450 | static GLOBAL_OBJECT_NODE* getGlobalObjectNode(const XGL_OBJECT object) |
| 451 | { |
| 452 | GLOBAL_OBJECT_NODE* pTrav = pGlobalObjectHead; |
| 453 | while (pTrav && (object != pTrav->object)) { |
| 454 | pTrav = pTrav->pNext; |
| 455 | } |
| 456 | return pTrav; |
| 457 | } |
| 458 | |
| 459 | static GLOBAL_OBJECT_NODE* insertGlobalObjectNode(XGL_OBJECT object) |
| 460 | { |
| 461 | GLOBAL_OBJECT_NODE* pTrav = pGlobalObjectHead; |
| 462 | if (!pTrav) { |
| 463 | pTrav = (GLOBAL_OBJECT_NODE*)malloc(sizeof(GLOBAL_OBJECT_NODE)); |
| 464 | if (!pTrav) |
| 465 | return NULL; |
| 466 | memset(pTrav, 0, sizeof(GLOBAL_OBJECT_NODE)); |
| 467 | pGlobalObjectHead = pTrav; |
| 468 | } |
| 469 | else { |
| 470 | GLOBAL_OBJECT_NODE* pPrev = pTrav; |
| 471 | while (pTrav) { |
| 472 | pPrev = pTrav; |
| 473 | pTrav = pTrav->pNext; |
| 474 | } |
| 475 | pTrav = (GLOBAL_OBJECT_NODE*)malloc(sizeof(GLOBAL_OBJECT_NODE)); |
| 476 | if (!pTrav) |
| 477 | return NULL; |
| 478 | memset(pTrav, 0, sizeof(GLOBAL_OBJECT_NODE)); |
| 479 | pPrev->pNext = pTrav; |
| 480 | } |
| 481 | pTrav->object = object; |
| 482 | return pTrav; |
| 483 | } |
| 484 | |
| 485 | // Remove object binding performs 3 tasks: |
| 486 | // 1. Remove object node from Global Mem Obj mini LL of obj bindings & free it |
| 487 | // 2. Decrement refCount for Global Mem Obj |
| 488 | // 3. Clear Global Mem Obj ptr from Global Object Node |
| 489 | static XGL_BOOL clearObjectBinding(XGL_OBJECT object) |
| 490 | { |
| 491 | GLOBAL_OBJECT_NODE* pGlobalObjTrav = getGlobalObjectNode(object); |
| 492 | if (!pGlobalObjTrav) { |
| 493 | printf("MEM ERROR : Attempting to clear mem binding for object %p\n", object); |
| 494 | return XGL_FALSE; |
| 495 | } |
| 496 | if (!pGlobalObjTrav->pMemNode) { |
| 497 | printf("MEM WARN : Attempting to clear mem binding on obj %p but it has no binding.\n", (void*)object); |
| 498 | return XGL_FALSE; |
| 499 | } |
| 500 | MINI_NODE* pObjTrav = pGlobalObjTrav->pMemNode->pObjBindings; |
| 501 | MINI_NODE* pPrevObj = pObjTrav; |
| 502 | while (pObjTrav) { |
| 503 | if (object == pObjTrav->object) { |
| 504 | pPrevObj->pNext = pObjTrav->pNext; |
| 505 | // check if HEAD needs to be updated |
| 506 | if (pGlobalObjTrav->pMemNode->pObjBindings == pObjTrav) |
| 507 | pGlobalObjTrav->pMemNode->pObjBindings = pObjTrav->pNext; |
| 508 | free(pObjTrav); |
| 509 | pGlobalObjTrav->pMemNode->refCount--; |
| 510 | pGlobalObjTrav->pMemNode = NULL; |
| 511 | return XGL_TRUE; |
| 512 | } |
| 513 | pPrevObj = pObjTrav; |
| 514 | pObjTrav = pObjTrav->pNext; |
| 515 | } |
| 516 | printf("MEM ERROR : While trying to clear mem binding for object %p, unable to find mem ref %p\n", object, pGlobalObjTrav->pMemNode->mem); |
| 517 | return XGL_FALSE; |
| 518 | } |
| 519 | |
| 520 | // For NULL mem case, clear any previous binding Else... |
| 521 | // Make sure given object is in global object LL |
| 522 | // Add link from global object node to global memory node |
| 523 | // Add mini-object node & reference off of global obj node |
| 524 | // Return XGL_TRUE if addition is successful, XGL_FALSE otherwise |
| 525 | static XGL_BOOL updateObjectBinding(XGL_OBJECT object, XGL_GPU_MEMORY mem) |
| 526 | { |
| 527 | // Handle NULL case separately, just clear previous binding & decrement reference |
| 528 | if (mem == XGL_NULL_HANDLE) { |
| 529 | clearObjectBinding(object); |
| 530 | return XGL_TRUE; |
| 531 | } |
| 532 | // Find obj node or add it if we don't have one |
| 533 | GLOBAL_OBJECT_NODE* pGlobalObjTrav = getGlobalObjectNode(object); |
| 534 | if (!pGlobalObjTrav) |
| 535 | pGlobalObjTrav = insertGlobalObjectNode(object); |
| 536 | |
| 537 | // non-null case so should have real mem obj |
| 538 | GLOBAL_MEM_OBJ_NODE* pTrav = getGlobalMemNode(mem); |
| 539 | if (!pTrav) { |
| 540 | printf("MEM ERROR : While trying to bind mem for obj %p, couldn't find node for mem obj %p\n", (void*)object, (void*)mem); |
| 541 | return XGL_FALSE; |
| 542 | } |
| 543 | XGL_RESULT result = insertMiniNode(&pTrav->pObjBindings, object, &pTrav->refCount); |
| 544 | if (XGL_SUCCESS != result) |
| 545 | return result; |
| 546 | |
| 547 | if (pGlobalObjTrav->pMemNode) |
| 548 | printf("MEM INFO : Updating memory binding for object %p from mem obj %p to %p\n", object, pGlobalObjTrav->pMemNode->mem, mem); |
| 549 | pGlobalObjTrav->pMemNode = pTrav; |
| 550 | return XGL_TRUE; |
| 551 | } |
| 552 | // Print details of global Obj tracking list |
| 553 | static void printObjList() |
| 554 | { |
| 555 | GLOBAL_OBJECT_NODE* pGlobalObjTrav = pGlobalObjectHead; |
| 556 | if (!pGlobalObjTrav) { |
| 557 | printf("MEM INFO : Global Object list is empty :(\n"); |
| 558 | } |
| 559 | else { |
| 560 | printf("MEM INFO : Details of Global Object list w/ HEAD at %p\n", (void*)pGlobalObjTrav); |
| 561 | while (pGlobalObjTrav) { |
| 562 | printf(" GlobObjNode %p has object %p, pNext %p, pMemNode %p\n", pGlobalObjTrav, pGlobalObjTrav->object, pGlobalObjTrav->pNext, pGlobalObjTrav->pMemNode); |
| 563 | pGlobalObjTrav = pGlobalObjTrav->pNext; |
| 564 | } |
| 565 | } |
| 566 | } |
| 567 | // For given Object, get 'mem' obj that it's bound to or NULL if no binding |
| 568 | static XGL_GPU_MEMORY getMemBindingFromObject(const XGL_OBJECT object) |
| 569 | { |
| 570 | XGL_GPU_MEMORY mem = NULL; |
| 571 | GLOBAL_OBJECT_NODE* pObjNode = getGlobalObjectNode(object); |
| 572 | if (pObjNode) { |
| 573 | if (pObjNode->pMemNode) { |
| 574 | mem = pObjNode->pMemNode->mem; |
| 575 | } |
| 576 | else { |
| 577 | printf("MEM ERROR : Trying to get mem binding for object %p but object has no mem binding\n", (void*)object); |
| 578 | printObjList(); |
| 579 | } |
| 580 | } |
| 581 | else { |
| 582 | printf("MEM ERROR : Trying to get mem binding for object %p but no such object in global list\n", (void*)object); |
| 583 | printObjList(); |
| 584 | } |
| 585 | return mem; |
| 586 | } |
| 587 | // Print details of global Mem Obj list |
| 588 | static void printMemList() |
| 589 | { |
| 590 | GLOBAL_MEM_OBJ_NODE* pTrav = pGlobalMemObjHead; |
| 591 | if (!pTrav) { |
| 592 | printf("MEM INFO : Global Memory Object list is empty :(\n"); |
| 593 | } |
| 594 | else { |
| 595 | printf("MEM INFO : Details of Global Memory Object list w/ HEAD at %p\n", (void*)pTrav); |
| 596 | while (pTrav) { |
| 597 | printf(" ===MemObj Node at %p===\n", (void*)pTrav); |
| 598 | printf(" Mem object: %p\n", (void*)pTrav->mem); |
| 599 | printf(" Ref Count: %u\n", pTrav->refCount); |
| 600 | printf(" pNext Mem Obj Node: %p\n", (void*)pTrav->pNextGlobalNode); |
| 601 | printf(" Mem Alloc info:\n%s", xgl_print_xgl_memory_alloc_info(&pTrav->allocInfo, " ")); |
| 602 | MINI_NODE* pObjTrav = pTrav->pObjBindings; |
| 603 | if (!pObjTrav) |
| 604 | printf(" No XGL Object bindings\n"); |
| 605 | else { |
| 606 | printf(" XGL OBJECT Binding list w/ HEAD at %p:\n", pObjTrav); |
| 607 | while (pObjTrav) { |
| 608 | printf(" OBJ_NODE(%p): XGL OBJECT %p, pNext %p\n", pObjTrav, pObjTrav->object, pObjTrav->pNext); |
| 609 | pObjTrav = pObjTrav->pNext; |
| 610 | } |
| 611 | } |
| 612 | MINI_NODE* pCBTrav = pTrav->pCmdBufferBindings; |
| 613 | if (!pCBTrav) |
| 614 | printf(" No Command Buffer bindings\n"); |
| 615 | else { |
| 616 | printf(" XGL Command Buffer (CB) binding list w/ HEAD at %p:\n", pCBTrav); |
| 617 | while (pCBTrav) { |
| 618 | printf(" CB_NODE(%p): XGL CB %p, pNext %p\n", pCBTrav, pCBTrav->cmdBuffer, pCBTrav->pNext); |
| 619 | pCBTrav = pCBTrav->pNext; |
| 620 | } |
| 621 | } |
| 622 | pTrav = pTrav->pNextGlobalNode; |
| 623 | } |
| 624 | } |
| 625 | } |
| 626 | |
| 627 | static void printGlobalCB() |
| 628 | { |
| 629 | GLOBAL_CB_NODE* pTrav = pGlobalCBHead; |
| 630 | if (!pTrav) { |
| 631 | printf("MEM INFO : Global Command Buffer (CB) list is empty :(\n"); |
| 632 | } |
| 633 | else { |
| 634 | printf("MEM INFO : Details of Global CB list w/ HEAD at %p:\n", (void*)pTrav); |
| 635 | while (pTrav) { |
| 636 | printf(" Global CB Node (%p) has CB %p, fence %p, and pMemObjList %p\n", (void*)pTrav, (void*)pTrav->cmdBuffer, (void*)pTrav->fence, (void*)pTrav->pMemObjList); |
| 637 | MINI_NODE* pMemObjTrav = pTrav->pMemObjList; |
| 638 | while (pMemObjTrav) { |
| 639 | printf(" MEM_NODE(%p): Mem obj %p, pNext %p\n", (void*)pMemObjTrav, (void*)pMemObjTrav->mem, (void*)pMemObjTrav->pNext); |
| 640 | pMemObjTrav = pMemObjTrav->pNext; |
| 641 | } |
| 642 | pTrav = pTrav->pNextGlobalCBNode; |
| 643 | } |
| 644 | } |
| 645 | } |
| 646 | |
| 647 | static XGL_FENCE createLocalFence() |
| 648 | { |
| 649 | XGL_FENCE_CREATE_INFO fci; |
| 650 | fci.sType = XGL_STRUCTURE_TYPE_FENCE_CREATE_INFO; |
| 651 | fci.pNext = NULL; |
| 652 | fci.flags = 0; |
| 653 | XGL_FENCE fence; |
| 654 | nextTable.CreateFence(globalDevice, &fci, &fence); |
| 655 | return fence; |
| 656 | } |
| 657 | |
| 658 | static void initLayerTable() |
| 659 | { |
| 660 | GetProcAddrType fpNextGPA; |
| 661 | fpNextGPA = pCurObj->pGPA; |
| 662 | assert(fpNextGPA); |
| 663 | |
| 664 | GetProcAddrType fpGetProcAddr = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetProcAddr"); |
| 665 | nextTable.GetProcAddr = fpGetProcAddr; |
| 666 | InitAndEnumerateGpusType fpInitAndEnumerateGpus = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglInitAndEnumerateGpus"); |
| 667 | nextTable.InitAndEnumerateGpus = fpInitAndEnumerateGpus; |
| 668 | GetGpuInfoType fpGetGpuInfo = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetGpuInfo"); |
| 669 | nextTable.GetGpuInfo = fpGetGpuInfo; |
| 670 | CreateDeviceType fpCreateDevice = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateDevice"); |
| 671 | nextTable.CreateDevice = fpCreateDevice; |
| 672 | DestroyDeviceType fpDestroyDevice = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDestroyDevice"); |
| 673 | nextTable.DestroyDevice = fpDestroyDevice; |
| 674 | GetExtensionSupportType fpGetExtensionSupport = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetExtensionSupport"); |
| 675 | nextTable.GetExtensionSupport = fpGetExtensionSupport; |
| 676 | EnumerateLayersType fpEnumerateLayers = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglEnumerateLayers"); |
| 677 | nextTable.EnumerateLayers = fpEnumerateLayers; |
| 678 | GetDeviceQueueType fpGetDeviceQueue = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetDeviceQueue"); |
| 679 | nextTable.GetDeviceQueue = fpGetDeviceQueue; |
| 680 | QueueSubmitType fpQueueSubmit = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglQueueSubmit"); |
| 681 | nextTable.QueueSubmit = fpQueueSubmit; |
| 682 | QueueSetGlobalMemReferencesType fpQueueSetGlobalMemReferences = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglQueueSetGlobalMemReferences"); |
| 683 | nextTable.QueueSetGlobalMemReferences = fpQueueSetGlobalMemReferences; |
| 684 | QueueWaitIdleType fpQueueWaitIdle = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglQueueWaitIdle"); |
| 685 | nextTable.QueueWaitIdle = fpQueueWaitIdle; |
| 686 | DeviceWaitIdleType fpDeviceWaitIdle = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDeviceWaitIdle"); |
| 687 | nextTable.DeviceWaitIdle = fpDeviceWaitIdle; |
| 688 | GetMemoryHeapCountType fpGetMemoryHeapCount = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetMemoryHeapCount"); |
| 689 | nextTable.GetMemoryHeapCount = fpGetMemoryHeapCount; |
| 690 | GetMemoryHeapInfoType fpGetMemoryHeapInfo = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetMemoryHeapInfo"); |
| 691 | nextTable.GetMemoryHeapInfo = fpGetMemoryHeapInfo; |
| 692 | AllocMemoryType fpAllocMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglAllocMemory"); |
| 693 | nextTable.AllocMemory = fpAllocMemory; |
| 694 | FreeMemoryType fpFreeMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglFreeMemory"); |
| 695 | nextTable.FreeMemory = fpFreeMemory; |
| 696 | SetMemoryPriorityType fpSetMemoryPriority = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglSetMemoryPriority"); |
| 697 | nextTable.SetMemoryPriority = fpSetMemoryPriority; |
| 698 | MapMemoryType fpMapMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglMapMemory"); |
| 699 | nextTable.MapMemory = fpMapMemory; |
| 700 | UnmapMemoryType fpUnmapMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglUnmapMemory"); |
| 701 | nextTable.UnmapMemory = fpUnmapMemory; |
| 702 | PinSystemMemoryType fpPinSystemMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglPinSystemMemory"); |
| 703 | nextTable.PinSystemMemory = fpPinSystemMemory; |
| 704 | RemapVirtualMemoryPagesType fpRemapVirtualMemoryPages = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglRemapVirtualMemoryPages"); |
| 705 | nextTable.RemapVirtualMemoryPages = fpRemapVirtualMemoryPages; |
| 706 | GetMultiGpuCompatibilityType fpGetMultiGpuCompatibility = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetMultiGpuCompatibility"); |
| 707 | nextTable.GetMultiGpuCompatibility = fpGetMultiGpuCompatibility; |
| 708 | OpenSharedMemoryType fpOpenSharedMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglOpenSharedMemory"); |
| 709 | nextTable.OpenSharedMemory = fpOpenSharedMemory; |
| 710 | OpenSharedQueueSemaphoreType fpOpenSharedQueueSemaphore = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglOpenSharedQueueSemaphore"); |
| 711 | nextTable.OpenSharedQueueSemaphore = fpOpenSharedQueueSemaphore; |
| 712 | OpenPeerMemoryType fpOpenPeerMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglOpenPeerMemory"); |
| 713 | nextTable.OpenPeerMemory = fpOpenPeerMemory; |
| 714 | OpenPeerImageType fpOpenPeerImage = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglOpenPeerImage"); |
| 715 | nextTable.OpenPeerImage = fpOpenPeerImage; |
| 716 | DestroyObjectType fpDestroyObject = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDestroyObject"); |
| 717 | nextTable.DestroyObject = fpDestroyObject; |
| 718 | GetObjectInfoType fpGetObjectInfo = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetObjectInfo"); |
| 719 | nextTable.GetObjectInfo = fpGetObjectInfo; |
| 720 | BindObjectMemoryType fpBindObjectMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglBindObjectMemory"); |
| 721 | nextTable.BindObjectMemory = fpBindObjectMemory; |
| 722 | CreateFenceType fpCreateFence = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateFence"); |
| 723 | nextTable.CreateFence = fpCreateFence; |
| 724 | GetFenceStatusType fpGetFenceStatus = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetFenceStatus"); |
| 725 | nextTable.GetFenceStatus = fpGetFenceStatus; |
| 726 | WaitForFencesType fpWaitForFences = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglWaitForFences"); |
| 727 | nextTable.WaitForFences = fpWaitForFences; |
| 728 | CreateQueueSemaphoreType fpCreateQueueSemaphore = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateQueueSemaphore"); |
| 729 | nextTable.CreateQueueSemaphore = fpCreateQueueSemaphore; |
| 730 | SignalQueueSemaphoreType fpSignalQueueSemaphore = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglSignalQueueSemaphore"); |
| 731 | nextTable.SignalQueueSemaphore = fpSignalQueueSemaphore; |
| 732 | WaitQueueSemaphoreType fpWaitQueueSemaphore = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglWaitQueueSemaphore"); |
| 733 | nextTable.WaitQueueSemaphore = fpWaitQueueSemaphore; |
| 734 | CreateEventType fpCreateEvent = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateEvent"); |
| 735 | nextTable.CreateEvent = fpCreateEvent; |
| 736 | GetEventStatusType fpGetEventStatus = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetEventStatus"); |
| 737 | nextTable.GetEventStatus = fpGetEventStatus; |
| 738 | SetEventType fpSetEvent = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglSetEvent"); |
| 739 | nextTable.SetEvent = fpSetEvent; |
| 740 | ResetEventType fpResetEvent = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglResetEvent"); |
| 741 | nextTable.ResetEvent = fpResetEvent; |
| 742 | CreateQueryPoolType fpCreateQueryPool = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateQueryPool"); |
| 743 | nextTable.CreateQueryPool = fpCreateQueryPool; |
| 744 | GetQueryPoolResultsType fpGetQueryPoolResults = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetQueryPoolResults"); |
| 745 | nextTable.GetQueryPoolResults = fpGetQueryPoolResults; |
| 746 | GetFormatInfoType fpGetFormatInfo = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetFormatInfo"); |
| 747 | nextTable.GetFormatInfo = fpGetFormatInfo; |
| 748 | CreateImageType fpCreateImage = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateImage"); |
| 749 | nextTable.CreateImage = fpCreateImage; |
| 750 | GetImageSubresourceInfoType fpGetImageSubresourceInfo = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetImageSubresourceInfo"); |
| 751 | nextTable.GetImageSubresourceInfo = fpGetImageSubresourceInfo; |
| 752 | CreateImageViewType fpCreateImageView = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateImageView"); |
| 753 | nextTable.CreateImageView = fpCreateImageView; |
| 754 | CreateColorAttachmentViewType fpCreateColorAttachmentView = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateColorAttachmentView"); |
| 755 | nextTable.CreateColorAttachmentView = fpCreateColorAttachmentView; |
| 756 | CreateDepthStencilViewType fpCreateDepthStencilView = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateDepthStencilView"); |
| 757 | nextTable.CreateDepthStencilView = fpCreateDepthStencilView; |
| 758 | CreateShaderType fpCreateShader = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateShader"); |
| 759 | nextTable.CreateShader = fpCreateShader; |
| 760 | CreateGraphicsPipelineType fpCreateGraphicsPipeline = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateGraphicsPipeline"); |
| 761 | nextTable.CreateGraphicsPipeline = fpCreateGraphicsPipeline; |
| 762 | CreateComputePipelineType fpCreateComputePipeline = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateComputePipeline"); |
| 763 | nextTable.CreateComputePipeline = fpCreateComputePipeline; |
| 764 | StorePipelineType fpStorePipeline = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglStorePipeline"); |
| 765 | nextTable.StorePipeline = fpStorePipeline; |
| 766 | LoadPipelineType fpLoadPipeline = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglLoadPipeline"); |
| 767 | nextTable.LoadPipeline = fpLoadPipeline; |
| 768 | CreatePipelineDeltaType fpCreatePipelineDelta = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreatePipelineDelta"); |
| 769 | nextTable.CreatePipelineDelta = fpCreatePipelineDelta; |
| 770 | CreateSamplerType fpCreateSampler = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateSampler"); |
| 771 | nextTable.CreateSampler = fpCreateSampler; |
| 772 | CreateDescriptorSetType fpCreateDescriptorSet = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateDescriptorSet"); |
| 773 | nextTable.CreateDescriptorSet = fpCreateDescriptorSet; |
| 774 | BeginDescriptorSetUpdateType fpBeginDescriptorSetUpdate = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglBeginDescriptorSetUpdate"); |
| 775 | nextTable.BeginDescriptorSetUpdate = fpBeginDescriptorSetUpdate; |
| 776 | EndDescriptorSetUpdateType fpEndDescriptorSetUpdate = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglEndDescriptorSetUpdate"); |
| 777 | nextTable.EndDescriptorSetUpdate = fpEndDescriptorSetUpdate; |
| 778 | AttachSamplerDescriptorsType fpAttachSamplerDescriptors = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglAttachSamplerDescriptors"); |
| 779 | nextTable.AttachSamplerDescriptors = fpAttachSamplerDescriptors; |
| 780 | AttachImageViewDescriptorsType fpAttachImageViewDescriptors = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglAttachImageViewDescriptors"); |
| 781 | nextTable.AttachImageViewDescriptors = fpAttachImageViewDescriptors; |
| 782 | AttachMemoryViewDescriptorsType fpAttachMemoryViewDescriptors = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglAttachMemoryViewDescriptors"); |
| 783 | nextTable.AttachMemoryViewDescriptors = fpAttachMemoryViewDescriptors; |
| 784 | AttachNestedDescriptorsType fpAttachNestedDescriptors = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglAttachNestedDescriptors"); |
| 785 | nextTable.AttachNestedDescriptors = fpAttachNestedDescriptors; |
| 786 | ClearDescriptorSetSlotsType fpClearDescriptorSetSlots = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglClearDescriptorSetSlots"); |
| 787 | nextTable.ClearDescriptorSetSlots = fpClearDescriptorSetSlots; |
| 788 | CreateViewportStateType fpCreateViewportState = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateViewportState"); |
| 789 | nextTable.CreateViewportState = fpCreateViewportState; |
| 790 | CreateRasterStateType fpCreateRasterState = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateRasterState"); |
| 791 | nextTable.CreateRasterState = fpCreateRasterState; |
| 792 | CreateMsaaStateType fpCreateMsaaState = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateMsaaState"); |
| 793 | nextTable.CreateMsaaState = fpCreateMsaaState; |
| 794 | CreateColorBlendStateType fpCreateColorBlendState = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateColorBlendState"); |
| 795 | nextTable.CreateColorBlendState = fpCreateColorBlendState; |
| 796 | CreateDepthStencilStateType fpCreateDepthStencilState = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateDepthStencilState"); |
| 797 | nextTable.CreateDepthStencilState = fpCreateDepthStencilState; |
| 798 | CreateCommandBufferType fpCreateCommandBuffer = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateCommandBuffer"); |
| 799 | nextTable.CreateCommandBuffer = fpCreateCommandBuffer; |
| 800 | BeginCommandBufferType fpBeginCommandBuffer = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglBeginCommandBuffer"); |
| 801 | nextTable.BeginCommandBuffer = fpBeginCommandBuffer; |
| 802 | EndCommandBufferType fpEndCommandBuffer = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglEndCommandBuffer"); |
| 803 | nextTable.EndCommandBuffer = fpEndCommandBuffer; |
| 804 | ResetCommandBufferType fpResetCommandBuffer = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglResetCommandBuffer"); |
| 805 | nextTable.ResetCommandBuffer = fpResetCommandBuffer; |
| 806 | CmdBindPipelineType fpCmdBindPipeline = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindPipeline"); |
| 807 | nextTable.CmdBindPipeline = fpCmdBindPipeline; |
| 808 | CmdBindPipelineDeltaType fpCmdBindPipelineDelta = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindPipelineDelta"); |
| 809 | nextTable.CmdBindPipelineDelta = fpCmdBindPipelineDelta; |
| 810 | CmdBindStateObjectType fpCmdBindStateObject = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindStateObject"); |
| 811 | nextTable.CmdBindStateObject = fpCmdBindStateObject; |
| 812 | CmdBindDescriptorSetType fpCmdBindDescriptorSet = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindDescriptorSet"); |
| 813 | nextTable.CmdBindDescriptorSet = fpCmdBindDescriptorSet; |
| 814 | CmdBindDynamicMemoryViewType fpCmdBindDynamicMemoryView = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindDynamicMemoryView"); |
| 815 | nextTable.CmdBindDynamicMemoryView = fpCmdBindDynamicMemoryView; |
| 816 | CmdBindIndexDataType fpCmdBindIndexData = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindIndexData"); |
| 817 | nextTable.CmdBindIndexData = fpCmdBindIndexData; |
| 818 | CmdBindAttachmentsType fpCmdBindAttachments = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindAttachments"); |
| 819 | nextTable.CmdBindAttachments = fpCmdBindAttachments; |
| 820 | CmdPrepareMemoryRegionsType fpCmdPrepareMemoryRegions = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdPrepareMemoryRegions"); |
| 821 | nextTable.CmdPrepareMemoryRegions = fpCmdPrepareMemoryRegions; |
| 822 | CmdPrepareImagesType fpCmdPrepareImages = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdPrepareImages"); |
| 823 | nextTable.CmdPrepareImages = fpCmdPrepareImages; |
| 824 | CmdDrawType fpCmdDraw = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDraw"); |
| 825 | nextTable.CmdDraw = fpCmdDraw; |
| 826 | CmdDrawIndexedType fpCmdDrawIndexed = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDrawIndexed"); |
| 827 | nextTable.CmdDrawIndexed = fpCmdDrawIndexed; |
| 828 | CmdDrawIndirectType fpCmdDrawIndirect = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDrawIndirect"); |
| 829 | nextTable.CmdDrawIndirect = fpCmdDrawIndirect; |
| 830 | CmdDrawIndexedIndirectType fpCmdDrawIndexedIndirect = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDrawIndexedIndirect"); |
| 831 | nextTable.CmdDrawIndexedIndirect = fpCmdDrawIndexedIndirect; |
| 832 | CmdDispatchType fpCmdDispatch = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDispatch"); |
| 833 | nextTable.CmdDispatch = fpCmdDispatch; |
| 834 | CmdDispatchIndirectType fpCmdDispatchIndirect = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDispatchIndirect"); |
| 835 | nextTable.CmdDispatchIndirect = fpCmdDispatchIndirect; |
| 836 | CmdCopyMemoryType fpCmdCopyMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdCopyMemory"); |
| 837 | nextTable.CmdCopyMemory = fpCmdCopyMemory; |
| 838 | CmdCopyImageType fpCmdCopyImage = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdCopyImage"); |
| 839 | nextTable.CmdCopyImage = fpCmdCopyImage; |
| 840 | CmdCopyMemoryToImageType fpCmdCopyMemoryToImage = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdCopyMemoryToImage"); |
| 841 | nextTable.CmdCopyMemoryToImage = fpCmdCopyMemoryToImage; |
| 842 | CmdCopyImageToMemoryType fpCmdCopyImageToMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdCopyImageToMemory"); |
| 843 | nextTable.CmdCopyImageToMemory = fpCmdCopyImageToMemory; |
| 844 | CmdCloneImageDataType fpCmdCloneImageData = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdCloneImageData"); |
| 845 | nextTable.CmdCloneImageData = fpCmdCloneImageData; |
| 846 | CmdUpdateMemoryType fpCmdUpdateMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdUpdateMemory"); |
| 847 | nextTable.CmdUpdateMemory = fpCmdUpdateMemory; |
| 848 | CmdFillMemoryType fpCmdFillMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdFillMemory"); |
| 849 | nextTable.CmdFillMemory = fpCmdFillMemory; |
| 850 | CmdClearColorImageType fpCmdClearColorImage = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdClearColorImage"); |
| 851 | nextTable.CmdClearColorImage = fpCmdClearColorImage; |
| 852 | CmdClearColorImageRawType fpCmdClearColorImageRaw = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdClearColorImageRaw"); |
| 853 | nextTable.CmdClearColorImageRaw = fpCmdClearColorImageRaw; |
| 854 | CmdClearDepthStencilType fpCmdClearDepthStencil = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdClearDepthStencil"); |
| 855 | nextTable.CmdClearDepthStencil = fpCmdClearDepthStencil; |
| 856 | CmdResolveImageType fpCmdResolveImage = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdResolveImage"); |
| 857 | nextTable.CmdResolveImage = fpCmdResolveImage; |
| 858 | CmdSetEventType fpCmdSetEvent = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdSetEvent"); |
| 859 | nextTable.CmdSetEvent = fpCmdSetEvent; |
| 860 | CmdResetEventType fpCmdResetEvent = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdResetEvent"); |
| 861 | nextTable.CmdResetEvent = fpCmdResetEvent; |
| 862 | CmdMemoryAtomicType fpCmdMemoryAtomic = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdMemoryAtomic"); |
| 863 | nextTable.CmdMemoryAtomic = fpCmdMemoryAtomic; |
| 864 | CmdBeginQueryType fpCmdBeginQuery = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBeginQuery"); |
| 865 | nextTable.CmdBeginQuery = fpCmdBeginQuery; |
| 866 | CmdEndQueryType fpCmdEndQuery = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdEndQuery"); |
| 867 | nextTable.CmdEndQuery = fpCmdEndQuery; |
| 868 | CmdResetQueryPoolType fpCmdResetQueryPool = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdResetQueryPool"); |
| 869 | nextTable.CmdResetQueryPool = fpCmdResetQueryPool; |
| 870 | CmdWriteTimestampType fpCmdWriteTimestamp = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdWriteTimestamp"); |
| 871 | nextTable.CmdWriteTimestamp = fpCmdWriteTimestamp; |
| 872 | CmdInitAtomicCountersType fpCmdInitAtomicCounters = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdInitAtomicCounters"); |
| 873 | nextTable.CmdInitAtomicCounters = fpCmdInitAtomicCounters; |
| 874 | CmdLoadAtomicCountersType fpCmdLoadAtomicCounters = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdLoadAtomicCounters"); |
| 875 | nextTable.CmdLoadAtomicCounters = fpCmdLoadAtomicCounters; |
| 876 | CmdSaveAtomicCountersType fpCmdSaveAtomicCounters = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdSaveAtomicCounters"); |
| 877 | nextTable.CmdSaveAtomicCounters = fpCmdSaveAtomicCounters; |
| 878 | DbgSetValidationLevelType fpDbgSetValidationLevel = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDbgSetValidationLevel"); |
| 879 | nextTable.DbgSetValidationLevel = fpDbgSetValidationLevel; |
| 880 | DbgRegisterMsgCallbackType fpDbgRegisterMsgCallback = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDbgRegisterMsgCallback"); |
| 881 | nextTable.DbgRegisterMsgCallback = fpDbgRegisterMsgCallback; |
| 882 | DbgUnregisterMsgCallbackType fpDbgUnregisterMsgCallback = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDbgUnregisterMsgCallback"); |
| 883 | nextTable.DbgUnregisterMsgCallback = fpDbgUnregisterMsgCallback; |
| 884 | DbgSetMessageFilterType fpDbgSetMessageFilter = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDbgSetMessageFilter"); |
| 885 | nextTable.DbgSetMessageFilter = fpDbgSetMessageFilter; |
| 886 | DbgSetObjectTagType fpDbgSetObjectTag = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDbgSetObjectTag"); |
| 887 | nextTable.DbgSetObjectTag = fpDbgSetObjectTag; |
| 888 | DbgSetGlobalOptionType fpDbgSetGlobalOption = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDbgSetGlobalOption"); |
| 889 | nextTable.DbgSetGlobalOption = fpDbgSetGlobalOption; |
| 890 | DbgSetDeviceOptionType fpDbgSetDeviceOption = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDbgSetDeviceOption"); |
| 891 | nextTable.DbgSetDeviceOption = fpDbgSetDeviceOption; |
| 892 | CmdDbgMarkerBeginType fpCmdDbgMarkerBegin = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDbgMarkerBegin"); |
| 893 | nextTable.CmdDbgMarkerBegin = fpCmdDbgMarkerBegin; |
| 894 | CmdDbgMarkerEndType fpCmdDbgMarkerEnd = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDbgMarkerEnd"); |
| 895 | nextTable.CmdDbgMarkerEnd = fpCmdDbgMarkerEnd; |
| 896 | WsiX11AssociateConnectionType fpWsiX11AssociateConnection = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglWsiX11AssociateConnection"); |
| 897 | nextTable.WsiX11AssociateConnection = fpWsiX11AssociateConnection; |
| 898 | WsiX11GetMSCType fpWsiX11GetMSC = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglWsiX11GetMSC"); |
| 899 | nextTable.WsiX11GetMSC = fpWsiX11GetMSC; |
| 900 | WsiX11CreatePresentableImageType fpWsiX11CreatePresentableImage = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglWsiX11CreatePresentableImage"); |
| 901 | nextTable.WsiX11CreatePresentableImage = fpWsiX11CreatePresentableImage; |
| 902 | WsiX11QueuePresentType fpWsiX11QueuePresent = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglWsiX11QueuePresent"); |
| 903 | nextTable.WsiX11QueuePresent = fpWsiX11QueuePresent; |
| 904 | } |
| 905 | |
| 906 | |
| 907 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetGpuInfo(XGL_PHYSICAL_GPU gpu, XGL_PHYSICAL_GPU_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData) |
| 908 | { |
| 909 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 910 | pCurObj = gpuw; |
| 911 | pthread_once(&tabOnce, initLayerTable); |
| 912 | XGL_RESULT result = nextTable.GetGpuInfo((XGL_PHYSICAL_GPU)gpuw->nextObject, infoType, pDataSize, pData); |
| 913 | return result; |
| 914 | } |
| 915 | |
| 916 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateDevice(XGL_PHYSICAL_GPU gpu, const XGL_DEVICE_CREATE_INFO* pCreateInfo, XGL_DEVICE* pDevice) |
| 917 | { |
| 918 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 919 | pCurObj = gpuw; |
| 920 | pthread_once(&tabOnce, initLayerTable); |
| 921 | XGL_RESULT result = nextTable.CreateDevice((XGL_PHYSICAL_GPU)gpuw->nextObject, pCreateInfo, pDevice); |
| 922 | // Save off device in case we need it to create Fences |
| 923 | globalDevice = *pDevice; |
| 924 | return result; |
| 925 | } |
| 926 | |
| 927 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDestroyDevice(XGL_DEVICE device) |
| 928 | { |
| 929 | printf("MEM INFO : Printing List details prior to xglDestroyDevice()\n"); |
| 930 | printMemList(); |
| 931 | printGlobalCB(); |
| 932 | printObjList(); |
| 933 | if (XGL_FALSE == deleteGlobalCBList()) |
| 934 | printf("MEM ERROR : Issue deleting global CB list in xglDestroyDevice()\n"); |
| 935 | XGL_RESULT result = nextTable.DestroyDevice(device); |
| 936 | return result; |
| 937 | } |
| 938 | |
| 939 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetExtensionSupport(XGL_PHYSICAL_GPU gpu, const XGL_CHAR* pExtName) |
| 940 | { |
| 941 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 942 | pCurObj = gpuw; |
| 943 | pthread_once(&tabOnce, initLayerTable); |
| 944 | XGL_RESULT result = nextTable.GetExtensionSupport((XGL_PHYSICAL_GPU)gpuw->nextObject, pExtName); |
| 945 | return result; |
| 946 | } |
| 947 | |
| 948 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, XGL_CHAR* const* pOutLayers, XGL_SIZE * pOutLayerCount) |
| 949 | { |
| 950 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 951 | pCurObj = gpuw; |
| 952 | pthread_once(&tabOnce, initLayerTable); |
| 953 | XGL_RESULT result = nextTable.EnumerateLayers((XGL_PHYSICAL_GPU)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayers, pOutLayerCount); |
| 954 | return result; |
| 955 | } |
| 956 | |
| 957 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetDeviceQueue(XGL_DEVICE device, XGL_QUEUE_TYPE queueType, XGL_UINT queueIndex, XGL_QUEUE* pQueue) |
| 958 | { |
| 959 | XGL_RESULT result = nextTable.GetDeviceQueue(device, queueType, queueIndex, pQueue); |
| 960 | return result; |
| 961 | } |
| 962 | |
| 963 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglQueueSubmit(XGL_QUEUE queue, XGL_UINT cmdBufferCount, const XGL_CMD_BUFFER* pCmdBuffers, XGL_UINT memRefCount, const XGL_MEMORY_REF* pMemRefs, XGL_FENCE fence) |
| 964 | { |
| 965 | // TODO : Need to track fence and clear mem references when fence clears |
| 966 | XGL_FENCE localFence = fence; |
| 967 | if (XGL_NULL_HANDLE == fence) { // allocate our own fence to track cmd buffer |
| 968 | localFence = createLocalFence(); |
| 969 | } |
| 970 | // TODO : Verify that the list of memory references here matches what the cmd buffers require |
| 971 | printf("MEM INFO : In xglQueueSubmit(), checking %u cmdBuffers with %u memRefs\n", cmdBufferCount, memRefCount); |
| 972 | printMemList(); |
| 973 | printGlobalCB(); |
| 974 | for (uint32_t i = 0; i < cmdBufferCount; i++) { |
| 975 | setCBFence(pCmdBuffers[i], localFence); |
| 976 | printf("MEM INFO : Verifying mem refs for CB %p\n", pCmdBuffers[i]); |
| 977 | if (XGL_FALSE == validateCBMemRef(pCmdBuffers[i], memRefCount, pMemRefs)) { |
| 978 | printf("MEM ERROR : Unable to verify memory references for CB %p\n", (void*)pCmdBuffers[i]); |
| 979 | } |
| 980 | } |
| 981 | printGlobalCB(); |
| 982 | XGL_RESULT result = nextTable.QueueSubmit(queue, cmdBufferCount, pCmdBuffers, memRefCount, pMemRefs, localFence); |
| 983 | return result; |
| 984 | } |
| 985 | |
| 986 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglQueueSetGlobalMemReferences(XGL_QUEUE queue, XGL_UINT memRefCount, const XGL_MEMORY_REF* pMemRefs) |
| 987 | { |
| 988 | // TODO : Use global mem references as part of list checked on QueueSubmit above |
| 989 | XGL_RESULT result = nextTable.QueueSetGlobalMemReferences(queue, memRefCount, pMemRefs); |
| 990 | return result; |
| 991 | } |
| 992 | |
| 993 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglQueueWaitIdle(XGL_QUEUE queue) |
| 994 | { |
| 995 | XGL_RESULT result = nextTable.QueueWaitIdle(queue); |
| 996 | return result; |
| 997 | } |
| 998 | |
| 999 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDeviceWaitIdle(XGL_DEVICE device) |
| 1000 | { |
| 1001 | XGL_RESULT result = nextTable.DeviceWaitIdle(device); |
| 1002 | return result; |
| 1003 | } |
| 1004 | |
| 1005 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetMemoryHeapCount(XGL_DEVICE device, XGL_UINT* pCount) |
| 1006 | { |
| 1007 | // TODO : Track memory stats here |
| 1008 | XGL_RESULT result = nextTable.GetMemoryHeapCount(device, pCount); |
| 1009 | return result; |
| 1010 | } |
| 1011 | |
| 1012 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetMemoryHeapInfo(XGL_DEVICE device, XGL_UINT heapId, XGL_MEMORY_HEAP_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData) |
| 1013 | { |
| 1014 | // TODO : Track memory stats here |
| 1015 | XGL_RESULT result = nextTable.GetMemoryHeapInfo(device, heapId, infoType, pDataSize, pData); |
| 1016 | return result; |
| 1017 | } |
| 1018 | |
| 1019 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglAllocMemory(XGL_DEVICE device, const XGL_MEMORY_ALLOC_INFO* pAllocInfo, XGL_GPU_MEMORY* pMem) |
| 1020 | { |
| 1021 | XGL_RESULT result = nextTable.AllocMemory(device, pAllocInfo, pMem); |
| 1022 | // TODO : Track allocations and overall size here |
| 1023 | insertGlobalMemObj(*pMem, pAllocInfo); |
| 1024 | printMemList(); |
| 1025 | return result; |
| 1026 | } |
| 1027 | |
| 1028 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglFreeMemory(XGL_GPU_MEMORY mem) |
| 1029 | { |
| 1030 | // TODO : Pick up frees here |
| 1031 | // Make sure mem object is unbound from any other objects |
| 1032 | // Make sure mem object not referenced by any queued command buffers |
| 1033 | if (XGL_FALSE == freeMemNode(mem)) |
| 1034 | printf("MEM ERROR : Issue while freeing mem obj %p\n", (void*)mem); |
| 1035 | |
| 1036 | printMemList(); |
| 1037 | printObjList(); |
| 1038 | printGlobalCB(); |
| 1039 | XGL_RESULT result = nextTable.FreeMemory(mem); |
| 1040 | return result; |
| 1041 | } |
| 1042 | |
| 1043 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglSetMemoryPriority(XGL_GPU_MEMORY mem, XGL_MEMORY_PRIORITY priority) |
| 1044 | { |
| 1045 | // TODO : Update tracking for this alloc |
| 1046 | // Make sure memory is not pinned, which can't have priority set |
| 1047 | XGL_RESULT result = nextTable.SetMemoryPriority(mem, priority); |
| 1048 | return result; |
| 1049 | } |
| 1050 | |
| 1051 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglMapMemory(XGL_GPU_MEMORY mem, XGL_FLAGS flags, XGL_VOID** ppData) |
| 1052 | { |
| 1053 | // TODO : Track when memory is mapped |
| 1054 | XGL_RESULT result = nextTable.MapMemory(mem, flags, ppData); |
| 1055 | return result; |
| 1056 | } |
| 1057 | |
| 1058 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglUnmapMemory(XGL_GPU_MEMORY mem) |
| 1059 | { |
| 1060 | // TODO : Track as memory gets unmapped, do we want to check what changed following map? |
| 1061 | // Make sure that memory was ever mapped to begin with |
| 1062 | XGL_RESULT result = nextTable.UnmapMemory(mem); |
| 1063 | return result; |
| 1064 | } |
| 1065 | |
| 1066 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglPinSystemMemory(XGL_DEVICE device, const XGL_VOID* pSysMem, XGL_SIZE memSize, XGL_GPU_MEMORY* pMem) |
| 1067 | { |
| 1068 | // TODO : Track this |
| 1069 | // Verify that memory is actually pinnable |
| 1070 | XGL_RESULT result = nextTable.PinSystemMemory(device, pSysMem, memSize, pMem); |
| 1071 | return result; |
| 1072 | } |
| 1073 | |
| 1074 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglRemapVirtualMemoryPages(XGL_DEVICE device, XGL_UINT rangeCount, const XGL_VIRTUAL_MEMORY_REMAP_RANGE* pRanges, XGL_UINT preWaitSemaphoreCount, const XGL_QUEUE_SEMAPHORE* pPreWaitSemaphores, XGL_UINT postSignalSemaphoreCount, const XGL_QUEUE_SEMAPHORE* pPostSignalSemaphores) |
| 1075 | { |
| 1076 | // TODO : Track this |
| 1077 | XGL_RESULT result = nextTable.RemapVirtualMemoryPages(device, rangeCount, pRanges, preWaitSemaphoreCount, pPreWaitSemaphores, postSignalSemaphoreCount, pPostSignalSemaphores); |
| 1078 | return result; |
| 1079 | } |
| 1080 | |
| 1081 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetMultiGpuCompatibility(XGL_PHYSICAL_GPU gpu0, XGL_PHYSICAL_GPU gpu1, XGL_GPU_COMPATIBILITY_INFO* pInfo) |
| 1082 | { |
| 1083 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu0; |
| 1084 | pCurObj = gpuw; |
| 1085 | pthread_once(&tabOnce, initLayerTable); |
| 1086 | XGL_RESULT result = nextTable.GetMultiGpuCompatibility((XGL_PHYSICAL_GPU)gpuw->nextObject, gpu1, pInfo); |
| 1087 | return result; |
| 1088 | } |
| 1089 | |
| 1090 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglOpenSharedMemory(XGL_DEVICE device, const XGL_MEMORY_OPEN_INFO* pOpenInfo, XGL_GPU_MEMORY* pMem) |
| 1091 | { |
| 1092 | // TODO : Track this |
| 1093 | XGL_RESULT result = nextTable.OpenSharedMemory(device, pOpenInfo, pMem); |
| 1094 | return result; |
| 1095 | } |
| 1096 | |
| 1097 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglOpenSharedQueueSemaphore(XGL_DEVICE device, const XGL_QUEUE_SEMAPHORE_OPEN_INFO* pOpenInfo, XGL_QUEUE_SEMAPHORE* pSemaphore) |
| 1098 | { |
| 1099 | XGL_RESULT result = nextTable.OpenSharedQueueSemaphore(device, pOpenInfo, pSemaphore); |
| 1100 | return result; |
| 1101 | } |
| 1102 | |
| 1103 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglOpenPeerMemory(XGL_DEVICE device, const XGL_PEER_MEMORY_OPEN_INFO* pOpenInfo, XGL_GPU_MEMORY* pMem) |
| 1104 | { |
| 1105 | // TODO : Track this |
| 1106 | XGL_RESULT result = nextTable.OpenPeerMemory(device, pOpenInfo, pMem); |
| 1107 | return result; |
| 1108 | } |
| 1109 | |
| 1110 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglOpenPeerImage(XGL_DEVICE device, const XGL_PEER_IMAGE_OPEN_INFO* pOpenInfo, XGL_IMAGE* pImage, XGL_GPU_MEMORY* pMem) |
| 1111 | { |
| 1112 | // TODO : Track this |
| 1113 | XGL_RESULT result = nextTable.OpenPeerImage(device, pOpenInfo, pImage, pMem); |
| 1114 | return result; |
| 1115 | } |
| 1116 | |
| 1117 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDestroyObject(XGL_OBJECT object) |
| 1118 | { |
| 1119 | // TODO : Verify that no memory is bound to this object at time of destruction |
| 1120 | GLOBAL_OBJECT_NODE* pTrav = getGlobalObjectNode(object); |
| 1121 | if (pTrav) { |
| 1122 | if (pTrav->pMemNode) { |
| 1123 | printf("MEM ERROR : Destroying obj %p that is still bound to memory object %p\n", object, (void*)pTrav->pMemNode->mem); |
| 1124 | printf("MEM ERROR : You should first clear binding by calling xglBindObjectMemory(%p, 0, XGL_NULL_HANDLE)\n", object); |
| 1125 | clearObjectBinding(object); |
| 1126 | } |
| 1127 | if (pGlobalObjectHead == pTrav) // update HEAD if needed |
| 1128 | pGlobalObjectHead = pTrav->pNext; |
| 1129 | // Delete the obj node |
| 1130 | free(pTrav); |
| 1131 | } |
| 1132 | XGL_RESULT result = nextTable.DestroyObject(object); |
| 1133 | return result; |
| 1134 | } |
| 1135 | |
| 1136 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetObjectInfo(XGL_BASE_OBJECT object, XGL_OBJECT_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData) |
| 1137 | { |
| 1138 | // TODO : What to track here? |
| 1139 | // Could potentially save returned mem requirements and validate values passed into BindObjectMemory for this object |
| 1140 | XGL_RESULT result = nextTable.GetObjectInfo(object, infoType, pDataSize, pData); |
| 1141 | return result; |
| 1142 | } |
| 1143 | |
| 1144 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglBindObjectMemory(XGL_OBJECT object, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset) |
| 1145 | { |
| 1146 | XGL_RESULT result = nextTable.BindObjectMemory(object, mem, offset); |
| 1147 | // Track objects tied to memory |
| 1148 | if (XGL_FALSE == updateObjectBinding(object, mem)) |
| 1149 | printf("MEM ERROR : Unable to set object %p binding to mem obj %p\n", (void*)object, (void*)mem); |
| 1150 | printObjList(); |
| 1151 | printMemList(); |
| 1152 | return result; |
| 1153 | } |
| 1154 | |
| 1155 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateFence(XGL_DEVICE device, const XGL_FENCE_CREATE_INFO* pCreateInfo, XGL_FENCE* pFence) |
| 1156 | { |
| 1157 | XGL_RESULT result = nextTable.CreateFence(device, pCreateInfo, pFence); |
| 1158 | return result; |
| 1159 | } |
| 1160 | |
| 1161 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetFenceStatus(XGL_FENCE fence) |
| 1162 | { |
| 1163 | XGL_RESULT result = nextTable.GetFenceStatus(fence); |
| 1164 | return result; |
| 1165 | } |
| 1166 | |
| 1167 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWaitForFences(XGL_DEVICE device, XGL_UINT fenceCount, const XGL_FENCE* pFences, XGL_BOOL waitAll, XGL_UINT64 timeout) |
| 1168 | { |
| 1169 | XGL_RESULT result = nextTable.WaitForFences(device, fenceCount, pFences, waitAll, timeout); |
| 1170 | return result; |
| 1171 | } |
| 1172 | |
| 1173 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateQueueSemaphore(XGL_DEVICE device, const XGL_QUEUE_SEMAPHORE_CREATE_INFO* pCreateInfo, XGL_QUEUE_SEMAPHORE* pSemaphore) |
| 1174 | { |
| 1175 | XGL_RESULT result = nextTable.CreateQueueSemaphore(device, pCreateInfo, pSemaphore); |
| 1176 | return result; |
| 1177 | } |
| 1178 | |
| 1179 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglSignalQueueSemaphore(XGL_QUEUE queue, XGL_QUEUE_SEMAPHORE semaphore) |
| 1180 | { |
| 1181 | XGL_RESULT result = nextTable.SignalQueueSemaphore(queue, semaphore); |
| 1182 | return result; |
| 1183 | } |
| 1184 | |
| 1185 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWaitQueueSemaphore(XGL_QUEUE queue, XGL_QUEUE_SEMAPHORE semaphore) |
| 1186 | { |
| 1187 | XGL_RESULT result = nextTable.WaitQueueSemaphore(queue, semaphore); |
| 1188 | return result; |
| 1189 | } |
| 1190 | |
| 1191 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateEvent(XGL_DEVICE device, const XGL_EVENT_CREATE_INFO* pCreateInfo, XGL_EVENT* pEvent) |
| 1192 | { |
| 1193 | XGL_RESULT result = nextTable.CreateEvent(device, pCreateInfo, pEvent); |
| 1194 | return result; |
| 1195 | } |
| 1196 | |
| 1197 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetEventStatus(XGL_EVENT event) |
| 1198 | { |
| 1199 | XGL_RESULT result = nextTable.GetEventStatus(event); |
| 1200 | return result; |
| 1201 | } |
| 1202 | |
| 1203 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglSetEvent(XGL_EVENT event) |
| 1204 | { |
| 1205 | XGL_RESULT result = nextTable.SetEvent(event); |
| 1206 | return result; |
| 1207 | } |
| 1208 | |
| 1209 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglResetEvent(XGL_EVENT event) |
| 1210 | { |
| 1211 | XGL_RESULT result = nextTable.ResetEvent(event); |
| 1212 | return result; |
| 1213 | } |
| 1214 | |
| 1215 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateQueryPool(XGL_DEVICE device, const XGL_QUERY_POOL_CREATE_INFO* pCreateInfo, XGL_QUERY_POOL* pQueryPool) |
| 1216 | { |
| 1217 | XGL_RESULT result = nextTable.CreateQueryPool(device, pCreateInfo, pQueryPool); |
| 1218 | return result; |
| 1219 | } |
| 1220 | |
| 1221 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetQueryPoolResults(XGL_QUERY_POOL queryPool, XGL_UINT startQuery, XGL_UINT queryCount, XGL_SIZE* pDataSize, XGL_VOID* pData) |
| 1222 | { |
| 1223 | XGL_RESULT result = nextTable.GetQueryPoolResults(queryPool, startQuery, queryCount, pDataSize, pData); |
| 1224 | return result; |
| 1225 | } |
| 1226 | |
| 1227 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetFormatInfo(XGL_DEVICE device, XGL_FORMAT format, XGL_FORMAT_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData) |
| 1228 | { |
| 1229 | XGL_RESULT result = nextTable.GetFormatInfo(device, format, infoType, pDataSize, pData); |
| 1230 | return result; |
| 1231 | } |
| 1232 | |
| 1233 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateImage(XGL_DEVICE device, const XGL_IMAGE_CREATE_INFO* pCreateInfo, XGL_IMAGE* pImage) |
| 1234 | { |
| 1235 | XGL_RESULT result = nextTable.CreateImage(device, pCreateInfo, pImage); |
| 1236 | return result; |
| 1237 | } |
| 1238 | |
| 1239 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetImageSubresourceInfo(XGL_IMAGE image, const XGL_IMAGE_SUBRESOURCE* pSubresource, XGL_SUBRESOURCE_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData) |
| 1240 | { |
| 1241 | XGL_RESULT result = nextTable.GetImageSubresourceInfo(image, pSubresource, infoType, pDataSize, pData); |
| 1242 | return result; |
| 1243 | } |
| 1244 | |
| 1245 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateImageView(XGL_DEVICE device, const XGL_IMAGE_VIEW_CREATE_INFO* pCreateInfo, XGL_IMAGE_VIEW* pView) |
| 1246 | { |
| 1247 | XGL_RESULT result = nextTable.CreateImageView(device, pCreateInfo, pView); |
| 1248 | return result; |
| 1249 | } |
| 1250 | |
| 1251 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateColorAttachmentView(XGL_DEVICE device, const XGL_COLOR_ATTACHMENT_VIEW_CREATE_INFO* pCreateInfo, XGL_COLOR_ATTACHMENT_VIEW* pView) |
| 1252 | { |
| 1253 | XGL_RESULT result = nextTable.CreateColorAttachmentView(device, pCreateInfo, pView); |
| 1254 | return result; |
| 1255 | } |
| 1256 | |
| 1257 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateDepthStencilView(XGL_DEVICE device, const XGL_DEPTH_STENCIL_VIEW_CREATE_INFO* pCreateInfo, XGL_DEPTH_STENCIL_VIEW* pView) |
| 1258 | { |
| 1259 | XGL_RESULT result = nextTable.CreateDepthStencilView(device, pCreateInfo, pView); |
| 1260 | return result; |
| 1261 | } |
| 1262 | |
| 1263 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateShader(XGL_DEVICE device, const XGL_SHADER_CREATE_INFO* pCreateInfo, XGL_SHADER* pShader) |
| 1264 | { |
| 1265 | XGL_RESULT result = nextTable.CreateShader(device, pCreateInfo, pShader); |
| 1266 | return result; |
| 1267 | } |
| 1268 | |
| 1269 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateGraphicsPipeline(XGL_DEVICE device, const XGL_GRAPHICS_PIPELINE_CREATE_INFO* pCreateInfo, XGL_PIPELINE* pPipeline) |
| 1270 | { |
| 1271 | XGL_RESULT result = nextTable.CreateGraphicsPipeline(device, pCreateInfo, pPipeline); |
| 1272 | return result; |
| 1273 | } |
| 1274 | |
| 1275 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateComputePipeline(XGL_DEVICE device, const XGL_COMPUTE_PIPELINE_CREATE_INFO* pCreateInfo, XGL_PIPELINE* pPipeline) |
| 1276 | { |
| 1277 | XGL_RESULT result = nextTable.CreateComputePipeline(device, pCreateInfo, pPipeline); |
| 1278 | return result; |
| 1279 | } |
| 1280 | |
| 1281 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglStorePipeline(XGL_PIPELINE pipeline, XGL_SIZE* pDataSize, XGL_VOID* pData) |
| 1282 | { |
| 1283 | XGL_RESULT result = nextTable.StorePipeline(pipeline, pDataSize, pData); |
| 1284 | return result; |
| 1285 | } |
| 1286 | |
| 1287 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglLoadPipeline(XGL_DEVICE device, XGL_SIZE dataSize, const XGL_VOID* pData, XGL_PIPELINE* pPipeline) |
| 1288 | { |
| 1289 | XGL_RESULT result = nextTable.LoadPipeline(device, dataSize, pData, pPipeline); |
| 1290 | return result; |
| 1291 | } |
| 1292 | |
| 1293 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreatePipelineDelta(XGL_DEVICE device, XGL_PIPELINE p1, XGL_PIPELINE p2, XGL_PIPELINE_DELTA* delta) |
| 1294 | { |
| 1295 | XGL_RESULT result = nextTable.CreatePipelineDelta(device, p1, p2, delta); |
| 1296 | return result; |
| 1297 | } |
| 1298 | |
| 1299 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateSampler(XGL_DEVICE device, const XGL_SAMPLER_CREATE_INFO* pCreateInfo, XGL_SAMPLER* pSampler) |
| 1300 | { |
| 1301 | XGL_RESULT result = nextTable.CreateSampler(device, pCreateInfo, pSampler); |
| 1302 | return result; |
| 1303 | } |
| 1304 | |
| 1305 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateDescriptorSet(XGL_DEVICE device, const XGL_DESCRIPTOR_SET_CREATE_INFO* pCreateInfo, XGL_DESCRIPTOR_SET* pDescriptorSet) |
| 1306 | { |
| 1307 | XGL_RESULT result = nextTable.CreateDescriptorSet(device, pCreateInfo, pDescriptorSet); |
| 1308 | return result; |
| 1309 | } |
| 1310 | |
| 1311 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglBeginDescriptorSetUpdate(XGL_DESCRIPTOR_SET descriptorSet) |
| 1312 | { |
| 1313 | nextTable.BeginDescriptorSetUpdate(descriptorSet); |
| 1314 | } |
| 1315 | |
| 1316 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglEndDescriptorSetUpdate(XGL_DESCRIPTOR_SET descriptorSet) |
| 1317 | { |
| 1318 | nextTable.EndDescriptorSetUpdate(descriptorSet); |
| 1319 | } |
| 1320 | |
| 1321 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglAttachSamplerDescriptors(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_SAMPLER* pSamplers) |
| 1322 | { |
| 1323 | nextTable.AttachSamplerDescriptors(descriptorSet, startSlot, slotCount, pSamplers); |
| 1324 | } |
| 1325 | |
| 1326 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglAttachImageViewDescriptors(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_IMAGE_VIEW_ATTACH_INFO* pImageViews) |
| 1327 | { |
| 1328 | nextTable.AttachImageViewDescriptors(descriptorSet, startSlot, slotCount, pImageViews); |
| 1329 | } |
| 1330 | |
| 1331 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglAttachMemoryViewDescriptors(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_MEMORY_VIEW_ATTACH_INFO* pMemViews) |
| 1332 | { |
| 1333 | nextTable.AttachMemoryViewDescriptors(descriptorSet, startSlot, slotCount, pMemViews); |
| 1334 | } |
| 1335 | |
| 1336 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglAttachNestedDescriptors(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_DESCRIPTOR_SET_ATTACH_INFO* pNestedDescriptorSets) |
| 1337 | { |
| 1338 | nextTable.AttachNestedDescriptors(descriptorSet, startSlot, slotCount, pNestedDescriptorSets); |
| 1339 | } |
| 1340 | |
| 1341 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglClearDescriptorSetSlots(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount) |
| 1342 | { |
| 1343 | nextTable.ClearDescriptorSetSlots(descriptorSet, startSlot, slotCount); |
| 1344 | } |
| 1345 | |
| 1346 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateViewportState(XGL_DEVICE device, const XGL_VIEWPORT_STATE_CREATE_INFO* pCreateInfo, XGL_VIEWPORT_STATE_OBJECT* pState) |
| 1347 | { |
| 1348 | XGL_RESULT result = nextTable.CreateViewportState(device, pCreateInfo, pState); |
| 1349 | return result; |
| 1350 | } |
| 1351 | |
| 1352 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateRasterState(XGL_DEVICE device, const XGL_RASTER_STATE_CREATE_INFO* pCreateInfo, XGL_RASTER_STATE_OBJECT* pState) |
| 1353 | { |
| 1354 | XGL_RESULT result = nextTable.CreateRasterState(device, pCreateInfo, pState); |
| 1355 | return result; |
| 1356 | } |
| 1357 | |
| 1358 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateMsaaState(XGL_DEVICE device, const XGL_MSAA_STATE_CREATE_INFO* pCreateInfo, XGL_MSAA_STATE_OBJECT* pState) |
| 1359 | { |
| 1360 | XGL_RESULT result = nextTable.CreateMsaaState(device, pCreateInfo, pState); |
| 1361 | return result; |
| 1362 | } |
| 1363 | |
| 1364 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateColorBlendState(XGL_DEVICE device, const XGL_COLOR_BLEND_STATE_CREATE_INFO* pCreateInfo, XGL_COLOR_BLEND_STATE_OBJECT* pState) |
| 1365 | { |
| 1366 | XGL_RESULT result = nextTable.CreateColorBlendState(device, pCreateInfo, pState); |
| 1367 | return result; |
| 1368 | } |
| 1369 | |
| 1370 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateDepthStencilState(XGL_DEVICE device, const XGL_DEPTH_STENCIL_STATE_CREATE_INFO* pCreateInfo, XGL_DEPTH_STENCIL_STATE_OBJECT* pState) |
| 1371 | { |
| 1372 | XGL_RESULT result = nextTable.CreateDepthStencilState(device, pCreateInfo, pState); |
| 1373 | return result; |
| 1374 | } |
| 1375 | |
| 1376 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateCommandBuffer(XGL_DEVICE device, const XGL_CMD_BUFFER_CREATE_INFO* pCreateInfo, XGL_CMD_BUFFER* pCmdBuffer) |
| 1377 | { |
| 1378 | XGL_RESULT result = nextTable.CreateCommandBuffer(device, pCreateInfo, pCmdBuffer); |
| 1379 | // At time of cmd buffer creation, create global cmd buffer node for the returned cmd buffer |
| 1380 | if (*pCmdBuffer) |
| 1381 | insertGlobalCB(*pCmdBuffer); |
| 1382 | printGlobalCB(); |
| 1383 | return result; |
| 1384 | } |
| 1385 | |
| 1386 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglBeginCommandBuffer(XGL_CMD_BUFFER cmdBuffer, XGL_FLAGS flags) |
| 1387 | { |
| 1388 | // This implicitly resets the Cmd Buffer so clear memory references |
| 1389 | freeCBBindings(cmdBuffer); |
| 1390 | XGL_RESULT result = nextTable.BeginCommandBuffer(cmdBuffer, flags); |
| 1391 | return result; |
| 1392 | } |
| 1393 | |
| 1394 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglEndCommandBuffer(XGL_CMD_BUFFER cmdBuffer) |
| 1395 | { |
| 1396 | // TODO : Anything to do here? |
| 1397 | XGL_RESULT result = nextTable.EndCommandBuffer(cmdBuffer); |
| 1398 | return result; |
| 1399 | } |
| 1400 | |
| 1401 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglResetCommandBuffer(XGL_CMD_BUFFER cmdBuffer) |
| 1402 | { |
| 1403 | // Clear memory references as this point. Anything else to do here? |
| 1404 | freeCBBindings(cmdBuffer); |
| 1405 | XGL_RESULT result = nextTable.ResetCommandBuffer(cmdBuffer); |
| 1406 | return result; |
| 1407 | } |
| 1408 | // TODO : For any xglCmdBind* calls that include an object which has mem bound to it, |
| 1409 | // need to account for that mem now having binding to given cmdBuffer |
| 1410 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindPipeline(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_PIPELINE pipeline) |
| 1411 | { |
| 1412 | nextTable.CmdBindPipeline(cmdBuffer, pipelineBindPoint, pipeline); |
| 1413 | } |
| 1414 | |
| 1415 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindPipelineDelta(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_PIPELINE_DELTA delta) |
| 1416 | { |
| 1417 | nextTable.CmdBindPipelineDelta(cmdBuffer, pipelineBindPoint, delta); |
| 1418 | } |
| 1419 | |
| 1420 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindStateObject(XGL_CMD_BUFFER cmdBuffer, XGL_STATE_BIND_POINT stateBindPoint, XGL_STATE_OBJECT state) |
| 1421 | { |
| 1422 | nextTable.CmdBindStateObject(cmdBuffer, stateBindPoint, state); |
| 1423 | } |
| 1424 | |
| 1425 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindDescriptorSet(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_UINT index, XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT slotOffset) |
| 1426 | { |
| 1427 | nextTable.CmdBindDescriptorSet(cmdBuffer, pipelineBindPoint, index, descriptorSet, slotOffset); |
| 1428 | } |
| 1429 | |
| 1430 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindDynamicMemoryView(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, const XGL_MEMORY_VIEW_ATTACH_INFO* pMemView) |
| 1431 | { |
| 1432 | nextTable.CmdBindDynamicMemoryView(cmdBuffer, pipelineBindPoint, pMemView); |
| 1433 | } |
| 1434 | |
| 1435 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindIndexData(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_INDEX_TYPE indexType) |
| 1436 | { |
| 1437 | // Track this memory. What exactly is this call doing? |
| 1438 | if (XGL_FALSE == updateCBBinding(cmdBuffer, mem)) |
| 1439 | printf("MEM ERROR : In xglCmdBindIndexData() call unable to update binding of mem %p to cmdBuffer %p\n", mem, cmdBuffer); |
| 1440 | nextTable.CmdBindIndexData(cmdBuffer, mem, offset, indexType); |
| 1441 | } |
| 1442 | |
| 1443 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindAttachments(XGL_CMD_BUFFER cmdBuffer, XGL_UINT colorAttachmentCount, const XGL_COLOR_ATTACHMENT_BIND_INFO* pColorAttachments, const XGL_DEPTH_STENCIL_BIND_INFO* pDepthStencilAttachment) |
| 1444 | { |
| 1445 | nextTable.CmdBindAttachments(cmdBuffer, colorAttachmentCount, pColorAttachments, pDepthStencilAttachment); |
| 1446 | } |
| 1447 | |
| 1448 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdPrepareMemoryRegions(XGL_CMD_BUFFER cmdBuffer, XGL_UINT transitionCount, const XGL_MEMORY_STATE_TRANSITION* pStateTransitions) |
| 1449 | { |
| 1450 | // TODO : Track memory state transitions |
| 1451 | // Flag incorrect transitions when states don't match |
| 1452 | XGL_GPU_MEMORY mem = pStateTransitions->mem; |
| 1453 | if (XGL_FALSE == updateCBBinding(cmdBuffer, mem)) |
| 1454 | printf("MEM ERROR : In xglCmdPrepareMemoryRegions() call unable to update binding of mem %p to cmdBuffer %p\n", mem, cmdBuffer); |
| 1455 | nextTable.CmdPrepareMemoryRegions(cmdBuffer, transitionCount, pStateTransitions); |
| 1456 | } |
| 1457 | |
| 1458 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdPrepareImages(XGL_CMD_BUFFER cmdBuffer, XGL_UINT transitionCount, const XGL_IMAGE_STATE_TRANSITION* pStateTransitions) |
| 1459 | { |
| 1460 | // TODO : This will have an image object that's bound to memory in the pStateTransitions struct |
| 1461 | // Need to pull object based on image and then pull mem mapping from that object |
| 1462 | XGL_GPU_MEMORY mem = getMemBindingFromObject((XGL_OBJECT)pStateTransitions->image); |
| 1463 | if (XGL_FALSE == updateCBBinding(cmdBuffer, mem)) |
| 1464 | printf("MEM ERROR : In xglCmdPrepareImages() call unable to update binding of mem %p to cmdBuffer %p\n", mem, cmdBuffer); |
| 1465 | nextTable.CmdPrepareImages(cmdBuffer, transitionCount, pStateTransitions); |
| 1466 | } |
| 1467 | |
| 1468 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDraw(XGL_CMD_BUFFER cmdBuffer, XGL_UINT firstVertex, XGL_UINT vertexCount, XGL_UINT firstInstance, XGL_UINT instanceCount) |
| 1469 | { |
| 1470 | nextTable.CmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount); |
| 1471 | } |
| 1472 | |
| 1473 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDrawIndexed(XGL_CMD_BUFFER cmdBuffer, XGL_UINT firstIndex, XGL_UINT indexCount, XGL_INT vertexOffset, XGL_UINT firstInstance, XGL_UINT instanceCount) |
| 1474 | { |
| 1475 | nextTable.CmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount); |
| 1476 | } |
| 1477 | |
| 1478 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDrawIndirect(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_UINT32 count, XGL_UINT32 stride) |
| 1479 | { |
| 1480 | // TODO : Track this |
| 1481 | if (XGL_FALSE == updateCBBinding(cmdBuffer, mem)) |
| 1482 | printf("MEM ERROR : In xglCmdDrawIndirect() call unable to update binding of mem %p to cmdBuffer %p\n", mem, cmdBuffer); |
| 1483 | nextTable.CmdDrawIndirect(cmdBuffer, mem, offset, count, stride); |
| 1484 | } |
| 1485 | |
| 1486 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDrawIndexedIndirect(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_UINT32 count, XGL_UINT32 stride) |
| 1487 | { |
| 1488 | // TODO : Track this |
| 1489 | if (XGL_FALSE == updateCBBinding(cmdBuffer, mem)) |
| 1490 | printf("MEM ERROR : In xglCmdDrawIndexedIndirect() call unable to update binding of mem %p to cmdBuffer %p\n", mem, cmdBuffer); |
| 1491 | nextTable.CmdDrawIndexedIndirect(cmdBuffer, mem, offset, count, stride); |
| 1492 | } |
| 1493 | |
| 1494 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDispatch(XGL_CMD_BUFFER cmdBuffer, XGL_UINT x, XGL_UINT y, XGL_UINT z) |
| 1495 | { |
| 1496 | nextTable.CmdDispatch(cmdBuffer, x, y, z); |
| 1497 | } |
| 1498 | |
| 1499 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDispatchIndirect(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset) |
| 1500 | { |
| 1501 | // TODO : Track this |
| 1502 | if (XGL_FALSE == updateCBBinding(cmdBuffer, mem)) |
| 1503 | printf("MEM ERROR : In xglCmdDispatchIndirect() call unable to update binding of mem %p to cmdBuffer %p\n", mem, cmdBuffer); |
| 1504 | nextTable.CmdDispatchIndirect(cmdBuffer, mem, offset); |
| 1505 | } |
| 1506 | |
| 1507 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdCopyMemory(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY srcMem, XGL_GPU_MEMORY destMem, XGL_UINT regionCount, const XGL_MEMORY_COPY* pRegions) |
| 1508 | { |
| 1509 | // TODO : Track this |
| 1510 | if (XGL_FALSE == updateCBBinding(cmdBuffer, srcMem)) |
| 1511 | printf("MEM ERROR : In xglCmdCopyMemory() call unable to update binding of srcMem %p to cmdBuffer %p\n", srcMem, cmdBuffer); |
| 1512 | if (XGL_FALSE == updateCBBinding(cmdBuffer, destMem)) |
| 1513 | printf("MEM ERROR : In xglCmdCopyMemory() call unable to update binding of destMem %p to cmdBuffer %p\n", destMem, cmdBuffer); |
| 1514 | nextTable.CmdCopyMemory(cmdBuffer, srcMem, destMem, regionCount, pRegions); |
| 1515 | } |
| 1516 | |
| 1517 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdCopyImage(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_IMAGE destImage, XGL_UINT regionCount, const XGL_IMAGE_COPY* pRegions) |
| 1518 | { |
| 1519 | // TODO : Each image will have mem mapping so track them |
| 1520 | nextTable.CmdCopyImage(cmdBuffer, srcImage, destImage, regionCount, pRegions); |
| 1521 | } |
| 1522 | |
| 1523 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdCopyMemoryToImage(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY srcMem, XGL_IMAGE destImage, XGL_UINT regionCount, const XGL_MEMORY_IMAGE_COPY* pRegions) |
| 1524 | { |
| 1525 | // TODO : Track this |
| 1526 | XGL_GPU_MEMORY mem = getMemBindingFromObject(destImage); |
| 1527 | if (XGL_FALSE == updateCBBinding(cmdBuffer, mem)) |
| 1528 | printf("MEM ERROR : In xglCmdCopyMemoryToImage() call unable to update binding of destImage mem %p to cmdBuffer %p\n", mem, cmdBuffer); |
| 1529 | if (XGL_FALSE == updateCBBinding(cmdBuffer, srcMem)) |
| 1530 | printf("MEM ERROR : In xglCmdCopyMemoryToImage() call unable to update binding of srcMem %p to cmdBuffer %p\n", srcMem, cmdBuffer); |
| 1531 | nextTable.CmdCopyMemoryToImage(cmdBuffer, srcMem, destImage, regionCount, pRegions); |
| 1532 | } |
| 1533 | |
| 1534 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdCopyImageToMemory(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_GPU_MEMORY destMem, XGL_UINT regionCount, const XGL_MEMORY_IMAGE_COPY* pRegions) |
| 1535 | { |
| 1536 | // TODO : Track this |
| 1537 | XGL_GPU_MEMORY mem = getMemBindingFromObject(srcImage); |
| 1538 | if (XGL_FALSE == updateCBBinding(cmdBuffer, mem)) |
| 1539 | printf("MEM ERROR : In xglCmdCopyImageToMemory() call unable to update binding of srcImage mem %p to cmdBuffer %p\n", mem, cmdBuffer); |
| 1540 | if (XGL_FALSE == updateCBBinding(cmdBuffer, destMem)) |
| 1541 | printf("MEM ERROR : In xglCmdCopyImageToMemory() call unable to update binding of destMem %p to cmdBuffer %p\n", destMem, cmdBuffer); |
| 1542 | nextTable.CmdCopyImageToMemory(cmdBuffer, srcImage, destMem, regionCount, pRegions); |
| 1543 | } |
| 1544 | |
| 1545 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdCloneImageData(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_IMAGE_STATE srcImageState, XGL_IMAGE destImage, XGL_IMAGE_STATE destImageState) |
| 1546 | { |
| 1547 | // TODO : Each image will have mem mapping so track them |
| 1548 | XGL_GPU_MEMORY mem = getMemBindingFromObject(srcImage); |
| 1549 | if (XGL_FALSE == updateCBBinding(cmdBuffer, mem)) |
| 1550 | printf("MEM ERROR : In xglCmdCloneImageData() call unable to update binding of srcImage mem %p to cmdBuffer %p\n", mem, cmdBuffer); |
| 1551 | mem = getMemBindingFromObject(destImage); |
| 1552 | if (XGL_FALSE == updateCBBinding(cmdBuffer, mem)) |
| 1553 | printf("MEM ERROR : In xglCmdCloneImageData() call unable to update binding of destImage mem %p to cmdBuffer %p\n", mem, cmdBuffer); |
| 1554 | nextTable.CmdCloneImageData(cmdBuffer, srcImage, srcImageState, destImage, destImageState); |
| 1555 | } |
| 1556 | |
| 1557 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdUpdateMemory(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY destMem, XGL_GPU_SIZE destOffset, XGL_GPU_SIZE dataSize, const XGL_UINT32* pData) |
| 1558 | { |
| 1559 | if (XGL_FALSE == updateCBBinding(cmdBuffer, destMem)) |
| 1560 | printf("MEM ERROR : In xglCmdUpdateMemory() call unable to update binding of destMem %p to cmdBuffer %p\n", destMem, cmdBuffer); |
| 1561 | nextTable.CmdUpdateMemory(cmdBuffer, destMem, destOffset, dataSize, pData); |
| 1562 | } |
| 1563 | |
| 1564 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdFillMemory(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY destMem, XGL_GPU_SIZE destOffset, XGL_GPU_SIZE fillSize, XGL_UINT32 data) |
| 1565 | { |
| 1566 | if (XGL_FALSE == updateCBBinding(cmdBuffer, destMem)) |
| 1567 | printf("MEM ERROR : In xglCmdFillMemory() call unable to update binding of destMem %p to cmdBuffer %p\n", destMem, cmdBuffer); |
| 1568 | nextTable.CmdFillMemory(cmdBuffer, destMem, destOffset, fillSize, data); |
| 1569 | } |
| 1570 | |
| 1571 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdClearColorImage(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE image, const XGL_FLOAT color[4], XGL_UINT rangeCount, const XGL_IMAGE_SUBRESOURCE_RANGE* pRanges) |
| 1572 | { |
| 1573 | XGL_GPU_MEMORY mem = getMemBindingFromObject(image); |
| 1574 | if (XGL_FALSE == updateCBBinding(cmdBuffer, mem)) |
| 1575 | printf("MEM ERROR : In xglCmdClearColorImage() call unable to update binding of image mem %p to cmdBuffer %p\n", mem, cmdBuffer); |
| 1576 | nextTable.CmdClearColorImage(cmdBuffer, image, color, rangeCount, pRanges); |
| 1577 | } |
| 1578 | |
| 1579 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdClearColorImageRaw(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE image, const XGL_UINT32 color[4], XGL_UINT rangeCount, const XGL_IMAGE_SUBRESOURCE_RANGE* pRanges) |
| 1580 | { |
| 1581 | XGL_GPU_MEMORY mem = getMemBindingFromObject(image); |
| 1582 | if (XGL_FALSE == updateCBBinding(cmdBuffer, mem)) |
| 1583 | printf("MEM ERROR : In xglCmdClearColorImageRaw() call unable to update binding of image mem %p to cmdBuffer %p\n", mem, cmdBuffer); |
| 1584 | nextTable.CmdClearColorImageRaw(cmdBuffer, image, color, rangeCount, pRanges); |
| 1585 | } |
| 1586 | |
| 1587 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdClearDepthStencil(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE image, XGL_FLOAT depth, XGL_UINT32 stencil, XGL_UINT rangeCount, const XGL_IMAGE_SUBRESOURCE_RANGE* pRanges) |
| 1588 | { |
| 1589 | XGL_GPU_MEMORY mem = getMemBindingFromObject(image); |
| 1590 | if (XGL_FALSE == updateCBBinding(cmdBuffer, mem)) |
| 1591 | printf("MEM ERROR : In xglCmdClearDepthStencil() call unable to update binding of image mem %p to cmdBuffer %p\n", mem, cmdBuffer); |
| 1592 | nextTable.CmdClearDepthStencil(cmdBuffer, image, depth, stencil, rangeCount, pRanges); |
| 1593 | } |
| 1594 | |
| 1595 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdResolveImage(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_IMAGE destImage, XGL_UINT rectCount, const XGL_IMAGE_RESOLVE* pRects) |
| 1596 | { |
| 1597 | XGL_GPU_MEMORY mem = getMemBindingFromObject(srcImage); |
| 1598 | if (XGL_FALSE == updateCBBinding(cmdBuffer, mem)) |
| 1599 | printf("MEM ERROR : In xglCmdResolveImage() call unable to update binding of srcImage mem %p to cmdBuffer %p\n", mem, cmdBuffer); |
| 1600 | mem = getMemBindingFromObject(destImage); |
| 1601 | if (XGL_FALSE == updateCBBinding(cmdBuffer, mem)) |
| 1602 | printf("MEM ERROR : In xglCmdResolveImage() call unable to update binding of destImage mem %p to cmdBuffer %p\n", mem, cmdBuffer); |
| 1603 | nextTable.CmdResolveImage(cmdBuffer, srcImage, destImage, rectCount, pRects); |
| 1604 | } |
| 1605 | |
| 1606 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdSetEvent(XGL_CMD_BUFFER cmdBuffer, XGL_EVENT event) |
| 1607 | { |
| 1608 | nextTable.CmdSetEvent(cmdBuffer, event); |
| 1609 | } |
| 1610 | |
| 1611 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdResetEvent(XGL_CMD_BUFFER cmdBuffer, XGL_EVENT event) |
| 1612 | { |
| 1613 | nextTable.CmdResetEvent(cmdBuffer, event); |
| 1614 | } |
| 1615 | |
| 1616 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdMemoryAtomic(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY destMem, XGL_GPU_SIZE destOffset, XGL_UINT64 srcData, XGL_ATOMIC_OP atomicOp) |
| 1617 | { |
| 1618 | if (XGL_FALSE == updateCBBinding(cmdBuffer, destMem)) |
| 1619 | printf("MEM ERROR : In xglCmdMemoryAtomic() call unable to update binding of destMem %p to cmdBuffer %p\n", destMem, cmdBuffer); |
| 1620 | nextTable.CmdMemoryAtomic(cmdBuffer, destMem, destOffset, srcData, atomicOp); |
| 1621 | } |
| 1622 | |
| 1623 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBeginQuery(XGL_CMD_BUFFER cmdBuffer, XGL_QUERY_POOL queryPool, XGL_UINT slot, XGL_FLAGS flags) |
| 1624 | { |
| 1625 | XGL_GPU_MEMORY mem = getMemBindingFromObject(queryPool); |
| 1626 | if (XGL_FALSE == updateCBBinding(cmdBuffer, mem)) |
| 1627 | printf("MEM ERROR : In xglCmdBeginQuery() call unable to update binding of queryPool mem %p to cmdBuffer %p\n", mem, cmdBuffer); |
| 1628 | nextTable.CmdBeginQuery(cmdBuffer, queryPool, slot, flags); |
| 1629 | } |
| 1630 | |
| 1631 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdEndQuery(XGL_CMD_BUFFER cmdBuffer, XGL_QUERY_POOL queryPool, XGL_UINT slot) |
| 1632 | { |
| 1633 | XGL_GPU_MEMORY mem = getMemBindingFromObject(queryPool); |
| 1634 | if (XGL_FALSE == updateCBBinding(cmdBuffer, mem)) |
| 1635 | printf("MEM ERROR : In xglCmdEndQuery() call unable to update binding of queryPool mem %p to cmdBuffer %p\n", mem, cmdBuffer); |
| 1636 | nextTable.CmdEndQuery(cmdBuffer, queryPool, slot); |
| 1637 | } |
| 1638 | |
| 1639 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdResetQueryPool(XGL_CMD_BUFFER cmdBuffer, XGL_QUERY_POOL queryPool, XGL_UINT startQuery, XGL_UINT queryCount) |
| 1640 | { |
| 1641 | XGL_GPU_MEMORY mem = getMemBindingFromObject(queryPool); |
| 1642 | if (XGL_FALSE == updateCBBinding(cmdBuffer, mem)) |
| 1643 | printf("MEM ERROR : In xglCmdResetQueryPool() call unable to update binding of queryPool mem %p to cmdBuffer %p\n", mem, cmdBuffer); |
| 1644 | nextTable.CmdResetQueryPool(cmdBuffer, queryPool, startQuery, queryCount); |
| 1645 | } |
| 1646 | |
| 1647 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdWriteTimestamp(XGL_CMD_BUFFER cmdBuffer, XGL_TIMESTAMP_TYPE timestampType, XGL_GPU_MEMORY destMem, XGL_GPU_SIZE destOffset) |
| 1648 | { |
| 1649 | if (XGL_FALSE == updateCBBinding(cmdBuffer, destMem)) |
| 1650 | printf("MEM ERROR : In xglCmdWriteTimestamp() call unable to update binding of destMem %p to cmdBuffer %p\n", destMem, cmdBuffer); |
| 1651 | nextTable.CmdWriteTimestamp(cmdBuffer, timestampType, destMem, destOffset); |
| 1652 | } |
| 1653 | |
| 1654 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdInitAtomicCounters(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_UINT startCounter, XGL_UINT counterCount, const XGL_UINT32* pData) |
| 1655 | { |
| 1656 | nextTable.CmdInitAtomicCounters(cmdBuffer, pipelineBindPoint, startCounter, counterCount, pData); |
| 1657 | } |
| 1658 | |
| 1659 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdLoadAtomicCounters(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_UINT startCounter, XGL_UINT counterCount, XGL_GPU_MEMORY srcMem, XGL_GPU_SIZE srcOffset) |
| 1660 | { |
| 1661 | if (XGL_FALSE == updateCBBinding(cmdBuffer, srcMem)) |
| 1662 | printf("MEM ERROR : In xglCmdLoadAtomicCounters() call unable to update binding of srcMem %p to cmdBuffer %p\n", srcMem, cmdBuffer); |
| 1663 | nextTable.CmdLoadAtomicCounters(cmdBuffer, pipelineBindPoint, startCounter, counterCount, srcMem, srcOffset); |
| 1664 | } |
| 1665 | |
| 1666 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdSaveAtomicCounters(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_UINT startCounter, XGL_UINT counterCount, XGL_GPU_MEMORY destMem, XGL_GPU_SIZE destOffset) |
| 1667 | { |
| 1668 | if (XGL_FALSE == updateCBBinding(cmdBuffer, destMem)) |
| 1669 | printf("MEM ERROR : In xglCmdSaveAtomicCounters() call unable to update binding of destMem %p to cmdBuffer %p\n", destMem, cmdBuffer); |
| 1670 | nextTable.CmdSaveAtomicCounters(cmdBuffer, pipelineBindPoint, startCounter, counterCount, destMem, destOffset); |
| 1671 | } |
| 1672 | |
| 1673 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDbgSetValidationLevel(XGL_DEVICE device, XGL_VALIDATION_LEVEL validationLevel) |
| 1674 | { |
| 1675 | XGL_RESULT result = nextTable.DbgSetValidationLevel(device, validationLevel); |
| 1676 | return result; |
| 1677 | } |
| 1678 | |
| 1679 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDbgRegisterMsgCallback(XGL_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback, XGL_VOID* pUserData) |
| 1680 | { |
| 1681 | XGL_RESULT result = nextTable.DbgRegisterMsgCallback(pfnMsgCallback, pUserData); |
| 1682 | return result; |
| 1683 | } |
| 1684 | |
| 1685 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDbgUnregisterMsgCallback(XGL_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback) |
| 1686 | { |
| 1687 | XGL_RESULT result = nextTable.DbgUnregisterMsgCallback(pfnMsgCallback); |
| 1688 | return result; |
| 1689 | } |
| 1690 | |
| 1691 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDbgSetMessageFilter(XGL_DEVICE device, XGL_INT msgCode, XGL_DBG_MSG_FILTER filter) |
| 1692 | { |
| 1693 | XGL_RESULT result = nextTable.DbgSetMessageFilter(device, msgCode, filter); |
| 1694 | return result; |
| 1695 | } |
| 1696 | |
| 1697 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDbgSetObjectTag(XGL_BASE_OBJECT object, XGL_SIZE tagSize, const XGL_VOID* pTag) |
| 1698 | { |
| 1699 | XGL_RESULT result = nextTable.DbgSetObjectTag(object, tagSize, pTag); |
| 1700 | return result; |
| 1701 | } |
| 1702 | |
| 1703 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDbgSetGlobalOption(XGL_DBG_GLOBAL_OPTION dbgOption, XGL_SIZE dataSize, const XGL_VOID* pData) |
| 1704 | { |
| 1705 | XGL_RESULT result = nextTable.DbgSetGlobalOption(dbgOption, dataSize, pData); |
| 1706 | return result; |
| 1707 | } |
| 1708 | |
| 1709 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDbgSetDeviceOption(XGL_DEVICE device, XGL_DBG_DEVICE_OPTION dbgOption, XGL_SIZE dataSize, const XGL_VOID* pData) |
| 1710 | { |
| 1711 | XGL_RESULT result = nextTable.DbgSetDeviceOption(device, dbgOption, dataSize, pData); |
| 1712 | return result; |
| 1713 | } |
| 1714 | |
| 1715 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDbgMarkerBegin(XGL_CMD_BUFFER cmdBuffer, const XGL_CHAR* pMarker) |
| 1716 | { |
| 1717 | nextTable.CmdDbgMarkerBegin(cmdBuffer, pMarker); |
| 1718 | } |
| 1719 | |
| 1720 | XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDbgMarkerEnd(XGL_CMD_BUFFER cmdBuffer) |
| 1721 | { |
| 1722 | nextTable.CmdDbgMarkerEnd(cmdBuffer); |
| 1723 | } |
| 1724 | |
| 1725 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWsiX11AssociateConnection(XGL_PHYSICAL_GPU gpu, const XGL_WSI_X11_CONNECTION_INFO* pConnectionInfo) |
| 1726 | { |
| 1727 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 1728 | printf("At start of layered WsiX11AssociateConnection\n"); |
| 1729 | pCurObj = gpuw; |
| 1730 | pthread_once(&tabOnce, initLayerTable); |
| 1731 | XGL_RESULT result = nextTable.WsiX11AssociateConnection((XGL_PHYSICAL_GPU)gpuw->nextObject, pConnectionInfo); |
| 1732 | printf("Completed layered WsiX11AssociateConnection\n"); |
| 1733 | return result; |
| 1734 | } |
| 1735 | |
| 1736 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWsiX11GetMSC(XGL_DEVICE device, xcb_randr_crtc_t crtc, XGL_UINT64* pMsc) |
| 1737 | { |
| 1738 | XGL_RESULT result = nextTable.WsiX11GetMSC(device, crtc, pMsc); |
| 1739 | return result; |
| 1740 | } |
| 1741 | |
| 1742 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWsiX11CreatePresentableImage(XGL_DEVICE device, const XGL_WSI_X11_PRESENTABLE_IMAGE_CREATE_INFO* pCreateInfo, XGL_IMAGE* pImage, XGL_GPU_MEMORY* pMem) |
| 1743 | { |
| 1744 | XGL_RESULT result = nextTable.WsiX11CreatePresentableImage(device, pCreateInfo, pImage, pMem); |
| 1745 | return result; |
| 1746 | } |
| 1747 | |
| 1748 | XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWsiX11QueuePresent(XGL_QUEUE queue, const XGL_WSI_X11_PRESENT_INFO* pPresentInfo, XGL_FENCE fence) |
| 1749 | { |
| 1750 | XGL_RESULT result = nextTable.WsiX11QueuePresent(queue, pPresentInfo, fence); |
| 1751 | return result; |
| 1752 | } |
| 1753 | |
| 1754 | XGL_LAYER_EXPORT XGL_VOID* XGLAPI xglGetProcAddr(XGL_PHYSICAL_GPU gpu, const XGL_CHAR* funcName) |
| 1755 | { |
| 1756 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 1757 | if (gpu == NULL) |
| 1758 | return NULL; |
| 1759 | pCurObj = gpuw; |
| 1760 | pthread_once(&tabOnce, initLayerTable); |
| 1761 | |
| 1762 | if (!strncmp("xglGetProcAddr", (const char *) funcName, sizeof("xglGetProcAddr"))) |
| 1763 | return xglGetProcAddr; |
| 1764 | else if (!strncmp("xglInitAndEnumerateGpus", (const char *) funcName, sizeof("xglInitAndEnumerateGpus"))) |
| 1765 | return nextTable.InitAndEnumerateGpus; |
| 1766 | else if (!strncmp("xglGetGpuInfo", (const char *) funcName, sizeof("xglGetGpuInfo"))) |
| 1767 | return xglGetGpuInfo; |
| 1768 | else if (!strncmp("xglCreateDevice", (const char *) funcName, sizeof("xglCreateDevice"))) |
| 1769 | return xglCreateDevice; |
| 1770 | else if (!strncmp("xglDestroyDevice", (const char *) funcName, sizeof("xglDestroyDevice"))) |
| 1771 | return xglDestroyDevice; |
| 1772 | else if (!strncmp("xglGetExtensionSupport", (const char *) funcName, sizeof("xglGetExtensionSupport"))) |
| 1773 | return xglGetExtensionSupport; |
| 1774 | else if (!strncmp("xglEnumerateLayers", (const char *) funcName, sizeof("xglEnumerateLayers"))) |
| 1775 | return xglEnumerateLayers; |
| 1776 | else if (!strncmp("xglGetDeviceQueue", (const char *) funcName, sizeof("xglGetDeviceQueue"))) |
| 1777 | return xglGetDeviceQueue; |
| 1778 | else if (!strncmp("xglQueueSubmit", (const char *) funcName, sizeof("xglQueueSubmit"))) |
| 1779 | return xglQueueSubmit; |
| 1780 | else if (!strncmp("xglQueueSetGlobalMemReferences", (const char *) funcName, sizeof("xglQueueSetGlobalMemReferences"))) |
| 1781 | return xglQueueSetGlobalMemReferences; |
| 1782 | else if (!strncmp("xglQueueWaitIdle", (const char *) funcName, sizeof("xglQueueWaitIdle"))) |
| 1783 | return xglQueueWaitIdle; |
| 1784 | else if (!strncmp("xglDeviceWaitIdle", (const char *) funcName, sizeof("xglDeviceWaitIdle"))) |
| 1785 | return xglDeviceWaitIdle; |
| 1786 | else if (!strncmp("xglGetMemoryHeapCount", (const char *) funcName, sizeof("xglGetMemoryHeapCount"))) |
| 1787 | return xglGetMemoryHeapCount; |
| 1788 | else if (!strncmp("xglGetMemoryHeapInfo", (const char *) funcName, sizeof("xglGetMemoryHeapInfo"))) |
| 1789 | return xglGetMemoryHeapInfo; |
| 1790 | else if (!strncmp("xglAllocMemory", (const char *) funcName, sizeof("xglAllocMemory"))) |
| 1791 | return xglAllocMemory; |
| 1792 | else if (!strncmp("xglFreeMemory", (const char *) funcName, sizeof("xglFreeMemory"))) |
| 1793 | return xglFreeMemory; |
| 1794 | else if (!strncmp("xglSetMemoryPriority", (const char *) funcName, sizeof("xglSetMemoryPriority"))) |
| 1795 | return xglSetMemoryPriority; |
| 1796 | else if (!strncmp("xglMapMemory", (const char *) funcName, sizeof("xglMapMemory"))) |
| 1797 | return xglMapMemory; |
| 1798 | else if (!strncmp("xglUnmapMemory", (const char *) funcName, sizeof("xglUnmapMemory"))) |
| 1799 | return xglUnmapMemory; |
| 1800 | else if (!strncmp("xglPinSystemMemory", (const char *) funcName, sizeof("xglPinSystemMemory"))) |
| 1801 | return xglPinSystemMemory; |
| 1802 | else if (!strncmp("xglRemapVirtualMemoryPages", (const char *) funcName, sizeof("xglRemapVirtualMemoryPages"))) |
| 1803 | return xglRemapVirtualMemoryPages; |
| 1804 | else if (!strncmp("xglGetMultiGpuCompatibility", (const char *) funcName, sizeof("xglGetMultiGpuCompatibility"))) |
| 1805 | return xglGetMultiGpuCompatibility; |
| 1806 | else if (!strncmp("xglOpenSharedMemory", (const char *) funcName, sizeof("xglOpenSharedMemory"))) |
| 1807 | return xglOpenSharedMemory; |
| 1808 | else if (!strncmp("xglOpenSharedQueueSemaphore", (const char *) funcName, sizeof("xglOpenSharedQueueSemaphore"))) |
| 1809 | return xglOpenSharedQueueSemaphore; |
| 1810 | else if (!strncmp("xglOpenPeerMemory", (const char *) funcName, sizeof("xglOpenPeerMemory"))) |
| 1811 | return xglOpenPeerMemory; |
| 1812 | else if (!strncmp("xglOpenPeerImage", (const char *) funcName, sizeof("xglOpenPeerImage"))) |
| 1813 | return xglOpenPeerImage; |
| 1814 | else if (!strncmp("xglDestroyObject", (const char *) funcName, sizeof("xglDestroyObject"))) |
| 1815 | return xglDestroyObject; |
| 1816 | else if (!strncmp("xglGetObjectInfo", (const char *) funcName, sizeof("xglGetObjectInfo"))) |
| 1817 | return xglGetObjectInfo; |
| 1818 | else if (!strncmp("xglBindObjectMemory", (const char *) funcName, sizeof("xglBindObjectMemory"))) |
| 1819 | return xglBindObjectMemory; |
| 1820 | else if (!strncmp("xglCreateFence", (const char *) funcName, sizeof("xglCreateFence"))) |
| 1821 | return xglCreateFence; |
| 1822 | else if (!strncmp("xglGetFenceStatus", (const char *) funcName, sizeof("xglGetFenceStatus"))) |
| 1823 | return xglGetFenceStatus; |
| 1824 | else if (!strncmp("xglWaitForFences", (const char *) funcName, sizeof("xglWaitForFences"))) |
| 1825 | return xglWaitForFences; |
| 1826 | else if (!strncmp("xglCreateQueueSemaphore", (const char *) funcName, sizeof("xglCreateQueueSemaphore"))) |
| 1827 | return xglCreateQueueSemaphore; |
| 1828 | else if (!strncmp("xglSignalQueueSemaphore", (const char *) funcName, sizeof("xglSignalQueueSemaphore"))) |
| 1829 | return xglSignalQueueSemaphore; |
| 1830 | else if (!strncmp("xglWaitQueueSemaphore", (const char *) funcName, sizeof("xglWaitQueueSemaphore"))) |
| 1831 | return xglWaitQueueSemaphore; |
| 1832 | else if (!strncmp("xglCreateEvent", (const char *) funcName, sizeof("xglCreateEvent"))) |
| 1833 | return xglCreateEvent; |
| 1834 | else if (!strncmp("xglGetEventStatus", (const char *) funcName, sizeof("xglGetEventStatus"))) |
| 1835 | return xglGetEventStatus; |
| 1836 | else if (!strncmp("xglSetEvent", (const char *) funcName, sizeof("xglSetEvent"))) |
| 1837 | return xglSetEvent; |
| 1838 | else if (!strncmp("xglResetEvent", (const char *) funcName, sizeof("xglResetEvent"))) |
| 1839 | return xglResetEvent; |
| 1840 | else if (!strncmp("xglCreateQueryPool", (const char *) funcName, sizeof("xglCreateQueryPool"))) |
| 1841 | return xglCreateQueryPool; |
| 1842 | else if (!strncmp("xglGetQueryPoolResults", (const char *) funcName, sizeof("xglGetQueryPoolResults"))) |
| 1843 | return xglGetQueryPoolResults; |
| 1844 | else if (!strncmp("xglGetFormatInfo", (const char *) funcName, sizeof("xglGetFormatInfo"))) |
| 1845 | return xglGetFormatInfo; |
| 1846 | else if (!strncmp("xglCreateImage", (const char *) funcName, sizeof("xglCreateImage"))) |
| 1847 | return xglCreateImage; |
| 1848 | else if (!strncmp("xglGetImageSubresourceInfo", (const char *) funcName, sizeof("xglGetImageSubresourceInfo"))) |
| 1849 | return xglGetImageSubresourceInfo; |
| 1850 | else if (!strncmp("xglCreateImageView", (const char *) funcName, sizeof("xglCreateImageView"))) |
| 1851 | return xglCreateImageView; |
| 1852 | else if (!strncmp("xglCreateColorAttachmentView", (const char *) funcName, sizeof("xglCreateColorAttachmentView"))) |
| 1853 | return xglCreateColorAttachmentView; |
| 1854 | else if (!strncmp("xglCreateDepthStencilView", (const char *) funcName, sizeof("xglCreateDepthStencilView"))) |
| 1855 | return xglCreateDepthStencilView; |
| 1856 | else if (!strncmp("xglCreateShader", (const char *) funcName, sizeof("xglCreateShader"))) |
| 1857 | return xglCreateShader; |
| 1858 | else if (!strncmp("xglCreateGraphicsPipeline", (const char *) funcName, sizeof("xglCreateGraphicsPipeline"))) |
| 1859 | return xglCreateGraphicsPipeline; |
| 1860 | else if (!strncmp("xglCreateComputePipeline", (const char *) funcName, sizeof("xglCreateComputePipeline"))) |
| 1861 | return xglCreateComputePipeline; |
| 1862 | else if (!strncmp("xglStorePipeline", (const char *) funcName, sizeof("xglStorePipeline"))) |
| 1863 | return xglStorePipeline; |
| 1864 | else if (!strncmp("xglLoadPipeline", (const char *) funcName, sizeof("xglLoadPipeline"))) |
| 1865 | return xglLoadPipeline; |
| 1866 | else if (!strncmp("xglCreatePipelineDelta", (const char *) funcName, sizeof("xglCreatePipelineDelta"))) |
| 1867 | return xglCreatePipelineDelta; |
| 1868 | else if (!strncmp("xglCreateSampler", (const char *) funcName, sizeof("xglCreateSampler"))) |
| 1869 | return xglCreateSampler; |
| 1870 | else if (!strncmp("xglCreateDescriptorSet", (const char *) funcName, sizeof("xglCreateDescriptorSet"))) |
| 1871 | return xglCreateDescriptorSet; |
| 1872 | else if (!strncmp("xglBeginDescriptorSetUpdate", (const char *) funcName, sizeof("xglBeginDescriptorSetUpdate"))) |
| 1873 | return xglBeginDescriptorSetUpdate; |
| 1874 | else if (!strncmp("xglEndDescriptorSetUpdate", (const char *) funcName, sizeof("xglEndDescriptorSetUpdate"))) |
| 1875 | return xglEndDescriptorSetUpdate; |
| 1876 | else if (!strncmp("xglAttachSamplerDescriptors", (const char *) funcName, sizeof("xglAttachSamplerDescriptors"))) |
| 1877 | return xglAttachSamplerDescriptors; |
| 1878 | else if (!strncmp("xglAttachImageViewDescriptors", (const char *) funcName, sizeof("xglAttachImageViewDescriptors"))) |
| 1879 | return xglAttachImageViewDescriptors; |
| 1880 | else if (!strncmp("xglAttachMemoryViewDescriptors", (const char *) funcName, sizeof("xglAttachMemoryViewDescriptors"))) |
| 1881 | return xglAttachMemoryViewDescriptors; |
| 1882 | else if (!strncmp("xglAttachNestedDescriptors", (const char *) funcName, sizeof("xglAttachNestedDescriptors"))) |
| 1883 | return xglAttachNestedDescriptors; |
| 1884 | else if (!strncmp("xglClearDescriptorSetSlots", (const char *) funcName, sizeof("xglClearDescriptorSetSlots"))) |
| 1885 | return xglClearDescriptorSetSlots; |
| 1886 | else if (!strncmp("xglCreateViewportState", (const char *) funcName, sizeof("xglCreateViewportState"))) |
| 1887 | return xglCreateViewportState; |
| 1888 | else if (!strncmp("xglCreateRasterState", (const char *) funcName, sizeof("xglCreateRasterState"))) |
| 1889 | return xglCreateRasterState; |
| 1890 | else if (!strncmp("xglCreateMsaaState", (const char *) funcName, sizeof("xglCreateMsaaState"))) |
| 1891 | return xglCreateMsaaState; |
| 1892 | else if (!strncmp("xglCreateColorBlendState", (const char *) funcName, sizeof("xglCreateColorBlendState"))) |
| 1893 | return xglCreateColorBlendState; |
| 1894 | else if (!strncmp("xglCreateDepthStencilState", (const char *) funcName, sizeof("xglCreateDepthStencilState"))) |
| 1895 | return xglCreateDepthStencilState; |
| 1896 | else if (!strncmp("xglCreateCommandBuffer", (const char *) funcName, sizeof("xglCreateCommandBuffer"))) |
| 1897 | return xglCreateCommandBuffer; |
| 1898 | else if (!strncmp("xglBeginCommandBuffer", (const char *) funcName, sizeof("xglBeginCommandBuffer"))) |
| 1899 | return xglBeginCommandBuffer; |
| 1900 | else if (!strncmp("xglEndCommandBuffer", (const char *) funcName, sizeof("xglEndCommandBuffer"))) |
| 1901 | return xglEndCommandBuffer; |
| 1902 | else if (!strncmp("xglResetCommandBuffer", (const char *) funcName, sizeof("xglResetCommandBuffer"))) |
| 1903 | return xglResetCommandBuffer; |
| 1904 | else if (!strncmp("xglCmdBindPipeline", (const char *) funcName, sizeof("xglCmdBindPipeline"))) |
| 1905 | return xglCmdBindPipeline; |
| 1906 | else if (!strncmp("xglCmdBindPipelineDelta", (const char *) funcName, sizeof("xglCmdBindPipelineDelta"))) |
| 1907 | return xglCmdBindPipelineDelta; |
| 1908 | else if (!strncmp("xglCmdBindStateObject", (const char *) funcName, sizeof("xglCmdBindStateObject"))) |
| 1909 | return xglCmdBindStateObject; |
| 1910 | else if (!strncmp("xglCmdBindDescriptorSet", (const char *) funcName, sizeof("xglCmdBindDescriptorSet"))) |
| 1911 | return xglCmdBindDescriptorSet; |
| 1912 | else if (!strncmp("xglCmdBindDynamicMemoryView", (const char *) funcName, sizeof("xglCmdBindDynamicMemoryView"))) |
| 1913 | return xglCmdBindDynamicMemoryView; |
| 1914 | else if (!strncmp("xglCmdBindIndexData", (const char *) funcName, sizeof("xglCmdBindIndexData"))) |
| 1915 | return xglCmdBindIndexData; |
| 1916 | else if (!strncmp("xglCmdBindAttachments", (const char *) funcName, sizeof("xglCmdBindAttachments"))) |
| 1917 | return xglCmdBindAttachments; |
| 1918 | else if (!strncmp("xglCmdPrepareMemoryRegions", (const char *) funcName, sizeof("xglCmdPrepareMemoryRegions"))) |
| 1919 | return xglCmdPrepareMemoryRegions; |
| 1920 | else if (!strncmp("xglCmdPrepareImages", (const char *) funcName, sizeof("xglCmdPrepareImages"))) |
| 1921 | return xglCmdPrepareImages; |
| 1922 | else if (!strncmp("xglCmdDraw", (const char *) funcName, sizeof("xglCmdDraw"))) |
| 1923 | return xglCmdDraw; |
| 1924 | else if (!strncmp("xglCmdDrawIndexed", (const char *) funcName, sizeof("xglCmdDrawIndexed"))) |
| 1925 | return xglCmdDrawIndexed; |
| 1926 | else if (!strncmp("xglCmdDrawIndirect", (const char *) funcName, sizeof("xglCmdDrawIndirect"))) |
| 1927 | return xglCmdDrawIndirect; |
| 1928 | else if (!strncmp("xglCmdDrawIndexedIndirect", (const char *) funcName, sizeof("xglCmdDrawIndexedIndirect"))) |
| 1929 | return xglCmdDrawIndexedIndirect; |
| 1930 | else if (!strncmp("xglCmdDispatch", (const char *) funcName, sizeof("xglCmdDispatch"))) |
| 1931 | return xglCmdDispatch; |
| 1932 | else if (!strncmp("xglCmdDispatchIndirect", (const char *) funcName, sizeof("xglCmdDispatchIndirect"))) |
| 1933 | return xglCmdDispatchIndirect; |
| 1934 | else if (!strncmp("xglCmdCopyMemory", (const char *) funcName, sizeof("xglCmdCopyMemory"))) |
| 1935 | return xglCmdCopyMemory; |
| 1936 | else if (!strncmp("xglCmdCopyImage", (const char *) funcName, sizeof("xglCmdCopyImage"))) |
| 1937 | return xglCmdCopyImage; |
| 1938 | else if (!strncmp("xglCmdCopyMemoryToImage", (const char *) funcName, sizeof("xglCmdCopyMemoryToImage"))) |
| 1939 | return xglCmdCopyMemoryToImage; |
| 1940 | else if (!strncmp("xglCmdCopyImageToMemory", (const char *) funcName, sizeof("xglCmdCopyImageToMemory"))) |
| 1941 | return xglCmdCopyImageToMemory; |
| 1942 | else if (!strncmp("xglCmdCloneImageData", (const char *) funcName, sizeof("xglCmdCloneImageData"))) |
| 1943 | return xglCmdCloneImageData; |
| 1944 | else if (!strncmp("xglCmdUpdateMemory", (const char *) funcName, sizeof("xglCmdUpdateMemory"))) |
| 1945 | return xglCmdUpdateMemory; |
| 1946 | else if (!strncmp("xglCmdFillMemory", (const char *) funcName, sizeof("xglCmdFillMemory"))) |
| 1947 | return xglCmdFillMemory; |
| 1948 | else if (!strncmp("xglCmdClearColorImage", (const char *) funcName, sizeof("xglCmdClearColorImage"))) |
| 1949 | return xglCmdClearColorImage; |
| 1950 | else if (!strncmp("xglCmdClearColorImageRaw", (const char *) funcName, sizeof("xglCmdClearColorImageRaw"))) |
| 1951 | return xglCmdClearColorImageRaw; |
| 1952 | else if (!strncmp("xglCmdClearDepthStencil", (const char *) funcName, sizeof("xglCmdClearDepthStencil"))) |
| 1953 | return xglCmdClearDepthStencil; |
| 1954 | else if (!strncmp("xglCmdResolveImage", (const char *) funcName, sizeof("xglCmdResolveImage"))) |
| 1955 | return xglCmdResolveImage; |
| 1956 | else if (!strncmp("xglCmdSetEvent", (const char *) funcName, sizeof("xglCmdSetEvent"))) |
| 1957 | return xglCmdSetEvent; |
| 1958 | else if (!strncmp("xglCmdResetEvent", (const char *) funcName, sizeof("xglCmdResetEvent"))) |
| 1959 | return xglCmdResetEvent; |
| 1960 | else if (!strncmp("xglCmdMemoryAtomic", (const char *) funcName, sizeof("xglCmdMemoryAtomic"))) |
| 1961 | return xglCmdMemoryAtomic; |
| 1962 | else if (!strncmp("xglCmdBeginQuery", (const char *) funcName, sizeof("xglCmdBeginQuery"))) |
| 1963 | return xglCmdBeginQuery; |
| 1964 | else if (!strncmp("xglCmdEndQuery", (const char *) funcName, sizeof("xglCmdEndQuery"))) |
| 1965 | return xglCmdEndQuery; |
| 1966 | else if (!strncmp("xglCmdResetQueryPool", (const char *) funcName, sizeof("xglCmdResetQueryPool"))) |
| 1967 | return xglCmdResetQueryPool; |
| 1968 | else if (!strncmp("xglCmdWriteTimestamp", (const char *) funcName, sizeof("xglCmdWriteTimestamp"))) |
| 1969 | return xglCmdWriteTimestamp; |
| 1970 | else if (!strncmp("xglCmdInitAtomicCounters", (const char *) funcName, sizeof("xglCmdInitAtomicCounters"))) |
| 1971 | return xglCmdInitAtomicCounters; |
| 1972 | else if (!strncmp("xglCmdLoadAtomicCounters", (const char *) funcName, sizeof("xglCmdLoadAtomicCounters"))) |
| 1973 | return xglCmdLoadAtomicCounters; |
| 1974 | else if (!strncmp("xglCmdSaveAtomicCounters", (const char *) funcName, sizeof("xglCmdSaveAtomicCounters"))) |
| 1975 | return xglCmdSaveAtomicCounters; |
| 1976 | else if (!strncmp("xglDbgSetValidationLevel", (const char *) funcName, sizeof("xglDbgSetValidationLevel"))) |
| 1977 | return xglDbgSetValidationLevel; |
| 1978 | else if (!strncmp("xglDbgRegisterMsgCallback", (const char *) funcName, sizeof("xglDbgRegisterMsgCallback"))) |
| 1979 | return xglDbgRegisterMsgCallback; |
| 1980 | else if (!strncmp("xglDbgUnregisterMsgCallback", (const char *) funcName, sizeof("xglDbgUnregisterMsgCallback"))) |
| 1981 | return xglDbgUnregisterMsgCallback; |
| 1982 | else if (!strncmp("xglDbgSetMessageFilter", (const char *) funcName, sizeof("xglDbgSetMessageFilter"))) |
| 1983 | return xglDbgSetMessageFilter; |
| 1984 | else if (!strncmp("xglDbgSetObjectTag", (const char *) funcName, sizeof("xglDbgSetObjectTag"))) |
| 1985 | return xglDbgSetObjectTag; |
| 1986 | else if (!strncmp("xglDbgSetGlobalOption", (const char *) funcName, sizeof("xglDbgSetGlobalOption"))) |
| 1987 | return xglDbgSetGlobalOption; |
| 1988 | else if (!strncmp("xglDbgSetDeviceOption", (const char *) funcName, sizeof("xglDbgSetDeviceOption"))) |
| 1989 | return xglDbgSetDeviceOption; |
| 1990 | else if (!strncmp("xglCmdDbgMarkerBegin", (const char *) funcName, sizeof("xglCmdDbgMarkerBegin"))) |
| 1991 | return xglCmdDbgMarkerBegin; |
| 1992 | else if (!strncmp("xglCmdDbgMarkerEnd", (const char *) funcName, sizeof("xglCmdDbgMarkerEnd"))) |
| 1993 | return xglCmdDbgMarkerEnd; |
| 1994 | else if (!strncmp("xglWsiX11AssociateConnection", (const char *) funcName, sizeof("xglWsiX11AssociateConnection"))) |
| 1995 | return xglWsiX11AssociateConnection; |
| 1996 | else if (!strncmp("xglWsiX11GetMSC", (const char *) funcName, sizeof("xglWsiX11GetMSC"))) |
| 1997 | return xglWsiX11GetMSC; |
| 1998 | else if (!strncmp("xglWsiX11CreatePresentableImage", (const char *) funcName, sizeof("xglWsiX11CreatePresentableImage"))) |
| 1999 | return xglWsiX11CreatePresentableImage; |
| 2000 | else if (!strncmp("xglWsiX11QueuePresent", (const char *) funcName, sizeof("xglWsiX11QueuePresent"))) |
| 2001 | return xglWsiX11QueuePresent; |
| 2002 | else { |
| 2003 | XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; |
| 2004 | if (gpuw->pGPA == NULL) |
| 2005 | return NULL; |
| 2006 | return gpuw->pGPA(gpuw->nextObject, funcName); |
| 2007 | } |
| 2008 | } |
| 2009 | |