diff options
author | Bas Nieuwenhuizen <[email protected]> | 2018-01-21 21:59:26 +0100 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2018-01-22 00:07:29 +0100 |
commit | 2c802ca66c480a1038e1fe52350e30a27658e78a (patch) | |
tree | e7c4a444ca71588b923c332d8d2940cd2b6a94cb /src/amd/vulkan | |
parent | c685076ab0706309d7ba2012a7bc4e2c6637d402 (diff) |
radv: Fix fragment resolve init memory allocation failure paths.
CC: <[email protected]>
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan')
-rw-r--r-- | src/amd/vulkan/radv_meta_resolve_fs.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/amd/vulkan/radv_meta_resolve_fs.c b/src/amd/vulkan/radv_meta_resolve_fs.c index 99314d94e53..08c9282bf0d 100644 --- a/src/amd/vulkan/radv_meta_resolve_fs.c +++ b/src/amd/vulkan/radv_meta_resolve_fs.c @@ -319,16 +319,9 @@ create_resolve_pipeline(struct radv_device *device, &vk_pipeline_info, &radv_pipeline_info, &device->meta_state.alloc, pipeline); - ralloc_free(vs.nir); ralloc_free(fs.nir); - if (result != VK_SUCCESS) - goto fail; - return VK_SUCCESS; -fail: - ralloc_free(vs.nir); - ralloc_free(fs.nir); return result; } @@ -339,14 +332,19 @@ radv_device_init_meta_resolve_fragment_state(struct radv_device *device) res = create_layout(device); if (res != VK_SUCCESS) - return res; + goto fail; for (uint32_t i = 0; i < MAX_SAMPLES_LOG2; ++i) { for (unsigned j = 0; j < ARRAY_SIZE(pipeline_formats); ++j) { res = create_resolve_pipeline(device, i, pipeline_formats[j]); + if (res != VK_SUCCESS) + goto fail; } } + return VK_SUCCESS; +fail: + radv_device_finish_meta_resolve_fragment_state(device); return res; } |