+
+ if (!(rscreen->b.debug_flags & DBG_NIR)) {
+ assert(sel->ir_type == PIPE_SHADER_IR_TGSI);
+ r = r600_shader_from_tgsi(rctx, shader, key);
+ if (r) {
+ R600_ERR("translation from TGSI failed !\n");
+ goto error;
+ }
+ } else {
+ if (sel->ir_type == PIPE_SHADER_IR_TGSI)
+ sel->nir = tgsi_to_nir_noscreen(sel->tokens, &r600_nir_options);
+ nir_tgsi_scan_shader(sel->nir, &sel->info, true);
+ r = r600_shader_from_nir(rctx, shader, &key);
+ if (r) {
+ fprintf(stderr, "--Failed shader--------------------------------------------------\n");
+
+ if (sel->ir_type == PIPE_SHADER_IR_TGSI) {
+ fprintf(stderr, "--TGSI--------------------------------------------------------\n");
+ tgsi_dump(sel->tokens, 0);
+ }
+
+ if (rscreen->b.debug_flags & DBG_NIR) {
+ fprintf(stderr, "--NIR --------------------------------------------------------\n");
+ nir_print_shader(sel->nir, stderr);
+ }
+
+ R600_ERR("translation from NIR failed !\n");
+ goto error;
+ }
+ }
+