nir: Port a floor->truncate algebraic opt pattern from GLSL.
Prevents regression when dropping code from the GLSL optimizer. Acked-by: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
This commit is contained in:
@@ -129,6 +129,8 @@ optimizations = [
|
||||
'!options->lower_bitops'),
|
||||
(('irem', a, '#b(is_neg_power_of_two)'), ('irem', a, ('iabs', b)), '!options->lower_bitops'),
|
||||
|
||||
(('~fmul', ('fsign', a), ('ffloor', ('fadd', ('fabs', a), 0.5))), ('ftrunc', ('fadd', a, ('fmul', ('fsign', a), 0.5))), '!options->lower_ftrunc || options->lower_ffloor'),
|
||||
|
||||
(('~fneg', ('fneg', a)), a),
|
||||
(('ineg', ('ineg', a)), a),
|
||||
(('fabs', ('fneg', a)), ('fabs', a)),
|
||||
|
Reference in New Issue
Block a user