mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
trace: Dump NIR.
Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17107>
This commit is contained in:
parent
382c6d395c
commit
69fbcdb568
3 changed files with 26 additions and 0 deletions
|
|
@ -56,6 +56,7 @@
|
|||
#include "util/u_string.h"
|
||||
#include "util/u_math.h"
|
||||
#include "util/format/u_format.h"
|
||||
#include "compiler/nir/nir.h"
|
||||
|
||||
#include "tr_dump.h"
|
||||
#include "tr_screen.h"
|
||||
|
|
@ -647,3 +648,17 @@ void trace_dump_transfer_ptr(struct pipe_transfer *_transfer)
|
|||
trace_dump_null();
|
||||
}
|
||||
}
|
||||
|
||||
void trace_dump_nir(void *nir)
|
||||
{
|
||||
if (!dumping)
|
||||
return;
|
||||
|
||||
// NIR doesn't have a print to string function. Use CDATA and hope for the
|
||||
// best.
|
||||
if (stream) {
|
||||
fputs("<string><![CDATA[", stream);
|
||||
nir_print_shader(nir, stream);
|
||||
fputs("]]></string>", stream);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@ void trace_dump_ptr(const void *value);
|
|||
/* will turn a wrapped object into the real one and dump ptr */
|
||||
void trace_dump_surface_ptr(struct pipe_surface *_surface);
|
||||
void trace_dump_transfer_ptr(struct pipe_transfer *_transfer);
|
||||
void trace_dump_nir(void *nir);
|
||||
|
||||
void trace_dump_trigger_active(bool active);
|
||||
void trace_dump_check_trigger(void);
|
||||
|
|
|
|||
|
|
@ -276,6 +276,8 @@ void trace_dump_shader_state(const struct pipe_shader_state *state)
|
|||
|
||||
trace_dump_struct_begin("pipe_shader_state");
|
||||
|
||||
trace_dump_member(uint, state, type);
|
||||
|
||||
trace_dump_member_begin("tokens");
|
||||
if (state->tokens) {
|
||||
static char str[64 * 1024];
|
||||
|
|
@ -286,6 +288,14 @@ void trace_dump_shader_state(const struct pipe_shader_state *state)
|
|||
}
|
||||
trace_dump_member_end();
|
||||
|
||||
trace_dump_member_begin("ir");
|
||||
if (state->type == PIPE_SHADER_IR_NIR) {
|
||||
trace_dump_nir(state->ir.nir);
|
||||
} else {
|
||||
trace_dump_null();
|
||||
}
|
||||
trace_dump_member_end();
|
||||
|
||||
trace_dump_member_begin("stream_output");
|
||||
trace_dump_struct_begin("pipe_stream_output_info");
|
||||
trace_dump_member(uint, &state->stream_output, num_outputs);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue