diff options
| author | Chris Forbes <chrisforbes@google.com> | 2016-11-30 14:44:03 +1300 |
|---|---|---|
| committer | Chris Forbes <chrisforbes@google.com> | 2016-12-02 07:48:08 +1300 |
| commit | f300f33b41f0df77a33818fa94d316defadad665 (patch) | |
| tree | 24071644f085213986c15af585d25c9e3b7b7f84 | |
| parent | 1e230b47b250d0d5a73465e29759d25bd7f2bf21 (diff) | |
| download | usermoji-f300f33b41f0df77a33818fa94d316defadad665.tar.xz | |
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 <chrisforbes@google.com>
| -rw-r--r-- | layers/core_validation.cpp | 10 |
1 files 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; |
