Lines Matching refs:state

107 log_error(validate_state *state, const char *cond, const char *file, int line)  in log_error()  argument
111 if (state->instr) in log_error()
112 obj = state->instr; in log_error()
113 else if (state->var) in log_error()
114 obj = state->var; in log_error()
118 char *msg = ralloc_asprintf(state->errors, "error: %s (%s:%d)", in log_error()
121 _mesa_hash_table_insert(state->errors, obj, msg); in log_error()
124 #define validate_assert(state, cond) do { \ argument
126 log_error(state, #cond, __FILE__, __LINE__); \
129 static void validate_src(nir_src *src, validate_state *state,
133 validate_reg_src(nir_src *src, validate_state *state, in validate_reg_src() argument
136 validate_assert(state, src->reg.reg != NULL); in validate_reg_src()
139 entry = _mesa_hash_table_search(state->regs, src->reg.reg); in validate_reg_src()
140 validate_assert(state, entry); in validate_reg_src()
144 if (state->instr) { in validate_reg_src()
147 validate_assert(state, state->if_stmt); in validate_reg_src()
152 validate_assert(state, reg_state->where_defined == state->impl && in validate_reg_src()
158 validate_assert(state, src->reg.reg->bit_size == bit_size); in validate_reg_src()
160 validate_assert(state, src->reg.reg->num_components == num_components); in validate_reg_src()
163 validate_assert(state, (src->reg.reg->num_array_elems == 0 || in validate_reg_src()
168 validate_assert(state, src->reg.reg->num_array_elems != 0); in validate_reg_src()
169 validate_assert(state, (src->reg.indirect->is_ssa || in validate_reg_src()
172 validate_src(src->reg.indirect, state, 32, 1); in validate_reg_src()
177 validate_ssa_src(nir_src *src, validate_state *state, in validate_ssa_src() argument
180 validate_assert(state, src->ssa != NULL); in validate_ssa_src()
182 struct hash_entry *entry = _mesa_hash_table_search(state->ssa_defs, src->ssa); in validate_ssa_src()
184 validate_assert(state, entry); in validate_ssa_src()
191 validate_assert(state, def_state->where_defined == state->impl && in validate_ssa_src()
194 if (state->instr) { in validate_ssa_src()
197 validate_assert(state, state->if_stmt); in validate_ssa_src()
202 validate_assert(state, src->ssa->bit_size == bit_size); in validate_ssa_src()
204 validate_assert(state, src->ssa->num_components == num_components); in validate_ssa_src()
210 validate_src(nir_src *src, validate_state *state, in validate_src() argument
213 if (state->instr) in validate_src()
214 validate_assert(state, src->parent_instr == state->instr); in validate_src()
216 validate_assert(state, src->parent_if == state->if_stmt); in validate_src()
219 validate_ssa_src(src, state, bit_size, num_components); in validate_src()
221 validate_reg_src(src, state, bit_size, num_components); in validate_src()
225 validate_alu_src(nir_alu_instr *instr, unsigned index, validate_state *state) in validate_alu_src() argument
239 validate_assert(state, src->swizzle[i] < 4); in validate_alu_src()
242 validate_assert(state, src->swizzle[i] < num_components); in validate_alu_src()
245 validate_src(&src->src, state, 0, 0); in validate_alu_src()
249 validate_reg_dest(nir_reg_dest *dest, validate_state *state, in validate_reg_dest() argument
252 validate_assert(state, dest->reg != NULL); in validate_reg_dest()
254 validate_assert(state, dest->parent_instr == state->instr); in validate_reg_dest()
257 entry2 = _mesa_hash_table_search(state->regs, dest->reg); in validate_reg_dest()
259 validate_assert(state, entry2); in validate_reg_dest()
265 validate_assert(state, reg_state->where_defined == state->impl && in validate_reg_dest()
271 validate_assert(state, dest->reg->bit_size == bit_size); in validate_reg_dest()
273 validate_assert(state, dest->reg->num_components == num_components); in validate_reg_dest()
276 validate_assert(state, (dest->reg->num_array_elems == 0 || in validate_reg_dest()
281 validate_assert(state, dest->reg->num_array_elems != 0); in validate_reg_dest()
282 validate_assert(state, (dest->indirect->is_ssa || dest->indirect->reg.indirect == NULL) && in validate_reg_dest()
284 validate_src(dest->indirect, state, 32, 1); in validate_reg_dest()
289 validate_ssa_def(nir_ssa_def *def, validate_state *state) in validate_ssa_def() argument
291 validate_assert(state, def->index < state->impl->ssa_alloc); in validate_ssa_def()
292 validate_assert(state, !BITSET_TEST(state->ssa_defs_found, def->index)); in validate_ssa_def()
293 BITSET_SET(state->ssa_defs_found, def->index); in validate_ssa_def()
295 validate_assert(state, def->parent_instr == state->instr); in validate_ssa_def()
297 validate_assert(state, def->num_components <= 4); in validate_ssa_def()
302 ssa_def_validate_state *def_state = ralloc(state->ssa_defs, in validate_ssa_def()
304 def_state->where_defined = state->impl; in validate_ssa_def()
309 _mesa_hash_table_insert(state->ssa_defs, def, def_state); in validate_ssa_def()
313 validate_dest(nir_dest *dest, validate_state *state, in validate_dest() argument
318 validate_assert(state, dest->ssa.bit_size == bit_size); in validate_dest()
320 validate_assert(state, dest->ssa.num_components == num_components); in validate_dest()
321 validate_ssa_def(&dest->ssa, state); in validate_dest()
323 validate_reg_dest(&dest->reg, state, bit_size, num_components); in validate_dest()
328 validate_alu_dest(nir_alu_instr *instr, validate_state *state) in validate_alu_dest() argument
340 validate_assert(state, is_packed || !(dest->write_mask & ~((1 << dest_size) - 1))); in validate_alu_dest()
345 nir_alu_instr *alu = nir_instr_as_alu(state->instr); in validate_alu_dest()
346 validate_assert(state, in validate_alu_dest()
351 validate_dest(&dest->dest, state, 0, 0); in validate_alu_dest()
355 validate_alu_instr(nir_alu_instr *instr, validate_state *state) in validate_alu_instr() argument
357 validate_assert(state, instr->op < nir_num_opcodes); in validate_alu_instr()
364 validate_assert(state, src_bit_size == nir_alu_type_get_type_size(src_type)); in validate_alu_instr()
366 validate_assert(state, src_bit_size == instr_bit_size); in validate_alu_instr()
373 validate_assert(state, src_bit_size == 16 || src_bit_size == 32 || in validate_alu_instr()
377 validate_alu_src(instr, i, state); in validate_alu_instr()
383 validate_assert(state, dest_bit_size == nir_alu_type_get_type_size(dest_type)); in validate_alu_instr()
385 validate_assert(state, dest_bit_size == instr_bit_size); in validate_alu_instr()
392 validate_assert(state, dest_bit_size == 16 || dest_bit_size == 32 || in validate_alu_instr()
396 validate_alu_dest(instr, state); in validate_alu_instr()
401 validate_state *state) in validate_deref_chain() argument
403 validate_assert(state, deref->child == NULL || ralloc_parent(deref->child) == deref); in validate_deref_chain()
414 validate_assert(state, glsl_type_is_array(parent->type) || in validate_deref_chain()
419 validate_assert(state, glsl_type_is_array(parent->type) || in validate_deref_chain()
422 validate_assert(state, deref->type == glsl_get_array_element(parent->type)); in validate_deref_chain()
425 validate_src(&nir_deref_as_array(deref)->indirect, state, 32, 1); in validate_deref_chain()
430 validate_assert(state, deref->type == in validate_deref_chain()
439 validate_assert(state, !"Invalid deref type"); in validate_deref_chain()
449 validate_var_use(nir_variable *var, validate_state *state) in validate_var_use() argument
452 struct hash_entry *entry = _mesa_hash_table_search(state->var_defs, var); in validate_var_use()
454 validate_assert(state, entry); in validate_var_use()
455 validate_assert(state, (nir_function_impl *) entry->data == state->impl); in validate_var_use()
460 validate_deref_var(void *parent_mem_ctx, nir_deref_var *deref, validate_state *state) in validate_deref_var() argument
462 validate_assert(state, deref != NULL); in validate_deref_var()
463 validate_assert(state, ralloc_parent(deref) == parent_mem_ctx); in validate_deref_var()
464 validate_assert(state, deref->deref.type == deref->var->type); in validate_deref_var()
466 validate_var_use(deref->var, state); in validate_deref_var()
468 validate_deref_chain(&deref->deref, deref->var->data.mode, state); in validate_deref_var()
472 validate_intrinsic_instr(nir_intrinsic_instr *instr, validate_state *state) in validate_intrinsic_instr() argument
489 validate_assert(state, components_read > 0); in validate_intrinsic_instr()
491 validate_src(&instr->src[i], state, bit_size, components_read); in validate_intrinsic_instr()
496 validate_deref_var(instr, instr->variables[i], state); in validate_intrinsic_instr()
505 validate_assert(state, components_written > 0); in validate_intrinsic_instr()
507 validate_dest(&instr->dest, state, bit_size, components_written); in validate_intrinsic_instr()
514 validate_assert(state, glsl_type_is_vector_or_scalar(type) || in validate_intrinsic_instr()
517 validate_assert(state, instr->num_components == glsl_get_vector_elements(type)); in validate_intrinsic_instr()
523 validate_assert(state, glsl_type_is_vector_or_scalar(type) || in validate_intrinsic_instr()
526 validate_assert(state, instr->num_components == glsl_get_vector_elements(type)); in validate_intrinsic_instr()
527 validate_assert(state, instr->variables[0]->var->data.mode != nir_var_shader_in && in validate_intrinsic_instr()
530 …validate_assert(state, (nir_intrinsic_write_mask(instr) & ~((1 << instr->num_components) - 1)) == … in validate_intrinsic_instr()
534 validate_assert(state, nir_deref_tail(&instr->variables[0]->deref)->type == in validate_intrinsic_instr()
536 validate_assert(state, instr->variables[0]->var->data.mode != nir_var_shader_in && in validate_intrinsic_instr()
546 validate_tex_instr(nir_tex_instr *instr, validate_state *state) in validate_tex_instr() argument
553 validate_assert(state, !src_type_seen[instr->src[i].src_type]); in validate_tex_instr()
555 validate_src(&instr->src[i].src, state, in validate_tex_instr()
560 validate_deref_var(instr, instr->texture, state); in validate_tex_instr()
563 validate_deref_var(instr, instr->sampler, state); in validate_tex_instr()
565 validate_dest(&instr->dest, state, 0, nir_tex_instr_dest_size(instr)); in validate_tex_instr()
569 validate_call_instr(nir_call_instr *instr, validate_state *state) in validate_call_instr() argument
572 validate_assert(state, glsl_type_is_void(instr->callee->return_type)); in validate_call_instr()
574 validate_assert(state, instr->return_deref->deref.type == instr->callee->return_type); in validate_call_instr()
575 validate_deref_var(instr, instr->return_deref, state); in validate_call_instr()
578 validate_assert(state, instr->num_params == instr->callee->num_params); in validate_call_instr()
581 validate_assert(state, instr->callee->params[i].type == instr->params[i]->deref.type); in validate_call_instr()
582 validate_deref_var(instr, instr->params[i], state); in validate_call_instr()
587 validate_load_const_instr(nir_load_const_instr *instr, validate_state *state) in validate_load_const_instr() argument
589 validate_ssa_def(&instr->def, state); in validate_load_const_instr()
593 validate_ssa_undef_instr(nir_ssa_undef_instr *instr, validate_state *state) in validate_ssa_undef_instr() argument
595 validate_ssa_def(&instr->def, state); in validate_ssa_undef_instr()
599 validate_phi_instr(nir_phi_instr *instr, validate_state *state) in validate_phi_instr() argument
606 validate_dest(&instr->dest, state, 0, 0); in validate_phi_instr()
609 validate_assert(state, exec_list_length(&instr->srcs) == in validate_phi_instr()
610 state->block->predecessors->entries); in validate_phi_instr()
614 validate_instr(nir_instr *instr, validate_state *state) in validate_instr() argument
616 validate_assert(state, instr->block == state->block); in validate_instr()
618 state->instr = instr; in validate_instr()
622 validate_alu_instr(nir_instr_as_alu(instr), state); in validate_instr()
626 validate_call_instr(nir_instr_as_call(instr), state); in validate_instr()
630 validate_intrinsic_instr(nir_instr_as_intrinsic(instr), state); in validate_instr()
634 validate_tex_instr(nir_instr_as_tex(instr), state); in validate_instr()
638 validate_load_const_instr(nir_instr_as_load_const(instr), state); in validate_instr()
642 validate_phi_instr(nir_instr_as_phi(instr), state); in validate_instr()
646 validate_ssa_undef_instr(nir_instr_as_ssa_undef(instr), state); in validate_instr()
653 validate_assert(state, !"Invalid ALU instruction type"); in validate_instr()
657 state->instr = NULL; in validate_instr()
661 validate_phi_src(nir_phi_instr *instr, nir_block *pred, validate_state *state) in validate_phi_src() argument
663 state->instr = &instr->instr; in validate_phi_src()
665 validate_assert(state, instr->dest.is_ssa); in validate_phi_src()
670 validate_assert(state, src->src.is_ssa); in validate_phi_src()
671 validate_src(&src->src, state, instr->dest.ssa.bit_size, in validate_phi_src()
673 state->instr = NULL; in validate_phi_src()
682 validate_phi_srcs(nir_block *block, nir_block *succ, validate_state *state) in validate_phi_srcs() argument
688 validate_phi_src(nir_instr_as_phi(instr), block, state); in validate_phi_srcs()
692 static void validate_cf_node(nir_cf_node *node, validate_state *state);
695 validate_block(nir_block *block, validate_state *state) in validate_block() argument
697 validate_assert(state, block->cf_node.parent == state->parent_node); in validate_block()
699 state->block = block; in validate_block()
704 validate_assert(state, instr == nir_block_first_instr(block) || in validate_block()
709 validate_assert(state, instr == nir_block_last_instr(block)); in validate_block()
712 validate_instr(instr, state); in validate_block()
715 validate_assert(state, block->successors[0] != NULL); in validate_block()
716 validate_assert(state, block->successors[0] != block->successors[1]); in validate_block()
722 validate_assert(state, entry); in validate_block()
724 validate_phi_srcs(block, block->successors[i], state); in validate_block()
731 validate_assert(state, pred->successors[0] == block || in validate_block()
737 validate_assert(state, block->successors[1] == NULL); in validate_block()
742 nir_cf_node_as_block(nir_cf_node_next(&state->loop->cf_node)); in validate_block()
743 validate_assert(state, block->successors[0] == after); in validate_block()
748 nir_block *first = nir_loop_first_block(state->loop); in validate_block()
749 validate_assert(state, block->successors[0] == first); in validate_block()
754 validate_assert(state, block->successors[0] == state->impl->end_block); in validate_block()
763 switch (state->parent_node->type) { in validate_block()
765 nir_block *first = nir_loop_first_block(state->loop); in validate_block()
766 validate_assert(state, block->successors[0] == first); in validate_block()
775 nir_cf_node_as_block(nir_cf_node_next(state->parent_node)); in validate_block()
776 validate_assert(state, block->successors[0] == after); in validate_block()
777 validate_assert(state, block->successors[1] == NULL); in validate_block()
782 validate_assert(state, block->successors[0] == state->impl->end_block); in validate_block()
783 validate_assert(state, block->successors[1] == NULL); in validate_block()
792 validate_assert(state, block->successors[0] == in validate_block()
794 validate_assert(state, block->successors[1] == in validate_block()
797 validate_assert(state, next->type == nir_cf_node_loop); in validate_block()
799 validate_assert(state, block->successors[0] == in validate_block()
801 validate_assert(state, block->successors[1] == NULL); in validate_block()
808 validate_if(nir_if *if_stmt, validate_state *state) in validate_if() argument
810 state->if_stmt = if_stmt; in validate_if()
812 validate_assert(state, !exec_node_is_head_sentinel(if_stmt->cf_node.node.prev)); in validate_if()
814 validate_assert(state, prev_node->type == nir_cf_node_block); in validate_if()
816 validate_assert(state, !exec_node_is_tail_sentinel(if_stmt->cf_node.node.next)); in validate_if()
818 validate_assert(state, next_node->type == nir_cf_node_block); in validate_if()
820 validate_src(&if_stmt->condition, state, 32, 1); in validate_if()
822 validate_assert(state, !exec_list_is_empty(&if_stmt->then_list)); in validate_if()
823 validate_assert(state, !exec_list_is_empty(&if_stmt->else_list)); in validate_if()
825 nir_cf_node *old_parent = state->parent_node; in validate_if()
826 state->parent_node = &if_stmt->cf_node; in validate_if()
830 validate_cf_node(cf_node, state); in validate_if()
835 validate_cf_node(cf_node, state); in validate_if()
838 state->parent_node = old_parent; in validate_if()
839 state->if_stmt = NULL; in validate_if()
843 validate_loop(nir_loop *loop, validate_state *state) in validate_loop() argument
845 validate_assert(state, !exec_node_is_head_sentinel(loop->cf_node.node.prev)); in validate_loop()
847 validate_assert(state, prev_node->type == nir_cf_node_block); in validate_loop()
849 validate_assert(state, !exec_node_is_tail_sentinel(loop->cf_node.node.next)); in validate_loop()
851 validate_assert(state, next_node->type == nir_cf_node_block); in validate_loop()
853 validate_assert(state, !exec_list_is_empty(&loop->body)); in validate_loop()
855 nir_cf_node *old_parent = state->parent_node; in validate_loop()
856 state->parent_node = &loop->cf_node; in validate_loop()
857 nir_loop *old_loop = state->loop; in validate_loop()
858 state->loop = loop; in validate_loop()
862 validate_cf_node(cf_node, state); in validate_loop()
865 state->parent_node = old_parent; in validate_loop()
866 state->loop = old_loop; in validate_loop()
870 validate_cf_node(nir_cf_node *node, validate_state *state) in validate_cf_node() argument
872 validate_assert(state, node->parent == state->parent_node); in validate_cf_node()
876 validate_block(nir_cf_node_as_block(node), state); in validate_cf_node()
880 validate_if(nir_cf_node_as_if(node), state); in validate_cf_node()
884 validate_loop(nir_cf_node_as_loop(node), state); in validate_cf_node()
893 prevalidate_reg_decl(nir_register *reg, bool is_global, validate_state *state) in prevalidate_reg_decl() argument
895 validate_assert(state, reg->is_global == is_global); in prevalidate_reg_decl()
898 validate_assert(state, reg->index < state->shader->reg_alloc); in prevalidate_reg_decl()
900 validate_assert(state, reg->index < state->impl->reg_alloc); in prevalidate_reg_decl()
901 validate_assert(state, !BITSET_TEST(state->regs_found, reg->index)); in prevalidate_reg_decl()
902 BITSET_SET(state->regs_found, reg->index); in prevalidate_reg_decl()
908 reg_validate_state *reg_state = ralloc(state->regs, reg_validate_state); in prevalidate_reg_decl()
916 reg_state->where_defined = is_global ? NULL : state->impl; in prevalidate_reg_decl()
918 _mesa_hash_table_insert(state->regs, reg, reg_state); in prevalidate_reg_decl()
922 postvalidate_reg_decl(nir_register *reg, validate_state *state) in postvalidate_reg_decl() argument
924 struct hash_entry *entry = _mesa_hash_table_search(state->regs, reg); in postvalidate_reg_decl()
931 validate_assert(state, entry); in postvalidate_reg_decl()
946 validate_assert(state, entry); in postvalidate_reg_decl()
961 validate_assert(state, entry); in postvalidate_reg_decl()
976 validate_var_decl(nir_variable *var, bool is_global, validate_state *state) in validate_var_decl() argument
978 state->var = var; in validate_var_decl()
980 validate_assert(state, is_global == nir_variable_is_global(var)); in validate_var_decl()
983 validate_assert(state, util_bitcount(var->data.mode) == 1); in validate_var_decl()
990 if (nir_is_per_vertex_io(var, state->shader->info.stage)) { in validate_var_decl()
1004 _mesa_hash_table_insert(state->var_defs, var, state->impl); in validate_var_decl()
1007 state->var = NULL; in validate_var_decl()
1013 validate_state *state = void_state; in postvalidate_ssa_def() local
1015 struct hash_entry *entry = _mesa_hash_table_search(state->ssa_defs, def); in postvalidate_ssa_def()
1022 validate_assert(state, entry); in postvalidate_ssa_def()
1037 validate_assert(state, entry); in postvalidate_ssa_def()
1054 validate_function_impl(nir_function_impl *impl, validate_state *state) in validate_function_impl() argument
1056 validate_assert(state, impl->function->impl == impl); in validate_function_impl()
1057 validate_assert(state, impl->cf_node.parent == NULL); in validate_function_impl()
1059 validate_assert(state, impl->num_params == impl->function->num_params); in validate_function_impl()
1061 validate_assert(state, impl->params[i]->type == impl->function->params[i].type); in validate_function_impl()
1062 validate_assert(state, impl->params[i]->data.mode == nir_var_param); in validate_function_impl()
1063 validate_assert(state, impl->params[i]->data.location == i); in validate_function_impl()
1064 validate_var_decl(impl->params[i], false, state); in validate_function_impl()
1068 validate_assert(state, impl->return_var == NULL); in validate_function_impl()
1070 validate_assert(state, impl->return_var->type == impl->function->return_type); in validate_function_impl()
1071 validate_assert(state, impl->return_var->data.mode == nir_var_param); in validate_function_impl()
1072 validate_assert(state, impl->return_var->data.location == -1); in validate_function_impl()
1073 validate_var_decl(impl->return_var, false, state); in validate_function_impl()
1076 validate_assert(state, exec_list_is_empty(&impl->end_block->instr_list)); in validate_function_impl()
1077 validate_assert(state, impl->end_block->successors[0] == NULL); in validate_function_impl()
1078 validate_assert(state, impl->end_block->successors[1] == NULL); in validate_function_impl()
1080 state->impl = impl; in validate_function_impl()
1081 state->parent_node = &impl->cf_node; in validate_function_impl()
1085 validate_var_decl(var, false, state); in validate_function_impl()
1088 state->regs_found = realloc(state->regs_found, in validate_function_impl()
1091 memset(state->regs_found, 0, BITSET_WORDS(impl->reg_alloc) * in validate_function_impl()
1095 prevalidate_reg_decl(reg, false, state); in validate_function_impl()
1098 state->ssa_defs_found = realloc(state->ssa_defs_found, in validate_function_impl()
1101 memset(state->ssa_defs_found, 0, BITSET_WORDS(impl->ssa_alloc) * in validate_function_impl()
1105 validate_cf_node(node, state); in validate_function_impl()
1109 postvalidate_reg_decl(reg, state); in validate_function_impl()
1114 nir_foreach_ssa_def(instr, postvalidate_ssa_def, state); in validate_function_impl()
1119 validate_function(nir_function *func, validate_state *state) in validate_function() argument
1122 validate_assert(state, func->impl->function == func); in validate_function()
1123 validate_function_impl(func->impl, state); in validate_function()
1128 init_validate_state(validate_state *state) in init_validate_state() argument
1130 state->regs = _mesa_hash_table_create(NULL, _mesa_hash_pointer, in init_validate_state()
1132 state->ssa_defs = _mesa_hash_table_create(NULL, _mesa_hash_pointer, in init_validate_state()
1134 state->ssa_defs_found = NULL; in init_validate_state()
1135 state->regs_found = NULL; in init_validate_state()
1136 state->var_defs = _mesa_hash_table_create(NULL, _mesa_hash_pointer, in init_validate_state()
1138 state->errors = _mesa_hash_table_create(NULL, _mesa_hash_pointer, in init_validate_state()
1141 state->loop = NULL; in init_validate_state()
1142 state->instr = NULL; in init_validate_state()
1143 state->var = NULL; in init_validate_state()
1147 destroy_validate_state(validate_state *state) in destroy_validate_state() argument
1149 _mesa_hash_table_destroy(state->regs, NULL); in destroy_validate_state()
1150 _mesa_hash_table_destroy(state->ssa_defs, NULL); in destroy_validate_state()
1151 free(state->ssa_defs_found); in destroy_validate_state()
1152 free(state->regs_found); in destroy_validate_state()
1153 _mesa_hash_table_destroy(state->var_defs, NULL); in destroy_validate_state()
1154 _mesa_hash_table_destroy(state->errors, NULL); in destroy_validate_state()
1158 dump_errors(validate_state *state) in dump_errors() argument
1160 struct hash_table *errors = state->errors; in dump_errors()
1164 nir_print_shader_annotated(state->shader, stderr, errors); in dump_errors()
1187 validate_state state; in nir_validate_shader() local
1188 init_validate_state(&state); in nir_validate_shader()
1190 state.shader = shader; in nir_validate_shader()
1194 validate_var_decl(var, true, &state); in nir_validate_shader()
1199 validate_var_decl(var, true, &state); in nir_validate_shader()
1204 validate_var_decl(var, true, &state); in nir_validate_shader()
1209 validate_var_decl(var, true, &state); in nir_validate_shader()
1214 validate_var_decl(var, true, &state); in nir_validate_shader()
1219 validate_var_decl(var, true, &state); in nir_validate_shader()
1222 state.regs_found = realloc(state.regs_found, in nir_validate_shader()
1225 memset(state.regs_found, 0, BITSET_WORDS(shader->reg_alloc) * in nir_validate_shader()
1229 prevalidate_reg_decl(reg, true, &state); in nir_validate_shader()
1234 validate_function(func, &state); in nir_validate_shader()
1238 postvalidate_reg_decl(reg, &state); in nir_validate_shader()
1241 if (_mesa_hash_table_num_entries(state.errors) > 0) in nir_validate_shader()
1242 dump_errors(&state); in nir_validate_shader()
1244 destroy_validate_state(&state); in nir_validate_shader()