Module: Mesa Branch: main Commit: 1a4dca989c678f7b4056255a05fa683ba81f1046 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1a4dca989c678f7b4056255a05fa683ba81f1046
Author: Icecream95 <[email protected]> Date: Wed Apr 27 08:23:35 2022 +1200 panfrost: Enable NIR lowering of half float packing The GLSL lowering of half float packing involves software conversion to half-float; instead, use the lowering in NIR. Both Midgard and Bifrost are already set to lower the instructions to bit operations, but change mdg_should_scalarize so that the lowerable split variants of the pack/unpack instructions are generated. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16175> --- src/gallium/drivers/panfrost/pan_screen.c | 1 + src/panfrost/midgard/midgard_compile.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index 21ae980f4b4..00477b519c8 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -122,6 +122,7 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param) case PIPE_CAP_FRAGMENT_SHADER_DERIVATIVES: case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT: case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION: + case PIPE_CAP_SHADER_PACK_HALF_FLOAT: return 1; case PIPE_CAP_MAX_RENDER_TARGETS: diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index b2f0a053ea5..cfa003c7f69 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -294,6 +294,8 @@ mdg_should_scalarize(const nir_instr *instr, const void *_unused) case nir_op_fdot2: case nir_op_umul_high: case nir_op_imul_high: + case nir_op_pack_half_2x16: + case nir_op_unpack_half_2x16: return true; default: return false;
