blob: 65a98af28104898cac602b0e701fb7730b4a9074 [file] [log] [blame]
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001/* 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"
Tobin Ehlis0f051a52014-10-24 13:03:56 -060033#include "xgl_string_helper.h"
Tobin Ehlisb8154982014-10-27 14:53:17 -060034#include "xgl_struct_string_helper.h"
Tobin Ehlis8726b9f2014-10-24 12:01:45 -060035
36static XGL_LAYER_DISPATCH_TABLE nextTable;
37static XGL_BASE_LAYER_OBJECT *pCurObj;
38static pthread_once_t tabOnce = PTHREAD_ONCE_INIT;
39
40// Block of code at start here for managing/tracking Pipeline state that this layer cares about
41// Just track 2 shaders for now
42#define VS 0
43#define FS 1
Tobin Ehlisb8154982014-10-27 14:53:17 -060044#define DRAW 0
45#define DRAW_INDEXED 1
46#define DRAW_INDIRECT 2
47#define DRAW_INDEXED_INDIRECT 3
48#define NUM_DRAW_TYPES 4
Tobin Ehlis8726b9f2014-10-24 12:01:45 -060049#define MAX_SLOTS 2048
Tobin Ehlisb8154982014-10-27 14:53:17 -060050
51static uint64_t drawCount[NUM_DRAW_TYPES] = {0, 0, 0, 0};
52
Tobin Ehlis8726b9f2014-10-24 12:01:45 -060053typedef struct _SHADER_DS_MAPPING {
54 XGL_UINT slotCount;
55 XGL_DESCRIPTOR_SLOT_INFO* pShaderMappingSlot;
56} SHADER_DS_MAPPING;
57
58typedef struct _PIPELINE_NODE {
59 XGL_PIPELINE pipeline;
60 struct _PIPELINE_NODE* pNext;
61 SHADER_DS_MAPPING dsMapping[2][XGL_MAX_DESCRIPTOR_SETS];
62} PIPELINE_NODE;
63
64typedef struct _PIPELINE_LL_HEADER {
65 XGL_STRUCTURE_TYPE sType;
66 const XGL_VOID* pNext;
67} PIPELINE_LL_HEADER;
68
69static PIPELINE_NODE *pPipelineHead = NULL;
70static XGL_PIPELINE lastBoundPipeline = NULL;
71
72static PIPELINE_NODE *getPipeline(XGL_PIPELINE pipeline)
73{
74 PIPELINE_NODE *pTrav = pPipelineHead;
75 while (pTrav) {
76 if (pTrav->pipeline == pipeline)
77 return pTrav;
78 pTrav = pTrav->pNext;
79 }
80 return NULL;
81}
82
83// Init the pipeline mapping info based on pipeline create info LL tree
84static void initPipeline(PIPELINE_NODE *pPipeline, const XGL_GRAPHICS_PIPELINE_CREATE_INFO* pCreateInfo)
85{
86 PIPELINE_LL_HEADER *pTrav = (PIPELINE_LL_HEADER*)pCreateInfo->pNext;
87 while (pTrav) {
88 if (XGL_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO == pTrav->sType) {
89 XGL_PIPELINE_SHADER_STAGE_CREATE_INFO* pSSCI = (XGL_PIPELINE_SHADER_STAGE_CREATE_INFO*)pTrav;
90 if (XGL_SHADER_STAGE_VERTEX == pSSCI->shader.stage) {
91 for (uint32_t i = 0; i < XGL_MAX_DESCRIPTOR_SETS; i++) {
92 if (pSSCI->shader.descriptorSetMapping[i].descriptorCount > MAX_SLOTS) {
93 printf("DS ERROR: descriptorCount for Vertex Shader exceeds 2048 (%u), is this correct? Changing to 0\n", pSSCI->shader.descriptorSetMapping[i].descriptorCount);
94 pSSCI->shader.descriptorSetMapping[i].descriptorCount = 0;
95 }
96 pPipeline->dsMapping[0][i].slotCount = pSSCI->shader.descriptorSetMapping[i].descriptorCount;
97 // Deep copy DS Slot array
98 pPipeline->dsMapping[0][i].pShaderMappingSlot = (XGL_DESCRIPTOR_SLOT_INFO*)malloc(sizeof(XGL_DESCRIPTOR_SLOT_INFO)*pPipeline->dsMapping[0][i].slotCount);
Tobin Ehlisb8154982014-10-27 14:53:17 -060099 memcpy(pPipeline->dsMapping[0][i].pShaderMappingSlot, pSSCI->shader.descriptorSetMapping[i].pDescriptorInfo, sizeof(XGL_DESCRIPTOR_SLOT_INFO)*pPipeline->dsMapping[0][i].slotCount);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600100 }
101 }
102 else if (XGL_SHADER_STAGE_FRAGMENT == pSSCI->shader.stage) {
103 for (uint32_t i = 0; i < XGL_MAX_DESCRIPTOR_SETS; i++) {
104 if (pSSCI->shader.descriptorSetMapping[i].descriptorCount > MAX_SLOTS) {
105 printf("DS ERROR: descriptorCount for Frag Shader exceeds 2048 (%u), is this correct? Changing to 0\n", pSSCI->shader.descriptorSetMapping[i].descriptorCount);
106 pSSCI->shader.descriptorSetMapping[i].descriptorCount = 0;
107 }
108 pPipeline->dsMapping[1][i].slotCount = pSSCI->shader.descriptorSetMapping[i].descriptorCount;
109 // Deep copy DS Slot array
110 pPipeline->dsMapping[1][i].pShaderMappingSlot = (XGL_DESCRIPTOR_SLOT_INFO*)malloc(sizeof(XGL_DESCRIPTOR_SLOT_INFO)*pPipeline->dsMapping[1][i].slotCount);
Tobin Ehlisb8154982014-10-27 14:53:17 -0600111 memcpy(pPipeline->dsMapping[1][i].pShaderMappingSlot, pSSCI->shader.descriptorSetMapping[i].pDescriptorInfo, sizeof(XGL_DESCRIPTOR_SLOT_INFO)*pPipeline->dsMapping[1][i].slotCount);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600112 }
113 }
114 }
Tobin Ehlisb8154982014-10-27 14:53:17 -0600115 pTrav = (PIPELINE_LL_HEADER*)pTrav->pNext;
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600116 }
117}
118
119// Block of code at start here specifically for managing/tracking DSs
120#define MAPPING_MEMORY 0x00000001
121#define MAPPING_IMAGE 0x00000002
122#define MAPPING_SAMPLER 0x00000004
123#define MAPPING_DS 0x00000008
124
Tobin Ehlis9e3d7532014-10-27 17:12:54 -0600125static char* stringSlotBinding(XGL_UINT binding)
126{
127 switch (binding)
128 {
129 case MAPPING_MEMORY:
130 return "Memory View";
131 case MAPPING_IMAGE:
132 return "Image View";
133 case MAPPING_SAMPLER:
134 return "Sampler";
135 default:
136 return "UNKNOWN DS BINDING";
137 }
138}
139
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600140typedef struct _DS_SLOT {
141 XGL_UINT slot;
142 XGL_DESCRIPTOR_SLOT_INFO shaderSlotInfo[2];
143 // Only 1 of 4 possible slot mappings active
144 XGL_UINT activeMapping;
145 XGL_UINT mappingMask; // store record of different mappings used
146 XGL_MEMORY_VIEW_ATTACH_INFO memView;
147 XGL_IMAGE_VIEW_ATTACH_INFO imageView;
148 XGL_SAMPLER sampler;
149} DS_SLOT;
150
151// Top-level node that points to start of DS
152typedef struct _DS_LL_HEAD {
153 XGL_DESCRIPTOR_SET dsID;
154 XGL_UINT numSlots;
155 struct _DS_LL_HEAD *pNextDS;
156 DS_SLOT *dsSlot; // Dynamically allocated array of DS_SLOTs
157 XGL_BOOL updateActive; // Track if DS is in an update block
158} DS_LL_HEAD;
159
160// ptr to HEAD of LL of DSs
161static DS_LL_HEAD *pDSHead = NULL;
162// Last DS that was bound
163static XGL_DESCRIPTOR_SET lastBoundDS[XGL_MAX_DESCRIPTOR_SETS] = {NULL, NULL};
164
165// Return DS Head ptr for specified ds or else NULL
166static DS_LL_HEAD* getDS(XGL_DESCRIPTOR_SET ds)
167{
168 DS_LL_HEAD *pTrav = pDSHead;
169 while (pTrav) {
170 if (pTrav->dsID == ds)
171 return pTrav;
172 pTrav = pTrav->pNextDS;
173 }
174 return NULL;
175}
176
177// Initialize a DS where all slots are UNUSED for all shaders
178static void initDS(DS_LL_HEAD *pDS)
179{
180 for (uint32_t i = 0; i < pDS->numSlots; i++) {
181 memset((void*)&pDS->dsSlot[i], 0, sizeof(DS_SLOT));
182 pDS->dsSlot[i].slot = i;
183 }
184}
185
186// Return XGL_TRUE if DS Exists and is within an xglBeginDescriptorSetUpdate() call sequence, otherwise XGL_FALSE
187static XGL_BOOL dsUpdate(XGL_DESCRIPTOR_SET ds)
188{
189 DS_LL_HEAD *pTrav = getDS(ds);
190 if (pTrav)
191 return pTrav->updateActive;
192 return XGL_FALSE;
193}
194
195// Clear specified slotCount DS Slots starting at startSlot
196// Return XGL_TRUE if DS is within a xglBeginDescriptorSetUpdate() call sequence, otherwise XGL_FALSE
197static XGL_BOOL clearDS(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount)
198{
199 DS_LL_HEAD *pTrav = getDS(descriptorSet);
200 if (!pTrav || ((startSlot + slotCount) > pTrav->numSlots)) {
201 // TODO : Log more meaningful error here
202 return XGL_FALSE;
203 }
204 for (uint32_t i = startSlot; i < slotCount; i++) {
205 memset((void*)&pTrav->dsSlot[i], 0, sizeof(DS_SLOT));
206 }
207 return XGL_TRUE;
208}
209
210static void dsSetMapping(DS_SLOT* pSlot, XGL_UINT mapping)
211{
212 pSlot->mappingMask |= mapping;
Tobin Ehlis0f051a52014-10-24 13:03:56 -0600213 pSlot->activeMapping = mapping;
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600214}
215
216static void noteSlotMapping(XGL_UINT32 mapping)
217{
218 if (MAPPING_MEMORY & mapping)
219 printf("\tMemory View previously mapped\n");
220 if (MAPPING_IMAGE & mapping)
221 printf("\tImage View previously mapped\n");
222 if (MAPPING_SAMPLER & mapping)
223 printf("\tSampler previously mapped\n");
224 if (MAPPING_DS & mapping)
225 printf("\tDESCRIPTOR SET ptr previously mapped\n");
226}
227
228static void dsSetMemMapping(DS_SLOT* pSlot, const XGL_MEMORY_VIEW_ATTACH_INFO* pMemView)
229{
230 if (pSlot->mappingMask) {
231 printf("DS INFO : While mapping Memory View to slot %u previous Mapping(s) identified:\n", pSlot->slot);
232 noteSlotMapping(pSlot->mappingMask);
233 }
234 memcpy(&pSlot->memView, pMemView, sizeof(XGL_MEMORY_VIEW_ATTACH_INFO));
235 dsSetMapping(pSlot, MAPPING_MEMORY);
236}
237
238static XGL_BOOL dsMemMapping(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_MEMORY_VIEW_ATTACH_INFO* pMemViews)
239{
240 DS_LL_HEAD *pTrav = getDS(descriptorSet);
241 if (pTrav) {
242 if (pTrav->numSlots < (startSlot + slotCount)) {
243 return XGL_FALSE;
244 }
245 for (uint32_t i = 0; i < slotCount; i++) {
246 dsSetMemMapping(&pTrav->dsSlot[i+startSlot], &pMemViews[i]);
247 }
248 }
Tobin Ehlis0f051a52014-10-24 13:03:56 -0600249 else
250 return XGL_FALSE;
251 return XGL_TRUE;
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600252}
253
254static void dsSetImageMapping(DS_SLOT* pSlot, const XGL_IMAGE_VIEW_ATTACH_INFO* pImageViews)
255{
256 if (pSlot->mappingMask) {
257 printf("DS INFO : While mapping Image View to slot %u previous Mapping(s) identified:\n", pSlot->slot);
258 noteSlotMapping(pSlot->mappingMask);
259 }
260 memcpy(&pSlot->imageView, pImageViews, sizeof(XGL_IMAGE_VIEW_ATTACH_INFO));
261 dsSetMapping(pSlot, MAPPING_IMAGE);
262}
263
264static XGL_BOOL dsImageMapping(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_IMAGE_VIEW_ATTACH_INFO* pImageViews)
265{
266 DS_LL_HEAD *pTrav = getDS(descriptorSet);
267 if (pTrav) {
268 if (pTrav->numSlots < (startSlot + slotCount)) {
269 return XGL_FALSE;
270 }
271 for (uint32_t i = 0; i < slotCount; i++) {
272 dsSetImageMapping(&pTrav->dsSlot[i+startSlot], &pImageViews[i]);
273 }
274 }
Tobin Ehlis0f051a52014-10-24 13:03:56 -0600275 else
276 return XGL_FALSE;
277 return XGL_TRUE;
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600278}
279
280static void dsSetSamplerMapping(DS_SLOT* pSlot, const XGL_SAMPLER sampler)
281{
282 if (pSlot->mappingMask) {
283 printf("DS INFO : While mapping Sampler to slot %u previous Mapping(s) identified:\n", pSlot->slot);
284 noteSlotMapping(pSlot->mappingMask);
285 }
286 pSlot->sampler = sampler;
287 dsSetMapping(pSlot, MAPPING_SAMPLER);
288}
289
290static XGL_BOOL dsSamplerMapping(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_SAMPLER* pSamplers)
291{
292 DS_LL_HEAD *pTrav = getDS(descriptorSet);
293 if (pTrav) {
294 if (pTrav->numSlots < (startSlot + slotCount)) {
295 return XGL_FALSE;
296 }
297 for (uint32_t i = 0; i < slotCount; i++) {
Tobin Ehlisb8154982014-10-27 14:53:17 -0600298 dsSetSamplerMapping(&pTrav->dsSlot[i+startSlot], pSamplers[i]);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600299 }
300 }
Tobin Ehlis0f051a52014-10-24 13:03:56 -0600301 else
302 return XGL_FALSE;
303 return XGL_TRUE;
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600304}
305
306// Synch up currently bound pipeline settings with DS mappings
307static void synchDSMapping()
308{
309 // First verify that we have a bound pipeline
310 PIPELINE_NODE *pPipeTrav = getPipeline(lastBoundPipeline);
311 if (!pPipeTrav) {
312 printf("DS ERROR : Can't find last bound Pipeline %p!\n", (void*)lastBoundPipeline);
313 }
314 else {
315 for (uint32_t i = 0; i < XGL_MAX_DESCRIPTOR_SETS; i++) {
Tobin Ehlis0f051a52014-10-24 13:03:56 -0600316 DS_LL_HEAD *pDS;
317 if (lastBoundDS[i]) {
318 pDS = getDS(lastBoundDS[i]);
319 if (!pDS) {
320 printf("DS ERROR : Can't find last bound DS %p. Did you need to bind DS to index %u?\n", (void*)lastBoundDS[i], i);
321 }
322 else { // We have a good DS & Pipeline, store pipeline mappings in DS
323 for (uint32_t j = 0; j < 2; j++) { // j is shader selector
324 for (uint32_t k = 0; k < XGL_MAX_DESCRIPTOR_SETS; k++) {
325 if (pPipeTrav->dsMapping[j][k].slotCount > pDS->numSlots) {
326 printf("DS ERROR : DS Mapping for shader %u has more slots (%u) than DS %p (%u)!\n", j, pPipeTrav->dsMapping[j][k].slotCount, (void*)pDS->dsID, pDS->numSlots);
327 }
328 else {
329 for (uint32_t r = 0; r < pPipeTrav->dsMapping[j][k].slotCount; r++) {
Tobin Ehlisb8154982014-10-27 14:53:17 -0600330 pDS->dsSlot[r].shaderSlotInfo[j] = pPipeTrav->dsMapping[j][k].pShaderMappingSlot[r];
Tobin Ehlis0f051a52014-10-24 13:03:56 -0600331 }
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600332 }
333 }
334 }
335 }
336 }
Tobin Ehlis0f051a52014-10-24 13:03:56 -0600337 else {
338 printf("DS INFO : It appears that no DS was bound to index %u.\n", i);
339 }
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600340 }
341 }
342}
343
Tobin Ehlis9e3d7532014-10-27 17:12:54 -0600344// Checks to make sure that shader mapping matches slot binding
345// Print an ERROR and return XGL_FALSE if they don't line up
346static XGL_BOOL verifyShaderSlotMapping(const XGL_UINT slot, const XGL_UINT slotBinding, const XGL_UINT shaderStage, const XGL_DESCRIPTOR_SET_SLOT_TYPE shaderMapping)
347{
348 XGL_BOOL error = XGL_FALSE;
349 switch (shaderMapping)
350 {
351 case XGL_SLOT_SHADER_RESOURCE:
352 if (MAPPING_MEMORY != slotBinding && MAPPING_IMAGE != slotBinding)
353 error = XGL_TRUE;
354 break;
355 case XGL_SLOT_SHADER_SAMPLER:
356 if (MAPPING_SAMPLER != slotBinding)
357 error = XGL_TRUE;
358 break;
359 case XGL_SLOT_VERTEX_INPUT:
360 if (MAPPING_MEMORY != slotBinding)
361 error = XGL_TRUE;
362 break;
363 case XGL_SLOT_SHADER_UAV:
364 if (MAPPING_MEMORY != slotBinding)
365 error = XGL_TRUE;
366 break;
367 case XGL_SLOT_NEXT_DESCRIPTOR_SET:
368 if (MAPPING_DS != slotBinding)
369 error = XGL_TRUE;
370 break;
371 case XGL_SLOT_UNUSED:
372 break;
373 default:
374 printf("DS ERROR : For DS slot %u, unknown shader slot mapping w/ value %u\n", slot, shaderMapping);
375 return XGL_FALSE;
376 }
377 if (XGL_TRUE == error) {
378 printf("DS ERROR : DS Slot #%u binding of %s does not match %s shader mapping of %s\n", slot, stringSlotBinding(slotBinding), (shaderStage == VS) ? "Vtx" : "Frag", string_XGL_DESCRIPTOR_SET_SLOT_TYPE(shaderMapping));
379 return XGL_FALSE;
380 }
381 return XGL_TRUE;
382}
383
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600384// Print details of DS config to stdout
385static void printDSConfig()
386{
387 for (uint32_t i = 0; i < XGL_MAX_DESCRIPTOR_SETS; i++) {
Tobin Ehlisb8154982014-10-27 14:53:17 -0600388 if (lastBoundDS[i]) {
389 DS_LL_HEAD *pDS = getDS(lastBoundDS[i]);
390 if (pDS) {
391 printf("DS INFO : Slot bindings for DS w/ %u slots at index %u (%p):\n", pDS->numSlots, i, (void*)pDS->dsID);
392 for (uint32_t j = 0; j < pDS->numSlots; j++) {
393 printf("----Slot %u\n", j);
394 switch (pDS->dsSlot[j].activeMapping)
395 {
396 case MAPPING_MEMORY:
397 printf(" Mapped to Memory View %p:\n%s", (void*)&pDS->dsSlot[j].memView, xgl_print_xgl_memory_view_attach_info(&pDS->dsSlot[j].memView, " "));
398 break;
399 case MAPPING_IMAGE:
400 printf(" Mapped to Image View %p:\n%s", (void*)&pDS->dsSlot[j].imageView, xgl_print_xgl_image_view_attach_info(&pDS->dsSlot[j].imageView, " "));
401 break;
402 case MAPPING_SAMPLER:
403 printf(" Mapped to Sampler Object %p (CAN PRINT DETAILS HERE)\n", (void*)pDS->dsSlot[j].sampler);
404 break;
405 default:
406 printf(" NO VIEW MAPPED TO THIS DS SLOT\n");
407 break;
408 }
Tobin Ehlis9e3d7532014-10-27 17:12:54 -0600409 // For each shader type, check its mapping
Tobin Ehlisb8154982014-10-27 14:53:17 -0600410 for (uint32_t k = 0; k < 2; k++) {
411 if (XGL_SLOT_UNUSED != pDS->dsSlot[j].shaderSlotInfo[k].slotObjectType) {
412 printf(" Shader type %s has %s slot type mapping to shaderEntityIndex %u\n", (k == 0) ? "VS" : "FS", string_XGL_DESCRIPTOR_SET_SLOT_TYPE(pDS->dsSlot[j].shaderSlotInfo[k].slotObjectType), pDS->dsSlot[j].shaderSlotInfo[k].shaderEntityIndex);
Tobin Ehlis9e3d7532014-10-27 17:12:54 -0600413 verifyShaderSlotMapping(j, pDS->dsSlot[j].activeMapping, k, pDS->dsSlot[j].shaderSlotInfo[k].slotObjectType);
Tobin Ehlisb8154982014-10-27 14:53:17 -0600414 }
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600415 }
416 }
417 }
Tobin Ehlisb8154982014-10-27 14:53:17 -0600418 else {
419 printf("DS ERROR : Can't find last bound DS %p. Did you need to bind DS to index %u?\n", (void*)lastBoundDS[i], i);
420 }
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600421 }
422 }
423}
424
425static void synchAndPrintDSConfig()
426{
427 synchDSMapping();
428 printDSConfig();
429}
430
431static void initLayerTable()
432{
433 GetProcAddrType fpNextGPA;
434 fpNextGPA = pCurObj->pGPA;
435 assert(fpNextGPA);
436
437 GetProcAddrType fpGetProcAddr = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetProcAddr");
438 nextTable.GetProcAddr = fpGetProcAddr;
439 InitAndEnumerateGpusType fpInitAndEnumerateGpus = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglInitAndEnumerateGpus");
440 nextTable.InitAndEnumerateGpus = fpInitAndEnumerateGpus;
441 GetGpuInfoType fpGetGpuInfo = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetGpuInfo");
442 nextTable.GetGpuInfo = fpGetGpuInfo;
443 CreateDeviceType fpCreateDevice = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateDevice");
444 nextTable.CreateDevice = fpCreateDevice;
445 DestroyDeviceType fpDestroyDevice = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDestroyDevice");
446 nextTable.DestroyDevice = fpDestroyDevice;
447 GetExtensionSupportType fpGetExtensionSupport = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetExtensionSupport");
448 nextTable.GetExtensionSupport = fpGetExtensionSupport;
449 EnumerateLayersType fpEnumerateLayers = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglEnumerateLayers");
450 nextTable.EnumerateLayers = fpEnumerateLayers;
451 GetDeviceQueueType fpGetDeviceQueue = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetDeviceQueue");
452 nextTable.GetDeviceQueue = fpGetDeviceQueue;
453 QueueSubmitType fpQueueSubmit = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglQueueSubmit");
454 nextTable.QueueSubmit = fpQueueSubmit;
455 QueueSetGlobalMemReferencesType fpQueueSetGlobalMemReferences = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglQueueSetGlobalMemReferences");
456 nextTable.QueueSetGlobalMemReferences = fpQueueSetGlobalMemReferences;
457 QueueWaitIdleType fpQueueWaitIdle = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglQueueWaitIdle");
458 nextTable.QueueWaitIdle = fpQueueWaitIdle;
459 DeviceWaitIdleType fpDeviceWaitIdle = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDeviceWaitIdle");
460 nextTable.DeviceWaitIdle = fpDeviceWaitIdle;
461 GetMemoryHeapCountType fpGetMemoryHeapCount = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetMemoryHeapCount");
462 nextTable.GetMemoryHeapCount = fpGetMemoryHeapCount;
463 GetMemoryHeapInfoType fpGetMemoryHeapInfo = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetMemoryHeapInfo");
464 nextTable.GetMemoryHeapInfo = fpGetMemoryHeapInfo;
465 AllocMemoryType fpAllocMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglAllocMemory");
466 nextTable.AllocMemory = fpAllocMemory;
467 FreeMemoryType fpFreeMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglFreeMemory");
468 nextTable.FreeMemory = fpFreeMemory;
469 SetMemoryPriorityType fpSetMemoryPriority = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglSetMemoryPriority");
470 nextTable.SetMemoryPriority = fpSetMemoryPriority;
471 MapMemoryType fpMapMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglMapMemory");
472 nextTable.MapMemory = fpMapMemory;
473 UnmapMemoryType fpUnmapMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglUnmapMemory");
474 nextTable.UnmapMemory = fpUnmapMemory;
475 PinSystemMemoryType fpPinSystemMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglPinSystemMemory");
476 nextTable.PinSystemMemory = fpPinSystemMemory;
477 RemapVirtualMemoryPagesType fpRemapVirtualMemoryPages = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglRemapVirtualMemoryPages");
478 nextTable.RemapVirtualMemoryPages = fpRemapVirtualMemoryPages;
479 GetMultiGpuCompatibilityType fpGetMultiGpuCompatibility = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetMultiGpuCompatibility");
480 nextTable.GetMultiGpuCompatibility = fpGetMultiGpuCompatibility;
481 OpenSharedMemoryType fpOpenSharedMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglOpenSharedMemory");
482 nextTable.OpenSharedMemory = fpOpenSharedMemory;
483 OpenSharedQueueSemaphoreType fpOpenSharedQueueSemaphore = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglOpenSharedQueueSemaphore");
484 nextTable.OpenSharedQueueSemaphore = fpOpenSharedQueueSemaphore;
485 OpenPeerMemoryType fpOpenPeerMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglOpenPeerMemory");
486 nextTable.OpenPeerMemory = fpOpenPeerMemory;
487 OpenPeerImageType fpOpenPeerImage = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglOpenPeerImage");
488 nextTable.OpenPeerImage = fpOpenPeerImage;
489 DestroyObjectType fpDestroyObject = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDestroyObject");
490 nextTable.DestroyObject = fpDestroyObject;
491 GetObjectInfoType fpGetObjectInfo = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetObjectInfo");
492 nextTable.GetObjectInfo = fpGetObjectInfo;
493 BindObjectMemoryType fpBindObjectMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglBindObjectMemory");
494 nextTable.BindObjectMemory = fpBindObjectMemory;
495 CreateFenceType fpCreateFence = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateFence");
496 nextTable.CreateFence = fpCreateFence;
497 GetFenceStatusType fpGetFenceStatus = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetFenceStatus");
498 nextTable.GetFenceStatus = fpGetFenceStatus;
499 WaitForFencesType fpWaitForFences = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglWaitForFences");
500 nextTable.WaitForFences = fpWaitForFences;
501 CreateQueueSemaphoreType fpCreateQueueSemaphore = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateQueueSemaphore");
502 nextTable.CreateQueueSemaphore = fpCreateQueueSemaphore;
503 SignalQueueSemaphoreType fpSignalQueueSemaphore = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglSignalQueueSemaphore");
504 nextTable.SignalQueueSemaphore = fpSignalQueueSemaphore;
505 WaitQueueSemaphoreType fpWaitQueueSemaphore = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglWaitQueueSemaphore");
506 nextTable.WaitQueueSemaphore = fpWaitQueueSemaphore;
507 CreateEventType fpCreateEvent = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateEvent");
508 nextTable.CreateEvent = fpCreateEvent;
509 GetEventStatusType fpGetEventStatus = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetEventStatus");
510 nextTable.GetEventStatus = fpGetEventStatus;
511 SetEventType fpSetEvent = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglSetEvent");
512 nextTable.SetEvent = fpSetEvent;
513 ResetEventType fpResetEvent = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglResetEvent");
514 nextTable.ResetEvent = fpResetEvent;
515 CreateQueryPoolType fpCreateQueryPool = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateQueryPool");
516 nextTable.CreateQueryPool = fpCreateQueryPool;
517 GetQueryPoolResultsType fpGetQueryPoolResults = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetQueryPoolResults");
518 nextTable.GetQueryPoolResults = fpGetQueryPoolResults;
519 GetFormatInfoType fpGetFormatInfo = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetFormatInfo");
520 nextTable.GetFormatInfo = fpGetFormatInfo;
521 CreateImageType fpCreateImage = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateImage");
522 nextTable.CreateImage = fpCreateImage;
523 GetImageSubresourceInfoType fpGetImageSubresourceInfo = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetImageSubresourceInfo");
524 nextTable.GetImageSubresourceInfo = fpGetImageSubresourceInfo;
525 CreateImageViewType fpCreateImageView = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateImageView");
526 nextTable.CreateImageView = fpCreateImageView;
527 CreateColorAttachmentViewType fpCreateColorAttachmentView = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateColorAttachmentView");
528 nextTable.CreateColorAttachmentView = fpCreateColorAttachmentView;
529 CreateDepthStencilViewType fpCreateDepthStencilView = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateDepthStencilView");
530 nextTable.CreateDepthStencilView = fpCreateDepthStencilView;
531 CreateShaderType fpCreateShader = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateShader");
532 nextTable.CreateShader = fpCreateShader;
533 CreateGraphicsPipelineType fpCreateGraphicsPipeline = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateGraphicsPipeline");
534 nextTable.CreateGraphicsPipeline = fpCreateGraphicsPipeline;
535 CreateComputePipelineType fpCreateComputePipeline = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateComputePipeline");
536 nextTable.CreateComputePipeline = fpCreateComputePipeline;
537 StorePipelineType fpStorePipeline = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglStorePipeline");
538 nextTable.StorePipeline = fpStorePipeline;
539 LoadPipelineType fpLoadPipeline = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglLoadPipeline");
540 nextTable.LoadPipeline = fpLoadPipeline;
541 CreatePipelineDeltaType fpCreatePipelineDelta = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreatePipelineDelta");
542 nextTable.CreatePipelineDelta = fpCreatePipelineDelta;
543 CreateSamplerType fpCreateSampler = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateSampler");
544 nextTable.CreateSampler = fpCreateSampler;
545 CreateDescriptorSetType fpCreateDescriptorSet = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateDescriptorSet");
546 nextTable.CreateDescriptorSet = fpCreateDescriptorSet;
547 BeginDescriptorSetUpdateType fpBeginDescriptorSetUpdate = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglBeginDescriptorSetUpdate");
548 nextTable.BeginDescriptorSetUpdate = fpBeginDescriptorSetUpdate;
549 EndDescriptorSetUpdateType fpEndDescriptorSetUpdate = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglEndDescriptorSetUpdate");
550 nextTable.EndDescriptorSetUpdate = fpEndDescriptorSetUpdate;
551 AttachSamplerDescriptorsType fpAttachSamplerDescriptors = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglAttachSamplerDescriptors");
552 nextTable.AttachSamplerDescriptors = fpAttachSamplerDescriptors;
553 AttachImageViewDescriptorsType fpAttachImageViewDescriptors = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglAttachImageViewDescriptors");
554 nextTable.AttachImageViewDescriptors = fpAttachImageViewDescriptors;
555 AttachMemoryViewDescriptorsType fpAttachMemoryViewDescriptors = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglAttachMemoryViewDescriptors");
556 nextTable.AttachMemoryViewDescriptors = fpAttachMemoryViewDescriptors;
557 AttachNestedDescriptorsType fpAttachNestedDescriptors = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglAttachNestedDescriptors");
558 nextTable.AttachNestedDescriptors = fpAttachNestedDescriptors;
559 ClearDescriptorSetSlotsType fpClearDescriptorSetSlots = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglClearDescriptorSetSlots");
560 nextTable.ClearDescriptorSetSlots = fpClearDescriptorSetSlots;
561 CreateViewportStateType fpCreateViewportState = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateViewportState");
562 nextTable.CreateViewportState = fpCreateViewportState;
563 CreateRasterStateType fpCreateRasterState = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateRasterState");
564 nextTable.CreateRasterState = fpCreateRasterState;
565 CreateMsaaStateType fpCreateMsaaState = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateMsaaState");
566 nextTable.CreateMsaaState = fpCreateMsaaState;
567 CreateColorBlendStateType fpCreateColorBlendState = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateColorBlendState");
568 nextTable.CreateColorBlendState = fpCreateColorBlendState;
569 CreateDepthStencilStateType fpCreateDepthStencilState = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateDepthStencilState");
570 nextTable.CreateDepthStencilState = fpCreateDepthStencilState;
571 CreateCommandBufferType fpCreateCommandBuffer = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateCommandBuffer");
572 nextTable.CreateCommandBuffer = fpCreateCommandBuffer;
573 BeginCommandBufferType fpBeginCommandBuffer = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglBeginCommandBuffer");
574 nextTable.BeginCommandBuffer = fpBeginCommandBuffer;
575 EndCommandBufferType fpEndCommandBuffer = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglEndCommandBuffer");
576 nextTable.EndCommandBuffer = fpEndCommandBuffer;
577 ResetCommandBufferType fpResetCommandBuffer = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglResetCommandBuffer");
578 nextTable.ResetCommandBuffer = fpResetCommandBuffer;
579 CmdBindPipelineType fpCmdBindPipeline = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindPipeline");
580 nextTable.CmdBindPipeline = fpCmdBindPipeline;
581 CmdBindPipelineDeltaType fpCmdBindPipelineDelta = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindPipelineDelta");
582 nextTable.CmdBindPipelineDelta = fpCmdBindPipelineDelta;
583 CmdBindStateObjectType fpCmdBindStateObject = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindStateObject");
584 nextTable.CmdBindStateObject = fpCmdBindStateObject;
585 CmdBindDescriptorSetType fpCmdBindDescriptorSet = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindDescriptorSet");
586 nextTable.CmdBindDescriptorSet = fpCmdBindDescriptorSet;
587 CmdBindDynamicMemoryViewType fpCmdBindDynamicMemoryView = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindDynamicMemoryView");
588 nextTable.CmdBindDynamicMemoryView = fpCmdBindDynamicMemoryView;
589 CmdBindIndexDataType fpCmdBindIndexData = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindIndexData");
590 nextTable.CmdBindIndexData = fpCmdBindIndexData;
591 CmdBindAttachmentsType fpCmdBindAttachments = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindAttachments");
592 nextTable.CmdBindAttachments = fpCmdBindAttachments;
593 CmdPrepareMemoryRegionsType fpCmdPrepareMemoryRegions = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdPrepareMemoryRegions");
594 nextTable.CmdPrepareMemoryRegions = fpCmdPrepareMemoryRegions;
595 CmdPrepareImagesType fpCmdPrepareImages = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdPrepareImages");
596 nextTable.CmdPrepareImages = fpCmdPrepareImages;
597 CmdDrawType fpCmdDraw = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDraw");
598 nextTable.CmdDraw = fpCmdDraw;
599 CmdDrawIndexedType fpCmdDrawIndexed = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDrawIndexed");
600 nextTable.CmdDrawIndexed = fpCmdDrawIndexed;
601 CmdDrawIndirectType fpCmdDrawIndirect = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDrawIndirect");
602 nextTable.CmdDrawIndirect = fpCmdDrawIndirect;
603 CmdDrawIndexedIndirectType fpCmdDrawIndexedIndirect = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDrawIndexedIndirect");
604 nextTable.CmdDrawIndexedIndirect = fpCmdDrawIndexedIndirect;
605 CmdDispatchType fpCmdDispatch = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDispatch");
606 nextTable.CmdDispatch = fpCmdDispatch;
607 CmdDispatchIndirectType fpCmdDispatchIndirect = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDispatchIndirect");
608 nextTable.CmdDispatchIndirect = fpCmdDispatchIndirect;
609 CmdCopyMemoryType fpCmdCopyMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdCopyMemory");
610 nextTable.CmdCopyMemory = fpCmdCopyMemory;
611 CmdCopyImageType fpCmdCopyImage = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdCopyImage");
612 nextTable.CmdCopyImage = fpCmdCopyImage;
613 CmdCopyMemoryToImageType fpCmdCopyMemoryToImage = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdCopyMemoryToImage");
614 nextTable.CmdCopyMemoryToImage = fpCmdCopyMemoryToImage;
615 CmdCopyImageToMemoryType fpCmdCopyImageToMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdCopyImageToMemory");
616 nextTable.CmdCopyImageToMemory = fpCmdCopyImageToMemory;
617 CmdCloneImageDataType fpCmdCloneImageData = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdCloneImageData");
618 nextTable.CmdCloneImageData = fpCmdCloneImageData;
619 CmdUpdateMemoryType fpCmdUpdateMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdUpdateMemory");
620 nextTable.CmdUpdateMemory = fpCmdUpdateMemory;
621 CmdFillMemoryType fpCmdFillMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdFillMemory");
622 nextTable.CmdFillMemory = fpCmdFillMemory;
623 CmdClearColorImageType fpCmdClearColorImage = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdClearColorImage");
624 nextTable.CmdClearColorImage = fpCmdClearColorImage;
625 CmdClearColorImageRawType fpCmdClearColorImageRaw = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdClearColorImageRaw");
626 nextTable.CmdClearColorImageRaw = fpCmdClearColorImageRaw;
627 CmdClearDepthStencilType fpCmdClearDepthStencil = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdClearDepthStencil");
628 nextTable.CmdClearDepthStencil = fpCmdClearDepthStencil;
629 CmdResolveImageType fpCmdResolveImage = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdResolveImage");
630 nextTable.CmdResolveImage = fpCmdResolveImage;
631 CmdSetEventType fpCmdSetEvent = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdSetEvent");
632 nextTable.CmdSetEvent = fpCmdSetEvent;
633 CmdResetEventType fpCmdResetEvent = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdResetEvent");
634 nextTable.CmdResetEvent = fpCmdResetEvent;
635 CmdMemoryAtomicType fpCmdMemoryAtomic = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdMemoryAtomic");
636 nextTable.CmdMemoryAtomic = fpCmdMemoryAtomic;
637 CmdBeginQueryType fpCmdBeginQuery = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBeginQuery");
638 nextTable.CmdBeginQuery = fpCmdBeginQuery;
639 CmdEndQueryType fpCmdEndQuery = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdEndQuery");
640 nextTable.CmdEndQuery = fpCmdEndQuery;
641 CmdResetQueryPoolType fpCmdResetQueryPool = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdResetQueryPool");
642 nextTable.CmdResetQueryPool = fpCmdResetQueryPool;
643 CmdWriteTimestampType fpCmdWriteTimestamp = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdWriteTimestamp");
644 nextTable.CmdWriteTimestamp = fpCmdWriteTimestamp;
645 CmdInitAtomicCountersType fpCmdInitAtomicCounters = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdInitAtomicCounters");
646 nextTable.CmdInitAtomicCounters = fpCmdInitAtomicCounters;
647 CmdLoadAtomicCountersType fpCmdLoadAtomicCounters = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdLoadAtomicCounters");
648 nextTable.CmdLoadAtomicCounters = fpCmdLoadAtomicCounters;
649 CmdSaveAtomicCountersType fpCmdSaveAtomicCounters = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdSaveAtomicCounters");
650 nextTable.CmdSaveAtomicCounters = fpCmdSaveAtomicCounters;
651 DbgSetValidationLevelType fpDbgSetValidationLevel = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDbgSetValidationLevel");
652 nextTable.DbgSetValidationLevel = fpDbgSetValidationLevel;
653 DbgRegisterMsgCallbackType fpDbgRegisterMsgCallback = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDbgRegisterMsgCallback");
654 nextTable.DbgRegisterMsgCallback = fpDbgRegisterMsgCallback;
655 DbgUnregisterMsgCallbackType fpDbgUnregisterMsgCallback = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDbgUnregisterMsgCallback");
656 nextTable.DbgUnregisterMsgCallback = fpDbgUnregisterMsgCallback;
657 DbgSetMessageFilterType fpDbgSetMessageFilter = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDbgSetMessageFilter");
658 nextTable.DbgSetMessageFilter = fpDbgSetMessageFilter;
659 DbgSetObjectTagType fpDbgSetObjectTag = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDbgSetObjectTag");
660 nextTable.DbgSetObjectTag = fpDbgSetObjectTag;
661 DbgSetGlobalOptionType fpDbgSetGlobalOption = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDbgSetGlobalOption");
662 nextTable.DbgSetGlobalOption = fpDbgSetGlobalOption;
663 DbgSetDeviceOptionType fpDbgSetDeviceOption = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDbgSetDeviceOption");
664 nextTable.DbgSetDeviceOption = fpDbgSetDeviceOption;
665 CmdDbgMarkerBeginType fpCmdDbgMarkerBegin = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDbgMarkerBegin");
666 nextTable.CmdDbgMarkerBegin = fpCmdDbgMarkerBegin;
667 CmdDbgMarkerEndType fpCmdDbgMarkerEnd = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDbgMarkerEnd");
668 nextTable.CmdDbgMarkerEnd = fpCmdDbgMarkerEnd;
669 WsiX11AssociateConnectionType fpWsiX11AssociateConnection = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglWsiX11AssociateConnection");
670 nextTable.WsiX11AssociateConnection = fpWsiX11AssociateConnection;
671 WsiX11GetMSCType fpWsiX11GetMSC = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglWsiX11GetMSC");
672 nextTable.WsiX11GetMSC = fpWsiX11GetMSC;
673 WsiX11CreatePresentableImageType fpWsiX11CreatePresentableImage = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglWsiX11CreatePresentableImage");
674 nextTable.WsiX11CreatePresentableImage = fpWsiX11CreatePresentableImage;
675 WsiX11QueuePresentType fpWsiX11QueuePresent = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglWsiX11QueuePresent");
676 nextTable.WsiX11QueuePresent = fpWsiX11QueuePresent;
677}
678
679
680XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetGpuInfo(XGL_PHYSICAL_GPU gpu, XGL_PHYSICAL_GPU_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData)
681{
682 XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu;
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600683 pCurObj = gpuw;
684 pthread_once(&tabOnce, initLayerTable);
685 XGL_RESULT result = nextTable.GetGpuInfo((XGL_PHYSICAL_GPU)gpuw->nextObject, infoType, pDataSize, pData);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600686 return result;
687}
688
689XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateDevice(XGL_PHYSICAL_GPU gpu, const XGL_DEVICE_CREATE_INFO* pCreateInfo, XGL_DEVICE* pDevice)
690{
691 XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu;
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600692 pCurObj = gpuw;
693 pthread_once(&tabOnce, initLayerTable);
694 XGL_RESULT result = nextTable.CreateDevice((XGL_PHYSICAL_GPU)gpuw->nextObject, pCreateInfo, pDevice);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600695 return result;
696}
697
698XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDestroyDevice(XGL_DEVICE device)
699{
700 XGL_RESULT result = nextTable.DestroyDevice(device);
701 return result;
702}
703
704XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetExtensionSupport(XGL_PHYSICAL_GPU gpu, const XGL_CHAR* pExtName)
705{
706 XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu;
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600707 pCurObj = gpuw;
708 pthread_once(&tabOnce, initLayerTable);
709 XGL_RESULT result = nextTable.GetExtensionSupport((XGL_PHYSICAL_GPU)gpuw->nextObject, pExtName);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600710 return result;
711}
712
713XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, XGL_CHAR* const* pOutLayers, XGL_SIZE * pOutLayerCount)
714{
715 XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu;
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600716 pCurObj = gpuw;
717 pthread_once(&tabOnce, initLayerTable);
718 XGL_RESULT result = nextTable.EnumerateLayers((XGL_PHYSICAL_GPU)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayers, pOutLayerCount);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600719 return result;
720}
721
722XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetDeviceQueue(XGL_DEVICE device, XGL_QUEUE_TYPE queueType, XGL_UINT queueIndex, XGL_QUEUE* pQueue)
723{
724 XGL_RESULT result = nextTable.GetDeviceQueue(device, queueType, queueIndex, pQueue);
725 return result;
726}
727
728XGL_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)
729{
730 XGL_RESULT result = nextTable.QueueSubmit(queue, cmdBufferCount, pCmdBuffers, memRefCount, pMemRefs, fence);
731 return result;
732}
733
734XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglQueueSetGlobalMemReferences(XGL_QUEUE queue, XGL_UINT memRefCount, const XGL_MEMORY_REF* pMemRefs)
735{
736 XGL_RESULT result = nextTable.QueueSetGlobalMemReferences(queue, memRefCount, pMemRefs);
737 return result;
738}
739
740XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglQueueWaitIdle(XGL_QUEUE queue)
741{
742 XGL_RESULT result = nextTable.QueueWaitIdle(queue);
743 return result;
744}
745
746XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDeviceWaitIdle(XGL_DEVICE device)
747{
748 XGL_RESULT result = nextTable.DeviceWaitIdle(device);
749 return result;
750}
751
752XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetMemoryHeapCount(XGL_DEVICE device, XGL_UINT* pCount)
753{
754 XGL_RESULT result = nextTable.GetMemoryHeapCount(device, pCount);
755 return result;
756}
757
758XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetMemoryHeapInfo(XGL_DEVICE device, XGL_UINT heapId, XGL_MEMORY_HEAP_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData)
759{
760 XGL_RESULT result = nextTable.GetMemoryHeapInfo(device, heapId, infoType, pDataSize, pData);
761 return result;
762}
763
764XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglAllocMemory(XGL_DEVICE device, const XGL_MEMORY_ALLOC_INFO* pAllocInfo, XGL_GPU_MEMORY* pMem)
765{
766 XGL_RESULT result = nextTable.AllocMemory(device, pAllocInfo, pMem);
767 return result;
768}
769
770XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglFreeMemory(XGL_GPU_MEMORY mem)
771{
772 XGL_RESULT result = nextTable.FreeMemory(mem);
773 return result;
774}
775
776XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglSetMemoryPriority(XGL_GPU_MEMORY mem, XGL_MEMORY_PRIORITY priority)
777{
778 XGL_RESULT result = nextTable.SetMemoryPriority(mem, priority);
779 return result;
780}
781
782XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglMapMemory(XGL_GPU_MEMORY mem, XGL_FLAGS flags, XGL_VOID** ppData)
783{
784 XGL_RESULT result = nextTable.MapMemory(mem, flags, ppData);
785 return result;
786}
787
788XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglUnmapMemory(XGL_GPU_MEMORY mem)
789{
790 XGL_RESULT result = nextTable.UnmapMemory(mem);
791 return result;
792}
793
794XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglPinSystemMemory(XGL_DEVICE device, const XGL_VOID* pSysMem, XGL_SIZE memSize, XGL_GPU_MEMORY* pMem)
795{
796 XGL_RESULT result = nextTable.PinSystemMemory(device, pSysMem, memSize, pMem);
797 return result;
798}
799
800XGL_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)
801{
802 XGL_RESULT result = nextTable.RemapVirtualMemoryPages(device, rangeCount, pRanges, preWaitSemaphoreCount, pPreWaitSemaphores, postSignalSemaphoreCount, pPostSignalSemaphores);
803 return result;
804}
805
806XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetMultiGpuCompatibility(XGL_PHYSICAL_GPU gpu0, XGL_PHYSICAL_GPU gpu1, XGL_GPU_COMPATIBILITY_INFO* pInfo)
807{
808 XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu0;
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600809 pCurObj = gpuw;
810 pthread_once(&tabOnce, initLayerTable);
811 XGL_RESULT result = nextTable.GetMultiGpuCompatibility((XGL_PHYSICAL_GPU)gpuw->nextObject, gpu1, pInfo);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600812 return result;
813}
814
815XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglOpenSharedMemory(XGL_DEVICE device, const XGL_MEMORY_OPEN_INFO* pOpenInfo, XGL_GPU_MEMORY* pMem)
816{
817 XGL_RESULT result = nextTable.OpenSharedMemory(device, pOpenInfo, pMem);
818 return result;
819}
820
821XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglOpenSharedQueueSemaphore(XGL_DEVICE device, const XGL_QUEUE_SEMAPHORE_OPEN_INFO* pOpenInfo, XGL_QUEUE_SEMAPHORE* pSemaphore)
822{
823 XGL_RESULT result = nextTable.OpenSharedQueueSemaphore(device, pOpenInfo, pSemaphore);
824 return result;
825}
826
827XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglOpenPeerMemory(XGL_DEVICE device, const XGL_PEER_MEMORY_OPEN_INFO* pOpenInfo, XGL_GPU_MEMORY* pMem)
828{
829 XGL_RESULT result = nextTable.OpenPeerMemory(device, pOpenInfo, pMem);
830 return result;
831}
832
833XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglOpenPeerImage(XGL_DEVICE device, const XGL_PEER_IMAGE_OPEN_INFO* pOpenInfo, XGL_IMAGE* pImage, XGL_GPU_MEMORY* pMem)
834{
835 XGL_RESULT result = nextTable.OpenPeerImage(device, pOpenInfo, pImage, pMem);
836 return result;
837}
838
839XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDestroyObject(XGL_OBJECT object)
840{
841 XGL_RESULT result = nextTable.DestroyObject(object);
842 return result;
843}
844
845XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetObjectInfo(XGL_BASE_OBJECT object, XGL_OBJECT_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData)
846{
847 XGL_RESULT result = nextTable.GetObjectInfo(object, infoType, pDataSize, pData);
848 return result;
849}
850
851XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglBindObjectMemory(XGL_OBJECT object, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset)
852{
853 XGL_RESULT result = nextTable.BindObjectMemory(object, mem, offset);
854 return result;
855}
856
857XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateFence(XGL_DEVICE device, const XGL_FENCE_CREATE_INFO* pCreateInfo, XGL_FENCE* pFence)
858{
859 XGL_RESULT result = nextTable.CreateFence(device, pCreateInfo, pFence);
860 return result;
861}
862
863XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetFenceStatus(XGL_FENCE fence)
864{
865 XGL_RESULT result = nextTable.GetFenceStatus(fence);
866 return result;
867}
868
869XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWaitForFences(XGL_DEVICE device, XGL_UINT fenceCount, const XGL_FENCE* pFences, XGL_BOOL waitAll, XGL_UINT64 timeout)
870{
871 XGL_RESULT result = nextTable.WaitForFences(device, fenceCount, pFences, waitAll, timeout);
872 return result;
873}
874
875XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateQueueSemaphore(XGL_DEVICE device, const XGL_QUEUE_SEMAPHORE_CREATE_INFO* pCreateInfo, XGL_QUEUE_SEMAPHORE* pSemaphore)
876{
877 XGL_RESULT result = nextTable.CreateQueueSemaphore(device, pCreateInfo, pSemaphore);
878 return result;
879}
880
881XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglSignalQueueSemaphore(XGL_QUEUE queue, XGL_QUEUE_SEMAPHORE semaphore)
882{
883 XGL_RESULT result = nextTable.SignalQueueSemaphore(queue, semaphore);
884 return result;
885}
886
887XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWaitQueueSemaphore(XGL_QUEUE queue, XGL_QUEUE_SEMAPHORE semaphore)
888{
889 XGL_RESULT result = nextTable.WaitQueueSemaphore(queue, semaphore);
890 return result;
891}
892
893XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateEvent(XGL_DEVICE device, const XGL_EVENT_CREATE_INFO* pCreateInfo, XGL_EVENT* pEvent)
894{
895 XGL_RESULT result = nextTable.CreateEvent(device, pCreateInfo, pEvent);
896 return result;
897}
898
899XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetEventStatus(XGL_EVENT event)
900{
901 XGL_RESULT result = nextTable.GetEventStatus(event);
902 return result;
903}
904
905XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglSetEvent(XGL_EVENT event)
906{
907 XGL_RESULT result = nextTable.SetEvent(event);
908 return result;
909}
910
911XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglResetEvent(XGL_EVENT event)
912{
913 XGL_RESULT result = nextTable.ResetEvent(event);
914 return result;
915}
916
917XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateQueryPool(XGL_DEVICE device, const XGL_QUERY_POOL_CREATE_INFO* pCreateInfo, XGL_QUERY_POOL* pQueryPool)
918{
919 XGL_RESULT result = nextTable.CreateQueryPool(device, pCreateInfo, pQueryPool);
920 return result;
921}
922
923XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetQueryPoolResults(XGL_QUERY_POOL queryPool, XGL_UINT startQuery, XGL_UINT queryCount, XGL_SIZE* pDataSize, XGL_VOID* pData)
924{
925 XGL_RESULT result = nextTable.GetQueryPoolResults(queryPool, startQuery, queryCount, pDataSize, pData);
926 return result;
927}
928
929XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetFormatInfo(XGL_DEVICE device, XGL_FORMAT format, XGL_FORMAT_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData)
930{
931 XGL_RESULT result = nextTable.GetFormatInfo(device, format, infoType, pDataSize, pData);
932 return result;
933}
934
935XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateImage(XGL_DEVICE device, const XGL_IMAGE_CREATE_INFO* pCreateInfo, XGL_IMAGE* pImage)
936{
937 XGL_RESULT result = nextTable.CreateImage(device, pCreateInfo, pImage);
938 return result;
939}
940
941XGL_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)
942{
943 XGL_RESULT result = nextTable.GetImageSubresourceInfo(image, pSubresource, infoType, pDataSize, pData);
944 return result;
945}
946
947XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateImageView(XGL_DEVICE device, const XGL_IMAGE_VIEW_CREATE_INFO* pCreateInfo, XGL_IMAGE_VIEW* pView)
948{
949 XGL_RESULT result = nextTable.CreateImageView(device, pCreateInfo, pView);
950 return result;
951}
952
953XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateColorAttachmentView(XGL_DEVICE device, const XGL_COLOR_ATTACHMENT_VIEW_CREATE_INFO* pCreateInfo, XGL_COLOR_ATTACHMENT_VIEW* pView)
954{
955 XGL_RESULT result = nextTable.CreateColorAttachmentView(device, pCreateInfo, pView);
956 return result;
957}
958
959XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateDepthStencilView(XGL_DEVICE device, const XGL_DEPTH_STENCIL_VIEW_CREATE_INFO* pCreateInfo, XGL_DEPTH_STENCIL_VIEW* pView)
960{
961 XGL_RESULT result = nextTable.CreateDepthStencilView(device, pCreateInfo, pView);
962 return result;
963}
964
965XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateShader(XGL_DEVICE device, const XGL_SHADER_CREATE_INFO* pCreateInfo, XGL_SHADER* pShader)
966{
967 XGL_RESULT result = nextTable.CreateShader(device, pCreateInfo, pShader);
968 return result;
969}
970
971XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateGraphicsPipeline(XGL_DEVICE device, const XGL_GRAPHICS_PIPELINE_CREATE_INFO* pCreateInfo, XGL_PIPELINE* pPipeline)
972{
973 XGL_RESULT result = nextTable.CreateGraphicsPipeline(device, pCreateInfo, pPipeline);
974 // Create LL HEAD for this Pipeline
Tobin Ehlisb8154982014-10-27 14:53:17 -0600975 printf("DS INFO : Created Gfx Pipeline %p\n", (void*)*pPipeline);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600976 PIPELINE_NODE *pTrav = pPipelineHead;
977 if (pTrav) {
978 while (pTrav->pNext)
979 pTrav = pTrav->pNext;
980 pTrav->pNext = (PIPELINE_NODE*)malloc(sizeof(PIPELINE_NODE));
981 pTrav = pTrav->pNext;
982 }
983 else {
984 pTrav = (PIPELINE_NODE*)malloc(sizeof(PIPELINE_NODE));
985 pPipelineHead = pTrav;
986 }
987 memset((void*)pTrav, 0, sizeof(PIPELINE_NODE));
988 pTrav->pipeline = *pPipeline;
989 initPipeline(pTrav, pCreateInfo);
990 return result;
991}
992
993XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateComputePipeline(XGL_DEVICE device, const XGL_COMPUTE_PIPELINE_CREATE_INFO* pCreateInfo, XGL_PIPELINE* pPipeline)
994{
995 XGL_RESULT result = nextTable.CreateComputePipeline(device, pCreateInfo, pPipeline);
996 return result;
997}
998
999XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglStorePipeline(XGL_PIPELINE pipeline, XGL_SIZE* pDataSize, XGL_VOID* pData)
1000{
1001 XGL_RESULT result = nextTable.StorePipeline(pipeline, pDataSize, pData);
1002 return result;
1003}
1004
1005XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglLoadPipeline(XGL_DEVICE device, XGL_SIZE dataSize, const XGL_VOID* pData, XGL_PIPELINE* pPipeline)
1006{
1007 XGL_RESULT result = nextTable.LoadPipeline(device, dataSize, pData, pPipeline);
1008 return result;
1009}
1010
1011XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreatePipelineDelta(XGL_DEVICE device, XGL_PIPELINE p1, XGL_PIPELINE p2, XGL_PIPELINE_DELTA* delta)
1012{
1013 XGL_RESULT result = nextTable.CreatePipelineDelta(device, p1, p2, delta);
1014 return result;
1015}
1016
1017XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateSampler(XGL_DEVICE device, const XGL_SAMPLER_CREATE_INFO* pCreateInfo, XGL_SAMPLER* pSampler)
1018{
1019 XGL_RESULT result = nextTable.CreateSampler(device, pCreateInfo, pSampler);
1020 return result;
1021}
1022
1023XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateDescriptorSet(XGL_DEVICE device, const XGL_DESCRIPTOR_SET_CREATE_INFO* pCreateInfo, XGL_DESCRIPTOR_SET* pDescriptorSet)
1024{
1025 XGL_RESULT result = nextTable.CreateDescriptorSet(device, pCreateInfo, pDescriptorSet);
1026 // Create LL chain
Tobin Ehlisb8154982014-10-27 14:53:17 -06001027 printf("DS INFO : Created Descriptor Set (DS) %p\n", (void*)*pDescriptorSet);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001028 DS_LL_HEAD *pTrav = pDSHead;
1029 if (pTrav) {
1030 // Grow existing list
1031 while (pTrav->pNextDS)
1032 pTrav = pTrav->pNextDS;
1033 pTrav->pNextDS = (DS_LL_HEAD*)malloc(sizeof(DS_LL_HEAD));
1034 pTrav = pTrav->pNextDS;
1035 }
1036 else { // Create new list
1037 pTrav = (DS_LL_HEAD*)malloc(sizeof(DS_LL_HEAD));
1038 pDSHead = pTrav;
1039 }
1040 pTrav->dsSlot = (DS_SLOT*)malloc(sizeof(DS_SLOT) * pCreateInfo->slots);
1041 pTrav->dsID = *pDescriptorSet;
1042 pTrav->numSlots = pCreateInfo->slots;
1043 pTrav->pNextDS = NULL;
1044 pTrav->updateActive = XGL_FALSE;
1045 initDS(pTrav);
1046 return result;
1047}
1048
1049XGL_LAYER_EXPORT XGL_VOID XGLAPI xglBeginDescriptorSetUpdate(XGL_DESCRIPTOR_SET descriptorSet)
1050{
Tobin Ehlis0f051a52014-10-24 13:03:56 -06001051 DS_LL_HEAD* pDS = getDS(descriptorSet);
1052 if (!pDS) {
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001053 // TODO : This is where we should flag a REAL error
1054 printf("DS ERROR : Specified Descriptor Set %p does not exist!\n", (void*)descriptorSet);
1055 }
Tobin Ehlis0f051a52014-10-24 13:03:56 -06001056 else {
1057 pDS->updateActive = XGL_TRUE;
1058 }
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001059 nextTable.BeginDescriptorSetUpdate(descriptorSet);
1060}
1061
1062XGL_LAYER_EXPORT XGL_VOID XGLAPI xglEndDescriptorSetUpdate(XGL_DESCRIPTOR_SET descriptorSet)
1063{
1064 if (!dsUpdate(descriptorSet)) {
1065 // TODO : This is where we should flag a REAL error
1066 printf("DS ERROR : You must call xglBeginDescriptorSetUpdate(%p) before this call to xglEndDescriptorSetUpdate()!\n", (void*)descriptorSet);
1067 }
Tobin Ehlis0f051a52014-10-24 13:03:56 -06001068 else {
1069 DS_LL_HEAD* pDS = getDS(descriptorSet);
1070 if (!pDS) {
1071 printf("DS ERROR : Specified Descriptor Set %p does not exist!\n", (void*)descriptorSet);
1072 }
1073 else {
1074 pDS->updateActive = XGL_FALSE;
1075 }
1076 }
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001077 nextTable.EndDescriptorSetUpdate(descriptorSet);
1078}
1079
1080XGL_LAYER_EXPORT XGL_VOID XGLAPI xglAttachSamplerDescriptors(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_SAMPLER* pSamplers)
1081{
1082 if (!dsUpdate(descriptorSet)) {
1083 // TODO : This is where we should flag a REAL error
1084 printf("DS ERROR : You must call xglBeginDescriptorSetUpdate(%p) before this call to xglAttachSamplerDescriptors()!\n", (void*)descriptorSet);
1085 }
1086 else {
1087 if (!dsSamplerMapping(descriptorSet, startSlot, slotCount, pSamplers))
1088 printf("DS ERROR : Unable to attach sampler descriptors to DS %p!\n", (void*)descriptorSet);
1089 }
1090 nextTable.AttachSamplerDescriptors(descriptorSet, startSlot, slotCount, pSamplers);
1091}
1092
1093XGL_LAYER_EXPORT XGL_VOID XGLAPI xglAttachImageViewDescriptors(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_IMAGE_VIEW_ATTACH_INFO* pImageViews)
1094{
1095 if (!dsUpdate(descriptorSet)) {
1096 // TODO : This is where we should flag a REAL error
1097 printf("DS ERROR : You must call xglBeginDescriptorSetUpdate(%p) before this call to xglAttachSamplerDescriptors()!\n", (void*)descriptorSet);
1098 }
1099 else {
1100 if (!dsImageMapping(descriptorSet, startSlot, slotCount, pImageViews))
1101 printf("DS ERROR : Unable to attach image view descriptors to DS %p!\n", (void*)descriptorSet);
1102 }
1103 nextTable.AttachImageViewDescriptors(descriptorSet, startSlot, slotCount, pImageViews);
1104}
1105
1106XGL_LAYER_EXPORT XGL_VOID XGLAPI xglAttachMemoryViewDescriptors(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_MEMORY_VIEW_ATTACH_INFO* pMemViews)
1107{
1108 if (!dsUpdate(descriptorSet)) {
1109 // TODO : This is where we should flag a REAL error
1110 printf("DS ERROR : You must call xglBeginDescriptorSetUpdate(%p) before this call to xglAttachSamplerDescriptors()!\n", (void*)descriptorSet);
1111 }
1112 else {
1113 if (!dsMemMapping(descriptorSet, startSlot, slotCount, pMemViews))
1114 printf("DS ERROR : Unable to attach memory view descriptors to DS %p!\n", (void*)descriptorSet);
1115 }
1116 nextTable.AttachMemoryViewDescriptors(descriptorSet, startSlot, slotCount, pMemViews);
1117}
1118
1119XGL_LAYER_EXPORT XGL_VOID XGLAPI xglAttachNestedDescriptors(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_DESCRIPTOR_SET_ATTACH_INFO* pNestedDescriptorSets)
1120{
1121 if (!dsUpdate(descriptorSet)) {
1122 // TODO : This is where we should flag a REAL error
1123 printf("DS ERROR : You must call xglBeginDescriptorSetUpdate(%p) before this call to xglAttachSamplerDescriptors()!\n", (void*)descriptorSet);
1124 }
1125 nextTable.AttachNestedDescriptors(descriptorSet, startSlot, slotCount, pNestedDescriptorSets);
1126}
1127
1128// TODO : Does xglBeginDescriptorSetUpdate() have to be called before this function?
1129XGL_LAYER_EXPORT XGL_VOID XGLAPI xglClearDescriptorSetSlots(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount)
1130{
1131 if (!dsUpdate(descriptorSet)) {
1132 // TODO : This is where we should flag a REAL error
1133 printf("DS ERROR : You must call xglBeginDescriptorSetUpdate(%p) before this call to xglClearDescriptorSetSlots()!\n", (void*)descriptorSet);
1134 }
1135 if (!clearDS(descriptorSet, startSlot, slotCount)) {
1136 // TODO : This is where we should flag a REAL error
1137 printf("DS ERROR : Unable to perform xglClearDescriptorSetSlots(%p, %u, %u) call!\n", descriptorSet, startSlot, slotCount);
1138 }
1139 nextTable.ClearDescriptorSetSlots(descriptorSet, startSlot, slotCount);
1140}
1141
1142XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateViewportState(XGL_DEVICE device, const XGL_VIEWPORT_STATE_CREATE_INFO* pCreateInfo, XGL_VIEWPORT_STATE_OBJECT* pState)
1143{
1144 XGL_RESULT result = nextTable.CreateViewportState(device, pCreateInfo, pState);
1145 return result;
1146}
1147
1148XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateRasterState(XGL_DEVICE device, const XGL_RASTER_STATE_CREATE_INFO* pCreateInfo, XGL_RASTER_STATE_OBJECT* pState)
1149{
1150 XGL_RESULT result = nextTable.CreateRasterState(device, pCreateInfo, pState);
1151 return result;
1152}
1153
1154XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateMsaaState(XGL_DEVICE device, const XGL_MSAA_STATE_CREATE_INFO* pCreateInfo, XGL_MSAA_STATE_OBJECT* pState)
1155{
1156 XGL_RESULT result = nextTable.CreateMsaaState(device, pCreateInfo, pState);
1157 return result;
1158}
1159
1160XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateColorBlendState(XGL_DEVICE device, const XGL_COLOR_BLEND_STATE_CREATE_INFO* pCreateInfo, XGL_COLOR_BLEND_STATE_OBJECT* pState)
1161{
1162 XGL_RESULT result = nextTable.CreateColorBlendState(device, pCreateInfo, pState);
1163 return result;
1164}
1165
1166XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateDepthStencilState(XGL_DEVICE device, const XGL_DEPTH_STENCIL_STATE_CREATE_INFO* pCreateInfo, XGL_DEPTH_STENCIL_STATE_OBJECT* pState)
1167{
1168 XGL_RESULT result = nextTable.CreateDepthStencilState(device, pCreateInfo, pState);
1169 return result;
1170}
1171
1172XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateCommandBuffer(XGL_DEVICE device, const XGL_CMD_BUFFER_CREATE_INFO* pCreateInfo, XGL_CMD_BUFFER* pCmdBuffer)
1173{
1174 XGL_RESULT result = nextTable.CreateCommandBuffer(device, pCreateInfo, pCmdBuffer);
1175 return result;
1176}
1177
1178XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglBeginCommandBuffer(XGL_CMD_BUFFER cmdBuffer, XGL_FLAGS flags)
1179{
1180 XGL_RESULT result = nextTable.BeginCommandBuffer(cmdBuffer, flags);
1181 return result;
1182}
1183
1184XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglEndCommandBuffer(XGL_CMD_BUFFER cmdBuffer)
1185{
1186 XGL_RESULT result = nextTable.EndCommandBuffer(cmdBuffer);
1187 return result;
1188}
1189
1190XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglResetCommandBuffer(XGL_CMD_BUFFER cmdBuffer)
1191{
1192 XGL_RESULT result = nextTable.ResetCommandBuffer(cmdBuffer);
1193 return result;
1194}
1195
1196XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindPipeline(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_PIPELINE pipeline)
1197{
1198 if (getPipeline(pipeline)) {
1199 lastBoundPipeline = pipeline;
1200 }
1201 else {
1202 printf("DS ERROR : Attempt to bind Pipeline %p that doesn't exist!\n", (void*)pipeline);
1203 }
1204 nextTable.CmdBindPipeline(cmdBuffer, pipelineBindPoint, pipeline);
1205}
1206
1207XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindPipelineDelta(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_PIPELINE_DELTA delta)
1208{
1209 nextTable.CmdBindPipelineDelta(cmdBuffer, pipelineBindPoint, delta);
1210}
1211
1212XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindStateObject(XGL_CMD_BUFFER cmdBuffer, XGL_STATE_BIND_POINT stateBindPoint, XGL_STATE_OBJECT state)
1213{
1214 nextTable.CmdBindStateObject(cmdBuffer, stateBindPoint, state);
1215}
1216
1217XGL_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)
1218{
1219 if (getDS(descriptorSet)) {
Tobin Ehlisb8154982014-10-27 14:53:17 -06001220 assert(index < XGL_MAX_DESCRIPTOR_SETS);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001221 lastBoundDS[index] = descriptorSet;
Tobin Ehlisb8154982014-10-27 14:53:17 -06001222 printf("DS INFO : DS %p bound to DS index %u on pipeline %s\n", (void*)descriptorSet, index, string_XGL_PIPELINE_BIND_POINT(pipelineBindPoint));
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001223 }
1224 else {
1225 printf("DS ERROR : Attempt to bind DS %p that doesn't exist!\n", (void*)descriptorSet);
1226 }
1227 nextTable.CmdBindDescriptorSet(cmdBuffer, pipelineBindPoint, index, descriptorSet, slotOffset);
1228}
1229
1230XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindDynamicMemoryView(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, const XGL_MEMORY_VIEW_ATTACH_INFO* pMemView)
1231{
1232 nextTable.CmdBindDynamicMemoryView(cmdBuffer, pipelineBindPoint, pMemView);
1233}
1234
1235XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindIndexData(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_INDEX_TYPE indexType)
1236{
1237 nextTable.CmdBindIndexData(cmdBuffer, mem, offset, indexType);
1238}
1239
1240XGL_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)
1241{
1242 nextTable.CmdBindAttachments(cmdBuffer, colorAttachmentCount, pColorAttachments, pDepthStencilAttachment);
1243}
1244
1245XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdPrepareMemoryRegions(XGL_CMD_BUFFER cmdBuffer, XGL_UINT transitionCount, const XGL_MEMORY_STATE_TRANSITION* pStateTransitions)
1246{
1247 nextTable.CmdPrepareMemoryRegions(cmdBuffer, transitionCount, pStateTransitions);
1248}
1249
1250XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdPrepareImages(XGL_CMD_BUFFER cmdBuffer, XGL_UINT transitionCount, const XGL_IMAGE_STATE_TRANSITION* pStateTransitions)
1251{
1252 nextTable.CmdPrepareImages(cmdBuffer, transitionCount, pStateTransitions);
1253}
1254
1255XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDraw(XGL_CMD_BUFFER cmdBuffer, XGL_UINT firstVertex, XGL_UINT vertexCount, XGL_UINT firstInstance, XGL_UINT instanceCount)
1256{
Tobin Ehlisb8154982014-10-27 14:53:17 -06001257 printf("DS INFO : xglCmdDraw() call #%lu, reporting DS state:\n", drawCount[DRAW]++);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001258 synchAndPrintDSConfig();
1259 nextTable.CmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount);
1260}
1261
1262XGL_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)
1263{
Tobin Ehlisb8154982014-10-27 14:53:17 -06001264 printf("DS INFO : xglCmdDrawIndexed() call #%lu, reporting DS state:\n", drawCount[DRAW_INDEXED]++);
1265 synchAndPrintDSConfig();
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001266 nextTable.CmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount);
1267}
1268
1269XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDrawIndirect(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_UINT32 count, XGL_UINT32 stride)
1270{
Tobin Ehlisb8154982014-10-27 14:53:17 -06001271 printf("DS INFO : xglCmdDrawIndirect() call #%lu, reporting DS state:\n", drawCount[DRAW_INDIRECT]++);
1272 synchAndPrintDSConfig();
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001273 nextTable.CmdDrawIndirect(cmdBuffer, mem, offset, count, stride);
1274}
1275
1276XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDrawIndexedIndirect(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_UINT32 count, XGL_UINT32 stride)
1277{
Tobin Ehlisb8154982014-10-27 14:53:17 -06001278 printf("DS INFO : xglCmdDrawIndexedIndirect() call #%lu, reporting DS state:\n", drawCount[DRAW_INDEXED_INDIRECT]++);
1279 synchAndPrintDSConfig();
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001280 nextTable.CmdDrawIndexedIndirect(cmdBuffer, mem, offset, count, stride);
1281}
1282
1283XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDispatch(XGL_CMD_BUFFER cmdBuffer, XGL_UINT x, XGL_UINT y, XGL_UINT z)
1284{
1285 nextTable.CmdDispatch(cmdBuffer, x, y, z);
1286}
1287
1288XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDispatchIndirect(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset)
1289{
1290 nextTable.CmdDispatchIndirect(cmdBuffer, mem, offset);
1291}
1292
1293XGL_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)
1294{
1295 nextTable.CmdCopyMemory(cmdBuffer, srcMem, destMem, regionCount, pRegions);
1296}
1297
1298XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdCopyImage(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_IMAGE destImage, XGL_UINT regionCount, const XGL_IMAGE_COPY* pRegions)
1299{
1300 nextTable.CmdCopyImage(cmdBuffer, srcImage, destImage, regionCount, pRegions);
1301}
1302
1303XGL_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)
1304{
1305 nextTable.CmdCopyMemoryToImage(cmdBuffer, srcMem, destImage, regionCount, pRegions);
1306}
1307
1308XGL_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)
1309{
1310 nextTable.CmdCopyImageToMemory(cmdBuffer, srcImage, destMem, regionCount, pRegions);
1311}
1312
1313XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdCloneImageData(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_IMAGE_STATE srcImageState, XGL_IMAGE destImage, XGL_IMAGE_STATE destImageState)
1314{
1315 nextTable.CmdCloneImageData(cmdBuffer, srcImage, srcImageState, destImage, destImageState);
1316}
1317
1318XGL_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)
1319{
1320 nextTable.CmdUpdateMemory(cmdBuffer, destMem, destOffset, dataSize, pData);
1321}
1322
1323XGL_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)
1324{
1325 nextTable.CmdFillMemory(cmdBuffer, destMem, destOffset, fillSize, data);
1326}
1327
1328XGL_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)
1329{
1330 nextTable.CmdClearColorImage(cmdBuffer, image, color, rangeCount, pRanges);
1331}
1332
1333XGL_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)
1334{
1335 nextTable.CmdClearColorImageRaw(cmdBuffer, image, color, rangeCount, pRanges);
1336}
1337
1338XGL_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)
1339{
1340 nextTable.CmdClearDepthStencil(cmdBuffer, image, depth, stencil, rangeCount, pRanges);
1341}
1342
1343XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdResolveImage(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_IMAGE destImage, XGL_UINT rectCount, const XGL_IMAGE_RESOLVE* pRects)
1344{
1345 nextTable.CmdResolveImage(cmdBuffer, srcImage, destImage, rectCount, pRects);
1346}
1347
1348XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdSetEvent(XGL_CMD_BUFFER cmdBuffer, XGL_EVENT event)
1349{
1350 nextTable.CmdSetEvent(cmdBuffer, event);
1351}
1352
1353XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdResetEvent(XGL_CMD_BUFFER cmdBuffer, XGL_EVENT event)
1354{
1355 nextTable.CmdResetEvent(cmdBuffer, event);
1356}
1357
1358XGL_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)
1359{
1360 nextTable.CmdMemoryAtomic(cmdBuffer, destMem, destOffset, srcData, atomicOp);
1361}
1362
1363XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBeginQuery(XGL_CMD_BUFFER cmdBuffer, XGL_QUERY_POOL queryPool, XGL_UINT slot, XGL_FLAGS flags)
1364{
1365 nextTable.CmdBeginQuery(cmdBuffer, queryPool, slot, flags);
1366}
1367
1368XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdEndQuery(XGL_CMD_BUFFER cmdBuffer, XGL_QUERY_POOL queryPool, XGL_UINT slot)
1369{
1370 nextTable.CmdEndQuery(cmdBuffer, queryPool, slot);
1371}
1372
1373XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdResetQueryPool(XGL_CMD_BUFFER cmdBuffer, XGL_QUERY_POOL queryPool, XGL_UINT startQuery, XGL_UINT queryCount)
1374{
1375 nextTable.CmdResetQueryPool(cmdBuffer, queryPool, startQuery, queryCount);
1376}
1377
1378XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdWriteTimestamp(XGL_CMD_BUFFER cmdBuffer, XGL_TIMESTAMP_TYPE timestampType, XGL_GPU_MEMORY destMem, XGL_GPU_SIZE destOffset)
1379{
1380 nextTable.CmdWriteTimestamp(cmdBuffer, timestampType, destMem, destOffset);
1381}
1382
1383XGL_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)
1384{
1385 nextTable.CmdInitAtomicCounters(cmdBuffer, pipelineBindPoint, startCounter, counterCount, pData);
1386}
1387
1388XGL_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)
1389{
1390 nextTable.CmdLoadAtomicCounters(cmdBuffer, pipelineBindPoint, startCounter, counterCount, srcMem, srcOffset);
1391}
1392
1393XGL_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)
1394{
1395 nextTable.CmdSaveAtomicCounters(cmdBuffer, pipelineBindPoint, startCounter, counterCount, destMem, destOffset);
1396}
1397
1398XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDbgSetValidationLevel(XGL_DEVICE device, XGL_VALIDATION_LEVEL validationLevel)
1399{
1400 XGL_RESULT result = nextTable.DbgSetValidationLevel(device, validationLevel);
1401 return result;
1402}
1403
1404XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDbgRegisterMsgCallback(XGL_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback, XGL_VOID* pUserData)
1405{
1406 XGL_RESULT result = nextTable.DbgRegisterMsgCallback(pfnMsgCallback, pUserData);
1407 return result;
1408}
1409
1410XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDbgUnregisterMsgCallback(XGL_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback)
1411{
1412 XGL_RESULT result = nextTable.DbgUnregisterMsgCallback(pfnMsgCallback);
1413 return result;
1414}
1415
1416XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDbgSetMessageFilter(XGL_DEVICE device, XGL_INT msgCode, XGL_DBG_MSG_FILTER filter)
1417{
1418 XGL_RESULT result = nextTable.DbgSetMessageFilter(device, msgCode, filter);
1419 return result;
1420}
1421
1422XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDbgSetObjectTag(XGL_BASE_OBJECT object, XGL_SIZE tagSize, const XGL_VOID* pTag)
1423{
1424 XGL_RESULT result = nextTable.DbgSetObjectTag(object, tagSize, pTag);
1425 return result;
1426}
1427
1428XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDbgSetGlobalOption(XGL_DBG_GLOBAL_OPTION dbgOption, XGL_SIZE dataSize, const XGL_VOID* pData)
1429{
1430 XGL_RESULT result = nextTable.DbgSetGlobalOption(dbgOption, dataSize, pData);
1431 return result;
1432}
1433
1434XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDbgSetDeviceOption(XGL_DEVICE device, XGL_DBG_DEVICE_OPTION dbgOption, XGL_SIZE dataSize, const XGL_VOID* pData)
1435{
1436 XGL_RESULT result = nextTable.DbgSetDeviceOption(device, dbgOption, dataSize, pData);
1437 return result;
1438}
1439
1440XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDbgMarkerBegin(XGL_CMD_BUFFER cmdBuffer, const XGL_CHAR* pMarker)
1441{
1442 nextTable.CmdDbgMarkerBegin(cmdBuffer, pMarker);
1443}
1444
1445XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDbgMarkerEnd(XGL_CMD_BUFFER cmdBuffer)
1446{
1447 nextTable.CmdDbgMarkerEnd(cmdBuffer);
1448}
1449
1450XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWsiX11AssociateConnection(XGL_PHYSICAL_GPU gpu, const XGL_WSI_X11_CONNECTION_INFO* pConnectionInfo)
1451{
1452 XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu;
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001453 pCurObj = gpuw;
1454 pthread_once(&tabOnce, initLayerTable);
1455 XGL_RESULT result = nextTable.WsiX11AssociateConnection((XGL_PHYSICAL_GPU)gpuw->nextObject, pConnectionInfo);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001456 return result;
1457}
1458
1459XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWsiX11GetMSC(XGL_DEVICE device, xcb_randr_crtc_t crtc, XGL_UINT64* pMsc)
1460{
1461 XGL_RESULT result = nextTable.WsiX11GetMSC(device, crtc, pMsc);
1462 return result;
1463}
1464
1465XGL_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)
1466{
1467 XGL_RESULT result = nextTable.WsiX11CreatePresentableImage(device, pCreateInfo, pImage, pMem);
1468 return result;
1469}
1470
1471XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWsiX11QueuePresent(XGL_QUEUE queue, const XGL_WSI_X11_PRESENT_INFO* pPresentInfo, XGL_FENCE fence)
1472{
1473 XGL_RESULT result = nextTable.WsiX11QueuePresent(queue, pPresentInfo, fence);
1474 return result;
1475}
1476
1477XGL_LAYER_EXPORT XGL_VOID* XGLAPI xglGetProcAddr(XGL_PHYSICAL_GPU gpu, const XGL_CHAR* funcName)
1478{
1479 XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu;
1480 if (gpu == NULL)
1481 return NULL;
1482 pCurObj = gpuw;
1483 pthread_once(&tabOnce, initLayerTable);
1484
1485 if (!strncmp("xglGetProcAddr", (const char *) funcName, sizeof("xglGetProcAddr")))
1486 return xglGetProcAddr;
1487 else if (!strncmp("xglInitAndEnumerateGpus", (const char *) funcName, sizeof("xglInitAndEnumerateGpus")))
1488 return nextTable.InitAndEnumerateGpus;
1489 else if (!strncmp("xglGetGpuInfo", (const char *) funcName, sizeof("xglGetGpuInfo")))
1490 return xglGetGpuInfo;
1491 else if (!strncmp("xglCreateDevice", (const char *) funcName, sizeof("xglCreateDevice")))
1492 return xglCreateDevice;
1493 else if (!strncmp("xglDestroyDevice", (const char *) funcName, sizeof("xglDestroyDevice")))
1494 return xglDestroyDevice;
1495 else if (!strncmp("xglGetExtensionSupport", (const char *) funcName, sizeof("xglGetExtensionSupport")))
1496 return xglGetExtensionSupport;
1497 else if (!strncmp("xglEnumerateLayers", (const char *) funcName, sizeof("xglEnumerateLayers")))
1498 return xglEnumerateLayers;
1499 else if (!strncmp("xglGetDeviceQueue", (const char *) funcName, sizeof("xglGetDeviceQueue")))
1500 return xglGetDeviceQueue;
1501 else if (!strncmp("xglQueueSubmit", (const char *) funcName, sizeof("xglQueueSubmit")))
1502 return xglQueueSubmit;
1503 else if (!strncmp("xglQueueSetGlobalMemReferences", (const char *) funcName, sizeof("xglQueueSetGlobalMemReferences")))
1504 return xglQueueSetGlobalMemReferences;
1505 else if (!strncmp("xglQueueWaitIdle", (const char *) funcName, sizeof("xglQueueWaitIdle")))
1506 return xglQueueWaitIdle;
1507 else if (!strncmp("xglDeviceWaitIdle", (const char *) funcName, sizeof("xglDeviceWaitIdle")))
1508 return xglDeviceWaitIdle;
1509 else if (!strncmp("xglGetMemoryHeapCount", (const char *) funcName, sizeof("xglGetMemoryHeapCount")))
1510 return xglGetMemoryHeapCount;
1511 else if (!strncmp("xglGetMemoryHeapInfo", (const char *) funcName, sizeof("xglGetMemoryHeapInfo")))
1512 return xglGetMemoryHeapInfo;
1513 else if (!strncmp("xglAllocMemory", (const char *) funcName, sizeof("xglAllocMemory")))
1514 return xglAllocMemory;
1515 else if (!strncmp("xglFreeMemory", (const char *) funcName, sizeof("xglFreeMemory")))
1516 return xglFreeMemory;
1517 else if (!strncmp("xglSetMemoryPriority", (const char *) funcName, sizeof("xglSetMemoryPriority")))
1518 return xglSetMemoryPriority;
1519 else if (!strncmp("xglMapMemory", (const char *) funcName, sizeof("xglMapMemory")))
1520 return xglMapMemory;
1521 else if (!strncmp("xglUnmapMemory", (const char *) funcName, sizeof("xglUnmapMemory")))
1522 return xglUnmapMemory;
1523 else if (!strncmp("xglPinSystemMemory", (const char *) funcName, sizeof("xglPinSystemMemory")))
1524 return xglPinSystemMemory;
1525 else if (!strncmp("xglRemapVirtualMemoryPages", (const char *) funcName, sizeof("xglRemapVirtualMemoryPages")))
1526 return xglRemapVirtualMemoryPages;
1527 else if (!strncmp("xglGetMultiGpuCompatibility", (const char *) funcName, sizeof("xglGetMultiGpuCompatibility")))
1528 return xglGetMultiGpuCompatibility;
1529 else if (!strncmp("xglOpenSharedMemory", (const char *) funcName, sizeof("xglOpenSharedMemory")))
1530 return xglOpenSharedMemory;
1531 else if (!strncmp("xglOpenSharedQueueSemaphore", (const char *) funcName, sizeof("xglOpenSharedQueueSemaphore")))
1532 return xglOpenSharedQueueSemaphore;
1533 else if (!strncmp("xglOpenPeerMemory", (const char *) funcName, sizeof("xglOpenPeerMemory")))
1534 return xglOpenPeerMemory;
1535 else if (!strncmp("xglOpenPeerImage", (const char *) funcName, sizeof("xglOpenPeerImage")))
1536 return xglOpenPeerImage;
1537 else if (!strncmp("xglDestroyObject", (const char *) funcName, sizeof("xglDestroyObject")))
1538 return xglDestroyObject;
1539 else if (!strncmp("xglGetObjectInfo", (const char *) funcName, sizeof("xglGetObjectInfo")))
1540 return xglGetObjectInfo;
1541 else if (!strncmp("xglBindObjectMemory", (const char *) funcName, sizeof("xglBindObjectMemory")))
1542 return xglBindObjectMemory;
1543 else if (!strncmp("xglCreateFence", (const char *) funcName, sizeof("xglCreateFence")))
1544 return xglCreateFence;
1545 else if (!strncmp("xglGetFenceStatus", (const char *) funcName, sizeof("xglGetFenceStatus")))
1546 return xglGetFenceStatus;
1547 else if (!strncmp("xglWaitForFences", (const char *) funcName, sizeof("xglWaitForFences")))
1548 return xglWaitForFences;
1549 else if (!strncmp("xglCreateQueueSemaphore", (const char *) funcName, sizeof("xglCreateQueueSemaphore")))
1550 return xglCreateQueueSemaphore;
1551 else if (!strncmp("xglSignalQueueSemaphore", (const char *) funcName, sizeof("xglSignalQueueSemaphore")))
1552 return xglSignalQueueSemaphore;
1553 else if (!strncmp("xglWaitQueueSemaphore", (const char *) funcName, sizeof("xglWaitQueueSemaphore")))
1554 return xglWaitQueueSemaphore;
1555 else if (!strncmp("xglCreateEvent", (const char *) funcName, sizeof("xglCreateEvent")))
1556 return xglCreateEvent;
1557 else if (!strncmp("xglGetEventStatus", (const char *) funcName, sizeof("xglGetEventStatus")))
1558 return xglGetEventStatus;
1559 else if (!strncmp("xglSetEvent", (const char *) funcName, sizeof("xglSetEvent")))
1560 return xglSetEvent;
1561 else if (!strncmp("xglResetEvent", (const char *) funcName, sizeof("xglResetEvent")))
1562 return xglResetEvent;
1563 else if (!strncmp("xglCreateQueryPool", (const char *) funcName, sizeof("xglCreateQueryPool")))
1564 return xglCreateQueryPool;
1565 else if (!strncmp("xglGetQueryPoolResults", (const char *) funcName, sizeof("xglGetQueryPoolResults")))
1566 return xglGetQueryPoolResults;
1567 else if (!strncmp("xglGetFormatInfo", (const char *) funcName, sizeof("xglGetFormatInfo")))
1568 return xglGetFormatInfo;
1569 else if (!strncmp("xglCreateImage", (const char *) funcName, sizeof("xglCreateImage")))
1570 return xglCreateImage;
1571 else if (!strncmp("xglGetImageSubresourceInfo", (const char *) funcName, sizeof("xglGetImageSubresourceInfo")))
1572 return xglGetImageSubresourceInfo;
1573 else if (!strncmp("xglCreateImageView", (const char *) funcName, sizeof("xglCreateImageView")))
1574 return xglCreateImageView;
1575 else if (!strncmp("xglCreateColorAttachmentView", (const char *) funcName, sizeof("xglCreateColorAttachmentView")))
1576 return xglCreateColorAttachmentView;
1577 else if (!strncmp("xglCreateDepthStencilView", (const char *) funcName, sizeof("xglCreateDepthStencilView")))
1578 return xglCreateDepthStencilView;
1579 else if (!strncmp("xglCreateShader", (const char *) funcName, sizeof("xglCreateShader")))
1580 return xglCreateShader;
1581 else if (!strncmp("xglCreateGraphicsPipeline", (const char *) funcName, sizeof("xglCreateGraphicsPipeline")))
1582 return xglCreateGraphicsPipeline;
1583 else if (!strncmp("xglCreateComputePipeline", (const char *) funcName, sizeof("xglCreateComputePipeline")))
1584 return xglCreateComputePipeline;
1585 else if (!strncmp("xglStorePipeline", (const char *) funcName, sizeof("xglStorePipeline")))
1586 return xglStorePipeline;
1587 else if (!strncmp("xglLoadPipeline", (const char *) funcName, sizeof("xglLoadPipeline")))
1588 return xglLoadPipeline;
1589 else if (!strncmp("xglCreatePipelineDelta", (const char *) funcName, sizeof("xglCreatePipelineDelta")))
1590 return xglCreatePipelineDelta;
1591 else if (!strncmp("xglCreateSampler", (const char *) funcName, sizeof("xglCreateSampler")))
1592 return xglCreateSampler;
1593 else if (!strncmp("xglCreateDescriptorSet", (const char *) funcName, sizeof("xglCreateDescriptorSet")))
1594 return xglCreateDescriptorSet;
1595 else if (!strncmp("xglBeginDescriptorSetUpdate", (const char *) funcName, sizeof("xglBeginDescriptorSetUpdate")))
1596 return xglBeginDescriptorSetUpdate;
1597 else if (!strncmp("xglEndDescriptorSetUpdate", (const char *) funcName, sizeof("xglEndDescriptorSetUpdate")))
1598 return xglEndDescriptorSetUpdate;
1599 else if (!strncmp("xglAttachSamplerDescriptors", (const char *) funcName, sizeof("xglAttachSamplerDescriptors")))
1600 return xglAttachSamplerDescriptors;
1601 else if (!strncmp("xglAttachImageViewDescriptors", (const char *) funcName, sizeof("xglAttachImageViewDescriptors")))
1602 return xglAttachImageViewDescriptors;
1603 else if (!strncmp("xglAttachMemoryViewDescriptors", (const char *) funcName, sizeof("xglAttachMemoryViewDescriptors")))
1604 return xglAttachMemoryViewDescriptors;
1605 else if (!strncmp("xglAttachNestedDescriptors", (const char *) funcName, sizeof("xglAttachNestedDescriptors")))
1606 return xglAttachNestedDescriptors;
1607 else if (!strncmp("xglClearDescriptorSetSlots", (const char *) funcName, sizeof("xglClearDescriptorSetSlots")))
1608 return xglClearDescriptorSetSlots;
1609 else if (!strncmp("xglCreateViewportState", (const char *) funcName, sizeof("xglCreateViewportState")))
1610 return xglCreateViewportState;
1611 else if (!strncmp("xglCreateRasterState", (const char *) funcName, sizeof("xglCreateRasterState")))
1612 return xglCreateRasterState;
1613 else if (!strncmp("xglCreateMsaaState", (const char *) funcName, sizeof("xglCreateMsaaState")))
1614 return xglCreateMsaaState;
1615 else if (!strncmp("xglCreateColorBlendState", (const char *) funcName, sizeof("xglCreateColorBlendState")))
1616 return xglCreateColorBlendState;
1617 else if (!strncmp("xglCreateDepthStencilState", (const char *) funcName, sizeof("xglCreateDepthStencilState")))
1618 return xglCreateDepthStencilState;
1619 else if (!strncmp("xglCreateCommandBuffer", (const char *) funcName, sizeof("xglCreateCommandBuffer")))
1620 return xglCreateCommandBuffer;
1621 else if (!strncmp("xglBeginCommandBuffer", (const char *) funcName, sizeof("xglBeginCommandBuffer")))
1622 return xglBeginCommandBuffer;
1623 else if (!strncmp("xglEndCommandBuffer", (const char *) funcName, sizeof("xglEndCommandBuffer")))
1624 return xglEndCommandBuffer;
1625 else if (!strncmp("xglResetCommandBuffer", (const char *) funcName, sizeof("xglResetCommandBuffer")))
1626 return xglResetCommandBuffer;
1627 else if (!strncmp("xglCmdBindPipeline", (const char *) funcName, sizeof("xglCmdBindPipeline")))
1628 return xglCmdBindPipeline;
1629 else if (!strncmp("xglCmdBindPipelineDelta", (const char *) funcName, sizeof("xglCmdBindPipelineDelta")))
1630 return xglCmdBindPipelineDelta;
1631 else if (!strncmp("xglCmdBindStateObject", (const char *) funcName, sizeof("xglCmdBindStateObject")))
1632 return xglCmdBindStateObject;
1633 else if (!strncmp("xglCmdBindDescriptorSet", (const char *) funcName, sizeof("xglCmdBindDescriptorSet")))
1634 return xglCmdBindDescriptorSet;
1635 else if (!strncmp("xglCmdBindDynamicMemoryView", (const char *) funcName, sizeof("xglCmdBindDynamicMemoryView")))
1636 return xglCmdBindDynamicMemoryView;
1637 else if (!strncmp("xglCmdBindIndexData", (const char *) funcName, sizeof("xglCmdBindIndexData")))
1638 return xglCmdBindIndexData;
1639 else if (!strncmp("xglCmdBindAttachments", (const char *) funcName, sizeof("xglCmdBindAttachments")))
1640 return xglCmdBindAttachments;
1641 else if (!strncmp("xglCmdPrepareMemoryRegions", (const char *) funcName, sizeof("xglCmdPrepareMemoryRegions")))
1642 return xglCmdPrepareMemoryRegions;
1643 else if (!strncmp("xglCmdPrepareImages", (const char *) funcName, sizeof("xglCmdPrepareImages")))
1644 return xglCmdPrepareImages;
1645 else if (!strncmp("xglCmdDraw", (const char *) funcName, sizeof("xglCmdDraw")))
1646 return xglCmdDraw;
1647 else if (!strncmp("xglCmdDrawIndexed", (const char *) funcName, sizeof("xglCmdDrawIndexed")))
1648 return xglCmdDrawIndexed;
1649 else if (!strncmp("xglCmdDrawIndirect", (const char *) funcName, sizeof("xglCmdDrawIndirect")))
1650 return xglCmdDrawIndirect;
1651 else if (!strncmp("xglCmdDrawIndexedIndirect", (const char *) funcName, sizeof("xglCmdDrawIndexedIndirect")))
1652 return xglCmdDrawIndexedIndirect;
1653 else if (!strncmp("xglCmdDispatch", (const char *) funcName, sizeof("xglCmdDispatch")))
1654 return xglCmdDispatch;
1655 else if (!strncmp("xglCmdDispatchIndirect", (const char *) funcName, sizeof("xglCmdDispatchIndirect")))
1656 return xglCmdDispatchIndirect;
1657 else if (!strncmp("xglCmdCopyMemory", (const char *) funcName, sizeof("xglCmdCopyMemory")))
1658 return xglCmdCopyMemory;
1659 else if (!strncmp("xglCmdCopyImage", (const char *) funcName, sizeof("xglCmdCopyImage")))
1660 return xglCmdCopyImage;
1661 else if (!strncmp("xglCmdCopyMemoryToImage", (const char *) funcName, sizeof("xglCmdCopyMemoryToImage")))
1662 return xglCmdCopyMemoryToImage;
1663 else if (!strncmp("xglCmdCopyImageToMemory", (const char *) funcName, sizeof("xglCmdCopyImageToMemory")))
1664 return xglCmdCopyImageToMemory;
1665 else if (!strncmp("xglCmdCloneImageData", (const char *) funcName, sizeof("xglCmdCloneImageData")))
1666 return xglCmdCloneImageData;
1667 else if (!strncmp("xglCmdUpdateMemory", (const char *) funcName, sizeof("xglCmdUpdateMemory")))
1668 return xglCmdUpdateMemory;
1669 else if (!strncmp("xglCmdFillMemory", (const char *) funcName, sizeof("xglCmdFillMemory")))
1670 return xglCmdFillMemory;
1671 else if (!strncmp("xglCmdClearColorImage", (const char *) funcName, sizeof("xglCmdClearColorImage")))
1672 return xglCmdClearColorImage;
1673 else if (!strncmp("xglCmdClearColorImageRaw", (const char *) funcName, sizeof("xglCmdClearColorImageRaw")))
1674 return xglCmdClearColorImageRaw;
1675 else if (!strncmp("xglCmdClearDepthStencil", (const char *) funcName, sizeof("xglCmdClearDepthStencil")))
1676 return xglCmdClearDepthStencil;
1677 else if (!strncmp("xglCmdResolveImage", (const char *) funcName, sizeof("xglCmdResolveImage")))
1678 return xglCmdResolveImage;
1679 else if (!strncmp("xglCmdSetEvent", (const char *) funcName, sizeof("xglCmdSetEvent")))
1680 return xglCmdSetEvent;
1681 else if (!strncmp("xglCmdResetEvent", (const char *) funcName, sizeof("xglCmdResetEvent")))
1682 return xglCmdResetEvent;
1683 else if (!strncmp("xglCmdMemoryAtomic", (const char *) funcName, sizeof("xglCmdMemoryAtomic")))
1684 return xglCmdMemoryAtomic;
1685 else if (!strncmp("xglCmdBeginQuery", (const char *) funcName, sizeof("xglCmdBeginQuery")))
1686 return xglCmdBeginQuery;
1687 else if (!strncmp("xglCmdEndQuery", (const char *) funcName, sizeof("xglCmdEndQuery")))
1688 return xglCmdEndQuery;
1689 else if (!strncmp("xglCmdResetQueryPool", (const char *) funcName, sizeof("xglCmdResetQueryPool")))
1690 return xglCmdResetQueryPool;
1691 else if (!strncmp("xglCmdWriteTimestamp", (const char *) funcName, sizeof("xglCmdWriteTimestamp")))
1692 return xglCmdWriteTimestamp;
1693 else if (!strncmp("xglCmdInitAtomicCounters", (const char *) funcName, sizeof("xglCmdInitAtomicCounters")))
1694 return xglCmdInitAtomicCounters;
1695 else if (!strncmp("xglCmdLoadAtomicCounters", (const char *) funcName, sizeof("xglCmdLoadAtomicCounters")))
1696 return xglCmdLoadAtomicCounters;
1697 else if (!strncmp("xglCmdSaveAtomicCounters", (const char *) funcName, sizeof("xglCmdSaveAtomicCounters")))
1698 return xglCmdSaveAtomicCounters;
1699 else if (!strncmp("xglDbgSetValidationLevel", (const char *) funcName, sizeof("xglDbgSetValidationLevel")))
1700 return xglDbgSetValidationLevel;
1701 else if (!strncmp("xglDbgRegisterMsgCallback", (const char *) funcName, sizeof("xglDbgRegisterMsgCallback")))
1702 return xglDbgRegisterMsgCallback;
1703 else if (!strncmp("xglDbgUnregisterMsgCallback", (const char *) funcName, sizeof("xglDbgUnregisterMsgCallback")))
1704 return xglDbgUnregisterMsgCallback;
1705 else if (!strncmp("xglDbgSetMessageFilter", (const char *) funcName, sizeof("xglDbgSetMessageFilter")))
1706 return xglDbgSetMessageFilter;
1707 else if (!strncmp("xglDbgSetObjectTag", (const char *) funcName, sizeof("xglDbgSetObjectTag")))
1708 return xglDbgSetObjectTag;
1709 else if (!strncmp("xglDbgSetGlobalOption", (const char *) funcName, sizeof("xglDbgSetGlobalOption")))
1710 return xglDbgSetGlobalOption;
1711 else if (!strncmp("xglDbgSetDeviceOption", (const char *) funcName, sizeof("xglDbgSetDeviceOption")))
1712 return xglDbgSetDeviceOption;
1713 else if (!strncmp("xglCmdDbgMarkerBegin", (const char *) funcName, sizeof("xglCmdDbgMarkerBegin")))
1714 return xglCmdDbgMarkerBegin;
1715 else if (!strncmp("xglCmdDbgMarkerEnd", (const char *) funcName, sizeof("xglCmdDbgMarkerEnd")))
1716 return xglCmdDbgMarkerEnd;
1717 else if (!strncmp("xglWsiX11AssociateConnection", (const char *) funcName, sizeof("xglWsiX11AssociateConnection")))
1718 return xglWsiX11AssociateConnection;
1719 else if (!strncmp("xglWsiX11GetMSC", (const char *) funcName, sizeof("xglWsiX11GetMSC")))
1720 return xglWsiX11GetMSC;
1721 else if (!strncmp("xglWsiX11CreatePresentableImage", (const char *) funcName, sizeof("xglWsiX11CreatePresentableImage")))
1722 return xglWsiX11CreatePresentableImage;
1723 else if (!strncmp("xglWsiX11QueuePresent", (const char *) funcName, sizeof("xglWsiX11QueuePresent")))
1724 return xglWsiX11QueuePresent;
1725 else {
1726 XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu;
1727 if (gpuw->pGPA == NULL)
1728 return NULL;
1729 return gpuw->pGPA(gpuw->nextObject, funcName);
1730 }
1731}
1732