From 95fe254cf29cc221bdcd7ef70bd7ee41835a94b8 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sat, 20 Jan 2018 01:05:13 -0800 Subject: [PATCH] iris: fix prim type --- src/gallium/drivers/iris/iris_state.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 348647d9aea..bfca3fb75cb 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -159,8 +159,6 @@ UNUSED static void pipe_asserts() static unsigned translate_prim_type(enum pipe_prim_type prim, uint8_t verts_per_patch) { - assert(prim == PIPE_PRIM_PATCHES || verts_per_patch == 0); - static const unsigned map[] = { [PIPE_PRIM_POINTS] = _3DPRIM_POINTLIST, [PIPE_PRIM_LINES] = _3DPRIM_LINELIST, @@ -179,7 +177,7 @@ translate_prim_type(enum pipe_prim_type prim, uint8_t verts_per_patch) [PIPE_PRIM_PATCHES] = _3DPRIM_PATCHLIST_1 - 1, }; - return map[prim] + verts_per_patch; + return map[prim] + (prim == PIPE_PRIM_PATCHES ? verts_per_patch : 0); } static unsigned -- 2.30.2