[Mesa-dev] [PATCH] draw: fix building error in draw_gs_init()

Dave Airlie airlied at gmail.com
Sat Apr 13 21:33:48 UTC 2019


Oops,

Reviewed-by: Dave Airlie <airlied at redhat.com>

I can't push from here, but I'll do it tomorrow if nobody beats me.

Dave.

On Sun, 14 Apr 2019 at 02:35, Mauro Rossi <issor.oruam at gmail.com> wrote:
>
> Fixes the following building error happening with Android build system:
>
> external/mesa/src/gallium/auxiliary/draw/draw_gs.c:740:79:
> error: address of array 'draw->gs.tgsi.machine->PrimitiveOffsets' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
>          if (!draw->gs.tgsi.machine->Primitives[i] || !draw->gs.tgsi.machine->PrimitiveOffsets)
>                                                       ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
> 1 error generated.
>
> Fixes: 7720ce3 ("draw: add support to tgsi paths for geometry streams. (v2)")
> Signed-off-by: Mauro Rossi <issor.oruam at gmail.com>
> ---
>  src/gallium/auxiliary/draw/draw_gs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gallium/auxiliary/draw/draw_gs.c b/src/gallium/auxiliary/draw/draw_gs.c
> index 1d6040993c..6420cfbb26 100644
> --- a/src/gallium/auxiliary/draw/draw_gs.c
> +++ b/src/gallium/auxiliary/draw/draw_gs.c
> @@ -737,7 +737,7 @@ draw_gs_init( struct draw_context *draw )
>              MAX_PRIMITIVES * sizeof(struct tgsi_exec_vector), 16);
>           draw->gs.tgsi.machine->PrimitiveOffsets[i] = align_malloc(
>              MAX_PRIMITIVES * sizeof(struct tgsi_exec_vector), 16);
> -         if (!draw->gs.tgsi.machine->Primitives[i] || !draw->gs.tgsi.machine->PrimitiveOffsets)
> +         if (!draw->gs.tgsi.machine->Primitives[i] || !draw->gs.tgsi.machine->PrimitiveOffsets[i])
>              return FALSE;
>           memset(draw->gs.tgsi.machine->Primitives[i], 0,
>                  MAX_PRIMITIVES * sizeof(struct tgsi_exec_vector));
> --
> 2.20.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list