static struct nir_shader *get_nir_shader(struct si_shader_selector *sel, bool *free_nir)
{
+ nir_shader *nir;
*free_nir = false;
if (sel->nir) {
- return sel->nir;
+ nir = sel->nir;
} else if (sel->nir_binary) {
struct pipe_screen *screen = &sel->screen->b;
const void *options = screen->get_compiler_options(screen, PIPE_SHADER_IR_NIR,
struct blob_reader blob_reader;
blob_reader_init(&blob_reader, sel->nir_binary, sel->nir_size);
*free_nir = true;
- return nir_deserialize(NULL, options, &blob_reader);
+ nir = nir_deserialize(NULL, options, &blob_reader);
+ } else {
+ return NULL;
}
- return NULL;
+
+ NIR_PASS_V(nir, nir_lower_bool_to_int32);
+
+ return nir;
}
static bool si_llvm_compile_shader(struct si_screen *sscreen, struct ac_llvm_compiler *compiler,
NIR_PASS_V(nir, nir_opt_cse);
}
- NIR_PASS_V(nir, nir_lower_bool_to_int32);
NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_function_temp, NULL);
if (sscreen->debug_flags & DBG(FS_CORRECT_DERIVS_AFTER_KILL))