[Mesa-dev] [PATCH 03/29] mesa: Do not assert on integer<->non-integer direct pack/unpack fast paths

Jason Ekstrand jason at jlekstrand.net
Wed Nov 19 12:04:35 PST 2014


Can you remind me again as to what formats hit these paths?  I remember you
hitting them, but I'm still not really seeing how it happens.
--Jason

On Tue, Nov 18, 2014 at 1:23 AM, Iago Toral Quiroga <itoral at igalia.com>
wrote:

> We can have conversions from non-integer types to integer types, so remove
> the assertions for these in the pack/unpack fast paths. It could be that
> we do not have all the necessary pack/unpack functions in these cases
> though,
> so protect these paths with conditionals and let _mesa_format_convert use
> other paths to resolve these kind of conversions if necessary.
> ---
>  src/mesa/main/format_utils.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/src/mesa/main/format_utils.c b/src/mesa/main/format_utils.c
> index 1d65f2b..56a3b8d 100644
> --- a/src/mesa/main/format_utils.c
> +++ b/src/mesa/main/format_utils.c
> @@ -143,8 +143,8 @@ _mesa_format_convert(void *void_dst, uint32_t
> dst_format, size_t dst_stride,
>              dst += dst_stride;
>           }
>           return;
> -      } else if (dst_array_format.as_uint == RGBA8888_UBYTE.as_uint) {
> -         assert(!_mesa_is_format_integer_color(src_format));
> +      } else if (dst_array_format.as_uint == RGBA8888_UBYTE.as_uint &&
> +                 !_mesa_is_format_integer_color(src_format)) {
>           for (row = 0; row < height; ++row) {
>              _mesa_unpack_ubyte_rgba_row(src_format, width,
>                                          src, (uint8_t (*)[4])dst);
> @@ -152,8 +152,8 @@ _mesa_format_convert(void *void_dst, uint32_t
> dst_format, size_t dst_stride,
>              dst += dst_stride;
>           }
>           return;
> -      } else if (dst_array_format.as_uint == RGBA8888_UINT.as_uint) {
> -         assert(_mesa_is_format_integer_color(src_format));
> +      } else if (dst_array_format.as_uint == RGBA8888_UINT.as_uint &&
> +                 _mesa_is_format_integer_color(src_format)) {
>           for (row = 0; row < height; ++row) {
>              _mesa_unpack_uint_rgba_row(src_format, width,
>                                         src, (uint32_t (*)[4])dst);
> @@ -174,8 +174,8 @@ _mesa_format_convert(void *void_dst, uint32_t
> dst_format, size_t dst_stride,
>              dst += dst_stride;
>           }
>           return;
> -      } else if (src_array_format.as_uint == RGBA8888_UBYTE.as_uint) {
> -         assert(!_mesa_is_format_integer_color(dst_format));
> +      } else if (src_array_format.as_uint == RGBA8888_UBYTE.as_uint &&
> +                 !_mesa_is_format_integer_color(dst_format)) {
>           for (row = 0; row < height; ++row) {
>              _mesa_pack_ubyte_rgba_row(dst_format, width,
>                                        (const uint8_t (*)[4])src, dst);
> @@ -183,8 +183,8 @@ _mesa_format_convert(void *void_dst, uint32_t
> dst_format, size_t dst_stride,
>              dst += dst_stride;
>           }
>           return;
> -      } else if (src_array_format.as_uint == RGBA8888_UINT.as_uint) {
> -         assert(_mesa_is_format_integer_color(dst_format));
> +      } else if (src_array_format.as_uint == RGBA8888_UINT.as_uint &&
> +                 _mesa_is_format_integer_color(dst_format)) {
>           for (row = 0; row < height; ++row) {
>              _mesa_pack_uint_rgba_row(dst_format, width,
>                                       (const uint32_t (*)[4])src, dst);
> --
> 1.9.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141119/3617016b/attachment.html>


More information about the mesa-dev mailing list