diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2023-01-25 12:30:27 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2023-02-02 14:57:18 +0100 |
commit | 0b20f243f7efbd612d41bab8c2000e6c9fcb13e9 (patch) | |
tree | c429aee931c293fc87f089038c8b28f114c34bcb /src/gui/vulkan/qvulkaninstance.h | |
parent | a14bcdfcc9ce98a50ec4c9c7b253f976dbdfd849 (diff) |
Modernize the VK_EXT_debug_utils callback
...as suggested by review comments.
Switching to std::function implies that we cannot easily
do the install-remove pattern anymore as there is no way to
compare an std::function to something other than null. Instead
of making it more complicated by returning a key or something
like that, change the remove function to a clear (that now clears
both the legacy VK_EXT_debug_report and the new VK_EXT_debug_utils
callback lists).
Also add a missing call that registers the new-style callbacks that
are installed before create().
Pick-to: 6.5
Change-Id: I66c1dd8e8dcc8eee0f5eb9671f94c2c80319dcaf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'src/gui/vulkan/qvulkaninstance.h')
-rw-r--r-- | src/gui/vulkan/qvulkaninstance.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/vulkan/qvulkaninstance.h b/src/gui/vulkan/qvulkaninstance.h index 74ff0f62cd..221f605fa2 100644 --- a/src/gui/vulkan/qvulkaninstance.h +++ b/src/gui/vulkan/qvulkaninstance.h @@ -203,9 +203,9 @@ public: }; Q_DECLARE_FLAGS(DebugMessageTypeFlags, DebugMessageTypeFlag) - typedef bool (*DebugUtilsFilter)(DebugMessageSeverityFlags severity, DebugMessageTypeFlags type, const void *callbackData); + using DebugUtilsFilter = std::function<bool(DebugMessageSeverityFlags severity, DebugMessageTypeFlags type, const void *message)>; void installDebugOutputFilter(DebugUtilsFilter filter); - void removeDebugOutputFilter(DebugUtilsFilter filter); + void clearDebugOutputFilters(); private: friend class QVulkanInstancePrivate; |