nir_shader *shader = nir_shader_create(NULL, options);
- if (state) {
- shader->num_user_structures = state->num_user_structures;
- shader->user_structures = ralloc_array(shader, glsl_type *,
- shader->num_user_structures);
- memcpy(shader->user_structures, state->user_structures,
- shader->num_user_structures * sizeof(glsl_type *));
- } else {
- shader->num_user_structures = 0;
- shader->user_structures = NULL;
- }
-
nir_visitor v1(shader, native_integers);
nir_function_visitor v2(&v1);
v2.run(ir);
shader->options = options;
- shader->num_user_structures = 0;
- shader->user_structures = NULL;
-
exec_list_make_empty(&shader->functions);
exec_list_make_empty(&shader->registers);
exec_list_make_empty(&shader->globals);
/** list of global register in the shader */
struct exec_list registers;
- /** structures used in this shader */
- unsigned num_user_structures;
- struct glsl_type **user_structures;
-
/** next available global register index */
unsigned reg_alloc;
print_var_state state;
init_print_state(&state);
- for (unsigned i = 0; i < shader->num_user_structures; i++) {
- glsl_print_struct(shader->user_structures[i], fp);
- }
-
struct hash_entry *entry;
hash_table_foreach(shader->uniforms, entry) {