mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
freedreno/ir3: More perfetto tracing
Some useful trace points that I had laying around. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22646>
This commit is contained in:
parent
d36643bef5
commit
15499250f2
7 changed files with 29 additions and 0 deletions
|
|
@ -30,6 +30,7 @@
|
|||
#include "compiler/nir/nir.h"
|
||||
#include "util/disk_cache.h"
|
||||
#include "util/log.h"
|
||||
#include "util/perf/cpu_trace.h"
|
||||
|
||||
#include "freedreno_dev_info.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -4230,6 +4230,8 @@ uses_store_output(struct ir3_shader_variant *so)
|
|||
static void
|
||||
emit_instructions(struct ir3_context *ctx)
|
||||
{
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
nir_function_impl *fxn = nir_shader_get_entrypoint(ctx->s);
|
||||
|
||||
/* some varying setup which can't be done in setup_input(): */
|
||||
|
|
@ -4576,6 +4578,8 @@ ir3_compile_shader_nir(struct ir3_compiler *compiler,
|
|||
int ret = 0, max_bary;
|
||||
bool progress;
|
||||
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
assert(!so->ir);
|
||||
|
||||
ctx = ir3_context_init(compiler, shader, so);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ struct ir3_context *
|
|||
ir3_context_init(struct ir3_compiler *compiler, struct ir3_shader *shader,
|
||||
struct ir3_shader_variant *so)
|
||||
{
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
struct ir3_context *ctx = rzalloc(NULL, struct ir3_context);
|
||||
|
||||
if (compiler->gen == 4) {
|
||||
|
|
|
|||
|
|
@ -87,6 +87,8 @@ ir3_nir_should_vectorize_mem(unsigned align_mul, unsigned align_offset,
|
|||
void
|
||||
ir3_optimize_loop(struct ir3_compiler *compiler, nir_shader *s)
|
||||
{
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
bool progress;
|
||||
unsigned lower_flrp = (s->options->lower_flrp16 ? 16 : 0) |
|
||||
(s->options->lower_flrp32 ? 32 : 0) |
|
||||
|
|
@ -325,6 +327,8 @@ ir3_nir_lower_array_sampler(nir_shader *shader)
|
|||
void
|
||||
ir3_finalize_nir(struct ir3_compiler *compiler, nir_shader *s)
|
||||
{
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
struct nir_lower_tex_options tex_options = {
|
||||
.lower_rect = 0,
|
||||
.lower_tg4_offsets = true,
|
||||
|
|
@ -462,6 +466,8 @@ ir3_nir_post_finalize(struct ir3_shader *shader)
|
|||
struct nir_shader *s = shader->nir;
|
||||
struct ir3_compiler *compiler = shader->compiler;
|
||||
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
NIR_PASS_V(s, nir_lower_io, nir_var_shader_in | nir_var_shader_out,
|
||||
ir3_glsl_type_size, nir_lower_io_lower_64bit_to_32);
|
||||
|
||||
|
|
@ -632,6 +638,8 @@ lower_ucp_vs(struct ir3_shader_variant *so)
|
|||
void
|
||||
ir3_nir_lower_variant(struct ir3_shader_variant *so, nir_shader *s)
|
||||
{
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
if (ir3_shader_debug & IR3_DBG_DISASM) {
|
||||
mesa_logi("----------------------");
|
||||
nir_log_shaderi(s);
|
||||
|
|
|
|||
|
|
@ -394,6 +394,8 @@ ir3_shader_get_variant(struct ir3_shader *shader,
|
|||
const struct ir3_shader_key *key, bool binning_pass,
|
||||
bool write_disasm, bool *created)
|
||||
{
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
mtx_lock(&shader->variants_lock);
|
||||
struct ir3_shader_variant *v = shader_variant(shader, key);
|
||||
|
||||
|
|
|
|||
|
|
@ -97,6 +97,8 @@ ir3_cache_lookup(struct ir3_cache *cache, const struct ir3_cache_key *key,
|
|||
return entry->data;
|
||||
}
|
||||
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
if (key->hs)
|
||||
assert(key->ds);
|
||||
|
||||
|
|
|
|||
|
|
@ -124,6 +124,8 @@ ir3_shader_variant(struct ir3_shader *shader, struct ir3_shader_key key,
|
|||
struct ir3_shader_variant *v;
|
||||
bool created = false;
|
||||
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
/* Some shader key values may not be used by a given ir3_shader (for
|
||||
* example, fragment shader saturates in the vertex shader), so clean out
|
||||
* those flags to avoid recompiling.
|
||||
|
|
@ -248,6 +250,8 @@ create_initial_variants_async(void *job, void *gdata, int thread_index)
|
|||
struct ir3_shader_state *hwcso = job;
|
||||
struct util_debug_callback debug = {};
|
||||
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
create_initial_variants(hwcso, &debug);
|
||||
}
|
||||
|
||||
|
|
@ -259,6 +263,8 @@ create_initial_compute_variants_async(void *job, void *gdata, int thread_index)
|
|||
struct util_debug_callback debug = {};
|
||||
static struct ir3_shader_key key; /* static is implicitly zeroed */
|
||||
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
ir3_shader_variant(shader, key, false, &debug);
|
||||
shader->initial_variants_done = true;
|
||||
}
|
||||
|
|
@ -450,6 +456,8 @@ ir3_get_shader(struct ir3_shader_state *hwcso)
|
|||
if (!hwcso)
|
||||
return NULL;
|
||||
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
struct ir3_shader *shader = hwcso->shader;
|
||||
perf_time (1000, "waited for %s:%s:%s variants",
|
||||
_mesa_shader_stage_to_abbrev(shader->type),
|
||||
|
|
@ -502,6 +510,8 @@ ir3_screen_finalize_nir(struct pipe_screen *pscreen, void *nir)
|
|||
{
|
||||
struct fd_screen *screen = fd_screen(pscreen);
|
||||
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
ir3_nir_lower_io_to_temporaries(nir);
|
||||
ir3_finalize_nir(screen->compiler, nir);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue