diff --git a/src/gallium/frontends/nine/nine_state.c b/src/gallium/frontends/nine/nine_state.c index 2cc12ffd81e..1365f1c937d 100644 --- a/src/gallium/frontends/nine/nine_state.c +++ b/src/gallium/frontends/nine/nine_state.c @@ -2371,6 +2371,7 @@ init_draw_info(struct pipe_draw_info *info, info->take_index_buffer_ownership = FALSE; info->index_bias_varies = FALSE; info->increment_draw_id = FALSE; + info->was_line_loop = FALSE; info->restart_index = 0; } diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 196a9f42c50..2a7eaf1ac9e 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -845,7 +845,8 @@ struct pipe_draw_info bool take_index_buffer_ownership:1; /**< callee inherits caller's refcount (no need to reference indexbuf, but still needs to unreference it) */ bool index_bias_varies:1; /**< true if index_bias varies between draws */ - uint8_t _pad:2; + bool was_line_loop:1; /**< true if pipe_prim_type was LINE_LOOP before translation */ + uint8_t _pad:1; unsigned start_instance; /**< first instance id */ unsigned instance_count; /**< number of instances */ diff --git a/src/mesa/main/draw.c b/src/mesa/main/draw.c index a28861b0165..15cef9e675c 100644 --- a/src/mesa/main/draw.c +++ b/src/mesa/main/draw.c @@ -1308,6 +1308,7 @@ _mesa_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start, info.has_user_indices = false; info.index_bounds_valid = true; info.increment_draw_id = false; + info.was_line_loop = false; info.take_index_buffer_ownership = false; info.index_bias_varies = false; /* Packed section end. */ @@ -1635,6 +1636,7 @@ _mesa_MultiDrawArrays(GLenum mode, const GLint *first, info.has_user_indices = false; info.index_bounds_valid = false; info.increment_draw_id = primcount > 1; + info.was_line_loop = false; info.take_index_buffer_ownership = false; info.index_bias_varies = false; /* Packed section end. */ @@ -1757,6 +1759,7 @@ _mesa_validated_drawrangeelements(struct gl_context *ctx, GLenum mode, info.has_user_indices = index_bo == NULL; info.index_bounds_valid = index_bounds_valid; info.increment_draw_id = false; + info.was_line_loop = false; info.take_index_buffer_ownership = false; info.index_bias_varies = false; /* Packed section end. */ @@ -2143,6 +2146,7 @@ _mesa_validated_multidrawelements(struct gl_context *ctx, GLenum mode, info.has_user_indices = index_bo == NULL; info.index_bounds_valid = false; info.increment_draw_id = primcount > 1; + info.was_line_loop = false; info.take_index_buffer_ownership = false; info.index_bias_varies = !!basevertex; /* Packed section end. */ @@ -2554,6 +2558,7 @@ _mesa_MultiDrawArraysIndirect(GLenum mode, const GLvoid *indirect, info.has_user_indices = false; info.index_bounds_valid = false; info.increment_draw_id = primcount > 1; + info.was_line_loop = false; info.take_index_buffer_ownership = false; info.index_bias_varies = false; /* Packed section end. */ @@ -2645,6 +2650,7 @@ _mesa_MultiDrawElementsIndirect(GLenum mode, GLenum type, info.has_user_indices = false; info.index_bounds_valid = false; info.increment_draw_id = primcount > 1; + info.was_line_loop = false; info.take_index_buffer_ownership = false; info.index_bias_varies = false; /* Packed section end. */ diff --git a/src/util/indices/u_primconvert.c b/src/util/indices/u_primconvert.c index ede86e4cd2a..5d0de366ace 100644 --- a/src/util/indices/u_primconvert.c +++ b/src/util/indices/u_primconvert.c @@ -258,6 +258,7 @@ primconvert_init_draw(struct primconvert_context *pc, else { gen_func(draw.start, new_draw->count, dst); } + new_info->was_line_loop = info->mode == PIPE_PRIM_LINE_LOOP; if (src_transfer) pipe_buffer_unmap(pc->pipe, src_transfer);