From 92bddc47c9fa95623cc4b882ff7729d56b83c084 Mon Sep 17 00:00:00 2001 From: Li Hao Date: Mon, 3 Sep 2018 11:12:14 +0800 Subject: [PATCH] Vulkan: add macro for vktrace Hide vktrace layout behide a marco 'DAWN_USE_VKTRACE' and enable it in build if need. --- src/dawn_native/vulkan/DeviceVk.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dawn_native/vulkan/DeviceVk.cpp b/src/dawn_native/vulkan/DeviceVk.cpp index 25984cb2f5..7245ec8411 100644 --- a/src/dawn_native/vulkan/DeviceVk.cpp +++ b/src/dawn_native/vulkan/DeviceVk.cpp @@ -421,13 +421,16 @@ namespace dawn_native { namespace vulkan { extensions->push_back(extension); }; - // vktrace works by instering a layer, so we need to explicitly enable it if it is present. + // vktrace works by instering a layer, but we hide it behind a macro unless we are + // debugging in vktrace. // Also it is good to put it in first position so that it doesn't see Vulkan calls inserted // by other layers. +#if defined(DAWN_USE_VKTRACE) if (mGlobalInfo.vktrace) { layersToRequest.push_back(kLayerNameLunargVKTrace); usedKnobs->vktrace = true; } +#endif // RenderDoc installs a layer at the system level for its capture but we don't want to use // it unless we are debugging in RenderDoc so we hide it behind a macro. #if defined(DAWN_USE_RENDERDOC)