From d62b0b9ee8016662687287baa8710f24859a74d0 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sat, 20 Jan 2018 01:09:36 -0800 Subject: [PATCH] iris: draw->restart_index is uninitialized if PR is not enabled --- src/gallium/drivers/iris/iris_state.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 1ec34bddbcb..03c42b7d777 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -1439,8 +1439,10 @@ iris_upload_render_state(struct iris_context *ice, if (1) { iris_emit_cmd(batch, GENX(3DSTATE_VF), vf) { - vf.IndexedDrawCutIndexEnable = draw->primitive_restart; - vf.CutIndex = draw->restart_index; + if (draw->primitive_restart) { + vf.IndexedDrawCutIndexEnable = true; + vf.CutIndex = draw->restart_index; + } } } -- 2.30.2