layers:Store GPDF2 struct
authorTobin Ehlis <tobine@google.com>
Fri, 11 May 2018 13:39:16 +0000 (07:39 -0600)
committerMark Lobodzinski <mark@lunarg.com>
Sat, 12 May 2018 00:47:55 +0000 (18:47 -0600)
In PHYSICAL_DEVICE_STATE track safe_VkPhysicalDeviceFeatures2 instead
of the old VkPhysicalDeviceFeatures. Initially just passing the
VkPhysicalDeviceFeatures of VkPhysicalDeviceFeatures2 wherever this was
used. This is laying groundwork to start using/comparing extended
features in core validation.

layers/core_validation.cpp
layers/core_validation.h

index bb463c4..5de8fe9 100644 (file)
@@ -2175,7 +2175,7 @@ static bool ValidateRequestedFeatures(instance_layer_data *instance_data, const
                                       const VkPhysicalDeviceFeatures *requested_features) {
     bool skip = false;
 
-    const VkBool32 *actual = reinterpret_cast<const VkBool32 *>(&pd_state->features);
+    const VkBool32 *actual = reinterpret_cast<const VkBool32 *>(&pd_state->features2.features.robustBufferAccess);
     const VkBool32 *requested = reinterpret_cast<const VkBool32 *>(requested_features);
     // TODO : This is a nice, compact way to loop through struct, but a bad way to report issues
     //  Need to provide the struct member name with the issue. To do that seems like we'll
@@ -11283,7 +11283,7 @@ VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDevices(VkInstance instance, uin
             auto &phys_device_state = instance_data->physical_device_map[pPhysicalDevices[i]];
             phys_device_state.phys_device = pPhysicalDevices[i];
             // Init actual features for each physical device
-            instance_data->dispatch_table.GetPhysicalDeviceFeatures(pPhysicalDevices[i], &phys_device_state.features);
+            instance_data->dispatch_table.GetPhysicalDeviceFeatures(pPhysicalDevices[i], &phys_device_state.features2.features);
         }
     }
     return result;
@@ -12121,7 +12121,7 @@ static void PostCallRecordEnumeratePhysicalDeviceGroups(instance_layer_data *ins
                 auto &phys_device_state = instance_data->physical_device_map[cur_phys_dev];
                 phys_device_state.phys_device = cur_phys_dev;
                 // Init actual features for each physical device
-                instance_data->dispatch_table.GetPhysicalDeviceFeatures(cur_phys_dev, &phys_device_state.features);
+                instance_data->dispatch_table.GetPhysicalDeviceFeatures(cur_phys_dev, &phys_device_state.features2.features);
             }
         }
     }
index 79330d5..fbd055c 100644 (file)
@@ -128,7 +128,7 @@ struct PHYSICAL_DEVICE_STATE {
     CALL_STATE vkGetPhysicalDeviceSurfacePresentModesKHRState = UNCALLED;
     CALL_STATE vkGetPhysicalDeviceSurfaceFormatsKHRState = UNCALLED;
     CALL_STATE vkGetPhysicalDeviceDisplayPlanePropertiesKHRState = UNCALLED;
-    VkPhysicalDeviceFeatures features = {};
+    safe_VkPhysicalDeviceFeatures2 features2 = {};
     VkPhysicalDevice phys_device = VK_NULL_HANDLE;
     uint32_t queue_family_count = 0;
     std::vector<VkQueueFamilyProperties> queue_family_properties;