r600: update pipe_draw_info::restart_index only when primitive_restart is enabled
This avoids the use of uninitialized memory: Conditional jump or move depends on uninitialised value(s) at 0x5EDBF87: r600_draw_vbo (r600_state_common.c:2232) by 0x5DEFA00: u_vbuf_draw_vbo (u_vbuf.c:1329) by 0x5D990EF: cso_multi_draw (cso_context.c:1445) by 0x59B7EF4: _mesa_draw_arrays (draw.c:1346) Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10442>
This commit is contained in:
parent
d42c9e4787
commit
ad853fc0e1
|
@ -2229,8 +2229,11 @@ static void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info
|
|||
}
|
||||
|
||||
/* Set the index offset and primitive restart. */
|
||||
if (rctx->vgt_state.vgt_multi_prim_ib_reset_en != info->primitive_restart ||
|
||||
rctx->vgt_state.vgt_multi_prim_ib_reset_indx != info->restart_index ||
|
||||
bool restart_index_changed = info->primitive_restart &&
|
||||
rctx->vgt_state.vgt_multi_prim_ib_reset_indx != info->restart_index;
|
||||
|
||||
if (rctx->vgt_state.vgt_multi_prim_ib_reset_en != info->primitive_restart ||
|
||||
restart_index_changed ||
|
||||
rctx->vgt_state.vgt_indx_offset != index_bias ||
|
||||
(rctx->vgt_state.last_draw_was_indirect && !indirect)) {
|
||||
rctx->vgt_state.vgt_multi_prim_ib_reset_en = info->primitive_restart;
|
||||
|
|
Loading…
Reference in New Issue