util: Make all 3 fetch_rgba functions occupy the same function slot.

A single format either had the float, the sint, or the uint version.
Making the dst be void * lets us store them in the same slot and not have
logic in the callers to call the right one.

-6kb on gallium drivers

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6305>
This commit is contained in:
Eric Anholt
2020-08-13 09:15:16 -07:00
committed by Marge Bot
parent 80babbbf7e
commit 35b22b5da0
22 changed files with 103 additions and 108 deletions

View File

@@ -178,7 +178,7 @@ int main(int argc, char** argv)
unsigned output_normalized = 0;
if (!output_format_desc
|| !output_format_unpack->fetch_rgba_float
|| !output_format_unpack->fetch_rgba
|| !output_format_pack->pack_rgba_float
|| output_format_desc->colorspace != UTIL_FORMAT_COLORSPACE_RGB
|| output_format_desc->layout != UTIL_FORMAT_LAYOUT_PLAIN
@@ -206,7 +206,7 @@ int main(int argc, char** argv)
boolean input_is_float = FALSE;
if (!input_format_desc
|| !input_format_unpack->fetch_rgba_float
|| !input_format_unpack->fetch_rgba
|| !input_format_pack->pack_rgba_float
|| input_format_desc->colorspace != UTIL_FORMAT_COLORSPACE_RGB
|| input_format_desc->layout != UTIL_FORMAT_LAYOUT_PLAIN
@@ -277,8 +277,8 @@ int main(int argc, char** argv)
{
float a[4];
float b[4];
input_format_unpack->fetch_rgba_float(a, buffer[2] + i * input_format_size, 0, 0);
input_format_unpack->fetch_rgba_float(b, buffer[4] + i * input_format_size, 0, 0);
input_format_unpack->fetch_rgba(a, buffer[2] + i * input_format_size, 0, 0);
input_format_unpack->fetch_rgba(b, buffer[4] + i * input_format_size, 0, 0);
for (j = 0; j < count; ++j)
{