From c1fbb2ab616d4023a16f80df3055e6b1a71a1f09 Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Wed, 16 Nov 2016 10:05:30 -0700 Subject: layers: Move val to PreCallCreateGraphicsPipelines In core validation, created a pre-call function and moved the validation calls into it. Change-Id: Ib7831c3d2f36628e24b90083be902ac724f25483 --- layers/core_validation.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'layers/core_validation.cpp') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 47725502..c27e6172 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -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 &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 = -- cgit v1.2.3