mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 21:10:42 +00:00
Add InitInstanceReplayTables() to fetch Dbg*MsgCallback functions
This commit is contained in:
@@ -257,9 +257,15 @@ void WrappedVulkan::Initialise(VkInitParams ¶ms)
|
||||
|
||||
VkResult ret = GetInstanceDispatchTable(NULL)->CreateInstance(&instinfo, &inst);
|
||||
|
||||
InitInstanceReplayTables(inst);
|
||||
|
||||
GetResourceManager()->WrapResource(inst, inst);
|
||||
GetResourceManager()->AddLiveResource(params.InstanceID, inst);
|
||||
|
||||
// VKTODOHIGH this must be deallocated
|
||||
VkDbgMsgCallback dummy;
|
||||
ObjDisp(inst)->DbgCreateMsgCallback(Unwrap(inst), 0x1e, (PFN_vkDbgMsgCallback)&DebugCallbackStatic, this, &dummy);
|
||||
|
||||
SAFE_DELETE_ARRAY(layerscstr);
|
||||
SAFE_DELETE_ARRAY(extscstr);
|
||||
}
|
||||
|
||||
@@ -65,10 +65,24 @@ void InitReplayTables()
|
||||
|
||||
{
|
||||
VkLayerInstanceDispatchTable &table = replayInstanceTable;
|
||||
HookInit(GetInstanceProcAddr);
|
||||
HookInitVulkanInstance();
|
||||
}
|
||||
}
|
||||
|
||||
void InitInstanceReplayTables(VkInstance instance)
|
||||
{
|
||||
VkLayerInstanceDispatchTable *table = GetInstanceDispatchTable(NULL);
|
||||
RDCASSERT(table);
|
||||
|
||||
#define InstanceGPA(func) table->func = (CONCAT(PFN_vk, func))table->GetInstanceProcAddr(instance, STRINGIZE(CONCAT(vk, func)));
|
||||
|
||||
InstanceGPA(DbgCreateMsgCallback)
|
||||
InstanceGPA(DbgDestroyMsgCallback)
|
||||
|
||||
#undef InstanceGPA
|
||||
}
|
||||
|
||||
void InitDeviceReplayTables(VkDevice device)
|
||||
{
|
||||
VkLayerDispatchTable *table = GetDeviceDispatchTable(NULL);
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <vk_layer.h>
|
||||
|
||||
void InitReplayTables();
|
||||
void InitInstanceReplayTables(VkInstance instance);
|
||||
void InitDeviceReplayTables(VkDevice device);
|
||||
|
||||
VkLayerDispatchTable *GetDeviceDispatchTable(void *device);
|
||||
|
||||
Reference in New Issue
Block a user