diff options
| author | Chris Forbes <chrisforbes@google.com> | 2016-11-30 14:39:24 +1300 |
|---|---|---|
| committer | Chris Forbes <chrisforbes@google.com> | 2016-12-02 07:48:08 +1300 |
| commit | a5ac5539c9d119a73f755d7246044d91f9d340eb (patch) | |
| tree | c72c57c03a4929f48e11143e64a92e2732763f61 | |
| parent | afdbcbf30b5da6620735d702b0fb0cd1b1fbd78b (diff) | |
| download | usermoji-a5ac5539c9d119a73f755d7246044d91f9d340eb.tar.xz | |
layers: CV: clean up Create*Pipelines
Signed-off-by: Chris Forbes <chrisforbes@google.com>
| -rw-r--r-- | layers/core_validation.cpp | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 50dc4b12..729de863 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -6851,7 +6851,6 @@ CreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t // 1. Pipeline create state is first shadowed into PIPELINE_STATE struct // 2. Create state is then validated (which uses flags setup during shadowing) // 3. If everything looks good, we'll then create the pipeline and add NODE to pipelineMap - VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; bool skip = false; // TODO : Improve this data struct w/ unique_ptrs so cleanup below is automatic vector<PIPELINE_STATE *> pipe_state(count); @@ -6873,15 +6872,15 @@ CreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t delete pipe_state[i]; pPipelines[i] = VK_NULL_HANDLE; } - } else { - lock.unlock(); - result = - dev_data->dispatch_table.CreateGraphicsPipelines(device, pipelineCache, count, pCreateInfos, pAllocator, pPipelines); - lock.lock(); - for (i = 0; i < count; i++) { - pipe_state[i]->pipeline = pPipelines[i]; - dev_data->pipelineMap[pipe_state[i]->pipeline] = pipe_state[i]; - } + return VK_ERROR_VALIDATION_FAILED_EXT; + } + + lock.unlock(); + auto result = dev_data->dispatch_table.CreateGraphicsPipelines(device, pipelineCache, count, pCreateInfos, pAllocator, pPipelines); + lock.lock(); + for (i = 0; i < count; i++) { + pipe_state[i]->pipeline = pPipelines[i]; + dev_data->pipelineMap[pipe_state[i]->pipeline] = pipe_state[i]; } return result; @@ -6891,7 +6890,6 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, const VkComputePipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) { - VkResult result = VK_SUCCESS; bool skip = false; // TODO : Improve this data struct w/ unique_ptrs so cleanup below is automatic @@ -6914,24 +6912,22 @@ CreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t // skip |= verifyPipelineCreateState(dev_data, pPipeState[i]); } - if (!skip) { - lock.unlock(); - result = - dev_data->dispatch_table.CreateComputePipelines(device, pipelineCache, count, pCreateInfos, pAllocator, pPipelines); - lock.lock(); - for (i = 0; i < count; i++) { - pPipeState[i]->pipeline = pPipelines[i]; - dev_data->pipelineMap[pPipeState[i]->pipeline] = pPipeState[i]; - } - lock.unlock(); - } else { + if (skip) { for (i = 0; i < count; i++) { // Clean up any locally allocated data structures delete pPipeState[i]; } - lock.unlock(); return VK_ERROR_VALIDATION_FAILED_EXT; } + + lock.unlock(); + auto result = dev_data->dispatch_table.CreateComputePipelines(device, pipelineCache, count, pCreateInfos, pAllocator, pPipelines); + lock.lock(); + for (i = 0; i < count; i++) { + pPipeState[i]->pipeline = pPipelines[i]; + dev_data->pipelineMap[pPipeState[i]->pipeline] = pPipeState[i]; + } + return result; } |
