summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2018-01-21 20:20:50 +0100
committerBas Nieuwenhuizen <[email protected]>2018-01-22 00:07:19 +0100
commit71f0315a8861ac20cd9ed36d89eb9db60462931f (patch)
tree5f5fc2254997c0a921631510a3b82108ac3db127 /src/amd/vulkan
parentd956e0bdf53a9dd51d4a07d3cb58ee16e37a4ace (diff)
radv: Fix memory allocation failure path in compute resolve init.
CC: <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan')
-rw-r--r--src/amd/vulkan/radv_meta_resolve_cs.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_meta_resolve_cs.c b/src/amd/vulkan/radv_meta_resolve_cs.c
index 5b3bc89832b..519e2a5f428 100644
--- a/src/amd/vulkan/radv_meta_resolve_cs.c
+++ b/src/amd/vulkan/radv_meta_resolve_cs.c
@@ -253,22 +253,31 @@ radv_device_init_meta_resolve_compute_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) {
uint32_t samples = 1 << i;
res = create_resolve_pipeline(device, samples, false, false,
&state->resolve_compute.rc[i].pipeline);
+ if (res != VK_SUCCESS)
+ goto fail;
res = create_resolve_pipeline(device, samples, true, false,
&state->resolve_compute.rc[i].i_pipeline);
+ if (res != VK_SUCCESS)
+ goto fail;
res = create_resolve_pipeline(device, samples, false, true,
&state->resolve_compute.rc[i].srgb_pipeline);
+ if (res != VK_SUCCESS)
+ goto fail;
}
+ return VK_SUCCESS;
+fail:
+ radv_device_finish_meta_resolve_compute_state(device);
return res;
}