mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 21:30:09 +01:00
compiler: add mesa_prim_has_adjacency helper
hk will use this, it's a pretty obvious thing to want. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32529>
This commit is contained in:
parent
e4f61771d8
commit
8abb043c19
1 changed files with 12 additions and 0 deletions
|
|
@ -1388,6 +1388,18 @@ u_reduced_prim(enum mesa_prim prim)
|
|||
}
|
||||
}
|
||||
|
||||
static inline bool
|
||||
mesa_prim_has_adjacency(enum mesa_prim prim)
|
||||
{
|
||||
static_assert(MESA_PRIM_LINE_STRIP_ADJACENCY == MESA_PRIM_LINES_ADJACENCY + 1, "");
|
||||
static_assert(MESA_PRIM_TRIANGLES_ADJACENCY == MESA_PRIM_LINES_ADJACENCY + 2, "");
|
||||
static_assert(MESA_PRIM_TRIANGLE_STRIP_ADJACENCY == MESA_PRIM_LINES_ADJACENCY + 3, "");
|
||||
|
||||
/* Adjacency primitives are together so we can do a simple comparison */
|
||||
return prim >= MESA_PRIM_LINES_ADJACENCY &&
|
||||
prim <= MESA_PRIM_TRIANGLE_STRIP_ADJACENCY;
|
||||
}
|
||||
|
||||
/**
|
||||
* A compare function enum for use in compiler lowering passes. This is in
|
||||
* the same order as GL's compare functions (shifted down by GL_NEVER), and is
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue