janitor: use fi and di from u_math.h across the tree
This MR addresses issue #9847.
This is mostly a relatively straightforward translation from various ad-hoc copies of union fi
and union di
to the common definition in u_math.h
. This MR also removes the last remaining definition (fi_type
) from mesa_private.h
, removing that header.
Converted usage sites
-
src/util/
:-
format_rgb9e5.h
: straightforward conversion from custom union tofi
-
format_r11g11b10f.h
: straightforward conversion from custom union tofi
-
format_srgb.h
: straightforward conversion from custom union tofi
-
bitpack_helpers.h
: straightforward conversion from custom union tofi
-
half_float.c
: straightforward conversion from custom union tofi
-
softfloat.c
: straightforward conversion from custom unions tofi
anddi
-
-
src/intel/isl
:-
isl_emit_depth_stencil.c
: straightforward conversion from custom union tofi
-
-
src/freedreno/rnn
:-
rnndec.c
: partially converted; converted use infloat float16(uint16_t)
-
-
src/gallium/drivers/nouveau
:-
nouveau_winsys.h
: straightforward conversion from custom union tofi
-
-
src/gallium/frontends/nine
:-
nine_helpers.h
: straightforward conversion from custom union tofi
-
-
src/mesa/main
:-
mesa_private.h
: previously definedfi_type
, now everything that used that now usesunion fi
the file became empty by removing that definition, so I removed the file -
macros.h
: some macros required changing to adjust to the different member names ofunion fi
-
context.c
: adjust member name.u
to.ui
-
tests/disable_windows_include.c
: removemesa_private.h
-
-
src/mesa/vbo
:-
vbo.h
: switch fromfi_type
tounion fi
-
vbo_save.h
: switch fromfi_type
tounion fi
-
vbo_private.h
switch fromfi_type
tounion fi
-
vbo_exec.c
,vbo_exec_api.c
,vbo_exec_draw.c
: switch fromfi_type
tounion fi
-
vbo_save_api.c
,vbo_save_draw.c
,vbo_save_loopback.c
: switch formfi_type
tounion fi
-
Skipped usage sites
-
src/intel/vulkan/grl
:-
include/GRLOCLCompatibility.h
: unsure if this should usefi
since the header seems to go out of its way not to depend on other mesa things
-
-
src/freedreno/rnn
:-
rnndec.c
: partially converted; skipped use inrnndec_decodeval
since it uses the same union to pun betweenuint64_t
,float
, anddouble
whilefi
anddi
only support either punning tofloat
ordouble
-
-
src/imgui
:-
imgui.h
: external library vendored into mesa
also uses the same union to pun between more types:int
,float
,void*
-
This PR is no longer a draft, but I'm still combing through the tree and adding commits as I find instances of this. I will squash the individual commits into one big janitor commit before this is merged, but leave it separated while I'm working on it to keep track of what I have already done.