iris: fix prim type
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 20 Jan 2018 09:05:13 +0000 (01:05 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:05 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_state.c

index 348647d9aeaa9ecefe253217f7c2d6637922ae94..bfca3fb75cbf4a56a9290dfa709594a73e6fc32d 100644 (file)
@@ -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