diff options
author | Eric Anholt <eric@anholt.net> | 2021-04-19 15:17:58 -0700 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-04-21 19:59:10 +0000 |
commit | 839af6545bf2f9a7406725e905ffa702731ddc10 (patch) | |
tree | 46b1ebfd9b00aa4a26aabc40ec195b51424e70d1 /src/mesa/main/format_pack.h | |
parent | 1a36b11a66ac32854adc1a47dd1b587d74ab01e7 (diff) |
mesa: Replace _mesa_pack_ubyte_rgba_row() with pack_ubyte_rgba_8unorm().
The major thing that the codegen had was support for expanding integers
from byte-per-channel to the target format's channel size. However, the
format_utils.c caller never did that for integers, and swrast doesn't have
support for integers, so that appears to be dead code. With this done,
format_pack.py goes away entirely.
I slightly changed the prototype of _mesa_pack_ubyte_rgba_row() to match
up with the new function, which involved (mostly) dropping some manual
casts from the callers to make their data match the old prototype.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10336>
Diffstat (limited to 'src/mesa/main/format_pack.h')
-rw-r--r-- | src/mesa/main/format_pack.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/main/format_pack.h b/src/mesa/main/format_pack.h index fce4045ac36..76b1c6a9eea 100644 --- a/src/mesa/main/format_pack.h +++ b/src/mesa/main/format_pack.h @@ -41,9 +41,13 @@ _mesa_pack_float_rgba_row(mesa_format format, uint32_t n, util_format_pack_rgba(format, dst, src, n); } -extern void +static inline void _mesa_pack_ubyte_rgba_row(mesa_format format, uint32_t n, - const uint8_t src[][4], void *dst); + const uint8_t *src, void *dst) +{ + const struct util_format_pack_description *pack = util_format_pack_description(format); + pack->pack_rgba_8unorm((uint8_t *)dst, 0, src, 0, n, 1); +} static inline void _mesa_pack_uint_rgba_row(mesa_format format, uint32_t n, |