[Mesa-dev] [PATCH] st/mesa: dump TGSI before calling into the driver
Ilia Mirkin
imirkin at alum.mit.edu
Wed Aug 6 08:13:36 PDT 2014
On Wed, Aug 6, 2014 at 9:33 AM, Marek Olšák <maraeo at gmail.com> wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> If the driver crashes in create_xx_shader, you want to see the shader.
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
> src/mesa/state_tracker/st_program.c | 22 ++++++++++------------
> 1 file changed, 10 insertions(+), 12 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
> index 9d7b7c4..fbf8930 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;
> }
>
> --
> 1.9.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list