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