layers: Work around bugs in old STL versions.
authorJamie Madill <jmadill@chromium.org>
Fri, 15 Dec 2017 22:14:04 +0000 (17:14 -0500)
committerTobin Ehlis <tobine@google.com>
Tue, 19 Dec 2017 16:34:16 +0000 (09:34 -0700)
Some old versions of the C++ STL have a few bugs with advanced features.
This works around two such issues:

- std::unordered_map::const_reference having the wrong type
- an error with an explicit std::vector constructor

layers/core_validation.cpp
layers/parameter_validation_utils.cpp

index abe3b279ab33182370319fd5e00a2ab4066fd562..4a31fac3b7b3768de4d46d2e2dfdc88b1b385101 100644 (file)
@@ -9418,7 +9418,7 @@ static bool PreCallValidateCreateSwapchainKHR(layer_data *dev_data, const char *
     // to present to any native window on Android; require the
     // application to have established support on any other platform.
     if (!dev_data->instance_data->extensions.vk_khr_android_surface) {
-        auto support_predicate = [dev_data](decltype(surface_state->gpu_queue_support)::const_reference qs) -> bool {
+        auto support_predicate = [dev_data](decltype(surface_state->gpu_queue_support)::value_type qs) -> bool {
             // TODO: should restrict search only to queue families of VkDeviceQueueCreateInfos, not whole phys. device
             return (qs.first.gpu == dev_data->physical_device) && qs.second;
         };
index 6af0f252f9cac7ff2955245a0a457962446b179b..7b848aeda6a879992b9f6cd0b9290804b2e975e6 100644 (file)
@@ -442,7 +442,8 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, c
 
         lock.lock();
 
-        validate_result(my_instance_data->report_data, "vkCreateDevice", {}, result);
+        std::vector<VkResult> empty_vec;
+        validate_result(my_instance_data->report_data, "vkCreateDevice", empty_vec, result);
 
         if (result == VK_SUCCESS) {
             layer_data *my_device_data = GetLayerDataPtr(get_dispatch_key(*pDevice), layer_data_map);