Vulkan: Prepend layer path to VK_LAYER_PATH
Directly setting this variable overwrites old value, as might be
unexpected. Instead the path can be prepended to it, so that old
value can still work.
This is needed in order to use additional debugging layers, like
the "api_dump" layer. See https://github.com/LunarG/VulkanTools
for more.
BUG=angleproject:2333
Change-Id: I5338a5b928ffa792cc9b6db5b69713320b5b0842
Reviewed-on: https://chromium-review.googlesource.com/898591
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/renderer/vulkan/RendererVk.cpp b/src/libANGLE/renderer/vulkan/RendererVk.cpp
index b505720..74c6bfa 100644
--- a/src/libANGLE/renderer/vulkan/RendererVk.cpp
+++ b/src/libANGLE/renderer/vulkan/RendererVk.cpp
@@ -122,7 +122,7 @@
// Override environment variable to use the ANGLE layers.
if (mEnableValidationLayers)
{
- if (!angle::SetEnvironmentVar(g_VkLoaderLayersPathEnv, ANGLE_VK_LAYERS_DIR))
+ if (!angle::PrependPathToEnvironmentVar(g_VkLoaderLayersPathEnv, ANGLE_VK_LAYERS_DIR))
{
ERR() << "Error setting environment for Vulkan layers init.";
mEnableValidationLayers = false;