mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
nir: add force_f2f16_rtz option to lower f2f16 to f2f16_rtz
Used by OpenGL driver like radeonsi which has undefined rounding mode. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Qiang Yu <yuq825@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25990>
This commit is contained in:
parent
5696790420
commit
7e4aac46ad
2 changed files with 5 additions and 0 deletions
|
|
@ -4016,6 +4016,9 @@ typedef struct nir_shader_compiler_options {
|
|||
|
||||
/** lowers fquantize2f16 to alu ops. */
|
||||
bool lower_fquantize2f16;
|
||||
|
||||
/** Lower f2f16 to f2f16_rtz when execution mode is not rtne. */
|
||||
bool force_f2f16_rtz;
|
||||
} nir_shader_compiler_options;
|
||||
|
||||
typedef struct nir_shader {
|
||||
|
|
|
|||
|
|
@ -3281,6 +3281,8 @@ late_optimizations += [
|
|||
(('u2fmp', a), ('u2f16', a), "!options->preserve_mediump"),
|
||||
(('fisfinite', a), ('flt', ('fabs', a), float("inf"))),
|
||||
|
||||
(('f2f16', a), ('f2f16_rtz', a), "options->force_f2f16_rtz && !nir_is_rounding_mode_rtne(info->float_controls_execution_mode, 16)"),
|
||||
|
||||
(('fcsel', ('slt', 0, a), b, c), ('fcsel_gt', a, b, c), "options->has_fused_comp_and_csel"),
|
||||
(('fcsel', ('slt', a, 0), b, c), ('fcsel_gt', ('fneg', a), b, c), "options->has_fused_comp_and_csel"),
|
||||
(('fcsel', ('sge', a, 0), b, c), ('fcsel_ge', a, b, c), "options->has_fused_comp_and_csel"),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue