radeonsi: don't use lp_build_if for the wrapping if block in merged shaders
[mesa.git] / src / gallium / drivers / softpipe / sp_compute.c
index d5b5913f6a23ee2b07d79eee93b1f4636eae3d94..31252255bd429cd7d6cb2b64e30e656183c03ac1 100644 (file)
@@ -175,7 +175,7 @@ softpipe_launch_grid(struct pipe_context *context,
    int bwidth, bheight, bdepth;
    int w, h, d, i;
    int g_w, g_h, g_d;
-   uint32_t grid_size[3];
+   uint32_t grid_size[3] = {0};
    void *local_mem = NULL;
 
    softpipe_update_compute_samplers(softpipe);
@@ -191,8 +191,10 @@ softpipe_launch_grid(struct pipe_context *context,
    }
 
    machines = CALLOC(sizeof(struct tgsi_exec_machine *), num_threads_in_group);
-   if (!machines)
+   if (!machines) {
+      FREE(local_mem);
       return;
+   }
 
    /* initialise machines + GRID_SIZE + THREAD_ID  + BLOCK_SIZE */
    for (d = 0; d < bdepth; d++) {