Commit 1af77016 authored by maurossi's avatar maurossi Committed by Dave Airlie

draw: fix building error in draw_gs_init()

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: 7720ce32 ("draw: add support to tgsi paths for geometry streams. (v2)")
Signed-off-by: maurossi's avatarMauro Rossi <issor.oruam@gmail.com>
Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
parent b46b661f
Pipeline #30522 passed with stages
in 12 minutes and 55 seconds
......@@ -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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment