panfrost: Make {midgard,bifrost}_compile_shader_nir() return a program object
authorBoris Brezillon <boris.brezillon@collabora.com>
Sat, 17 Oct 2020 10:08:17 +0000 (12:08 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 23 Oct 2020 14:48:22 +0000 (14:48 +0000)
commit69c864b0b92da981b169cf879f7718e3d2c458c0
tree4ae7fb48138d5d02ddce388dcf1d3fd9b3f0129d
parentb83c293674c11de4acec14a45f798cb12566a8e0
panfrost: Make {midgard,bifrost}_compile_shader_nir() return a program object

Letting the caller zero-initialize the program object is error prone,
not to mention that resources attached to the program might not be freed
by the caller. Let's simplify that by letting the compiler allocate the
panfrost_program object. Those objects should be freed with ralloc_free().

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7206>
12 files changed:
src/gallium/drivers/panfrost/pan_assemble.c
src/gallium/drivers/panfrost/pan_blend_shaders.c
src/panfrost/bifrost/bi_pack.c
src/panfrost/bifrost/bifrost_compile.c
src/panfrost/bifrost/bifrost_compile.h
src/panfrost/bifrost/cmdline.c
src/panfrost/bifrost/test/bi_submit.c
src/panfrost/bifrost/test/bi_test_pack.c
src/panfrost/bifrost/test/bit.h
src/panfrost/lib/pan_blit.c
src/panfrost/midgard/midgard_compile.c
src/panfrost/midgard/midgard_compile.h