pan/mdg: Obey f2fmp size restriction in fuse_io_16

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6283>
This commit is contained in:
Alyssa Rosenzweig 2020-09-10 16:47:37 -04:00 committed by Marge Bot
parent 5cd6235958
commit 3064feb235

View file

@ -87,6 +87,15 @@ nir_fuse_io_16(nir_shader *shader)
continue;
intr->dest.ssa.bit_size = 16;
nir_builder b;
nir_builder_init(&b, function->impl);
b.cursor = nir_after_instr(instr);
/* The f2f32(f2fmp(x)) will cancel by opt_algebraic */
nir_ssa_def *conv = nir_f2f32(&b, &intr->dest.ssa);
nir_ssa_def_rewrite_uses_after(&intr->dest.ssa, nir_src_for_ssa(conv), conv->parent_instr);
progress |= true;
}
}