diff options
| author | Jon Ashburn <jon@lunarg.com> | 2015-04-08 21:33:34 -0600 |
|---|---|---|
| committer | Chia-I Wu <olv@lunarg.com> | 2015-04-16 17:48:19 +0800 |
| commit | a65963a5c7edcfd5e44f8d5102e8379ba86916ec (patch) | |
| tree | 4d931bb5a34a6ec5b6cb77001f7f627d7b2a8227 /layers | |
| parent | 17cef59f95e4ffa518740c575dc18d59a4007fad (diff) | |
| download | usermoji-a65963a5c7edcfd5e44f8d5102e8379ba86916ec.tar.xz | |
layers: Remove wrapping of GPU objects by loader and layers
Loader only wraps GPU objects for creating a layer chain. After layer activation
layers and loader use unwrapped gpu object returned by the driver.
This is a large simplification.
This fixes a nasty bug where layers intercepting entrypoints with gpu objects
but not all these entrypoints would fail. These would cause non-uniform
unwrapping of gpu objects by the time the driver was called with a gpu object.
Fixes issue in loader_get_icd where it was trying to compare a wrapped GPU
against a non-wrapped GPU.
Diffstat (limited to 'layers')
| -rw-r--r-- | layers/basic.cpp | 21 | ||||
| -rw-r--r-- | layers/draw_state.cpp | 20 | ||||
| -rw-r--r-- | layers/mem_tracker.cpp | 13 | ||||
| -rw-r--r-- | layers/multi.cpp | 77 | ||||
| -rw-r--r-- | layers/param_checker.cpp | 30 |
5 files changed, 84 insertions, 77 deletions
diff --git a/layers/basic.cpp b/layers/basic.cpp index 3854577c..524bd40f 100644 --- a/layers/basic.cpp +++ b/layers/basic.cpp @@ -39,11 +39,11 @@ static VkLayerDispatchTable * initLayerTable(const VkBaseLayerObject *gpuw) VkLayerDispatchTable *pTable; assert(gpuw); - std::unordered_map<void *, VkLayerDispatchTable *>::const_iterator it = tableMap.find((void *) gpuw); + std::unordered_map<void *, VkLayerDispatchTable *>::const_iterator it = tableMap.find((void *) gpuw->baseObject); if (it == tableMap.end()) { pTable = new VkLayerDispatchTable; - tableMap[(void *) gpuw] = pTable; + tableMap[(void *) gpuw->baseObject] = pTable; } else { return it->second; @@ -64,7 +64,6 @@ VK_LAYER_EXPORT VkResult VKAPI vkLayerExtension1(VkDevice device) VK_LAYER_EXPORT VkResult VKAPI vkGetExtensionSupport(VkPhysicalGpu gpu, const char* pExtName) { VkResult result; - VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu; /* This entrypoint is NOT going to init it's own dispatch table since loader calls here early */ if (!strncmp(pExtName, "vkLayerExtension1", strlen("vkLayerExtension1"))) @@ -73,11 +72,11 @@ VK_LAYER_EXPORT VkResult VKAPI vkGetExtensionSupport(VkPhysicalGpu gpu, const ch } else if (!strncmp(pExtName, "Basic", strlen("Basic"))) { result = VK_SUCCESS; - } else if (!tableMap.empty() && (tableMap.find(gpuw) != tableMap.end())) + } else if (!tableMap.empty() && (tableMap.find(gpu) != tableMap.end())) { printf("At start of wrapped vkGetExtensionSupport() call w/ gpu: %p\n", (void*)gpu); - VkLayerDispatchTable* pTable = tableMap[gpuw]; - result = pTable->GetExtensionSupport((VkPhysicalGpu)gpuw->nextObject, pExtName); + VkLayerDispatchTable* pTable = tableMap[gpu]; + result = pTable->GetExtensionSupport(gpu, pExtName); printf("Completed wrapped vkGetExtensionSupport() call w/ gpu: %p\n", (void*)gpu); } else { @@ -88,11 +87,10 @@ VK_LAYER_EXPORT VkResult VKAPI vkGetExtensionSupport(VkPhysicalGpu gpu, const ch VK_LAYER_EXPORT VkResult VKAPI vkCreateDevice(VkPhysicalGpu gpu, const VkDeviceCreateInfo* pCreateInfo, VkDevice* pDevice) { - VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu; - VkLayerDispatchTable* pTable = tableMap[gpuw]; + VkLayerDispatchTable* pTable = tableMap[gpu]; printf("At start of wrapped vkCreateDevice() call w/ gpu: %p\n", (void*)gpu); - VkResult result = pTable->CreateDevice((VkPhysicalGpu)gpuw->nextObject, pCreateInfo, pDevice); + VkResult result = pTable->CreateDevice(gpu, pCreateInfo, pDevice); // create a mapping for the device object into the dispatch table tableMap.emplace(*pDevice, pTable); printf("Completed wrapped vkCreateDevice() call w/ pDevice, Device %p: %p\n", (void*)pDevice, (void *) *pDevice); @@ -112,11 +110,10 @@ VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalGpu gpu, size_t maxLa { if (gpu != NULL) { - VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu; - VkLayerDispatchTable* pTable = initLayerTable(gpuw); + VkLayerDispatchTable* pTable = initLayerTable((const VkBaseLayerObject *) gpu); printf("At start of wrapped vkEnumerateLayers() call w/ gpu: %p\n", gpu); - VkResult result = pTable->EnumerateLayers((VkPhysicalGpu)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved); + VkResult result = pTable->EnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved); return result; } else { diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index cb3e6833..1de84b17 100644 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -1443,10 +1443,9 @@ static void initDrawState(void) VK_LAYER_EXPORT VkResult VKAPI vkCreateDevice(VkPhysicalGpu gpu, const VkDeviceCreateInfo* pCreateInfo, VkDevice* pDevice) { - VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu; - pCurObj = gpuw; + pCurObj = (VkBaseLayerObject *) gpu; loader_platform_thread_once(&g_initOnce, initDrawState); - VkResult result = nextTable.CreateDevice((VkPhysicalGpu)gpuw->nextObject, pCreateInfo, pDevice); + VkResult result = nextTable.CreateDevice(gpu, pCreateInfo, pDevice); return result; } @@ -1469,8 +1468,8 @@ VK_LAYER_EXPORT VkResult VKAPI vkDestroyDevice(VkDevice device) VK_LAYER_EXPORT VkResult VKAPI vkGetExtensionSupport(VkPhysicalGpu gpu, const char* pExtName) { - VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu; VkResult result; + /* This entrypoint is NOT going to init its own dispatch table since loader calls here early */ if (!strcmp(pExtName, "DrawState") || !strcmp(pExtName, "drawStateDumpDotFile") || !strcmp(pExtName, "drawStateDumpCommandBufferDotFile") || !strcmp(pExtName, "drawStateDumpPngFile")) @@ -1478,9 +1477,8 @@ VK_LAYER_EXPORT VkResult VKAPI vkGetExtensionSupport(VkPhysicalGpu gpu, const ch result = VK_SUCCESS; } else if (nextTable.GetExtensionSupport != NULL) { - result = nextTable.GetExtensionSupport((VkPhysicalGpu)gpuw->nextObject, pExtName); - } else - { + result = nextTable.GetExtensionSupport(gpu, pExtName); + } else { result = VK_ERROR_INVALID_EXTENSION; } return result; @@ -1490,13 +1488,11 @@ VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalGpu gpu, size_t maxLa { if (gpu != NULL) { - VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu; - pCurObj = gpuw; + pCurObj = (VkBaseLayerObject *) gpu; loader_platform_thread_once(&g_initOnce, initDrawState); - VkResult result = nextTable.EnumerateLayers((VkPhysicalGpu)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved); + VkResult result = nextTable.EnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved); return result; - } else - { + } else { if (pOutLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL) return VK_ERROR_INVALID_POINTER; // This layer compatible with all GPUs diff --git a/layers/mem_tracker.cpp b/layers/mem_tracker.cpp index 1a00669c..1b32f886 100644 --- a/layers/mem_tracker.cpp +++ b/layers/mem_tracker.cpp @@ -823,10 +823,9 @@ static void initMemTracker(void) VK_LAYER_EXPORT VkResult VKAPI vkCreateDevice(VkPhysicalGpu gpu, const VkDeviceCreateInfo* pCreateInfo, VkDevice* pDevice) { - VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu; - pCurObj = gpuw; + pCurObj = (VkBaseLayerObject *) gpu; loader_platform_thread_once(&g_initOnce, initMemTracker); - VkResult result = nextTable.CreateDevice((VkPhysicalGpu)gpuw->nextObject, pCreateInfo, pDevice); + VkResult result = nextTable.CreateDevice(gpu, pCreateInfo, pDevice); // Save off device in case we need it to create Fences globalDevice = *pDevice; return result; @@ -867,7 +866,6 @@ VK_LAYER_EXPORT VkResult VKAPI vkDestroyDevice(VkDevice device) VK_LAYER_EXPORT VkResult VKAPI vkGetExtensionSupport(VkPhysicalGpu gpu, const char* pExtName) { - VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu; VkResult result; /* This entrypoint is NOT going to init its own dispatch table since loader calls here early */ if (!strcmp(pExtName, "MemTracker")) @@ -875,7 +873,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkGetExtensionSupport(VkPhysicalGpu gpu, const ch result = VK_SUCCESS; } else if (nextTable.GetExtensionSupport != NULL) { - result = nextTable.GetExtensionSupport((VkPhysicalGpu)gpuw->nextObject, pExtName); + result = nextTable.GetExtensionSupport(gpu, pExtName); } else { result = VK_ERROR_INVALID_EXTENSION; @@ -888,10 +886,9 @@ VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalGpu gpu, size_t maxLa { if (gpu != NULL) { - VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu; - pCurObj = gpuw; + pCurObj = (VkBaseLayerObject *) gpu; loader_platform_thread_once(&g_initOnce, initMemTracker); - VkResult result = nextTable.EnumerateLayers((VkPhysicalGpu)gpuw->nextObject, maxLayerCount, + VkResult result = nextTable.EnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved); return result; } else diff --git a/layers/multi.cpp b/layers/multi.cpp index 53286c57..910bc5bb 100644 --- a/layers/multi.cpp +++ b/layers/multi.cpp @@ -45,11 +45,11 @@ static VkLayerDispatchTable * getLayer1Table(const VkBaseLayerObject *gpuw) VkLayerDispatchTable *pTable; assert(gpuw); - std::unordered_map<void *, VkLayerDispatchTable *>::const_iterator it = tableMap1.find((void *) gpuw); + std::unordered_map<void *, VkLayerDispatchTable *>::const_iterator it = tableMap1.find((void *) gpuw->baseObject); if (it == tableMap1.end()) { pTable = new VkLayerDispatchTable; - tableMap1[(void *) gpuw] = pTable; + tableMap1[(void *) gpuw->baseObject] = pTable; initLayerTable(gpuw, pTable, 1); return pTable; } else @@ -65,11 +65,9 @@ extern "C" { VK_LAYER_EXPORT VkResult VKAPI multi1CreateDevice(VkPhysicalGpu gpu, const VkDeviceCreateInfo* pCreateInfo, VkDevice* pDevice) { - VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu; - VkLayerDispatchTable* pTable = getLayer1Table(gpuw); - + VkLayerDispatchTable* pTable = tableMap1[gpu]; printf("At start of multi1 layer vkCreateDevice()\n"); - VkResult result = pTable->CreateDevice((VkPhysicalGpu)gpuw->nextObject, pCreateInfo, pDevice); + VkResult result = pTable->CreateDevice(gpu, pCreateInfo, pDevice); // create a mapping for the device object into the dispatch table tableMap1.emplace(*pDevice, pTable); printf("Completed multi1 layer vkCreateDevice()\n"); @@ -106,15 +104,28 @@ VK_LAYER_EXPORT VkResult VKAPI multi1EnumerateLayers(VkPhysicalGpu gpu, size_t m if (gpu == NULL) return vkEnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved); - VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu; - VkLayerDispatchTable* pTable = getLayer1Table(gpuw); - + VkLayerDispatchTable* pTable = tableMap1[gpu]; printf("At start of multi1 layer vkEnumerateLayers()\n"); - VkResult result = pTable->EnumerateLayers((VkPhysicalGpu)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved); + VkResult result = pTable->EnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved); printf("Completed multi1 layer vkEnumerateLayers()\n"); return result; } +VK_LAYER_EXPORT VkResult VKAPI multi1GetExtensionSupport(VkPhysicalGpu gpu, const char* pExtName) +{ + VkResult result; + + if (!tableMap1.empty() && (tableMap1.find(gpu) != tableMap1.end())) + { + VkLayerDispatchTable* pTable = tableMap1[gpu]; + result = pTable->GetExtensionSupport(gpu, pExtName); + } else + { + result = VK_ERROR_INVALID_EXTENSION; + } + return result; +} + VK_LAYER_EXPORT void * VKAPI multi1GetProcAddr(VkPhysicalGpu gpu, const char* pName) { VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu; @@ -133,7 +144,7 @@ VK_LAYER_EXPORT void * VKAPI multi1GetProcAddr(VkPhysicalGpu gpu, const char* pN else if (!strncmp("vkStorePipeline", pName, sizeof ("vkStorePipeline"))) return (void *) multi1StorePipeline; else if (!strncmp("vkGetExtensionSupport", pName, sizeof ("vkGetExtensionSupport"))) - return (void *) vkGetExtensionSupport; + return (void *) multi1GetExtensionSupport; else { if (gpuw->pGPA == NULL) return NULL; @@ -150,11 +161,11 @@ static VkLayerDispatchTable * getLayer2Table(const VkBaseLayerObject *gpuw) VkLayerDispatchTable *pTable; assert(gpuw); - std::unordered_map<void *, VkLayerDispatchTable *>::const_iterator it = tableMap2.find((void *) gpuw); + std::unordered_map<void *, VkLayerDispatchTable *>::const_iterator it = tableMap2.find((void *) gpuw->baseObject); if (it == tableMap2.end()) { pTable = new VkLayerDispatchTable; - tableMap2[(void *) gpuw] = pTable; + tableMap2[(void *) gpuw->baseObject] = pTable; initLayerTable(gpuw, pTable, 2); return pTable; } else @@ -166,11 +177,10 @@ static VkLayerDispatchTable * getLayer2Table(const VkBaseLayerObject *gpuw) VK_LAYER_EXPORT VkResult VKAPI multi2CreateDevice(VkPhysicalGpu gpu, const VkDeviceCreateInfo* pCreateInfo, VkDevice* pDevice) { - VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu; - VkLayerDispatchTable* pTable = getLayer2Table(gpuw); + VkLayerDispatchTable* pTable = tableMap2[gpu]; printf("At start of multi2 vkCreateDevice()\n"); - VkResult result = pTable->CreateDevice((VkPhysicalGpu)gpuw->nextObject, pCreateInfo, pDevice); + VkResult result = pTable->CreateDevice(gpu, pCreateInfo, pDevice); // create a mapping for the device object into the dispatch table for layer2 tableMap2.emplace(*pDevice, pTable); printf("Completed multi2 layer vkCreateDevice()\n"); @@ -208,15 +218,29 @@ VK_LAYER_EXPORT VkResult VKAPI multi2EnumerateLayers(VkPhysicalGpu gpu, size_t m if (gpu == NULL) return vkEnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved); - VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu; - VkLayerDispatchTable* pTable = getLayer2Table(gpuw); + VkLayerDispatchTable* pTable = tableMap2[gpu]; printf("At start of multi2 layer vkEnumerateLayers()\n"); - VkResult result = pTable->EnumerateLayers((VkPhysicalGpu)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved); + VkResult result = pTable->EnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved); printf("Completed multi2 layer vkEnumerateLayers()\n"); return result; } +VK_LAYER_EXPORT VkResult VKAPI multi2GetExtensionSupport(VkPhysicalGpu gpu, const char* pExtName) +{ + VkResult result; + + if (!tableMap2.empty() && (tableMap2.find(gpu) != tableMap2.end())) + { + VkLayerDispatchTable* pTable = tableMap2[gpu]; + result = pTable->GetExtensionSupport(gpu, pExtName); + } else + { + result = VK_ERROR_INVALID_EXTENSION; + } + return result; +} + VK_LAYER_EXPORT void * VKAPI multi2GetProcAddr(VkPhysicalGpu gpu, const char* pName) { VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu; @@ -235,7 +259,7 @@ VK_LAYER_EXPORT void * VKAPI multi2GetProcAddr(VkPhysicalGpu gpu, const char* pN else if (!strncmp("vkBeginCommandBuffer", pName, sizeof ("vkBeginCommandBuffer"))) return (void *) multi2BeginCommandBuffer; else if (!strncmp("vkGetExtensionSupport", pName, sizeof ("vkGetExtensionSupport"))) - return (void *) vkGetExtensionSupport; + return (void *) multi2GetExtensionSupport; else { if (gpuw->pGPA == NULL) return NULL; @@ -262,7 +286,6 @@ VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalGpu gpu, size_t maxLa VK_LAYER_EXPORT VkResult VKAPI vkGetExtensionSupport(VkPhysicalGpu gpu, const char* pExtName) { VkResult result; - VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu; /* This entrypoint is NOT going to init it's own dispatch table since loader calls here early */ if (!strncmp(pExtName, "multi1", strlen("multi1"))) @@ -271,14 +294,14 @@ VK_LAYER_EXPORT VkResult VKAPI vkGetExtensionSupport(VkPhysicalGpu gpu, const ch } else if (!strncmp(pExtName, "multi2", strlen("multi2"))) { result = VK_SUCCESS; - } else if (!tableMap1.empty() && (tableMap1.find(gpuw) != tableMap1.end())) + } else if (!tableMap1.empty() && (tableMap1.find(gpu) != tableMap1.end())) { - VkLayerDispatchTable* pTable = tableMap1[gpuw]; - result = pTable->GetExtensionSupport((VkPhysicalGpu)gpuw->nextObject, pExtName); - } else if (!tableMap2.empty() && (tableMap2.find(gpuw) != tableMap2.end())) + VkLayerDispatchTable* pTable = tableMap1[gpu]; + result = pTable->GetExtensionSupport(gpu, pExtName); + } else if (!tableMap2.empty() && (tableMap2.find(gpu) != tableMap2.end())) { - VkLayerDispatchTable* pTable = tableMap2[gpuw]; - result = pTable->GetExtensionSupport((VkPhysicalGpu)gpuw->nextObject, pExtName); + VkLayerDispatchTable* pTable = tableMap2[gpu]; + result = pTable->GetExtensionSupport(gpu, pExtName); } else { result = VK_ERROR_INVALID_EXTENSION; diff --git a/layers/param_checker.cpp b/layers/param_checker.cpp index 1ce946ae..4c2b4402 100644 --- a/layers/param_checker.cpp +++ b/layers/param_checker.cpp @@ -148,15 +148,14 @@ VK_LAYER_EXPORT VkResult VKAPI vkEnumerateGpus(VkInstance instance, uint32_t max VK_LAYER_EXPORT VkResult VKAPI vkGetGpuInfo(VkPhysicalGpu gpu, VkPhysicalGpuInfoType infoType, size_t* pDataSize, void* pData) { - VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu; - pCurObj = gpuw; + pCurObj = (VkBaseLayerObject *) gpu; loader_platform_thread_once(&tabOnce, initParamChecker); char str[1024]; if (!validate_VkPhysicalGpuInfoType(infoType)) { sprintf(str, "Parameter infoType to function GetGpuInfo has invalid value of %i.", (int)infoType); layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, NULL, 0, 1, "PARAMCHECK", str); } - VkResult result = nextTable.GetGpuInfo((VkPhysicalGpu)gpuw->nextObject, infoType, pDataSize, pData); + VkResult result = nextTable.GetGpuInfo(gpu, infoType, pDataSize, pData); return result; } @@ -243,11 +242,10 @@ void PostCreateDevice(VkResult result, VkDevice* pDevice) VK_LAYER_EXPORT VkResult VKAPI vkCreateDevice(VkPhysicalGpu gpu, const VkDeviceCreateInfo* pCreateInfo, VkDevice* pDevice) { - VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu; - pCurObj = gpuw; + pCurObj = (VkBaseLayerObject *) gpu; loader_platform_thread_once(&tabOnce, initParamChecker); PreCreateDevice(gpu, pCreateInfo); - VkResult result = nextTable.CreateDevice((VkPhysicalGpu)gpuw->nextObject, pCreateInfo, pDevice); + VkResult result = nextTable.CreateDevice(gpu, pCreateInfo, pDevice); PostCreateDevice(result, pDevice); return result; } @@ -261,11 +259,10 @@ VK_LAYER_EXPORT VkResult VKAPI vkDestroyDevice(VkDevice device) VK_LAYER_EXPORT VkResult VKAPI vkGetExtensionSupport(VkPhysicalGpu gpu, const char* pExtName) { - VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu; - pCurObj = gpuw; + pCurObj = (VkBaseLayerObject *) gpu; loader_platform_thread_once(&tabOnce, initParamChecker); - VkResult result = nextTable.GetExtensionSupport((VkPhysicalGpu)gpuw->nextObject, pExtName); + VkResult result = nextTable.GetExtensionSupport(gpu, pExtName); return result; } @@ -273,12 +270,11 @@ VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalGpu gpu, size_t maxLa { char str[1024]; if (gpu != NULL) { - VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu; sprintf(str, "At start of layered EnumerateLayers\n"); layerCbMsg(VK_DBG_MSG_UNKNOWN, VK_VALIDATION_LEVEL_0, nullptr, 0, 0, "PARAMCHECK", str); - pCurObj = gpuw; + pCurObj = (VkBaseLayerObject *) gpu; loader_platform_thread_once(&tabOnce, initParamChecker); - VkResult result = nextTable.EnumerateLayers((VkPhysicalGpu)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved); + VkResult result = nextTable.EnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved); sprintf(str, "Completed layered EnumerateLayers\n"); layerCbMsg(VK_DBG_MSG_UNKNOWN, VK_VALIDATION_LEVEL_0, nullptr, 0, 0, "PARAMCHECK", str); fflush(stdout); @@ -386,11 +382,10 @@ VK_LAYER_EXPORT VkResult VKAPI vkPinSystemMemory(VkDevice device, const void* pS VK_LAYER_EXPORT VkResult VKAPI vkGetMultiGpuCompatibility(VkPhysicalGpu gpu0, VkPhysicalGpu gpu1, VkGpuCompatibilityInfo* pInfo) { - VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu0; - pCurObj = gpuw; + pCurObj = (VkBaseLayerObject *) gpu0; loader_platform_thread_once(&tabOnce, initParamChecker); - VkResult result = nextTable.GetMultiGpuCompatibility((VkPhysicalGpu)gpuw->nextObject, gpu1, pInfo); + VkResult result = nextTable.GetMultiGpuCompatibility(gpu0, gpu1, pInfo); return result; } @@ -1932,11 +1927,10 @@ VK_LAYER_EXPORT void VKAPI vkCmdDbgMarkerEnd(VkCmdBuffer cmdBuffer) VK_LAYER_EXPORT VkResult VKAPI vkWsiX11AssociateConnection(VkPhysicalGpu gpu, const VK_WSI_X11_CONNECTION_INFO* pConnectionInfo) { - VkBaseLayerObject* gpuw = (VkBaseLayerObject *) gpu; - pCurObj = gpuw; + pCurObj = (VkBaseLayerObject *) gpu; loader_platform_thread_once(&tabOnce, initParamChecker); - VkResult result = nextTable.WsiX11AssociateConnection((VkPhysicalGpu)gpuw->nextObject, pConnectionInfo); + VkResult result = nextTable.WsiX11AssociateConnection(gpu, pConnectionInfo); return result; } |
