Skip to content

Commit a2328de

Browse files
committed
fix: only enable validation layer when renderdoc profiling is enabled
1 parent 9868a63 commit a2328de

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/gpu.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@
2727

2828
// There is known issue that vkDestroyDebugUtilsMessengerEXT crash on exit when vulkan validation layer enabled
2929
// upstream fix https://github.com/KhronosGroup/Vulkan-Loader/pull/539
30+
#if NCNN_ENABLE_RENDERDOC_PROFILING
3031
#define ENABLE_VALIDATION_LAYER 1
32+
#else
33+
#define ENABLE_VALIDATION_LAYER 0
34+
#endif
3135

3236
#if NCNN_ENABLE_RENDERDOC_PROFILING
3337

@@ -2415,8 +2419,8 @@ static int init_instance_extension()
24152419

24162420
#if ENABLE_VALIDATION_LAYER
24172421
static VKAPI_ATTR VkBool32 VKAPI_CALL debugCallback(
2418-
VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
2419-
VkDebugUtilsMessageTypeFlagsEXT messageType,
2422+
VkDebugUtilsMessageSeverityFlagBitsEXT /*messageSeverity*/,
2423+
VkDebugUtilsMessageTypeFlagsEXT /*messageType*/,
24202424
const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData,
24212425
void* /*pUserData*/)
24222426
{

0 commit comments

Comments
 (0)