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