Vulkan: add macro for vktrace

Hide vktrace layout behide a marco 'DAWN_USE_VKTRACE' and enable it in
build if need.
This commit is contained in:
Li Hao 2018-09-03 11:12:14 +08:00 committed by Corentin Wallez
parent 9daa4ad1c8
commit 92bddc47c9

View File

@ -421,13 +421,16 @@ namespace dawn_native { namespace vulkan {
extensions->push_back(extension); 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 // Also it is good to put it in first position so that it doesn't see Vulkan calls inserted
// by other layers. // by other layers.
#if defined(DAWN_USE_VKTRACE)
if (mGlobalInfo.vktrace) { if (mGlobalInfo.vktrace) {
layersToRequest.push_back(kLayerNameLunargVKTrace); layersToRequest.push_back(kLayerNameLunargVKTrace);
usedKnobs->vktrace = true; usedKnobs->vktrace = true;
} }
#endif
// RenderDoc installs a layer at the system level for its capture but we don't want to use // 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. // it unless we are debugging in RenderDoc so we hide it behind a macro.
#if defined(DAWN_USE_RENDERDOC) #if defined(DAWN_USE_RENDERDOC)