aboutsummaryrefslogtreecommitdiff
path: root/layers
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <courtney@LunarG.com>2015-06-08 14:58:39 -0600
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-06-18 10:18:20 -0600
commit330730656fa94b09baf008d1ca712534f3512fc1 (patch)
tree49e60cfcbd4664d5d2b3275630ad479ca98be372 /layers
parent1f7e1b54bfb089677646ce22c9a9ec0b15450a04 (diff)
downloadusermoji-330730656fa94b09baf008d1ca712534f3512fc1.tar.xz
layers: Initialize debug_report instance proc table
Diffstat (limited to 'layers')
-rw-r--r--layers/draw_state.cpp5
-rw-r--r--layers/layers_msg.h9
-rw-r--r--layers/mem_tracker.cpp8
-rw-r--r--layers/param_checker.cpp6
-rw-r--r--layers/shader_checker.cpp5
5 files changed, 32 insertions, 1 deletions
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp
index 4b76f05e..33712714 100644
--- a/layers/draw_state.cpp
+++ b/layers/draw_state.cpp
@@ -1536,6 +1536,11 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateInstance(const VkInstanceCreateInfo* pCre
if (result == VK_SUCCESS) {
enable_debug_report(pCreateInfo->extensionCount, pCreateInfo->pEnabledExtensions);
+
+ debug_report_init_instance_extension_dispatch_table(
+ pTable,
+ pTable->GetInstanceProcAddr,
+ *pInstance);
}
return result;
}
diff --git a/layers/layers_msg.h b/layers/layers_msg.h
index a5e90de3..f73e4d3d 100644
--- a/layers/layers_msg.h
+++ b/layers/layers_msg.h
@@ -96,6 +96,15 @@ static VkResult layer_destroy_msg_callback(
return result;
}
+static inline void debug_report_init_instance_extension_dispatch_table(
+ VkLayerInstanceDispatchTable *table,
+ PFN_vkGetInstanceProcAddr gpa,
+ VkInstance inst)
+{
+ table->DbgCreateMsgCallback = (PFN_vkDbgCreateMsgCallback) gpa(inst, "vkDbgCreateMsgCallback");
+ table->DbgDestroyMsgCallback = (PFN_vkDbgDestroyMsgCallback) gpa(inst, "vkDbgDestroyMsgCallback");
+}
+
static void* msg_callback_get_proc_addr(
const char *funcName)
{
diff --git a/layers/mem_tracker.cpp b/layers/mem_tracker.cpp
index b6a839d3..9e51e889 100644
--- a/layers/mem_tracker.cpp
+++ b/layers/mem_tracker.cpp
@@ -869,10 +869,16 @@ VkResult VKAPI vkCreateInstance(
{
loader_platform_thread_once(&g_initOnce, initMemTracker);
- VkResult result = instance_dispatch_table(*pInstance)->CreateInstance(pCreateInfo, pInstance);
+ VkLayerInstanceDispatchTable *pTable = instance_dispatch_table(*pInstance);
+ VkResult result = pTable->CreateInstance(pCreateInfo, pInstance);
if (result == VK_SUCCESS) {
enable_debug_report(pCreateInfo->extensionCount, pCreateInfo->pEnabledExtensions);
+
+ debug_report_init_instance_extension_dispatch_table(
+ pTable,
+ pTable->GetInstanceProcAddr,
+ *pInstance);
}
return result;
}
diff --git a/layers/param_checker.cpp b/layers/param_checker.cpp
index 79903f3f..15056f5a 100644
--- a/layers/param_checker.cpp
+++ b/layers/param_checker.cpp
@@ -189,6 +189,12 @@ void PostCreateInstance(VkResult result, const VkInstanceCreateInfo *pCreateInfo
layerCbMsg(VK_DBG_REPORT_INFO_BIT, (VkObjectType) 0, NULL, 0, 1, "PARAMCHECK", str);
return;
}
+
+ VkLayerInstanceDispatchTable *pTable = instance_dispatch_table(*pInstance);
+ debug_report_init_instance_extension_dispatch_table(
+ pTable,
+ pTable->GetInstanceProcAddr,
+ *pInstance);
}
VK_LAYER_EXPORT VkResult VKAPI vkCreateInstance(const VkInstanceCreateInfo* pCreateInfo, VkInstance* pInstance)
diff --git a/layers/shader_checker.cpp b/layers/shader_checker.cpp
index 20f1aae4..d31d7f65 100644
--- a/layers/shader_checker.cpp
+++ b/layers/shader_checker.cpp
@@ -955,6 +955,11 @@ VkResult VKAPI vkCreateInstance(
if (result == VK_SUCCESS) {
enable_debug_report(pCreateInfo->extensionCount, pCreateInfo->pEnabledExtensions);
+
+ debug_report_init_instance_extension_dispatch_table(
+ pTable,
+ pTable->GetInstanceProcAddr,
+ *pInstance);
}
return result;
}