layers: Validate Enabled Features in PV
authorMark Lobodzinski <mark@lunarg.com>
Tue, 9 Aug 2016 19:41:09 +0000 (13:41 -0600)
committerMark Lobodzinski <mark@lunarg.com>
Thu, 11 Aug 2016 19:12:08 +0000 (13:12 -0600)
ParameterValidation was using the hardware supported feature set for
validation -- these are now replaced with the application-enabled
features at CreateDevice time.

Change-Id: If52d3ae3e55c69611e02437d33a651d88ba7043d

layers/parameter_validation.cpp

index 87c4cc7..54882a7 100644 (file)
@@ -1651,7 +1651,6 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDevice(VkPhysicalDevice physicalDevice,
             my_device_data->report_data = layer_debug_report_create_device(my_instance_data->report_data, *pDevice);
             initDeviceTable(*pDevice, fpGetDeviceProcAddr, pc_device_table_map);
 
-
             uint32_t count;
             VkLayerInstanceDispatchTable *instance_dispatch_table = get_dispatch_table(pc_instance_table_map, physicalDevice);
             instance_dispatch_table->GetPhysicalDeviceQueueFamilyProperties(physicalDevice, &count, nullptr);
@@ -1666,6 +1665,13 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDevice(VkPhysicalDevice physicalDevice,
             instance_dispatch_table->GetPhysicalDeviceProperties(physicalDevice, &device_properties);
             memcpy(&my_device_data->device_limits, &device_properties.limits, sizeof(VkPhysicalDeviceLimits));
             my_device_data->physical_device = physicalDevice;
+
+            // Save app-enabled features in this device's layer_data structure
+            if (pCreateInfo->pEnabledFeatures) {
+                my_device_data->physical_device_features = *pCreateInfo->pEnabledFeatures;
+            } else {
+                memset(&my_device_data->physical_device_features, 0, sizeof(VkPhysicalDeviceFeatures));
+            }
         }
     }