mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 08:00:12 +01:00
nir: Add a new nir_cf_list_is_empty_block() helper.
Helper and name suggested by Eric Anholt. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
08dc93c67c
commit
2b44b27dbe
1 changed files with 15 additions and 0 deletions
|
|
@ -2127,6 +2127,21 @@ nir_loop_last_block(nir_loop *loop)
|
|||
return nir_cf_node_as_block(exec_node_data(nir_cf_node, tail, node));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if this list of cf_nodes contains a single empty block.
|
||||
*/
|
||||
static inline bool
|
||||
nir_cf_list_is_empty_block(struct exec_list *cf_list)
|
||||
{
|
||||
if (exec_list_is_singular(cf_list)) {
|
||||
struct exec_node *head = exec_list_get_head(cf_list);
|
||||
nir_block *block =
|
||||
nir_cf_node_as_block(exec_node_data(nir_cf_node, head, node));
|
||||
return exec_list_is_empty(&block->instr_list);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
uint8_t num_components;
|
||||
uint8_t bit_size;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue