From 735109c24892a95290974c9665527b57b01e5440 Mon Sep 17 00:00:00 2001 From: egdaniel Date: Wed, 27 Jul 2016 08:03:57 -0700 Subject: Add gyp define to enable vulkan debug layers On Debug vulkan bots, running with the debug layers on seems to be adding more than an hour to the total running time. Since we suppress any output on the bots anyways the debug layers are serving no purpose. Thus I am adding a gyp define to disable the layers on the bot. With this change, by default when running vulkan in Debug, the debug_layers will be enabled. The bots should disable the layers. Android framework should also have them disabled by default. TBR=djsollen@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2185953003 Review-Url: https://codereview.chromium.org/2185953003 --- src/gpu/vk/GrVkBackendContext.cpp | 6 +++--- src/gpu/vk/GrVkGpu.cpp | 6 +++--- src/gpu/vk/GrVkGpu.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/gpu') diff --git a/src/gpu/vk/GrVkBackendContext.cpp b/src/gpu/vk/GrVkBackendContext.cpp index e859b19ae5..a2165b4107 100644 --- a/src/gpu/vk/GrVkBackendContext.cpp +++ b/src/gpu/vk/GrVkBackendContext.cpp @@ -13,7 +13,7 @@ //////////////////////////////////////////////////////////////////////////////// // Helper code to set up Vulkan context objects -#ifdef ENABLE_VK_LAYERS +#ifdef SK_ENABLE_VK_LAYERS const char* kDebugLayerNames[] = { // elements of VK_LAYER_LUNARG_standard_validation "VK_LAYER_GOOGLE_threading", @@ -62,7 +62,7 @@ const GrVkBackendContext* GrVkBackendContext::Create(uint32_t* presentQueueIndex SkTArray instanceLayerNames; SkTArray instanceExtensionNames; uint32_t extensionFlags = 0; -#ifdef ENABLE_VK_LAYERS +#ifdef SK_ENABLE_VK_LAYERS for (size_t i = 0; i < SK_ARRAY_COUNT(kDebugLayerNames); ++i) { if (extensions.hasInstanceLayer(kDebugLayerNames[i])) { instanceLayerNames.push_back(kDebugLayerNames[i]); @@ -172,7 +172,7 @@ const GrVkBackendContext* GrVkBackendContext::Create(uint32_t* presentQueueIndex SkTArray deviceLayerNames; SkTArray deviceExtensionNames; -#ifdef ENABLE_VK_LAYERS +#ifdef SK_ENABLE_VK_LAYERS for (size_t i = 0; i < SK_ARRAY_COUNT(kDebugLayerNames); ++i) { if (extensions.hasDeviceLayer(kDebugLayerNames[i])) { deviceLayerNames.push_back(kDebugLayerNames[i]); diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp index 7fddd4bb8c..724a50de54 100644 --- a/src/gpu/vk/GrVkGpu.cpp +++ b/src/gpu/vk/GrVkGpu.cpp @@ -44,7 +44,7 @@ #define VK_CALL_RET(RET, X) GR_VK_CALL_RET(this->vkInterface(), RET, X) #define VK_CALL_ERRCHECK(X) GR_VK_CALL_ERRCHECK(this->vkInterface(), X) -#ifdef ENABLE_VK_LAYERS +#ifdef SK_ENABLE_VK_LAYERS VKAPI_ATTR VkBool32 VKAPI_CALL DebugReportCallback( VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, @@ -93,7 +93,7 @@ GrVkGpu::GrVkGpu(GrContext* context, const GrContextOptions& options, , fResourceProvider(this) { fBackendContext.reset(backendCtx); -#ifdef ENABLE_VK_LAYERS +#ifdef SK_ENABLE_VK_LAYERS fCallback = VK_NULL_HANDLE; if (backendCtx->fExtensions & kEXT_debug_report_GrVkExtensionFlag) { // Setup callback creation information @@ -191,7 +191,7 @@ GrVkGpu::~GrVkGpu() { shaderc_compiler_release(fCompiler); #endif -#ifdef ENABLE_VK_LAYERS +#ifdef SK_ENABLE_VK_LAYERS if (fCallback) { VK_CALL(DestroyDebugReportCallbackEXT(fBackendContext->fInstance, fCallback, nullptr)); fCallback = VK_NULL_HANDLE; diff --git a/src/gpu/vk/GrVkGpu.h b/src/gpu/vk/GrVkGpu.h index 37d4e4f1e8..a0bed3bcbe 100644 --- a/src/gpu/vk/GrVkGpu.h +++ b/src/gpu/vk/GrVkGpu.h @@ -250,7 +250,7 @@ private: SkAutoTDelete fHeaps[kHeapCount]; -#ifdef ENABLE_VK_LAYERS +#ifdef SK_ENABLE_VK_LAYERS // For reporting validation layer errors VkDebugReportCallbackEXT fCallback; #endif -- cgit v1.2.3