diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-01-20 16:01:53 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-01-22 13:48:24 +0000 |
commit | 4936120230f07b959ec902aca989fdeae4e80d55 (patch) | |
tree | 4941dc499f692e852e7f164a1bfab14ce4a79a78 | |
parent | d817f2c69615cf37b78f484a25b7831ebe9dbe6f (diff) |
panfrost: Fix crash in compute variant allocation
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Fixes: d8a3501f1b2 ("panfrost: Dynamically allocate shader variants")
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3515>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3515>
-rw-r--r-- | src/gallium/drivers/panfrost/pan_compute.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/panfrost/pan_compute.c b/src/gallium/drivers/panfrost/pan_compute.c index 905e6e234e0..9e3306b673f 100644 --- a/src/gallium/drivers/panfrost/pan_compute.c +++ b/src/gallium/drivers/panfrost/pan_compute.c @@ -46,7 +46,8 @@ panfrost_create_compute_state( so->cbase = *cso; so->is_compute = true; - struct panfrost_shader_state *v = &so->variants[0]; + struct panfrost_shader_state *v = calloc(1, sizeof(*v)); + so->variants = v; so->variant_count = 1; so->active_variant = 0; |