diff options
author | Jaebaek Seo <duke.acacia@gmail.com> | 2019-02-07 09:15:53 -0500 |
---|---|---|
committer | dan sinclair <dj2@everburning.com> | 2019-02-07 09:15:53 -0500 |
commit | 05a490ce54781f7943d1f80462c923fc406724c8 (patch) | |
tree | 0b0a80f53f9542151fff7b502fd0af9ec3fad79d /samples | |
parent | 2bd5adfff09df425f9e54e8d8265d4c5f3c59c94 (diff) | |
download | amber-05a490ce54781f7943d1f80462c923fc406724c8.tar.gz |
Fix compiler error for release build with GCC 7.3 (#258)
Calling important functions within assert() causes build / runtime
errors. We must use assert() only when reporting the error and it
must not contain critical logic.
Fixes #257
Diffstat (limited to 'samples')
-rw-r--r-- | samples/config_helper_vulkan.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/samples/config_helper_vulkan.cc b/samples/config_helper_vulkan.cc index 62b7b0d..2ce9e13 100644 --- a/samples/config_helper_vulkan.cc +++ b/samples/config_helper_vulkan.cc @@ -522,7 +522,7 @@ bool AreAllExtensionsSupported( // Check if |physical_device| supports both compute and graphics // pipelines. uint32_t ChooseQueueFamilyIndex(const VkPhysicalDevice& physical_device) { - uint32_t count; + uint32_t count = 0; std::vector<VkQueueFamilyProperties> properties; vkGetPhysicalDeviceQueueFamilyProperties(physical_device, &count, nullptr); @@ -598,7 +598,7 @@ amber::Result ConfigHelperVulkan::CreateDebugReportCallback() { amber::Result ConfigHelperVulkan::ChooseVulkanPhysicalDevice( const VkPhysicalDeviceFeatures& required_features, const std::vector<std::string>& required_extensions) { - uint32_t count; + uint32_t count = 0; std::vector<VkPhysicalDevice> physical_devices; if (vkEnumeratePhysicalDevices(vulkan_instance_, &count, nullptr) != |