MCPcopy Create free account
hub / github.com/a2flo/floor / vulkan_debug_callback

Function vulkan_debug_callback

src/device/vulkan/internal/vulkan_debug.cpp:35–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33using namespace std::literals;
34
35VKAPI_ATTR VkBool32 VKAPI_CALL vulkan_debug_callback(VkDebugUtilsMessageSeverityFlagBitsEXT severity,
36 VkDebugUtilsMessageTypeFlagsEXT message_types floor_unused,
37 const VkDebugUtilsMessengerCallbackDataEXT* cb_data,
38 /* vulkan_context* */ void* ctx) {
39 const auto vk_ctx = (const vulkan_context*)ctx;
40 if (vk_ctx->is_vulkan_validation_ignored()) {
41 return VK_FALSE; // don't abort
42 }
43 if (cb_data != nullptr) {
44 if ((cb_data->messageIdNumber == 181611958 || cb_data->messageIdNumber == 555635515) &&
45 vk_ctx->get_vulkan_vr_context() != nullptr) {
46 // ignore UNASSIGNED-BestPractices-vkCreateDevice-deprecated-extension and
47 // VUID-VkDeviceCreateInfo-pNext-02830 when we're using a VR context
48 return VK_FALSE;
49 }
50 if (cb_data->pMessage && cb_data->messageIdNumber == -628989766 &&
51 (strstr(cb_data->pMessage, "VK_KHR_maintenance6") != nullptr ||
52 strstr(cb_data->pMessage, "VK_EXT_robustness2") != nullptr ||
53 strstr(cb_data->pMessage, "VK_EXT_swapchain_maintenance1") != nullptr)) {
54 // ignore warnings about deprecated extensions:
55 // * VK_KHR_maintenance6: still needed in Vulkan 1.4, since we still need to enable it for VK_EXT_descriptor_buffer functionality ...
56 // * VK_EXT_robustness2/VK_EXT_swapchain_maintenance1: we support the KHR variants, but still need to support the EXT variants as well
57 return VK_FALSE;
58 }
59 }
60
61 std::string debug_message;
62 if (cb_data != nullptr) {
63 static const std::unordered_set<int32_t> ignore_msg_ids {
64 -2027362524, // UNASSIGNED-BestPractices-vkCreateCommandPool-command-buffer-reset
65 141128897, // BestPractices-vkCreateCommandPool-command-buffer-reset
66 1218486124, // UNASSIGNED-BestPractices-pipeline-stage-flags
67 561140764, // BestPractices-pipeline-stage-flags2-compute
68 -298369678, // BestPractices-pipeline-stage-flags2-graphics
69 -394667308, // UNASSIGNED-BestPractices-vkBeginCommandBuffer-simultaneous-use
70 1231549373, // BestPractices-vkBeginCommandBuffer-simultaneous-use
71 -1993010233, // UNASSIGNED-Descriptor uninitialized (NOTE/TODO: not updated for descriptor buffer use?)
72 67123586, // UNASSIGNED-BestPractices-vkCreateRenderPass-image-requires-memory
73 1016899250, // BestPractices-vkCreateRenderPass-image-requires-memory
74 1734198062, // BestPractices-specialuse-extension
75 -1443561624, // BestPractices-SyncObjects-HighNumberOfFences
76 -539066078, // BestPractices-SyncObjects-HighNumberOfSemaphores
77 -222910232, // BestPractices-NVIDIA-CreatePipelineLayout-SeparateSampler
78 1469440330, // BestPractices-NVIDIA-CreatePipelineLayout-LargePipelineLayout
79 -2047828895, // BestPractices-AMD-LocalWorkgroup-Multiple64 (seems to ignore actual work-group size?)
80 1829508205, // BestPractices-Pipeline-SortAndBind
81 -267480408, // BestPractices-NVIDIA-CreateImage-Depth32Format
82 -1819900685, // BestPractices-AMD-VkCommandBuffer-AvoidSecondaryCmdBuffers
83 1063606403, // BestPractices-AMD-vkImage-DontUseStorageRenderTargets
84 };
85 // separate list for when heap allocations are disabled
86 static const std::unordered_set<int32_t> ignore_msg_ids_no_heap {
87 -602362517, // UNASSIGNED-BestPractices-vkAllocateMemory-small-allocation
88 -40745094, // BestPractices-vkAllocateMemory-small-allocation
89 -1277938581, // UNASSIGNED-BestPractices-vkBindMemory-small-dedicated-allocation
90 280337739, // BestPractices-vkBindBufferMemory-small-dedicated-allocation
91 1147161417, // BestPractices-vkBindImageMemory-small-dedicated-allocation
92 1484263523, // UNASSIGNED-BestPractices-vkAllocateMemory-too-many-objects

Callers

nothing calls this directly

Calls 10

tokenizeFunction · 0.85
get_vulkan_vr_contextMethod · 0.80
findMethod · 0.80
to_stringFunction · 0.50
trimFunction · 0.50
containsMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected