ac/nir/lower_sin_cos: preserve fp_math_ctrl

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39187>
This commit is contained in:
Georg Lehmann 2026-01-07 11:39:12 +01:00 committed by Marge Bot
parent 9331726157
commit 5241343ccb

View file

@ -16,6 +16,7 @@ lower_sin_cos(struct nir_builder *b, nir_alu_instr *sincos, UNUSED void *_)
return false;
b->cursor = nir_before_instr(&sincos->instr);
b->fp_math_ctrl = sincos->fp_math_ctrl;
nir_def *src = nir_fmul_imm(b, nir_ssa_for_alu_src(b, sincos, 0), 0.15915493667125702);
nir_def *replace = sincos->op == nir_op_fsin ? nir_fsin_amd(b, src) : nir_fcos_amd(b, src);