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