vc4: Dump the TGSI before trying to convert it to NIR.
authorEric Anholt <eric@anholt.net>
Thu, 4 Aug 2016 20:30:10 +0000 (13:30 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 19 Aug 2016 20:11:36 +0000 (13:11 -0700)
In the case of debugging a crash in TTN, this is nice to have.

src/gallium/drivers/vc4/vc4_program.c

index 406910d08635d6cb9d7a9989eb96a7ce4feeb8ad..030643a1ca25ce2f117a99fa29a2a484158ba378 100644 (file)
@@ -2155,16 +2155,15 @@ vc4_shader_state_create(struct pipe_context *pctx,
 
         so->program_id = vc4->next_uncompiled_program_id++;
 
-        nir_shader *s = tgsi_to_nir(cso->tokens, &nir_options);
-
         if (vc4_debug & VC4_DEBUG_TGSI) {
-                fprintf(stderr, "%s prog %d TGSI:\n",
-                        gl_shader_stage_name(s->stage),
+                fprintf(stderr, "prog %d TGSI:\n",
                         so->program_id);
                 tgsi_dump(cso->tokens, 0);
                 fprintf(stderr, "\n");
         }
 
+        nir_shader *s = tgsi_to_nir(cso->tokens, &nir_options);
+
         NIR_PASS_V(s, nir_opt_global_to_local);
         NIR_PASS_V(s, nir_convert_to_ssa);
         NIR_PASS_V(s, nir_normalize_cubemap_coords);