From f300f33b41f0df77a33818fa94d316defadad665 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Wed, 30 Nov 2016 14:44:03 +1300 Subject: layers: Apply previous fixes to CV CreateComputePipelines Compute pipeline creation can partially fail in the same way as graphics pipeline creation. Handle it exactly the same way in CV. Signed-off-by: Chris Forbes --- layers/core_validation.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 5e0a7c93..d86bc270 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -6921,6 +6921,7 @@ CreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t for (i = 0; i < count; i++) { // Clean up any locally allocated data structures delete pPipeState[i]; + pPipelines[i] = VK_NULL_HANDLE; } return VK_ERROR_VALIDATION_FAILED_EXT; } @@ -6929,8 +6930,13 @@ CreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t 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]; + if (pPipelines[i] == VK_NULL_HANDLE) { + delete pPipeState[i]; + } + else { + pPipeState[i]->pipeline = pPipelines[i]; + dev_data->pipelineMap[pPipeState[i]->pipeline] = pPipeState[i]; + } } return result; -- cgit v1.2.3