vulkan: add DebugReportLogger
Add DebugReportLogger that can be used during vkCreateInstance and other
commands. Add vulkan::driver::Logger to create a temporary
DebugReportLogger from a dispatchable object. With them, we can log to
debug report by, for example,
Logger(instance).Warn(obj, "failed with %s", err);
Bug: 28120066
Change-Id: If059d38d3cfcfe591031ca135695d08cad42e0a4
diff --git a/vulkan/libvulkan/driver.h b/vulkan/libvulkan/driver.h
index 9a3c141..210c3c7 100644
--- a/vulkan/libvulkan/driver.h
+++ b/vulkan/libvulkan/driver.h
@@ -219,6 +219,11 @@
return *reinterpret_cast<DeviceData*>(GetDataInternal(dispatchable));
}
+template <typename DispatchableType>
+const DebugReportLogger Logger(DispatchableType dispatchable) {
+ return DebugReportLogger(GetData(dispatchable).debug_report_callbacks);
+}
+
} // namespace driver
} // namespace vulkan