layers: Move CreateComputePipelines in OT
authorMark Lobodzinski <mark@lunarg.com>
Wed, 19 Jul 2017 18:37:04 +0000 (12:37 -0600)
committerMark Lobodzinski <mark@lunarg.com>
Mon, 24 Jul 2017 16:21:38 +0000 (10:21 -0600)
Moved to manually-generated, it has an odd corner case that's a one-
off and not worth code-generating.

Change-Id: I2631dd2107fffcd7e641b5a98bee126502d61ba8

layers/object_tracker.cpp
layers/object_tracker.h
layers/object_tracker_utils.cpp

index d474ba5..c23bb05 100644 (file)
@@ -2782,50 +2782,6 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateGraphicsPipelines(VkDevice device, VkPipeli
     return result;
 }
 
-VKAPI_ATTR VkResult VKAPI_CALL CreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount,
-                                                      const VkComputePipelineCreateInfo *pCreateInfos,
-                                                      const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) {
-    bool skip = VK_FALSE;
-    std::unique_lock<std::mutex> lock(global_lock);
-    skip |= ValidateObject(device, device, kVulkanObjectTypeDevice, false, VALIDATION_ERROR_1f205601, VALIDATION_ERROR_UNDEFINED);
-    if (pCreateInfos) {
-        for (uint32_t idx0 = 0; idx0 < createInfoCount; ++idx0) {
-            if (pCreateInfos[idx0].basePipelineHandle) {
-                skip |= ValidateObject(device, pCreateInfos[idx0].basePipelineHandle, kVulkanObjectTypePipeline, true,
-                                       VALIDATION_ERROR_03000572, VALIDATION_ERROR_03000009);
-            }
-            if (pCreateInfos[idx0].layout) {
-                skip |= ValidateObject(device, pCreateInfos[idx0].layout, kVulkanObjectTypePipelineLayout, false,
-                                       VALIDATION_ERROR_0300be01, VALIDATION_ERROR_03000009);
-            }
-            if (pCreateInfos[idx0].stage.module) {
-                skip |= ValidateObject(device, pCreateInfos[idx0].stage.module, kVulkanObjectTypeShaderModule, false,
-                                       VALIDATION_ERROR_1060d201, VALIDATION_ERROR_UNDEFINED);
-            }
-        }
-    }
-    if (pipelineCache) {
-        skip |= ValidateObject(device, pipelineCache, kVulkanObjectTypePipelineCache, true, VALIDATION_ERROR_1f228001,
-                               VALIDATION_ERROR_1f228007);
-    }
-    lock.unlock();
-    if (skip) {
-        for (uint32_t i = 0; i < createInfoCount; i++) {
-            pPipelines[i] = VK_NULL_HANDLE;
-        }
-        return VK_ERROR_VALIDATION_FAILED_EXT;
-    }
-    VkResult result = get_dispatch_table(ot_device_table_map, device)
-                          ->CreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
-    lock.lock();
-    for (uint32_t idx1 = 0; idx1 < createInfoCount; ++idx1) {
-        if (pPipelines[idx1] != VK_NULL_HANDLE) {
-            CreateObject(device, pPipelines[idx1], kVulkanObjectTypePipeline, pAllocator);
-        }
-    }
-    lock.unlock();
-    return result;
-}
 
 // VK_KHR_display Extension
 VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceDisplayPropertiesKHR(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount,
index 249d3f9..b19ee61 100644 (file)
@@ -207,6 +207,9 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetDeviceProcAddr(VkDevice device, cons
 VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetInstanceProcAddr(VkInstance instance, const char *funcName);
 VKAPI_ATTR void VKAPI_CALL DestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT msgCallback,
                                                          const VkAllocationCallbacks *pAllocator);
+VKAPI_ATTR VkResult VKAPI_CALL CreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount,
+                                                      const VkComputePipelineCreateInfo *pCreateInfos,
+                                                      const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines);
 
 template <typename T1, typename T2>
 bool ValidateObject(T1 dispatchable_object, T2 object, VulkanObjectType object_type, bool null_allowed,
index 82184fe..298c089 100644 (file)
@@ -400,6 +400,51 @@ VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSets(VkDevice device, uint32_t descri
         ->UpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies);
 }
 
+VKAPI_ATTR VkResult VKAPI_CALL CreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount,
+                                                      const VkComputePipelineCreateInfo *pCreateInfos,
+                                                      const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) {
+    bool skip = VK_FALSE;
+    std::unique_lock<std::mutex> lock(global_lock);
+    skip |= ValidateObject(device, device, kVulkanObjectTypeDevice, false, VALIDATION_ERROR_1f205601, VALIDATION_ERROR_UNDEFINED);
+    if (pCreateInfos) {
+        for (uint32_t idx0 = 0; idx0 < createInfoCount; ++idx0) {
+            if (pCreateInfos[idx0].basePipelineHandle) {
+                skip |= ValidateObject(device, pCreateInfos[idx0].basePipelineHandle, kVulkanObjectTypePipeline, true,
+                                       VALIDATION_ERROR_03000572, VALIDATION_ERROR_03000009);
+            }
+            if (pCreateInfos[idx0].layout) {
+                skip |= ValidateObject(device, pCreateInfos[idx0].layout, kVulkanObjectTypePipelineLayout, false,
+                                       VALIDATION_ERROR_0300be01, VALIDATION_ERROR_03000009);
+            }
+            if (pCreateInfos[idx0].stage.module) {
+                skip |= ValidateObject(device, pCreateInfos[idx0].stage.module, kVulkanObjectTypeShaderModule, false,
+                                       VALIDATION_ERROR_1060d201, VALIDATION_ERROR_UNDEFINED);
+            }
+        }
+    }
+    if (pipelineCache) {
+        skip |= ValidateObject(device, pipelineCache, kVulkanObjectTypePipelineCache, true, VALIDATION_ERROR_1f228001,
+                               VALIDATION_ERROR_1f228007);
+    }
+    lock.unlock();
+    if (skip) {
+        for (uint32_t i = 0; i < createInfoCount; i++) {
+            pPipelines[i] = VK_NULL_HANDLE;
+        }
+        return VK_ERROR_VALIDATION_FAILED_EXT;
+    }
+    VkResult result = get_dispatch_table(ot_device_table_map, device)
+                          ->CreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
+    lock.lock();
+    for (uint32_t idx1 = 0; idx1 < createInfoCount; ++idx1) {
+        if (pPipelines[idx1] != VK_NULL_HANDLE) {
+            CreateObject(device, pPipelines[idx1], kVulkanObjectTypePipeline, pAllocator);
+        }
+    }
+    lock.unlock();
+    return result;
+}
+
 VKAPI_ATTR VkResult VKAPI_CALL ResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool,
                                                    VkDescriptorPoolResetFlags flags) {
     bool skip = false;