layers: DS: populate features correctly
authorChris Forbes <chrisforbes@google.com>
Wed, 2 Mar 2016 04:21:08 +0000 (17:21 +1300)
committerChris Forbes <chrisforbes@google.com>
Wed, 2 Mar 2016 04:24:13 +0000 (17:24 +1300)
- Remove the redundant first fetching of the device features. This was
  always clobbered.
- Treat pEnabledFeatures==NULL as disabling all features, as per
  30.1 of the spec.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
layers/draw_state.cpp

index 5c874f5..29fd377 100644 (file)
@@ -3609,7 +3609,6 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice g
     createDeviceRegisterExtensions(pCreateInfo, *pDevice);
     // Get physical device limits for this device
     my_instance_data->instance_dispatch_table->GetPhysicalDeviceProperties(gpu, &(my_device_data->physDevProperties.properties));
-    my_instance_data->instance_dispatch_table->GetPhysicalDeviceFeatures(gpu, &(my_device_data->physDevProperties.features));
     uint32_t count;
     my_instance_data->instance_dispatch_table->GetPhysicalDeviceQueueFamilyProperties(gpu, &count, nullptr);
     my_device_data->physDevProperties.queue_family_properties.resize(count);
@@ -3619,8 +3618,7 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice g
         my_device_data->physDevProperties.features =
             *pCreateInfo->pEnabledFeatures;
     } else {
-        my_instance_data->instance_dispatch_table->GetPhysicalDeviceFeatures(
-            gpu, &my_device_data->physDevProperties.features);
+        memset(&my_device_data->physDevProperties.features, 0, sizeof(VkPhysicalDeviceFeatures));
     }
     loader_platform_thread_unlock_mutex(&globalLock);
     return result;