mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
u_prim_restart: add inline function for getting restart index based on index size
handy to have this available for drivers to reuse Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6147>
This commit is contained in:
parent
1f24c54458
commit
070fd2b66f
1 changed files with 12 additions and 0 deletions
|
|
@ -51,6 +51,18 @@ enum pipe_error
|
|||
util_draw_vbo_without_prim_restart(struct pipe_context *context,
|
||||
const struct pipe_draw_info *info);
|
||||
|
||||
static inline unsigned
|
||||
util_prim_restart_index_from_size(unsigned index_size)
|
||||
{
|
||||
if (index_size == 1)
|
||||
return 0xff;
|
||||
if (index_size == 2)
|
||||
return 0xffff;
|
||||
if (index_size == 4)
|
||||
return 0xffffffff;
|
||||
unreachable("unknown index size passed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue