diff options
| author | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-06-01 14:46:33 -0600 |
|---|---|---|
| committer | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-06-18 10:18:19 -0600 |
| commit | 9284c285380687ff09da3afec2c343c426a076ef (patch) | |
| tree | 763cab5eae0c037f718475dd66f01ff3ef3c5467 /layers/shader_checker.cpp | |
| parent | 56dc45b851d14f17dce9f9a3894ceac064908fb7 (diff) | |
| download | usermoji-9284c285380687ff09da3afec2c343c426a076ef.tar.xz | |
shader_checker: Use DEBUG_REPORT helper functions
Include and use DEBUG_REPORT layer helper functions
for create, destroy and GetInstanceProcAddr.
Diffstat (limited to 'layers/shader_checker.cpp')
| -rw-r--r-- | layers/shader_checker.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/layers/shader_checker.cpp b/layers/shader_checker.cpp index 5b66c631..20f1aae4 100644 --- a/layers/shader_checker.cpp +++ b/layers/shader_checker.cpp @@ -939,6 +939,26 @@ VK_LAYER_EXPORT VkResult VKAPI vkDestroyDevice(VkDevice device) return res; } +VkResult VKAPI vkCreateInstance( + const VkInstanceCreateInfo* pCreateInfo, + VkInstance* pInstance) +{ + + loader_platform_thread_once(&g_initOnce, initLayer); + /* + * For layers, the pInstance has already been filled out + * by the loader so that dispatch table is available. + */ + VkLayerInstanceDispatchTable *pTable = initLayerInstanceTable((const VkBaseLayerObject *) (*pInstance)); + + VkResult result = pTable->CreateInstance(pCreateInfo, pInstance); + + if (result == VK_SUCCESS) { + enable_debug_report(pCreateInfo->extensionCount, pCreateInfo->pEnabledExtensions); + } + return result; +} + /* hook DestroyInstance to remove tableInstanceMap entry */ VK_LAYER_EXPORT VkResult VKAPI vkDestroyInstance(VkInstance instance) { @@ -948,6 +968,25 @@ VK_LAYER_EXPORT VkResult VKAPI vkDestroyInstance(VkInstance instance) return res; } +VK_LAYER_EXPORT VkResult VKAPI vkDbgCreateMsgCallback( + VkInstance instance, + VkFlags msgFlags, + const PFN_vkDbgMsgCallback pfnMsgCallback, + void* pUserData, + VkDbgMsgCallback* pMsgCallback) +{ + VkLayerInstanceDispatchTable *pTable = tableInstanceMap[(VkBaseLayerObject *)instance]; + return layer_create_msg_callback(instance, pTable, msgFlags, pfnMsgCallback, pUserData, pMsgCallback); +} + +VK_LAYER_EXPORT VkResult VKAPI vkDbgDestroyMsgCallback( + VkInstance instance, + VkDbgMsgCallback msgCallback) +{ + VkLayerInstanceDispatchTable *pTable = tableInstanceMap[(VkBaseLayerObject *)instance]; + return layer_destroy_msg_callback(instance, pTable, msgCallback); +} + VK_LAYER_EXPORT void * VKAPI vkGetDeviceProcAddr(VkDevice device, const char* pName) { if (device == NULL) @@ -978,6 +1017,8 @@ VK_LAYER_EXPORT void * VKAPI vkGetDeviceProcAddr(VkDevice device, const char* pN VK_LAYER_EXPORT void * VKAPI vkGetInstanceProcAddr(VkInstance inst, const char* pName) { + void *fptr; + if (inst == NULL) return NULL; @@ -991,10 +1032,15 @@ VK_LAYER_EXPORT void * VKAPI vkGetInstanceProcAddr(VkInstance inst, const char* if (!strncmp(#fn, pName, sizeof(#fn))) \ return (void *) fn + ADD_HOOK(vkCreateInstance); ADD_HOOK(vkDestroyInstance); ADD_HOOK(vkGetGlobalExtensionInfo); #undef ADD_HOOK + fptr = msg_callback_get_proc_addr(pName); + if (fptr) + return fptr; + VkLayerInstanceDispatchTable* pTable = tableInstanceMap[(VkBaseLayerObject *) inst]; if (pTable->GetInstanceProcAddr == NULL) return NULL; |
