Change-Id: Ife211b1b2dc97c5bab0d6e7b177ead6b1a6105d3
my_data->instance_dispatch_table->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices);
if (NULL == pPhysicalDevices) {
my_data->instance_state->physical_devices_count = *pPhysicalDeviceCount;
- } else { // Save physical devices
+ } else if (result == VK_SUCCESS){ // Save physical devices
for (uint32_t i = 0; i < *pPhysicalDeviceCount; i++) {
layer_data *phy_dev_data = get_my_data_ptr(get_dispatch_key(pPhysicalDevices[i]), layer_data_map);
phy_dev_data->physical_device_state = unique_ptr<PHYSICAL_DEVICE_STATE>(new PHYSICAL_DEVICE_STATE());