From 55949fea34b4392c988b902e4835939d9a8d5574 Mon Sep 17 00:00:00 2001 From: "yuan.tian" Date: Thu, 17 Dec 2020 14:19:31 +0800 Subject: [PATCH] Fix bug in computeheadless and renderheadless. The bug passed invalid pointer value to vkCreateInstance. Upstream-Status: Submitted [https://github.com/SaschaWillems/Vulkan/issues/792] Signed-off-by: yuan.tian --- examples/computeheadless/computeheadless.cpp | 4 ++-- examples/renderheadless/renderheadless.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/computeheadless/computeheadless.cpp b/examples/computeheadless/computeheadless.cpp index 49566394..002f74a4 100644 --- a/examples/computeheadless/computeheadless.cpp +++ b/examples/computeheadless/computeheadless.cpp @@ -154,6 +154,7 @@ public: vkEnumerateInstanceLayerProperties(&instanceLayerCount, nullptr); std::vector instanceLayers(instanceLayerCount); vkEnumerateInstanceLayerProperties(&instanceLayerCount, instanceLayers.data()); + const char *validationExt = VK_EXT_DEBUG_REPORT_EXTENSION_NAME; bool layersAvailable = true; for (auto layerName : validationLayers) { @@ -172,7 +173,6 @@ public: if (layersAvailable) { instanceCreateInfo.ppEnabledLayerNames = validationLayers; - const char *validationExt = VK_EXT_DEBUG_REPORT_EXTENSION_NAME; instanceCreateInfo.enabledLayerCount = layerCount; instanceCreateInfo.enabledExtensionCount = 1; instanceCreateInfo.ppEnabledExtensionNames = &validationExt; @@ -562,4 +562,4 @@ int main() { delete(vulkanExample); return 0; } -#endif \ No newline at end of file +#endif diff --git a/examples/renderheadless/renderheadless.cpp b/examples/renderheadless/renderheadless.cpp index a0126cf3..295346c0 100644 --- a/examples/renderheadless/renderheadless.cpp +++ b/examples/renderheadless/renderheadless.cpp @@ -184,6 +184,7 @@ public: vkEnumerateInstanceLayerProperties(&instanceLayerCount, nullptr); std::vector instanceLayers(instanceLayerCount); vkEnumerateInstanceLayerProperties(&instanceLayerCount, instanceLayers.data()); + const char *validationExt = VK_EXT_DEBUG_REPORT_EXTENSION_NAME; bool layersAvailable = true; for (auto layerName : validationLayers) { @@ -202,7 +203,6 @@ public: if (layersAvailable) { instanceCreateInfo.ppEnabledLayerNames = validationLayers; - const char *validationExt = VK_EXT_DEBUG_REPORT_EXTENSION_NAME; instanceCreateInfo.enabledLayerCount = layerCount; instanceCreateInfo.enabledExtensionCount = 1; instanceCreateInfo.ppEnabledExtensionNames = &validationExt; @@ -894,4 +894,4 @@ int main() { delete(vulkanExample); return 0; } -#endif \ No newline at end of file +#endif -- 2.17.1