diff options
| author | Sai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com> | 2022-07-12 11:09:49 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-12 11:09:49 -0400 |
| commit | a6775666c38ccaeb2a991921a08343afa09c659b (patch) | |
| tree | 9c67b4b3443760dd905efc240a8bcfd55ebd6adb | |
| parent | b513d0deef521318ad943d820dd37029075a33c4 (diff) | |
Fixed incorrectly scoped variable causing crashes on certain linux toolchains (#2319)
| -rw-r--r-- | tools/gfx/vulkan/vk-device.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/gfx/vulkan/vk-device.cpp b/tools/gfx/vulkan/vk-device.cpp index a5e990232..d62734394 100644 --- a/tools/gfx/vulkan/vk-device.cpp +++ b/tools/gfx/vulkan/vk-device.cpp @@ -168,6 +168,8 @@ Result DeviceImpl::initVulkanInstanceAndDevice( instanceCreateInfo.enabledExtensionCount = (uint32_t)instanceExtensions.getCount(); instanceCreateInfo.ppEnabledExtensionNames = &instanceExtensions[0]; + const char* layerNames[] = { nullptr }; + if (useValidationLayer) { // Depending on driver version, validation layer may or may not exist. @@ -183,7 +185,6 @@ Result DeviceImpl::initVulkanInstanceAndDevice( availableLayers.setCount(layerCount); m_api.vkEnumerateInstanceLayerProperties(&layerCount, availableLayers.getBuffer()); - const char* layerNames[] = { nullptr }; for (auto& layer : availableLayers) { if (strncmp( |
