blob: 8a2e4c78a2ed00ea8904284c3cff867568a60bed [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;
Tobin Ehlis9e3d7532014-10-27 17:12:54 -0600357 case XGL_SLOT_SHADER_UAV:
358 if (MAPPING_MEMORY != slotBinding)
359 error = XGL_TRUE;
360 break;
361 case XGL_SLOT_NEXT_DESCRIPTOR_SET:
362 if (MAPPING_DS != slotBinding)
363 error = XGL_TRUE;
364 break;
365 case XGL_SLOT_UNUSED:
366 break;
367 default:
368 printf("DS ERROR : For DS slot %u, unknown shader slot mapping w/ value %u\n", slot, shaderMapping);
369 return XGL_FALSE;
370 }
371 if (XGL_TRUE == error) {
372 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));
373 return XGL_FALSE;
374 }
375 return XGL_TRUE;
376}
377
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600378// Print details of DS config to stdout
379static void printDSConfig()
380{
Tobin Ehlis791a49c2014-11-10 12:29:12 -0700381 uint32_t skipUnusedCount = 0; // track consecutive unused slots for minimal reporting
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600382 for (uint32_t i = 0; i < XGL_MAX_DESCRIPTOR_SETS; i++) {
Tobin Ehlisb8154982014-10-27 14:53:17 -0600383 if (lastBoundDS[i]) {
384 DS_LL_HEAD *pDS = getDS(lastBoundDS[i]);
385 if (pDS) {
386 printf("DS INFO : Slot bindings for DS w/ %u slots at index %u (%p):\n", pDS->numSlots, i, (void*)pDS->dsID);
387 for (uint32_t j = 0; j < pDS->numSlots; j++) {
Tobin Ehlisb8154982014-10-27 14:53:17 -0600388 switch (pDS->dsSlot[j].activeMapping)
389 {
390 case MAPPING_MEMORY:
Tobin Ehlis791a49c2014-11-10 12:29:12 -0700391 if (0 != skipUnusedCount) {// finish sequence of unused slots
392 printf("----Skipped %u slot%s w/o a view attached...\n", skipUnusedCount, (1 != skipUnusedCount) ? "s" : "");
393 skipUnusedCount = 0;
394 }
395 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 -0600396 break;
397 case MAPPING_IMAGE:
Tobin Ehlis791a49c2014-11-10 12:29:12 -0700398 if (0 != skipUnusedCount) {// finish sequence of unused slots
399 printf("----Skipped %u slot%s w/o a view attached...\n", skipUnusedCount, (1 != skipUnusedCount) ? "s" : "");
400 skipUnusedCount = 0;
401 }
402 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 -0600403 break;
404 case MAPPING_SAMPLER:
Tobin Ehlis791a49c2014-11-10 12:29:12 -0700405 if (0 != skipUnusedCount) {// finish sequence of unused slots
406 printf("----Skipped %u slot%s w/o a view attached...\n", skipUnusedCount, (1 != skipUnusedCount) ? "s" : "");
407 skipUnusedCount = 0;
408 }
409 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 -0600410 break;
411 default:
Tobin Ehlis791a49c2014-11-10 12:29:12 -0700412 if (!skipUnusedCount) // only report start of unused sequences
413 printf("----Skipping slot(s) w/o a view attached...\n");
414 skipUnusedCount++;
Tobin Ehlisb8154982014-10-27 14:53:17 -0600415 break;
416 }
Tobin Ehlis9e3d7532014-10-27 17:12:54 -0600417 // For each shader type, check its mapping
Tobin Ehlisb8154982014-10-27 14:53:17 -0600418 for (uint32_t k = 0; k < 2; k++) {
419 if (XGL_SLOT_UNUSED != pDS->dsSlot[j].shaderSlotInfo[k].slotObjectType) {
420 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 -0600421 verifyShaderSlotMapping(j, pDS->dsSlot[j].activeMapping, k, pDS->dsSlot[j].shaderSlotInfo[k].slotObjectType);
Tobin Ehlisb8154982014-10-27 14:53:17 -0600422 }
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600423 }
424 }
Tobin Ehlis791a49c2014-11-10 12:29:12 -0700425 if (0 != skipUnusedCount) {// finish sequence of unused slots
426 printf("----Skipped %u slot%s w/o a view attached...\n", skipUnusedCount, (1 != skipUnusedCount) ? "s" : "");
427 skipUnusedCount = 0;
428 }
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600429 }
Tobin Ehlisb8154982014-10-27 14:53:17 -0600430 else {
431 printf("DS ERROR : Can't find last bound DS %p. Did you need to bind DS to index %u?\n", (void*)lastBoundDS[i], i);
432 }
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600433 }
434 }
435}
436
437static void synchAndPrintDSConfig()
438{
439 synchDSMapping();
440 printDSConfig();
441}
442
443static void initLayerTable()
444{
445 GetProcAddrType fpNextGPA;
446 fpNextGPA = pCurObj->pGPA;
447 assert(fpNextGPA);
448
449 GetProcAddrType fpGetProcAddr = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetProcAddr");
450 nextTable.GetProcAddr = fpGetProcAddr;
451 InitAndEnumerateGpusType fpInitAndEnumerateGpus = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglInitAndEnumerateGpus");
452 nextTable.InitAndEnumerateGpus = fpInitAndEnumerateGpus;
453 GetGpuInfoType fpGetGpuInfo = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetGpuInfo");
454 nextTable.GetGpuInfo = fpGetGpuInfo;
455 CreateDeviceType fpCreateDevice = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateDevice");
456 nextTable.CreateDevice = fpCreateDevice;
457 DestroyDeviceType fpDestroyDevice = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDestroyDevice");
458 nextTable.DestroyDevice = fpDestroyDevice;
459 GetExtensionSupportType fpGetExtensionSupport = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetExtensionSupport");
460 nextTable.GetExtensionSupport = fpGetExtensionSupport;
461 EnumerateLayersType fpEnumerateLayers = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglEnumerateLayers");
462 nextTable.EnumerateLayers = fpEnumerateLayers;
463 GetDeviceQueueType fpGetDeviceQueue = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetDeviceQueue");
464 nextTable.GetDeviceQueue = fpGetDeviceQueue;
465 QueueSubmitType fpQueueSubmit = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglQueueSubmit");
466 nextTable.QueueSubmit = fpQueueSubmit;
467 QueueSetGlobalMemReferencesType fpQueueSetGlobalMemReferences = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglQueueSetGlobalMemReferences");
468 nextTable.QueueSetGlobalMemReferences = fpQueueSetGlobalMemReferences;
469 QueueWaitIdleType fpQueueWaitIdle = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglQueueWaitIdle");
470 nextTable.QueueWaitIdle = fpQueueWaitIdle;
471 DeviceWaitIdleType fpDeviceWaitIdle = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDeviceWaitIdle");
472 nextTable.DeviceWaitIdle = fpDeviceWaitIdle;
473 GetMemoryHeapCountType fpGetMemoryHeapCount = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetMemoryHeapCount");
474 nextTable.GetMemoryHeapCount = fpGetMemoryHeapCount;
475 GetMemoryHeapInfoType fpGetMemoryHeapInfo = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetMemoryHeapInfo");
476 nextTable.GetMemoryHeapInfo = fpGetMemoryHeapInfo;
477 AllocMemoryType fpAllocMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglAllocMemory");
478 nextTable.AllocMemory = fpAllocMemory;
479 FreeMemoryType fpFreeMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglFreeMemory");
480 nextTable.FreeMemory = fpFreeMemory;
481 SetMemoryPriorityType fpSetMemoryPriority = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglSetMemoryPriority");
482 nextTable.SetMemoryPriority = fpSetMemoryPriority;
483 MapMemoryType fpMapMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglMapMemory");
484 nextTable.MapMemory = fpMapMemory;
485 UnmapMemoryType fpUnmapMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglUnmapMemory");
486 nextTable.UnmapMemory = fpUnmapMemory;
487 PinSystemMemoryType fpPinSystemMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglPinSystemMemory");
488 nextTable.PinSystemMemory = fpPinSystemMemory;
489 RemapVirtualMemoryPagesType fpRemapVirtualMemoryPages = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglRemapVirtualMemoryPages");
490 nextTable.RemapVirtualMemoryPages = fpRemapVirtualMemoryPages;
491 GetMultiGpuCompatibilityType fpGetMultiGpuCompatibility = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetMultiGpuCompatibility");
492 nextTable.GetMultiGpuCompatibility = fpGetMultiGpuCompatibility;
493 OpenSharedMemoryType fpOpenSharedMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglOpenSharedMemory");
494 nextTable.OpenSharedMemory = fpOpenSharedMemory;
495 OpenSharedQueueSemaphoreType fpOpenSharedQueueSemaphore = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglOpenSharedQueueSemaphore");
496 nextTable.OpenSharedQueueSemaphore = fpOpenSharedQueueSemaphore;
497 OpenPeerMemoryType fpOpenPeerMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglOpenPeerMemory");
498 nextTable.OpenPeerMemory = fpOpenPeerMemory;
499 OpenPeerImageType fpOpenPeerImage = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglOpenPeerImage");
500 nextTable.OpenPeerImage = fpOpenPeerImage;
501 DestroyObjectType fpDestroyObject = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDestroyObject");
502 nextTable.DestroyObject = fpDestroyObject;
503 GetObjectInfoType fpGetObjectInfo = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetObjectInfo");
504 nextTable.GetObjectInfo = fpGetObjectInfo;
505 BindObjectMemoryType fpBindObjectMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglBindObjectMemory");
506 nextTable.BindObjectMemory = fpBindObjectMemory;
507 CreateFenceType fpCreateFence = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateFence");
508 nextTable.CreateFence = fpCreateFence;
509 GetFenceStatusType fpGetFenceStatus = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetFenceStatus");
510 nextTable.GetFenceStatus = fpGetFenceStatus;
511 WaitForFencesType fpWaitForFences = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglWaitForFences");
512 nextTable.WaitForFences = fpWaitForFences;
513 CreateQueueSemaphoreType fpCreateQueueSemaphore = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateQueueSemaphore");
514 nextTable.CreateQueueSemaphore = fpCreateQueueSemaphore;
515 SignalQueueSemaphoreType fpSignalQueueSemaphore = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglSignalQueueSemaphore");
516 nextTable.SignalQueueSemaphore = fpSignalQueueSemaphore;
517 WaitQueueSemaphoreType fpWaitQueueSemaphore = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglWaitQueueSemaphore");
518 nextTable.WaitQueueSemaphore = fpWaitQueueSemaphore;
519 CreateEventType fpCreateEvent = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateEvent");
520 nextTable.CreateEvent = fpCreateEvent;
521 GetEventStatusType fpGetEventStatus = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetEventStatus");
522 nextTable.GetEventStatus = fpGetEventStatus;
523 SetEventType fpSetEvent = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglSetEvent");
524 nextTable.SetEvent = fpSetEvent;
525 ResetEventType fpResetEvent = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglResetEvent");
526 nextTable.ResetEvent = fpResetEvent;
527 CreateQueryPoolType fpCreateQueryPool = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateQueryPool");
528 nextTable.CreateQueryPool = fpCreateQueryPool;
529 GetQueryPoolResultsType fpGetQueryPoolResults = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetQueryPoolResults");
530 nextTable.GetQueryPoolResults = fpGetQueryPoolResults;
531 GetFormatInfoType fpGetFormatInfo = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetFormatInfo");
532 nextTable.GetFormatInfo = fpGetFormatInfo;
533 CreateImageType fpCreateImage = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateImage");
534 nextTable.CreateImage = fpCreateImage;
535 GetImageSubresourceInfoType fpGetImageSubresourceInfo = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetImageSubresourceInfo");
536 nextTable.GetImageSubresourceInfo = fpGetImageSubresourceInfo;
537 CreateImageViewType fpCreateImageView = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateImageView");
538 nextTable.CreateImageView = fpCreateImageView;
539 CreateColorAttachmentViewType fpCreateColorAttachmentView = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateColorAttachmentView");
540 nextTable.CreateColorAttachmentView = fpCreateColorAttachmentView;
541 CreateDepthStencilViewType fpCreateDepthStencilView = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateDepthStencilView");
542 nextTable.CreateDepthStencilView = fpCreateDepthStencilView;
543 CreateShaderType fpCreateShader = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateShader");
544 nextTable.CreateShader = fpCreateShader;
545 CreateGraphicsPipelineType fpCreateGraphicsPipeline = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateGraphicsPipeline");
546 nextTable.CreateGraphicsPipeline = fpCreateGraphicsPipeline;
547 CreateComputePipelineType fpCreateComputePipeline = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateComputePipeline");
548 nextTable.CreateComputePipeline = fpCreateComputePipeline;
549 StorePipelineType fpStorePipeline = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglStorePipeline");
550 nextTable.StorePipeline = fpStorePipeline;
551 LoadPipelineType fpLoadPipeline = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglLoadPipeline");
552 nextTable.LoadPipeline = fpLoadPipeline;
553 CreatePipelineDeltaType fpCreatePipelineDelta = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreatePipelineDelta");
554 nextTable.CreatePipelineDelta = fpCreatePipelineDelta;
555 CreateSamplerType fpCreateSampler = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateSampler");
556 nextTable.CreateSampler = fpCreateSampler;
557 CreateDescriptorSetType fpCreateDescriptorSet = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateDescriptorSet");
558 nextTable.CreateDescriptorSet = fpCreateDescriptorSet;
559 BeginDescriptorSetUpdateType fpBeginDescriptorSetUpdate = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglBeginDescriptorSetUpdate");
560 nextTable.BeginDescriptorSetUpdate = fpBeginDescriptorSetUpdate;
561 EndDescriptorSetUpdateType fpEndDescriptorSetUpdate = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglEndDescriptorSetUpdate");
562 nextTable.EndDescriptorSetUpdate = fpEndDescriptorSetUpdate;
563 AttachSamplerDescriptorsType fpAttachSamplerDescriptors = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglAttachSamplerDescriptors");
564 nextTable.AttachSamplerDescriptors = fpAttachSamplerDescriptors;
565 AttachImageViewDescriptorsType fpAttachImageViewDescriptors = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglAttachImageViewDescriptors");
566 nextTable.AttachImageViewDescriptors = fpAttachImageViewDescriptors;
567 AttachMemoryViewDescriptorsType fpAttachMemoryViewDescriptors = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglAttachMemoryViewDescriptors");
568 nextTable.AttachMemoryViewDescriptors = fpAttachMemoryViewDescriptors;
569 AttachNestedDescriptorsType fpAttachNestedDescriptors = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglAttachNestedDescriptors");
570 nextTable.AttachNestedDescriptors = fpAttachNestedDescriptors;
571 ClearDescriptorSetSlotsType fpClearDescriptorSetSlots = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglClearDescriptorSetSlots");
572 nextTable.ClearDescriptorSetSlots = fpClearDescriptorSetSlots;
573 CreateViewportStateType fpCreateViewportState = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateViewportState");
574 nextTable.CreateViewportState = fpCreateViewportState;
575 CreateRasterStateType fpCreateRasterState = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateRasterState");
576 nextTable.CreateRasterState = fpCreateRasterState;
577 CreateMsaaStateType fpCreateMsaaState = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateMsaaState");
578 nextTable.CreateMsaaState = fpCreateMsaaState;
579 CreateColorBlendStateType fpCreateColorBlendState = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateColorBlendState");
580 nextTable.CreateColorBlendState = fpCreateColorBlendState;
581 CreateDepthStencilStateType fpCreateDepthStencilState = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateDepthStencilState");
582 nextTable.CreateDepthStencilState = fpCreateDepthStencilState;
583 CreateCommandBufferType fpCreateCommandBuffer = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCreateCommandBuffer");
584 nextTable.CreateCommandBuffer = fpCreateCommandBuffer;
585 BeginCommandBufferType fpBeginCommandBuffer = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglBeginCommandBuffer");
586 nextTable.BeginCommandBuffer = fpBeginCommandBuffer;
587 EndCommandBufferType fpEndCommandBuffer = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglEndCommandBuffer");
588 nextTable.EndCommandBuffer = fpEndCommandBuffer;
589 ResetCommandBufferType fpResetCommandBuffer = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglResetCommandBuffer");
590 nextTable.ResetCommandBuffer = fpResetCommandBuffer;
591 CmdBindPipelineType fpCmdBindPipeline = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindPipeline");
592 nextTable.CmdBindPipeline = fpCmdBindPipeline;
593 CmdBindPipelineDeltaType fpCmdBindPipelineDelta = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindPipelineDelta");
594 nextTable.CmdBindPipelineDelta = fpCmdBindPipelineDelta;
595 CmdBindStateObjectType fpCmdBindStateObject = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindStateObject");
596 nextTable.CmdBindStateObject = fpCmdBindStateObject;
597 CmdBindDescriptorSetType fpCmdBindDescriptorSet = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindDescriptorSet");
598 nextTable.CmdBindDescriptorSet = fpCmdBindDescriptorSet;
599 CmdBindDynamicMemoryViewType fpCmdBindDynamicMemoryView = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindDynamicMemoryView");
600 nextTable.CmdBindDynamicMemoryView = fpCmdBindDynamicMemoryView;
Chia-I Wu3b04af52014-11-08 10:48:20 +0800601 CmdBindVertexDataType fpCmdBindVertexData = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindVertexData");
602 nextTable.CmdBindVertexData = fpCmdBindVertexData;
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600603 CmdBindIndexDataType fpCmdBindIndexData = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindIndexData");
604 nextTable.CmdBindIndexData = fpCmdBindIndexData;
605 CmdBindAttachmentsType fpCmdBindAttachments = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBindAttachments");
606 nextTable.CmdBindAttachments = fpCmdBindAttachments;
607 CmdPrepareMemoryRegionsType fpCmdPrepareMemoryRegions = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdPrepareMemoryRegions");
608 nextTable.CmdPrepareMemoryRegions = fpCmdPrepareMemoryRegions;
609 CmdPrepareImagesType fpCmdPrepareImages = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdPrepareImages");
610 nextTable.CmdPrepareImages = fpCmdPrepareImages;
611 CmdDrawType fpCmdDraw = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDraw");
612 nextTable.CmdDraw = fpCmdDraw;
613 CmdDrawIndexedType fpCmdDrawIndexed = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDrawIndexed");
614 nextTable.CmdDrawIndexed = fpCmdDrawIndexed;
615 CmdDrawIndirectType fpCmdDrawIndirect = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDrawIndirect");
616 nextTable.CmdDrawIndirect = fpCmdDrawIndirect;
617 CmdDrawIndexedIndirectType fpCmdDrawIndexedIndirect = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDrawIndexedIndirect");
618 nextTable.CmdDrawIndexedIndirect = fpCmdDrawIndexedIndirect;
619 CmdDispatchType fpCmdDispatch = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDispatch");
620 nextTable.CmdDispatch = fpCmdDispatch;
621 CmdDispatchIndirectType fpCmdDispatchIndirect = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDispatchIndirect");
622 nextTable.CmdDispatchIndirect = fpCmdDispatchIndirect;
623 CmdCopyMemoryType fpCmdCopyMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdCopyMemory");
624 nextTable.CmdCopyMemory = fpCmdCopyMemory;
625 CmdCopyImageType fpCmdCopyImage = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdCopyImage");
626 nextTable.CmdCopyImage = fpCmdCopyImage;
627 CmdCopyMemoryToImageType fpCmdCopyMemoryToImage = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdCopyMemoryToImage");
628 nextTable.CmdCopyMemoryToImage = fpCmdCopyMemoryToImage;
629 CmdCopyImageToMemoryType fpCmdCopyImageToMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdCopyImageToMemory");
630 nextTable.CmdCopyImageToMemory = fpCmdCopyImageToMemory;
631 CmdCloneImageDataType fpCmdCloneImageData = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdCloneImageData");
632 nextTable.CmdCloneImageData = fpCmdCloneImageData;
633 CmdUpdateMemoryType fpCmdUpdateMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdUpdateMemory");
634 nextTable.CmdUpdateMemory = fpCmdUpdateMemory;
635 CmdFillMemoryType fpCmdFillMemory = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdFillMemory");
636 nextTable.CmdFillMemory = fpCmdFillMemory;
637 CmdClearColorImageType fpCmdClearColorImage = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdClearColorImage");
638 nextTable.CmdClearColorImage = fpCmdClearColorImage;
639 CmdClearColorImageRawType fpCmdClearColorImageRaw = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdClearColorImageRaw");
640 nextTable.CmdClearColorImageRaw = fpCmdClearColorImageRaw;
641 CmdClearDepthStencilType fpCmdClearDepthStencil = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdClearDepthStencil");
642 nextTable.CmdClearDepthStencil = fpCmdClearDepthStencil;
643 CmdResolveImageType fpCmdResolveImage = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdResolveImage");
644 nextTable.CmdResolveImage = fpCmdResolveImage;
645 CmdSetEventType fpCmdSetEvent = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdSetEvent");
646 nextTable.CmdSetEvent = fpCmdSetEvent;
647 CmdResetEventType fpCmdResetEvent = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdResetEvent");
648 nextTable.CmdResetEvent = fpCmdResetEvent;
649 CmdMemoryAtomicType fpCmdMemoryAtomic = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdMemoryAtomic");
650 nextTable.CmdMemoryAtomic = fpCmdMemoryAtomic;
651 CmdBeginQueryType fpCmdBeginQuery = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdBeginQuery");
652 nextTable.CmdBeginQuery = fpCmdBeginQuery;
653 CmdEndQueryType fpCmdEndQuery = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdEndQuery");
654 nextTable.CmdEndQuery = fpCmdEndQuery;
655 CmdResetQueryPoolType fpCmdResetQueryPool = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdResetQueryPool");
656 nextTable.CmdResetQueryPool = fpCmdResetQueryPool;
657 CmdWriteTimestampType fpCmdWriteTimestamp = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdWriteTimestamp");
658 nextTable.CmdWriteTimestamp = fpCmdWriteTimestamp;
659 CmdInitAtomicCountersType fpCmdInitAtomicCounters = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdInitAtomicCounters");
660 nextTable.CmdInitAtomicCounters = fpCmdInitAtomicCounters;
661 CmdLoadAtomicCountersType fpCmdLoadAtomicCounters = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdLoadAtomicCounters");
662 nextTable.CmdLoadAtomicCounters = fpCmdLoadAtomicCounters;
663 CmdSaveAtomicCountersType fpCmdSaveAtomicCounters = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdSaveAtomicCounters");
664 nextTable.CmdSaveAtomicCounters = fpCmdSaveAtomicCounters;
665 DbgSetValidationLevelType fpDbgSetValidationLevel = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDbgSetValidationLevel");
666 nextTable.DbgSetValidationLevel = fpDbgSetValidationLevel;
667 DbgRegisterMsgCallbackType fpDbgRegisterMsgCallback = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDbgRegisterMsgCallback");
668 nextTable.DbgRegisterMsgCallback = fpDbgRegisterMsgCallback;
669 DbgUnregisterMsgCallbackType fpDbgUnregisterMsgCallback = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDbgUnregisterMsgCallback");
670 nextTable.DbgUnregisterMsgCallback = fpDbgUnregisterMsgCallback;
671 DbgSetMessageFilterType fpDbgSetMessageFilter = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDbgSetMessageFilter");
672 nextTable.DbgSetMessageFilter = fpDbgSetMessageFilter;
673 DbgSetObjectTagType fpDbgSetObjectTag = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDbgSetObjectTag");
674 nextTable.DbgSetObjectTag = fpDbgSetObjectTag;
675 DbgSetGlobalOptionType fpDbgSetGlobalOption = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDbgSetGlobalOption");
676 nextTable.DbgSetGlobalOption = fpDbgSetGlobalOption;
677 DbgSetDeviceOptionType fpDbgSetDeviceOption = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglDbgSetDeviceOption");
678 nextTable.DbgSetDeviceOption = fpDbgSetDeviceOption;
679 CmdDbgMarkerBeginType fpCmdDbgMarkerBegin = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDbgMarkerBegin");
680 nextTable.CmdDbgMarkerBegin = fpCmdDbgMarkerBegin;
681 CmdDbgMarkerEndType fpCmdDbgMarkerEnd = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglCmdDbgMarkerEnd");
682 nextTable.CmdDbgMarkerEnd = fpCmdDbgMarkerEnd;
683 WsiX11AssociateConnectionType fpWsiX11AssociateConnection = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglWsiX11AssociateConnection");
684 nextTable.WsiX11AssociateConnection = fpWsiX11AssociateConnection;
685 WsiX11GetMSCType fpWsiX11GetMSC = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglWsiX11GetMSC");
686 nextTable.WsiX11GetMSC = fpWsiX11GetMSC;
687 WsiX11CreatePresentableImageType fpWsiX11CreatePresentableImage = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglWsiX11CreatePresentableImage");
688 nextTable.WsiX11CreatePresentableImage = fpWsiX11CreatePresentableImage;
689 WsiX11QueuePresentType fpWsiX11QueuePresent = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglWsiX11QueuePresent");
690 nextTable.WsiX11QueuePresent = fpWsiX11QueuePresent;
691}
692
693
694XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetGpuInfo(XGL_PHYSICAL_GPU gpu, XGL_PHYSICAL_GPU_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData)
695{
696 XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu;
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600697 pCurObj = gpuw;
698 pthread_once(&tabOnce, initLayerTable);
699 XGL_RESULT result = nextTable.GetGpuInfo((XGL_PHYSICAL_GPU)gpuw->nextObject, infoType, pDataSize, pData);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600700 return result;
701}
702
703XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateDevice(XGL_PHYSICAL_GPU gpu, const XGL_DEVICE_CREATE_INFO* pCreateInfo, XGL_DEVICE* pDevice)
704{
705 XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu;
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600706 pCurObj = gpuw;
707 pthread_once(&tabOnce, initLayerTable);
708 XGL_RESULT result = nextTable.CreateDevice((XGL_PHYSICAL_GPU)gpuw->nextObject, pCreateInfo, pDevice);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600709 return result;
710}
711
712XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDestroyDevice(XGL_DEVICE device)
713{
714 XGL_RESULT result = nextTable.DestroyDevice(device);
715 return result;
716}
717
718XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetExtensionSupport(XGL_PHYSICAL_GPU gpu, const XGL_CHAR* pExtName)
719{
720 XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu;
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600721 pCurObj = gpuw;
722 pthread_once(&tabOnce, initLayerTable);
723 XGL_RESULT result = nextTable.GetExtensionSupport((XGL_PHYSICAL_GPU)gpuw->nextObject, pExtName);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600724 return result;
725}
726
727XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, XGL_CHAR* const* pOutLayers, XGL_SIZE * pOutLayerCount)
728{
729 XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu;
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600730 pCurObj = gpuw;
731 pthread_once(&tabOnce, initLayerTable);
732 XGL_RESULT result = nextTable.EnumerateLayers((XGL_PHYSICAL_GPU)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayers, pOutLayerCount);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600733 return result;
734}
735
736XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetDeviceQueue(XGL_DEVICE device, XGL_QUEUE_TYPE queueType, XGL_UINT queueIndex, XGL_QUEUE* pQueue)
737{
738 XGL_RESULT result = nextTable.GetDeviceQueue(device, queueType, queueIndex, pQueue);
739 return result;
740}
741
742XGL_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)
743{
744 XGL_RESULT result = nextTable.QueueSubmit(queue, cmdBufferCount, pCmdBuffers, memRefCount, pMemRefs, fence);
745 return result;
746}
747
748XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglQueueSetGlobalMemReferences(XGL_QUEUE queue, XGL_UINT memRefCount, const XGL_MEMORY_REF* pMemRefs)
749{
750 XGL_RESULT result = nextTable.QueueSetGlobalMemReferences(queue, memRefCount, pMemRefs);
751 return result;
752}
753
754XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglQueueWaitIdle(XGL_QUEUE queue)
755{
756 XGL_RESULT result = nextTable.QueueWaitIdle(queue);
757 return result;
758}
759
760XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDeviceWaitIdle(XGL_DEVICE device)
761{
762 XGL_RESULT result = nextTable.DeviceWaitIdle(device);
763 return result;
764}
765
766XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetMemoryHeapCount(XGL_DEVICE device, XGL_UINT* pCount)
767{
768 XGL_RESULT result = nextTable.GetMemoryHeapCount(device, pCount);
769 return result;
770}
771
772XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetMemoryHeapInfo(XGL_DEVICE device, XGL_UINT heapId, XGL_MEMORY_HEAP_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData)
773{
774 XGL_RESULT result = nextTable.GetMemoryHeapInfo(device, heapId, infoType, pDataSize, pData);
775 return result;
776}
777
778XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglAllocMemory(XGL_DEVICE device, const XGL_MEMORY_ALLOC_INFO* pAllocInfo, XGL_GPU_MEMORY* pMem)
779{
780 XGL_RESULT result = nextTable.AllocMemory(device, pAllocInfo, pMem);
781 return result;
782}
783
784XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglFreeMemory(XGL_GPU_MEMORY mem)
785{
786 XGL_RESULT result = nextTable.FreeMemory(mem);
787 return result;
788}
789
790XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglSetMemoryPriority(XGL_GPU_MEMORY mem, XGL_MEMORY_PRIORITY priority)
791{
792 XGL_RESULT result = nextTable.SetMemoryPriority(mem, priority);
793 return result;
794}
795
796XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglMapMemory(XGL_GPU_MEMORY mem, XGL_FLAGS flags, XGL_VOID** ppData)
797{
798 XGL_RESULT result = nextTable.MapMemory(mem, flags, ppData);
799 return result;
800}
801
802XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglUnmapMemory(XGL_GPU_MEMORY mem)
803{
804 XGL_RESULT result = nextTable.UnmapMemory(mem);
805 return result;
806}
807
808XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglPinSystemMemory(XGL_DEVICE device, const XGL_VOID* pSysMem, XGL_SIZE memSize, XGL_GPU_MEMORY* pMem)
809{
810 XGL_RESULT result = nextTable.PinSystemMemory(device, pSysMem, memSize, pMem);
811 return result;
812}
813
814XGL_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)
815{
816 XGL_RESULT result = nextTable.RemapVirtualMemoryPages(device, rangeCount, pRanges, preWaitSemaphoreCount, pPreWaitSemaphores, postSignalSemaphoreCount, pPostSignalSemaphores);
817 return result;
818}
819
820XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetMultiGpuCompatibility(XGL_PHYSICAL_GPU gpu0, XGL_PHYSICAL_GPU gpu1, XGL_GPU_COMPATIBILITY_INFO* pInfo)
821{
822 XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu0;
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600823 pCurObj = gpuw;
824 pthread_once(&tabOnce, initLayerTable);
825 XGL_RESULT result = nextTable.GetMultiGpuCompatibility((XGL_PHYSICAL_GPU)gpuw->nextObject, gpu1, pInfo);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600826 return result;
827}
828
829XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglOpenSharedMemory(XGL_DEVICE device, const XGL_MEMORY_OPEN_INFO* pOpenInfo, XGL_GPU_MEMORY* pMem)
830{
831 XGL_RESULT result = nextTable.OpenSharedMemory(device, pOpenInfo, pMem);
832 return result;
833}
834
835XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglOpenSharedQueueSemaphore(XGL_DEVICE device, const XGL_QUEUE_SEMAPHORE_OPEN_INFO* pOpenInfo, XGL_QUEUE_SEMAPHORE* pSemaphore)
836{
837 XGL_RESULT result = nextTable.OpenSharedQueueSemaphore(device, pOpenInfo, pSemaphore);
838 return result;
839}
840
841XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglOpenPeerMemory(XGL_DEVICE device, const XGL_PEER_MEMORY_OPEN_INFO* pOpenInfo, XGL_GPU_MEMORY* pMem)
842{
843 XGL_RESULT result = nextTable.OpenPeerMemory(device, pOpenInfo, pMem);
844 return result;
845}
846
847XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglOpenPeerImage(XGL_DEVICE device, const XGL_PEER_IMAGE_OPEN_INFO* pOpenInfo, XGL_IMAGE* pImage, XGL_GPU_MEMORY* pMem)
848{
849 XGL_RESULT result = nextTable.OpenPeerImage(device, pOpenInfo, pImage, pMem);
850 return result;
851}
852
853XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDestroyObject(XGL_OBJECT object)
854{
855 XGL_RESULT result = nextTable.DestroyObject(object);
856 return result;
857}
858
859XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetObjectInfo(XGL_BASE_OBJECT object, XGL_OBJECT_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData)
860{
861 XGL_RESULT result = nextTable.GetObjectInfo(object, infoType, pDataSize, pData);
862 return result;
863}
864
865XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglBindObjectMemory(XGL_OBJECT object, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset)
866{
867 XGL_RESULT result = nextTable.BindObjectMemory(object, mem, offset);
868 return result;
869}
870
871XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateFence(XGL_DEVICE device, const XGL_FENCE_CREATE_INFO* pCreateInfo, XGL_FENCE* pFence)
872{
873 XGL_RESULT result = nextTable.CreateFence(device, pCreateInfo, pFence);
874 return result;
875}
876
877XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetFenceStatus(XGL_FENCE fence)
878{
879 XGL_RESULT result = nextTable.GetFenceStatus(fence);
880 return result;
881}
882
883XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWaitForFences(XGL_DEVICE device, XGL_UINT fenceCount, const XGL_FENCE* pFences, XGL_BOOL waitAll, XGL_UINT64 timeout)
884{
885 XGL_RESULT result = nextTable.WaitForFences(device, fenceCount, pFences, waitAll, timeout);
886 return result;
887}
888
889XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateQueueSemaphore(XGL_DEVICE device, const XGL_QUEUE_SEMAPHORE_CREATE_INFO* pCreateInfo, XGL_QUEUE_SEMAPHORE* pSemaphore)
890{
891 XGL_RESULT result = nextTable.CreateQueueSemaphore(device, pCreateInfo, pSemaphore);
892 return result;
893}
894
895XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglSignalQueueSemaphore(XGL_QUEUE queue, XGL_QUEUE_SEMAPHORE semaphore)
896{
897 XGL_RESULT result = nextTable.SignalQueueSemaphore(queue, semaphore);
898 return result;
899}
900
901XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWaitQueueSemaphore(XGL_QUEUE queue, XGL_QUEUE_SEMAPHORE semaphore)
902{
903 XGL_RESULT result = nextTable.WaitQueueSemaphore(queue, semaphore);
904 return result;
905}
906
907XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateEvent(XGL_DEVICE device, const XGL_EVENT_CREATE_INFO* pCreateInfo, XGL_EVENT* pEvent)
908{
909 XGL_RESULT result = nextTable.CreateEvent(device, pCreateInfo, pEvent);
910 return result;
911}
912
913XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetEventStatus(XGL_EVENT event)
914{
915 XGL_RESULT result = nextTable.GetEventStatus(event);
916 return result;
917}
918
919XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglSetEvent(XGL_EVENT event)
920{
921 XGL_RESULT result = nextTable.SetEvent(event);
922 return result;
923}
924
925XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglResetEvent(XGL_EVENT event)
926{
927 XGL_RESULT result = nextTable.ResetEvent(event);
928 return result;
929}
930
931XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateQueryPool(XGL_DEVICE device, const XGL_QUERY_POOL_CREATE_INFO* pCreateInfo, XGL_QUERY_POOL* pQueryPool)
932{
933 XGL_RESULT result = nextTable.CreateQueryPool(device, pCreateInfo, pQueryPool);
934 return result;
935}
936
937XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetQueryPoolResults(XGL_QUERY_POOL queryPool, XGL_UINT startQuery, XGL_UINT queryCount, XGL_SIZE* pDataSize, XGL_VOID* pData)
938{
939 XGL_RESULT result = nextTable.GetQueryPoolResults(queryPool, startQuery, queryCount, pDataSize, pData);
940 return result;
941}
942
943XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetFormatInfo(XGL_DEVICE device, XGL_FORMAT format, XGL_FORMAT_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData)
944{
945 XGL_RESULT result = nextTable.GetFormatInfo(device, format, infoType, pDataSize, pData);
946 return result;
947}
948
949XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateImage(XGL_DEVICE device, const XGL_IMAGE_CREATE_INFO* pCreateInfo, XGL_IMAGE* pImage)
950{
951 XGL_RESULT result = nextTable.CreateImage(device, pCreateInfo, pImage);
952 return result;
953}
954
955XGL_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)
956{
957 XGL_RESULT result = nextTable.GetImageSubresourceInfo(image, pSubresource, infoType, pDataSize, pData);
958 return result;
959}
960
961XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateImageView(XGL_DEVICE device, const XGL_IMAGE_VIEW_CREATE_INFO* pCreateInfo, XGL_IMAGE_VIEW* pView)
962{
963 XGL_RESULT result = nextTable.CreateImageView(device, pCreateInfo, pView);
964 return result;
965}
966
967XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateColorAttachmentView(XGL_DEVICE device, const XGL_COLOR_ATTACHMENT_VIEW_CREATE_INFO* pCreateInfo, XGL_COLOR_ATTACHMENT_VIEW* pView)
968{
969 XGL_RESULT result = nextTable.CreateColorAttachmentView(device, pCreateInfo, pView);
970 return result;
971}
972
973XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateDepthStencilView(XGL_DEVICE device, const XGL_DEPTH_STENCIL_VIEW_CREATE_INFO* pCreateInfo, XGL_DEPTH_STENCIL_VIEW* pView)
974{
975 XGL_RESULT result = nextTable.CreateDepthStencilView(device, pCreateInfo, pView);
976 return result;
977}
978
979XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateShader(XGL_DEVICE device, const XGL_SHADER_CREATE_INFO* pCreateInfo, XGL_SHADER* pShader)
980{
981 XGL_RESULT result = nextTable.CreateShader(device, pCreateInfo, pShader);
982 return result;
983}
984
985XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateGraphicsPipeline(XGL_DEVICE device, const XGL_GRAPHICS_PIPELINE_CREATE_INFO* pCreateInfo, XGL_PIPELINE* pPipeline)
986{
987 XGL_RESULT result = nextTable.CreateGraphicsPipeline(device, pCreateInfo, pPipeline);
988 // Create LL HEAD for this Pipeline
Tobin Ehlisb8154982014-10-27 14:53:17 -0600989 printf("DS INFO : Created Gfx Pipeline %p\n", (void*)*pPipeline);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -0600990 PIPELINE_NODE *pTrav = pPipelineHead;
991 if (pTrav) {
992 while (pTrav->pNext)
993 pTrav = pTrav->pNext;
994 pTrav->pNext = (PIPELINE_NODE*)malloc(sizeof(PIPELINE_NODE));
995 pTrav = pTrav->pNext;
996 }
997 else {
998 pTrav = (PIPELINE_NODE*)malloc(sizeof(PIPELINE_NODE));
999 pPipelineHead = pTrav;
1000 }
1001 memset((void*)pTrav, 0, sizeof(PIPELINE_NODE));
1002 pTrav->pipeline = *pPipeline;
1003 initPipeline(pTrav, pCreateInfo);
1004 return result;
1005}
1006
1007XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateComputePipeline(XGL_DEVICE device, const XGL_COMPUTE_PIPELINE_CREATE_INFO* pCreateInfo, XGL_PIPELINE* pPipeline)
1008{
1009 XGL_RESULT result = nextTable.CreateComputePipeline(device, pCreateInfo, pPipeline);
1010 return result;
1011}
1012
1013XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglStorePipeline(XGL_PIPELINE pipeline, XGL_SIZE* pDataSize, XGL_VOID* pData)
1014{
1015 XGL_RESULT result = nextTable.StorePipeline(pipeline, pDataSize, pData);
1016 return result;
1017}
1018
1019XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglLoadPipeline(XGL_DEVICE device, XGL_SIZE dataSize, const XGL_VOID* pData, XGL_PIPELINE* pPipeline)
1020{
1021 XGL_RESULT result = nextTable.LoadPipeline(device, dataSize, pData, pPipeline);
1022 return result;
1023}
1024
1025XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreatePipelineDelta(XGL_DEVICE device, XGL_PIPELINE p1, XGL_PIPELINE p2, XGL_PIPELINE_DELTA* delta)
1026{
1027 XGL_RESULT result = nextTable.CreatePipelineDelta(device, p1, p2, delta);
1028 return result;
1029}
1030
1031XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateSampler(XGL_DEVICE device, const XGL_SAMPLER_CREATE_INFO* pCreateInfo, XGL_SAMPLER* pSampler)
1032{
1033 XGL_RESULT result = nextTable.CreateSampler(device, pCreateInfo, pSampler);
1034 return result;
1035}
1036
1037XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateDescriptorSet(XGL_DEVICE device, const XGL_DESCRIPTOR_SET_CREATE_INFO* pCreateInfo, XGL_DESCRIPTOR_SET* pDescriptorSet)
1038{
1039 XGL_RESULT result = nextTable.CreateDescriptorSet(device, pCreateInfo, pDescriptorSet);
1040 // Create LL chain
Tobin Ehlisb8154982014-10-27 14:53:17 -06001041 printf("DS INFO : Created Descriptor Set (DS) %p\n", (void*)*pDescriptorSet);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001042 DS_LL_HEAD *pTrav = pDSHead;
1043 if (pTrav) {
1044 // Grow existing list
1045 while (pTrav->pNextDS)
1046 pTrav = pTrav->pNextDS;
1047 pTrav->pNextDS = (DS_LL_HEAD*)malloc(sizeof(DS_LL_HEAD));
1048 pTrav = pTrav->pNextDS;
1049 }
1050 else { // Create new list
1051 pTrav = (DS_LL_HEAD*)malloc(sizeof(DS_LL_HEAD));
1052 pDSHead = pTrav;
1053 }
1054 pTrav->dsSlot = (DS_SLOT*)malloc(sizeof(DS_SLOT) * pCreateInfo->slots);
1055 pTrav->dsID = *pDescriptorSet;
1056 pTrav->numSlots = pCreateInfo->slots;
1057 pTrav->pNextDS = NULL;
1058 pTrav->updateActive = XGL_FALSE;
1059 initDS(pTrav);
1060 return result;
1061}
1062
1063XGL_LAYER_EXPORT XGL_VOID XGLAPI xglBeginDescriptorSetUpdate(XGL_DESCRIPTOR_SET descriptorSet)
1064{
Tobin Ehlis0f051a52014-10-24 13:03:56 -06001065 DS_LL_HEAD* pDS = getDS(descriptorSet);
1066 if (!pDS) {
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001067 // TODO : This is where we should flag a REAL error
1068 printf("DS ERROR : Specified Descriptor Set %p does not exist!\n", (void*)descriptorSet);
1069 }
Tobin Ehlis0f051a52014-10-24 13:03:56 -06001070 else {
1071 pDS->updateActive = XGL_TRUE;
1072 }
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001073 nextTable.BeginDescriptorSetUpdate(descriptorSet);
1074}
1075
1076XGL_LAYER_EXPORT XGL_VOID XGLAPI xglEndDescriptorSetUpdate(XGL_DESCRIPTOR_SET descriptorSet)
1077{
1078 if (!dsUpdate(descriptorSet)) {
1079 // TODO : This is where we should flag a REAL error
1080 printf("DS ERROR : You must call xglBeginDescriptorSetUpdate(%p) before this call to xglEndDescriptorSetUpdate()!\n", (void*)descriptorSet);
1081 }
Tobin Ehlis0f051a52014-10-24 13:03:56 -06001082 else {
1083 DS_LL_HEAD* pDS = getDS(descriptorSet);
1084 if (!pDS) {
1085 printf("DS ERROR : Specified Descriptor Set %p does not exist!\n", (void*)descriptorSet);
1086 }
1087 else {
1088 pDS->updateActive = XGL_FALSE;
1089 }
1090 }
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001091 nextTable.EndDescriptorSetUpdate(descriptorSet);
1092}
1093
1094XGL_LAYER_EXPORT XGL_VOID XGLAPI xglAttachSamplerDescriptors(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_SAMPLER* pSamplers)
1095{
1096 if (!dsUpdate(descriptorSet)) {
1097 // TODO : This is where we should flag a REAL error
1098 printf("DS ERROR : You must call xglBeginDescriptorSetUpdate(%p) before this call to xglAttachSamplerDescriptors()!\n", (void*)descriptorSet);
1099 }
1100 else {
1101 if (!dsSamplerMapping(descriptorSet, startSlot, slotCount, pSamplers))
1102 printf("DS ERROR : Unable to attach sampler descriptors to DS %p!\n", (void*)descriptorSet);
1103 }
1104 nextTable.AttachSamplerDescriptors(descriptorSet, startSlot, slotCount, pSamplers);
1105}
1106
1107XGL_LAYER_EXPORT XGL_VOID XGLAPI xglAttachImageViewDescriptors(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_IMAGE_VIEW_ATTACH_INFO* pImageViews)
1108{
1109 if (!dsUpdate(descriptorSet)) {
1110 // TODO : This is where we should flag a REAL error
1111 printf("DS ERROR : You must call xglBeginDescriptorSetUpdate(%p) before this call to xglAttachSamplerDescriptors()!\n", (void*)descriptorSet);
1112 }
1113 else {
1114 if (!dsImageMapping(descriptorSet, startSlot, slotCount, pImageViews))
1115 printf("DS ERROR : Unable to attach image view descriptors to DS %p!\n", (void*)descriptorSet);
1116 }
1117 nextTable.AttachImageViewDescriptors(descriptorSet, startSlot, slotCount, pImageViews);
1118}
1119
1120XGL_LAYER_EXPORT XGL_VOID XGLAPI xglAttachMemoryViewDescriptors(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_MEMORY_VIEW_ATTACH_INFO* pMemViews)
1121{
1122 if (!dsUpdate(descriptorSet)) {
1123 // TODO : This is where we should flag a REAL error
1124 printf("DS ERROR : You must call xglBeginDescriptorSetUpdate(%p) before this call to xglAttachSamplerDescriptors()!\n", (void*)descriptorSet);
1125 }
1126 else {
1127 if (!dsMemMapping(descriptorSet, startSlot, slotCount, pMemViews))
1128 printf("DS ERROR : Unable to attach memory view descriptors to DS %p!\n", (void*)descriptorSet);
1129 }
1130 nextTable.AttachMemoryViewDescriptors(descriptorSet, startSlot, slotCount, pMemViews);
1131}
1132
1133XGL_LAYER_EXPORT XGL_VOID XGLAPI xglAttachNestedDescriptors(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_DESCRIPTOR_SET_ATTACH_INFO* pNestedDescriptorSets)
1134{
1135 if (!dsUpdate(descriptorSet)) {
1136 // TODO : This is where we should flag a REAL error
1137 printf("DS ERROR : You must call xglBeginDescriptorSetUpdate(%p) before this call to xglAttachSamplerDescriptors()!\n", (void*)descriptorSet);
1138 }
1139 nextTable.AttachNestedDescriptors(descriptorSet, startSlot, slotCount, pNestedDescriptorSets);
1140}
1141
1142// TODO : Does xglBeginDescriptorSetUpdate() have to be called before this function?
1143XGL_LAYER_EXPORT XGL_VOID XGLAPI xglClearDescriptorSetSlots(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount)
1144{
1145 if (!dsUpdate(descriptorSet)) {
1146 // TODO : This is where we should flag a REAL error
1147 printf("DS ERROR : You must call xglBeginDescriptorSetUpdate(%p) before this call to xglClearDescriptorSetSlots()!\n", (void*)descriptorSet);
1148 }
1149 if (!clearDS(descriptorSet, startSlot, slotCount)) {
1150 // TODO : This is where we should flag a REAL error
1151 printf("DS ERROR : Unable to perform xglClearDescriptorSetSlots(%p, %u, %u) call!\n", descriptorSet, startSlot, slotCount);
1152 }
1153 nextTable.ClearDescriptorSetSlots(descriptorSet, startSlot, slotCount);
1154}
1155
1156XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateViewportState(XGL_DEVICE device, const XGL_VIEWPORT_STATE_CREATE_INFO* pCreateInfo, XGL_VIEWPORT_STATE_OBJECT* pState)
1157{
1158 XGL_RESULT result = nextTable.CreateViewportState(device, pCreateInfo, pState);
1159 return result;
1160}
1161
1162XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateRasterState(XGL_DEVICE device, const XGL_RASTER_STATE_CREATE_INFO* pCreateInfo, XGL_RASTER_STATE_OBJECT* pState)
1163{
1164 XGL_RESULT result = nextTable.CreateRasterState(device, pCreateInfo, pState);
1165 return result;
1166}
1167
1168XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateMsaaState(XGL_DEVICE device, const XGL_MSAA_STATE_CREATE_INFO* pCreateInfo, XGL_MSAA_STATE_OBJECT* pState)
1169{
1170 XGL_RESULT result = nextTable.CreateMsaaState(device, pCreateInfo, pState);
1171 return result;
1172}
1173
1174XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateColorBlendState(XGL_DEVICE device, const XGL_COLOR_BLEND_STATE_CREATE_INFO* pCreateInfo, XGL_COLOR_BLEND_STATE_OBJECT* pState)
1175{
1176 XGL_RESULT result = nextTable.CreateColorBlendState(device, pCreateInfo, pState);
1177 return result;
1178}
1179
1180XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateDepthStencilState(XGL_DEVICE device, const XGL_DEPTH_STENCIL_STATE_CREATE_INFO* pCreateInfo, XGL_DEPTH_STENCIL_STATE_OBJECT* pState)
1181{
1182 XGL_RESULT result = nextTable.CreateDepthStencilState(device, pCreateInfo, pState);
1183 return result;
1184}
1185
1186XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglCreateCommandBuffer(XGL_DEVICE device, const XGL_CMD_BUFFER_CREATE_INFO* pCreateInfo, XGL_CMD_BUFFER* pCmdBuffer)
1187{
1188 XGL_RESULT result = nextTable.CreateCommandBuffer(device, pCreateInfo, pCmdBuffer);
1189 return result;
1190}
1191
1192XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglBeginCommandBuffer(XGL_CMD_BUFFER cmdBuffer, XGL_FLAGS flags)
1193{
1194 XGL_RESULT result = nextTable.BeginCommandBuffer(cmdBuffer, flags);
1195 return result;
1196}
1197
1198XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglEndCommandBuffer(XGL_CMD_BUFFER cmdBuffer)
1199{
1200 XGL_RESULT result = nextTable.EndCommandBuffer(cmdBuffer);
1201 return result;
1202}
1203
1204XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglResetCommandBuffer(XGL_CMD_BUFFER cmdBuffer)
1205{
1206 XGL_RESULT result = nextTable.ResetCommandBuffer(cmdBuffer);
1207 return result;
1208}
1209
1210XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindPipeline(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_PIPELINE pipeline)
1211{
1212 if (getPipeline(pipeline)) {
1213 lastBoundPipeline = pipeline;
1214 }
1215 else {
1216 printf("DS ERROR : Attempt to bind Pipeline %p that doesn't exist!\n", (void*)pipeline);
1217 }
1218 nextTable.CmdBindPipeline(cmdBuffer, pipelineBindPoint, pipeline);
1219}
1220
1221XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindPipelineDelta(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_PIPELINE_DELTA delta)
1222{
1223 nextTable.CmdBindPipelineDelta(cmdBuffer, pipelineBindPoint, delta);
1224}
1225
1226XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindStateObject(XGL_CMD_BUFFER cmdBuffer, XGL_STATE_BIND_POINT stateBindPoint, XGL_STATE_OBJECT state)
1227{
1228 nextTable.CmdBindStateObject(cmdBuffer, stateBindPoint, state);
1229}
1230
1231XGL_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)
1232{
1233 if (getDS(descriptorSet)) {
Tobin Ehlisb8154982014-10-27 14:53:17 -06001234 assert(index < XGL_MAX_DESCRIPTOR_SETS);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001235 lastBoundDS[index] = descriptorSet;
Tobin Ehlisb8154982014-10-27 14:53:17 -06001236 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 -06001237 }
1238 else {
1239 printf("DS ERROR : Attempt to bind DS %p that doesn't exist!\n", (void*)descriptorSet);
1240 }
1241 nextTable.CmdBindDescriptorSet(cmdBuffer, pipelineBindPoint, index, descriptorSet, slotOffset);
1242}
1243
1244XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindDynamicMemoryView(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, const XGL_MEMORY_VIEW_ATTACH_INFO* pMemView)
1245{
1246 nextTable.CmdBindDynamicMemoryView(cmdBuffer, pipelineBindPoint, pMemView);
1247}
1248
Chia-I Wu3b04af52014-11-08 10:48:20 +08001249XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindVertexData(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_UINT binding)
1250{
1251 nextTable.CmdBindVertexData(cmdBuffer, mem, offset, binding);
1252}
1253
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001254XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindIndexData(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_INDEX_TYPE indexType)
1255{
1256 nextTable.CmdBindIndexData(cmdBuffer, mem, offset, indexType);
1257}
1258
1259XGL_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)
1260{
1261 nextTable.CmdBindAttachments(cmdBuffer, colorAttachmentCount, pColorAttachments, pDepthStencilAttachment);
1262}
1263
1264XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdPrepareMemoryRegions(XGL_CMD_BUFFER cmdBuffer, XGL_UINT transitionCount, const XGL_MEMORY_STATE_TRANSITION* pStateTransitions)
1265{
1266 nextTable.CmdPrepareMemoryRegions(cmdBuffer, transitionCount, pStateTransitions);
1267}
1268
1269XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdPrepareImages(XGL_CMD_BUFFER cmdBuffer, XGL_UINT transitionCount, const XGL_IMAGE_STATE_TRANSITION* pStateTransitions)
1270{
1271 nextTable.CmdPrepareImages(cmdBuffer, transitionCount, pStateTransitions);
1272}
1273
1274XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDraw(XGL_CMD_BUFFER cmdBuffer, XGL_UINT firstVertex, XGL_UINT vertexCount, XGL_UINT firstInstance, XGL_UINT instanceCount)
1275{
Tobin Ehlisb8154982014-10-27 14:53:17 -06001276 printf("DS INFO : xglCmdDraw() call #%lu, reporting DS state:\n", drawCount[DRAW]++);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001277 synchAndPrintDSConfig();
1278 nextTable.CmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount);
1279}
1280
1281XGL_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)
1282{
Tobin Ehlisb8154982014-10-27 14:53:17 -06001283 printf("DS INFO : xglCmdDrawIndexed() call #%lu, reporting DS state:\n", drawCount[DRAW_INDEXED]++);
1284 synchAndPrintDSConfig();
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001285 nextTable.CmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount);
1286}
1287
1288XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDrawIndirect(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_UINT32 count, XGL_UINT32 stride)
1289{
Tobin Ehlisb8154982014-10-27 14:53:17 -06001290 printf("DS INFO : xglCmdDrawIndirect() call #%lu, reporting DS state:\n", drawCount[DRAW_INDIRECT]++);
1291 synchAndPrintDSConfig();
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001292 nextTable.CmdDrawIndirect(cmdBuffer, mem, offset, count, stride);
1293}
1294
1295XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDrawIndexedIndirect(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_UINT32 count, XGL_UINT32 stride)
1296{
Tobin Ehlisb8154982014-10-27 14:53:17 -06001297 printf("DS INFO : xglCmdDrawIndexedIndirect() call #%lu, reporting DS state:\n", drawCount[DRAW_INDEXED_INDIRECT]++);
1298 synchAndPrintDSConfig();
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001299 nextTable.CmdDrawIndexedIndirect(cmdBuffer, mem, offset, count, stride);
1300}
1301
1302XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDispatch(XGL_CMD_BUFFER cmdBuffer, XGL_UINT x, XGL_UINT y, XGL_UINT z)
1303{
1304 nextTable.CmdDispatch(cmdBuffer, x, y, z);
1305}
1306
1307XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDispatchIndirect(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset)
1308{
1309 nextTable.CmdDispatchIndirect(cmdBuffer, mem, offset);
1310}
1311
1312XGL_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)
1313{
1314 nextTable.CmdCopyMemory(cmdBuffer, srcMem, destMem, regionCount, pRegions);
1315}
1316
1317XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdCopyImage(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_IMAGE destImage, XGL_UINT regionCount, const XGL_IMAGE_COPY* pRegions)
1318{
1319 nextTable.CmdCopyImage(cmdBuffer, srcImage, destImage, regionCount, pRegions);
1320}
1321
1322XGL_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)
1323{
1324 nextTable.CmdCopyMemoryToImage(cmdBuffer, srcMem, destImage, regionCount, pRegions);
1325}
1326
1327XGL_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)
1328{
1329 nextTable.CmdCopyImageToMemory(cmdBuffer, srcImage, destMem, regionCount, pRegions);
1330}
1331
1332XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdCloneImageData(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_IMAGE_STATE srcImageState, XGL_IMAGE destImage, XGL_IMAGE_STATE destImageState)
1333{
1334 nextTable.CmdCloneImageData(cmdBuffer, srcImage, srcImageState, destImage, destImageState);
1335}
1336
1337XGL_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)
1338{
1339 nextTable.CmdUpdateMemory(cmdBuffer, destMem, destOffset, dataSize, pData);
1340}
1341
1342XGL_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)
1343{
1344 nextTable.CmdFillMemory(cmdBuffer, destMem, destOffset, fillSize, data);
1345}
1346
1347XGL_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)
1348{
1349 nextTable.CmdClearColorImage(cmdBuffer, image, color, rangeCount, pRanges);
1350}
1351
1352XGL_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)
1353{
1354 nextTable.CmdClearColorImageRaw(cmdBuffer, image, color, rangeCount, pRanges);
1355}
1356
1357XGL_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)
1358{
1359 nextTable.CmdClearDepthStencil(cmdBuffer, image, depth, stencil, rangeCount, pRanges);
1360}
1361
1362XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdResolveImage(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_IMAGE destImage, XGL_UINT rectCount, const XGL_IMAGE_RESOLVE* pRects)
1363{
1364 nextTable.CmdResolveImage(cmdBuffer, srcImage, destImage, rectCount, pRects);
1365}
1366
1367XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdSetEvent(XGL_CMD_BUFFER cmdBuffer, XGL_EVENT event)
1368{
1369 nextTable.CmdSetEvent(cmdBuffer, event);
1370}
1371
1372XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdResetEvent(XGL_CMD_BUFFER cmdBuffer, XGL_EVENT event)
1373{
1374 nextTable.CmdResetEvent(cmdBuffer, event);
1375}
1376
1377XGL_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)
1378{
1379 nextTable.CmdMemoryAtomic(cmdBuffer, destMem, destOffset, srcData, atomicOp);
1380}
1381
1382XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBeginQuery(XGL_CMD_BUFFER cmdBuffer, XGL_QUERY_POOL queryPool, XGL_UINT slot, XGL_FLAGS flags)
1383{
1384 nextTable.CmdBeginQuery(cmdBuffer, queryPool, slot, flags);
1385}
1386
1387XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdEndQuery(XGL_CMD_BUFFER cmdBuffer, XGL_QUERY_POOL queryPool, XGL_UINT slot)
1388{
1389 nextTable.CmdEndQuery(cmdBuffer, queryPool, slot);
1390}
1391
1392XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdResetQueryPool(XGL_CMD_BUFFER cmdBuffer, XGL_QUERY_POOL queryPool, XGL_UINT startQuery, XGL_UINT queryCount)
1393{
1394 nextTable.CmdResetQueryPool(cmdBuffer, queryPool, startQuery, queryCount);
1395}
1396
1397XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdWriteTimestamp(XGL_CMD_BUFFER cmdBuffer, XGL_TIMESTAMP_TYPE timestampType, XGL_GPU_MEMORY destMem, XGL_GPU_SIZE destOffset)
1398{
1399 nextTable.CmdWriteTimestamp(cmdBuffer, timestampType, destMem, destOffset);
1400}
1401
1402XGL_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)
1403{
1404 nextTable.CmdInitAtomicCounters(cmdBuffer, pipelineBindPoint, startCounter, counterCount, pData);
1405}
1406
1407XGL_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)
1408{
1409 nextTable.CmdLoadAtomicCounters(cmdBuffer, pipelineBindPoint, startCounter, counterCount, srcMem, srcOffset);
1410}
1411
1412XGL_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)
1413{
1414 nextTable.CmdSaveAtomicCounters(cmdBuffer, pipelineBindPoint, startCounter, counterCount, destMem, destOffset);
1415}
1416
1417XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDbgSetValidationLevel(XGL_DEVICE device, XGL_VALIDATION_LEVEL validationLevel)
1418{
1419 XGL_RESULT result = nextTable.DbgSetValidationLevel(device, validationLevel);
1420 return result;
1421}
1422
1423XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDbgRegisterMsgCallback(XGL_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback, XGL_VOID* pUserData)
1424{
1425 XGL_RESULT result = nextTable.DbgRegisterMsgCallback(pfnMsgCallback, pUserData);
1426 return result;
1427}
1428
1429XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDbgUnregisterMsgCallback(XGL_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback)
1430{
1431 XGL_RESULT result = nextTable.DbgUnregisterMsgCallback(pfnMsgCallback);
1432 return result;
1433}
1434
1435XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDbgSetMessageFilter(XGL_DEVICE device, XGL_INT msgCode, XGL_DBG_MSG_FILTER filter)
1436{
1437 XGL_RESULT result = nextTable.DbgSetMessageFilter(device, msgCode, filter);
1438 return result;
1439}
1440
1441XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDbgSetObjectTag(XGL_BASE_OBJECT object, XGL_SIZE tagSize, const XGL_VOID* pTag)
1442{
1443 XGL_RESULT result = nextTable.DbgSetObjectTag(object, tagSize, pTag);
1444 return result;
1445}
1446
1447XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDbgSetGlobalOption(XGL_DBG_GLOBAL_OPTION dbgOption, XGL_SIZE dataSize, const XGL_VOID* pData)
1448{
1449 XGL_RESULT result = nextTable.DbgSetGlobalOption(dbgOption, dataSize, pData);
1450 return result;
1451}
1452
1453XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglDbgSetDeviceOption(XGL_DEVICE device, XGL_DBG_DEVICE_OPTION dbgOption, XGL_SIZE dataSize, const XGL_VOID* pData)
1454{
1455 XGL_RESULT result = nextTable.DbgSetDeviceOption(device, dbgOption, dataSize, pData);
1456 return result;
1457}
1458
1459XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDbgMarkerBegin(XGL_CMD_BUFFER cmdBuffer, const XGL_CHAR* pMarker)
1460{
1461 nextTable.CmdDbgMarkerBegin(cmdBuffer, pMarker);
1462}
1463
1464XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdDbgMarkerEnd(XGL_CMD_BUFFER cmdBuffer)
1465{
1466 nextTable.CmdDbgMarkerEnd(cmdBuffer);
1467}
1468
1469XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWsiX11AssociateConnection(XGL_PHYSICAL_GPU gpu, const XGL_WSI_X11_CONNECTION_INFO* pConnectionInfo)
1470{
1471 XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu;
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001472 pCurObj = gpuw;
1473 pthread_once(&tabOnce, initLayerTable);
1474 XGL_RESULT result = nextTable.WsiX11AssociateConnection((XGL_PHYSICAL_GPU)gpuw->nextObject, pConnectionInfo);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001475 return result;
1476}
1477
Chia-I Wu6204f342014-11-07 13:33:45 +08001478XGL_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 -06001479{
Chia-I Wu6204f342014-11-07 13:33:45 +08001480 XGL_RESULT result = nextTable.WsiX11GetMSC(device, window, crtc, pMsc);
Tobin Ehlis8726b9f2014-10-24 12:01:45 -06001481 return result;
1482}
1483
1484XGL_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)
1485{
1486 XGL_RESULT result = nextTable.WsiX11CreatePresentableImage(device, pCreateInfo, pImage, pMem);
1487 return result;
1488}
1489
1490XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWsiX11QueuePresent(XGL_QUEUE queue, const XGL_WSI_X11_PRESENT_INFO* pPresentInfo, XGL_FENCE fence)
1491{
1492 XGL_RESULT result = nextTable.WsiX11QueuePresent(queue, pPresentInfo, fence);
1493 return result;
1494}
1495
1496XGL_LAYER_EXPORT XGL_VOID* XGLAPI xglGetProcAddr(XGL_PHYSICAL_GPU gpu, const XGL_CHAR* funcName)
1497{
1498 XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu;
1499 if (gpu == NULL)
1500 return NULL;
1501 pCurObj = gpuw;
1502 pthread_once(&tabOnce, initLayerTable);
1503
1504 if (!strncmp("xglGetProcAddr", (const char *) funcName, sizeof("xglGetProcAddr")))
1505 return xglGetProcAddr;
1506 else if (!strncmp("xglInitAndEnumerateGpus", (const char *) funcName, sizeof("xglInitAndEnumerateGpus")))
1507 return nextTable.InitAndEnumerateGpus;
1508 else if (!strncmp("xglGetGpuInfo", (const char *) funcName, sizeof("xglGetGpuInfo")))
1509 return xglGetGpuInfo;
1510 else if (!strncmp("xglCreateDevice", (const char *) funcName, sizeof("xglCreateDevice")))
1511 return xglCreateDevice;
1512 else if (!strncmp("xglDestroyDevice", (const char *) funcName, sizeof("xglDestroyDevice")))
1513 return xglDestroyDevice;
1514 else if (!strncmp("xglGetExtensionSupport", (const char *) funcName, sizeof("xglGetExtensionSupport")))
1515 return xglGetExtensionSupport;
1516 else if (!strncmp("xglEnumerateLayers", (const char *) funcName, sizeof("xglEnumerateLayers")))
1517 return xglEnumerateLayers;
1518 else if (!strncmp("xglGetDeviceQueue", (const char *) funcName, sizeof("xglGetDeviceQueue")))
1519 return xglGetDeviceQueue;
1520 else if (!strncmp("xglQueueSubmit", (const char *) funcName, sizeof("xglQueueSubmit")))
1521 return xglQueueSubmit;
1522 else if (!strncmp("xglQueueSetGlobalMemReferences", (const char *) funcName, sizeof("xglQueueSetGlobalMemReferences")))
1523 return xglQueueSetGlobalMemReferences;
1524 else if (!strncmp("xglQueueWaitIdle", (const char *) funcName, sizeof("xglQueueWaitIdle")))
1525 return xglQueueWaitIdle;
1526 else if (!strncmp("xglDeviceWaitIdle", (const char *) funcName, sizeof("xglDeviceWaitIdle")))
1527 return xglDeviceWaitIdle;
1528 else if (!strncmp("xglGetMemoryHeapCount", (const char *) funcName, sizeof("xglGetMemoryHeapCount")))
1529 return xglGetMemoryHeapCount;
1530 else if (!strncmp("xglGetMemoryHeapInfo", (const char *) funcName, sizeof("xglGetMemoryHeapInfo")))
1531 return xglGetMemoryHeapInfo;
1532 else if (!strncmp("xglAllocMemory", (const char *) funcName, sizeof("xglAllocMemory")))
1533 return xglAllocMemory;
1534 else if (!strncmp("xglFreeMemory", (const char *) funcName, sizeof("xglFreeMemory")))
1535 return xglFreeMemory;
1536 else if (!strncmp("xglSetMemoryPriority", (const char *) funcName, sizeof("xglSetMemoryPriority")))
1537 return xglSetMemoryPriority;
1538 else if (!strncmp("xglMapMemory", (const char *) funcName, sizeof("xglMapMemory")))
1539 return xglMapMemory;
1540 else if (!strncmp("xglUnmapMemory", (const char *) funcName, sizeof("xglUnmapMemory")))
1541 return xglUnmapMemory;
1542 else if (!strncmp("xglPinSystemMemory", (const char *) funcName, sizeof("xglPinSystemMemory")))
1543 return xglPinSystemMemory;
1544 else if (!strncmp("xglRemapVirtualMemoryPages", (const char *) funcName, sizeof("xglRemapVirtualMemoryPages")))
1545 return xglRemapVirtualMemoryPages;
1546 else if (!strncmp("xglGetMultiGpuCompatibility", (const char *) funcName, sizeof("xglGetMultiGpuCompatibility")))
1547 return xglGetMultiGpuCompatibility;
1548 else if (!strncmp("xglOpenSharedMemory", (const char *) funcName, sizeof("xglOpenSharedMemory")))
1549 return xglOpenSharedMemory;
1550 else if (!strncmp("xglOpenSharedQueueSemaphore", (const char *) funcName, sizeof("xglOpenSharedQueueSemaphore")))
1551 return xglOpenSharedQueueSemaphore;
1552 else if (!strncmp("xglOpenPeerMemory", (const char *) funcName, sizeof("xglOpenPeerMemory")))
1553 return xglOpenPeerMemory;
1554 else if (!strncmp("xglOpenPeerImage", (const char *) funcName, sizeof("xglOpenPeerImage")))
1555 return xglOpenPeerImage;
1556 else if (!strncmp("xglDestroyObject", (const char *) funcName, sizeof("xglDestroyObject")))
1557 return xglDestroyObject;
1558 else if (!strncmp("xglGetObjectInfo", (const char *) funcName, sizeof("xglGetObjectInfo")))
1559 return xglGetObjectInfo;
1560 else if (!strncmp("xglBindObjectMemory", (const char *) funcName, sizeof("xglBindObjectMemory")))
1561 return xglBindObjectMemory;
1562 else if (!strncmp("xglCreateFence", (const char *) funcName, sizeof("xglCreateFence")))
1563 return xglCreateFence;
1564 else if (!strncmp("xglGetFenceStatus", (const char *) funcName, sizeof("xglGetFenceStatus")))
1565 return xglGetFenceStatus;
1566 else if (!strncmp("xglWaitForFences", (const char *) funcName, sizeof("xglWaitForFences")))
1567 return xglWaitForFences;
1568 else if (!strncmp("xglCreateQueueSemaphore", (const char *) funcName, sizeof("xglCreateQueueSemaphore")))
1569 return xglCreateQueueSemaphore;
1570 else if (!strncmp("xglSignalQueueSemaphore", (const char *) funcName, sizeof("xglSignalQueueSemaphore")))
1571 return xglSignalQueueSemaphore;
1572 else if (!strncmp("xglWaitQueueSemaphore", (const char *) funcName, sizeof("xglWaitQueueSemaphore")))
1573 return xglWaitQueueSemaphore;
1574 else if (!strncmp("xglCreateEvent", (const char *) funcName, sizeof("xglCreateEvent")))
1575 return xglCreateEvent;
1576 else if (!strncmp("xglGetEventStatus", (const char *) funcName, sizeof("xglGetEventStatus")))
1577 return xglGetEventStatus;
1578 else if (!strncmp("xglSetEvent", (const char *) funcName, sizeof("xglSetEvent")))
1579 return xglSetEvent;
1580 else if (!strncmp("xglResetEvent", (const char *) funcName, sizeof("xglResetEvent")))
1581 return xglResetEvent;
1582 else if (!strncmp("xglCreateQueryPool", (const char *) funcName, sizeof("xglCreateQueryPool")))
1583 return xglCreateQueryPool;
1584 else if (!strncmp("xglGetQueryPoolResults", (const char *) funcName, sizeof("xglGetQueryPoolResults")))
1585 return xglGetQueryPoolResults;
1586 else if (!strncmp("xglGetFormatInfo", (const char *) funcName, sizeof("xglGetFormatInfo")))
1587 return xglGetFormatInfo;
1588 else if (!strncmp("xglCreateImage", (const char *) funcName, sizeof("xglCreateImage")))
1589 return xglCreateImage;
1590 else if (!strncmp("xglGetImageSubresourceInfo", (const char *) funcName, sizeof("xglGetImageSubresourceInfo")))
1591 return xglGetImageSubresourceInfo;
1592 else if (!strncmp("xglCreateImageView", (const char *) funcName, sizeof("xglCreateImageView")))
1593 return xglCreateImageView;
1594 else if (!strncmp("xglCreateColorAttachmentView", (const char *) funcName, sizeof("xglCreateColorAttachmentView")))
1595 return xglCreateColorAttachmentView;
1596 else if (!strncmp("xglCreateDepthStencilView", (const char *) funcName, sizeof("xglCreateDepthStencilView")))
1597 return xglCreateDepthStencilView;
1598 else if (!strncmp("xglCreateShader", (const char *) funcName, sizeof("xglCreateShader")))
1599 return xglCreateShader;
1600 else if (!strncmp("xglCreateGraphicsPipeline", (const char *) funcName, sizeof("xglCreateGraphicsPipeline")))
1601 return xglCreateGraphicsPipeline;
1602 else if (!strncmp("xglCreateComputePipeline", (const char *) funcName, sizeof("xglCreateComputePipeline")))
1603 return xglCreateComputePipeline;
1604 else if (!strncmp("xglStorePipeline", (const char *) funcName, sizeof("xglStorePipeline")))
1605 return xglStorePipeline;
1606 else if (!strncmp("xglLoadPipeline", (const char *) funcName, sizeof("xglLoadPipeline")))
1607 return xglLoadPipeline;
1608 else if (!strncmp("xglCreatePipelineDelta", (const char *) funcName, sizeof("xglCreatePipelineDelta")))
1609 return xglCreatePipelineDelta;
1610 else if (!strncmp("xglCreateSampler", (const char *) funcName, sizeof("xglCreateSampler")))
1611 return xglCreateSampler;
1612 else if (!strncmp("xglCreateDescriptorSet", (const char *) funcName, sizeof("xglCreateDescriptorSet")))
1613 return xglCreateDescriptorSet;
1614 else if (!strncmp("xglBeginDescriptorSetUpdate", (const char *) funcName, sizeof("xglBeginDescriptorSetUpdate")))
1615 return xglBeginDescriptorSetUpdate;
1616 else if (!strncmp("xglEndDescriptorSetUpdate", (const char *) funcName, sizeof("xglEndDescriptorSetUpdate")))
1617 return xglEndDescriptorSetUpdate;
1618 else if (!strncmp("xglAttachSamplerDescriptors", (const char *) funcName, sizeof("xglAttachSamplerDescriptors")))
1619 return xglAttachSamplerDescriptors;
1620 else if (!strncmp("xglAttachImageViewDescriptors", (const char *) funcName, sizeof("xglAttachImageViewDescriptors")))
1621 return xglAttachImageViewDescriptors;
1622 else if (!strncmp("xglAttachMemoryViewDescriptors", (const char *) funcName, sizeof("xglAttachMemoryViewDescriptors")))
1623 return xglAttachMemoryViewDescriptors;
1624 else if (!strncmp("xglAttachNestedDescriptors", (const char *) funcName, sizeof("xglAttachNestedDescriptors")))
1625 return xglAttachNestedDescriptors;
1626 else if (!strncmp("xglClearDescriptorSetSlots", (const char *) funcName, sizeof("xglClearDescriptorSetSlots")))
1627 return xglClearDescriptorSetSlots;
1628 else if (!strncmp("xglCreateViewportState", (const char *) funcName, sizeof("xglCreateViewportState")))
1629 return xglCreateViewportState;
1630 else if (!strncmp("xglCreateRasterState", (const char *) funcName, sizeof("xglCreateRasterState")))
1631 return xglCreateRasterState;
1632 else if (!strncmp("xglCreateMsaaState", (const char *) funcName, sizeof("xglCreateMsaaState")))
1633 return xglCreateMsaaState;
1634 else if (!strncmp("xglCreateColorBlendState", (const char *) funcName, sizeof("xglCreateColorBlendState")))
1635 return xglCreateColorBlendState;
1636 else if (!strncmp("xglCreateDepthStencilState", (const char *) funcName, sizeof("xglCreateDepthStencilState")))
1637 return xglCreateDepthStencilState;
1638 else if (!strncmp("xglCreateCommandBuffer", (const char *) funcName, sizeof("xglCreateCommandBuffer")))
1639 return xglCreateCommandBuffer;
1640 else if (!strncmp("xglBeginCommandBuffer", (const char *) funcName, sizeof("xglBeginCommandBuffer")))
1641 return xglBeginCommandBuffer;
1642 else if (!strncmp("xglEndCommandBuffer", (const char *) funcName, sizeof("xglEndCommandBuffer")))
1643 return xglEndCommandBuffer;
1644 else if (!strncmp("xglResetCommandBuffer", (const char *) funcName, sizeof("xglResetCommandBuffer")))
1645 return xglResetCommandBuffer;
1646 else if (!strncmp("xglCmdBindPipeline", (const char *) funcName, sizeof("xglCmdBindPipeline")))
1647 return xglCmdBindPipeline;
1648 else if (!strncmp("xglCmdBindPipelineDelta", (const char *) funcName, sizeof("xglCmdBindPipelineDelta")))
1649 return xglCmdBindPipelineDelta;
1650 else if (!strncmp("xglCmdBindStateObject", (const char *) funcName, sizeof("xglCmdBindStateObject")))
1651 return xglCmdBindStateObject;
1652 else if (!strncmp("xglCmdBindDescriptorSet", (const char *) funcName, sizeof("xglCmdBindDescriptorSet")))
1653 return xglCmdBindDescriptorSet;
1654 else if (!strncmp("xglCmdBindDynamicMemoryView", (const char *) funcName, sizeof("xglCmdBindDynamicMemoryView")))
1655 return xglCmdBindDynamicMemoryView;
1656 else if (!strncmp("xglCmdBindIndexData", (const char *) funcName, sizeof("xglCmdBindIndexData")))
1657 return xglCmdBindIndexData;
1658 else if (!strncmp("xglCmdBindAttachments", (const char *) funcName, sizeof("xglCmdBindAttachments")))
1659 return xglCmdBindAttachments;
1660 else if (!strncmp("xglCmdPrepareMemoryRegions", (const char *) funcName, sizeof("xglCmdPrepareMemoryRegions")))
1661 return xglCmdPrepareMemoryRegions;
1662 else if (!strncmp("xglCmdPrepareImages", (const char *) funcName, sizeof("xglCmdPrepareImages")))
1663 return xglCmdPrepareImages;
1664 else if (!strncmp("xglCmdDraw", (const char *) funcName, sizeof("xglCmdDraw")))
1665 return xglCmdDraw;
1666 else if (!strncmp("xglCmdDrawIndexed", (const char *) funcName, sizeof("xglCmdDrawIndexed")))
1667 return xglCmdDrawIndexed;
1668 else if (!strncmp("xglCmdDrawIndirect", (const char *) funcName, sizeof("xglCmdDrawIndirect")))
1669 return xglCmdDrawIndirect;
1670 else if (!strncmp("xglCmdDrawIndexedIndirect", (const char *) funcName, sizeof("xglCmdDrawIndexedIndirect")))
1671 return xglCmdDrawIndexedIndirect;
1672 else if (!strncmp("xglCmdDispatch", (const char *) funcName, sizeof("xglCmdDispatch")))
1673 return xglCmdDispatch;
1674 else if (!strncmp("xglCmdDispatchIndirect", (const char *) funcName, sizeof("xglCmdDispatchIndirect")))
1675 return xglCmdDispatchIndirect;
1676 else if (!strncmp("xglCmdCopyMemory", (const char *) funcName, sizeof("xglCmdCopyMemory")))
1677 return xglCmdCopyMemory;
1678 else if (!strncmp("xglCmdCopyImage", (const char *) funcName, sizeof("xglCmdCopyImage")))
1679 return xglCmdCopyImage;
1680 else if (!strncmp("xglCmdCopyMemoryToImage", (const char *) funcName, sizeof("xglCmdCopyMemoryToImage")))
1681 return xglCmdCopyMemoryToImage;
1682 else if (!strncmp("xglCmdCopyImageToMemory", (const char *) funcName, sizeof("xglCmdCopyImageToMemory")))
1683 return xglCmdCopyImageToMemory;
1684 else if (!strncmp("xglCmdCloneImageData", (const char *) funcName, sizeof("xglCmdCloneImageData")))
1685 return xglCmdCloneImageData;
1686 else if (!strncmp("xglCmdUpdateMemory", (const char *) funcName, sizeof("xglCmdUpdateMemory")))
1687 return xglCmdUpdateMemory;
1688 else if (!strncmp("xglCmdFillMemory", (const char *) funcName, sizeof("xglCmdFillMemory")))
1689 return xglCmdFillMemory;
1690 else if (!strncmp("xglCmdClearColorImage", (const char *) funcName, sizeof("xglCmdClearColorImage")))
1691 return xglCmdClearColorImage;
1692 else if (!strncmp("xglCmdClearColorImageRaw", (const char *) funcName, sizeof("xglCmdClearColorImageRaw")))
1693 return xglCmdClearColorImageRaw;
1694 else if (!strncmp("xglCmdClearDepthStencil", (const char *) funcName, sizeof("xglCmdClearDepthStencil")))
1695 return xglCmdClearDepthStencil;
1696 else if (!strncmp("xglCmdResolveImage", (const char *) funcName, sizeof("xglCmdResolveImage")))
1697 return xglCmdResolveImage;
1698 else if (!strncmp("xglCmdSetEvent", (const char *) funcName, sizeof("xglCmdSetEvent")))
1699 return xglCmdSetEvent;
1700 else if (!strncmp("xglCmdResetEvent", (const char *) funcName, sizeof("xglCmdResetEvent")))
1701 return xglCmdResetEvent;
1702 else if (!strncmp("xglCmdMemoryAtomic", (const char *) funcName, sizeof("xglCmdMemoryAtomic")))
1703 return xglCmdMemoryAtomic;
1704 else if (!strncmp("xglCmdBeginQuery", (const char *) funcName, sizeof("xglCmdBeginQuery")))
1705 return xglCmdBeginQuery;
1706 else if (!strncmp("xglCmdEndQuery", (const char *) funcName, sizeof("xglCmdEndQuery")))
1707 return xglCmdEndQuery;
1708 else if (!strncmp("xglCmdResetQueryPool", (const char *) funcName, sizeof("xglCmdResetQueryPool")))
1709 return xglCmdResetQueryPool;
1710 else if (!strncmp("xglCmdWriteTimestamp", (const char *) funcName, sizeof("xglCmdWriteTimestamp")))
1711 return xglCmdWriteTimestamp;
1712 else if (!strncmp("xglCmdInitAtomicCounters", (const char *) funcName, sizeof("xglCmdInitAtomicCounters")))
1713 return xglCmdInitAtomicCounters;
1714 else if (!strncmp("xglCmdLoadAtomicCounters", (const char *) funcName, sizeof("xglCmdLoadAtomicCounters")))
1715 return xglCmdLoadAtomicCounters;
1716 else if (!strncmp("xglCmdSaveAtomicCounters", (const char *) funcName, sizeof("xglCmdSaveAtomicCounters")))
1717 return xglCmdSaveAtomicCounters;
1718 else if (!strncmp("xglDbgSetValidationLevel", (const char *) funcName, sizeof("xglDbgSetValidationLevel")))
1719 return xglDbgSetValidationLevel;
1720 else if (!strncmp("xglDbgRegisterMsgCallback", (const char *) funcName, sizeof("xglDbgRegisterMsgCallback")))
1721 return xglDbgRegisterMsgCallback;
1722 else if (!strncmp("xglDbgUnregisterMsgCallback", (const char *) funcName, sizeof("xglDbgUnregisterMsgCallback")))
1723 return xglDbgUnregisterMsgCallback;
1724 else if (!strncmp("xglDbgSetMessageFilter", (const char *) funcName, sizeof("xglDbgSetMessageFilter")))
1725 return xglDbgSetMessageFilter;
1726 else if (!strncmp("xglDbgSetObjectTag", (const char *) funcName, sizeof("xglDbgSetObjectTag")))
1727 return xglDbgSetObjectTag;
1728 else if (!strncmp("xglDbgSetGlobalOption", (const char *) funcName, sizeof("xglDbgSetGlobalOption")))
1729 return xglDbgSetGlobalOption;
1730 else if (!strncmp("xglDbgSetDeviceOption", (const char *) funcName, sizeof("xglDbgSetDeviceOption")))
1731 return xglDbgSetDeviceOption;
1732 else if (!strncmp("xglCmdDbgMarkerBegin", (const char *) funcName, sizeof("xglCmdDbgMarkerBegin")))
1733 return xglCmdDbgMarkerBegin;
1734 else if (!strncmp("xglCmdDbgMarkerEnd", (const char *) funcName, sizeof("xglCmdDbgMarkerEnd")))
1735 return xglCmdDbgMarkerEnd;
1736 else if (!strncmp("xglWsiX11AssociateConnection", (const char *) funcName, sizeof("xglWsiX11AssociateConnection")))
1737 return xglWsiX11AssociateConnection;
1738 else if (!strncmp("xglWsiX11GetMSC", (const char *) funcName, sizeof("xglWsiX11GetMSC")))
1739 return xglWsiX11GetMSC;
1740 else if (!strncmp("xglWsiX11CreatePresentableImage", (const char *) funcName, sizeof("xglWsiX11CreatePresentableImage")))
1741 return xglWsiX11CreatePresentableImage;
1742 else if (!strncmp("xglWsiX11QueuePresent", (const char *) funcName, sizeof("xglWsiX11QueuePresent")))
1743 return xglWsiX11QueuePresent;
1744 else {
1745 XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu;
1746 if (gpuw->pGPA == NULL)
1747 return NULL;
1748 return gpuw->pGPA(gpuw->nextObject, funcName);
1749 }
1750}
1751