summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-08-06 13:20:41 +0200
committerMarek Olšák <[email protected]>2014-08-09 23:41:15 +0200
commit88e0a2f88bcb25211a5292ee93e997cc8b73f6c1 (patch)
tree50c9c48181322821f6a13d48faba6e4d7b45519d /src/mesa
parenta2e1dc0cce3f5c4b94123a5fd4de42ecc988ab14 (diff)
st/mesa: dump TGSI before calling into the driver
If the driver crashes in create_xx_shader, you want to see the shader. Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_program.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 9d7b7c475a6..fbf8930cb8b 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -393,13 +393,12 @@ st_translate_vertex_program(struct st_context *st,
&vpv->tgsi.stream_output);
}
- vpv->driver_shader = pipe->create_vs_state(pipe, &vpv->tgsi);
-
if (ST_DEBUG & DEBUG_TGSI) {
- tgsi_dump( vpv->tgsi.tokens, 0 );
+ tgsi_dump(vpv->tgsi.tokens, 0);
debug_printf("\n");
}
+ vpv->driver_shader = pipe->create_vs_state(pipe, &vpv->tgsi);
return vpv;
fail:
@@ -804,15 +803,15 @@ st_translate_fragment_program(struct st_context *st,
variant->tgsi.tokens = ureg_get_tokens( ureg, NULL );
ureg_destroy( ureg );
- /* fill in variant */
- variant->driver_shader = pipe->create_fs_state(pipe, &variant->tgsi);
- variant->key = *key;
-
if (ST_DEBUG & DEBUG_TGSI) {
- tgsi_dump( variant->tgsi.tokens, 0/*TGSI_DUMP_VERBOSE*/ );
+ tgsi_dump(variant->tgsi.tokens, 0/*TGSI_DUMP_VERBOSE*/);
debug_printf("\n");
}
+ /* fill in variant */
+ variant->driver_shader = pipe->create_fs_state(pipe, &variant->tgsi);
+ variant->key = *key;
+
if (deleteFP) {
/* Free the temporary program made above */
struct gl_fragment_program *fp = &stfp->Base;
@@ -1173,10 +1172,6 @@ st_translate_geometry_program(struct st_context *st,
&stgp->tgsi.stream_output);
}
- /* fill in new variant */
- gpv->driver_shader = pipe->create_gs_state(pipe, &stgp->tgsi);
- gpv->key = *key;
-
if ((ST_DEBUG & DEBUG_TGSI) && (ST_DEBUG & DEBUG_MESA)) {
_mesa_print_program(&stgp->Base.Base);
debug_printf("\n");
@@ -1187,6 +1182,9 @@ st_translate_geometry_program(struct st_context *st,
debug_printf("\n");
}
+ /* fill in new variant */
+ gpv->driver_shader = pipe->create_gs_state(pipe, &stgp->tgsi);
+ gpv->key = *key;
return gpv;
}