mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-09 21:20:14 +01:00
panfrost: Don't leak NIR compute shaders
We never steal the NIR program or free it explicitly, and the state tracker expects drivers to take ownership of the program object. Since panfrost doesn't need to keep the original NIR shader around for compute, let's just free it before returning. Fixes:40372bd720("panfrost: Implement a disk cache") Cc: stable Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26424> (cherry picked from commit692a4b1804)
This commit is contained in:
parent
42f5040e69
commit
605f8b70d4
2 changed files with 2 additions and 1 deletions
|
|
@ -3394,7 +3394,7 @@
|
|||
"description": "panfrost: Don't leak NIR compute shaders",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "40372bd720fe16186e9abc832bb452a3143d0e00",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -470,6 +470,7 @@ panfrost_create_compute_state(struct pipe_context *pctx,
|
|||
/* The NIR becomes invalid after this. For compute kernels, we never
|
||||
* need to access it again. Don't keep a dangling pointer around.
|
||||
*/
|
||||
ralloc_free((void *)so->nir);
|
||||
so->nir = NULL;
|
||||
|
||||
return so;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue