layers: Move val to PreCallCreateGraphicsPipelines
authorMark Lobodzinski <mark@lunarg.com>
Wed, 16 Nov 2016 17:05:30 +0000 (10:05 -0700)
committerMark Lobodzinski <mark@lunarg.com>
Wed, 16 Nov 2016 20:01:55 +0000 (13:01 -0700)
In core validation, created a pre-call function and moved the
validation calls into it.

Change-Id: Ib7831c3d2f36628e24b90083be902ac724f25483

layers/core_validation.cpp

index 4772550..c27e617 100644 (file)
@@ -6778,6 +6778,17 @@ void set_pipeline_state(PIPELINE_STATE *pPipe) {
     }
 }
 
+static bool PreCallCreateGraphicsPipelines(layer_data *device_data, uint32_t count,
+                                           const VkGraphicsPipelineCreateInfo *create_infos, vector<PIPELINE_STATE *> &pipe_state) {
+    bool skip = false;
+    layer_data *phy_dev_data = get_my_data_ptr(get_dispatch_key(device_data->instance_data), layer_data_map);
+
+    for (uint32_t i = 0; i < count; i++) {
+        skip |= verifyPipelineCreateState(device_data, pipe_state, i);
+    }
+    return skip;
+}
+
 VKAPI_ATTR VkResult VKAPI_CALL
 CreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count,
                         const VkGraphicsPipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator,
@@ -6801,10 +6812,10 @@ CreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t
         pPipeState[i]->initGraphicsPipeline(&pCreateInfos[i]);
         pPipeState[i]->render_pass_ci.initialize(getRenderPassState(dev_data, pCreateInfos[i].renderPass)->createInfo.ptr());
         pPipeState[i]->pipeline_layout = *getPipelineLayout(dev_data, pCreateInfos[i].layout);
-
-        skip_call |= verifyPipelineCreateState(dev_data, pPipeState, i);
     }
 
+    skip_call |= PreCallCreateGraphicsPipelines(dev_data, count, pCreateInfos, pPipeState);
+
     if (!skip_call) {
         lock.unlock();
         result =