layers: Add in missing CreatDevice physdev obj check
authorMark Lobodzinski <mark@lunarg.com>
Mon, 12 Jun 2017 16:19:26 +0000 (10:19 -0600)
committerMark Lobodzinski <mark@lunarg.com>
Mon, 12 Jun 2017 18:10:09 +0000 (12:10 -0600)
Prevents doc validator from failing.

Change-Id: I0e70da954f0a7d7ed4a54d4bcefe996a6cc9cfb3

layers/object_tracker.cpp

index a4acc720c0e24bcacde1f89fa358550bfa2baf6b..1265524adadebd3de657caa9680b0dff1d0cd76d 100644 (file)
@@ -3282,6 +3282,10 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDisplayPlaneSurfaceKHR(VkInstance instance,
 VKAPI_ATTR VkResult VKAPI_CALL CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo,
                                             const VkAllocationCallbacks *pAllocator, VkDevice *pDevice) {
     std::lock_guard<std::mutex> lock(global_lock);
+    bool skip = ValidateObject(physicalDevice, physicalDevice, kVulkanObjectTypePhysicalDevice, false, VALIDATION_ERROR_1fc27a01,
+                               VALIDATION_ERROR_UNDEFINED);
+    if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
+
     layer_data *phy_dev_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), layer_data_map);
     VkLayerDeviceCreateInfo *chain_info = get_chain_info(pCreateInfo, VK_LAYER_LINK_INFO);