etnaviv: switch to float_to_ubyte(..)
authorChristian Gmeiner <cgmeiner@igalia.com>
Mon, 14 Aug 2023 11:30:29 +0000 (13:30 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 17 Aug 2023 09:42:20 +0000 (09:42 +0000)
commite13bdbbd5bfc1cef00cf504b0567238ae8f45524
tree22fcbb6543b4fee7585d94623fdf893b6363f2b9
parent98eecece9bb4e82a964edfaf3840887e7adeee06
etnaviv: switch to float_to_ubyte(..)

The blob generates following values for e.g. this call.
  glBlendColor(0.002000f, 0.018000f, 0.030000f, 1.0)

  0xff010508, /*   [01424] PE.ALPHA_BLEND_COLOR := B=0x8,G=0x5,R=0x1,A=0xff */

etnaviv's etna_cfloat_to_uint8(..) creates different values.

  0.002000: 0x0
  0.018000: 0x4
  0.030000: 0x7

The same applies for the alpha reference value.

Lets drop this hand-rolled conversion helper to get the same values as
blob.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24727>
src/gallium/drivers/etnaviv/etnaviv_blend.c
src/gallium/drivers/etnaviv/etnaviv_util.h
src/gallium/drivers/etnaviv/etnaviv_zsa.c