mesa/nir: Add some perfetto traces

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22646>
This commit is contained in:
Rob Clark
2023-03-16 11:30:21 -07:00
committed by Marge Bot
parent 15499250f2
commit f136f89487
12 changed files with 44 additions and 0 deletions

View File

@@ -30,6 +30,7 @@
#include "main/shaderobj.h"
#include "ir_uniform.h" /* for gl_uniform_storage */
#include "util/glheader.h"
#include "util/perf/cpu_trace.h"
/**
* This file included general link methods, using NIR, instead of IR as
@@ -41,6 +42,8 @@ gl_nir_opts(nir_shader *nir)
{
bool progress;
MESA_TRACE_FUNC();
do {
progress = false;
@@ -122,6 +125,8 @@ gl_nir_opts(nir_shader *nir)
static void
gl_nir_link_opts(nir_shader *producer, nir_shader *consumer)
{
MESA_TRACE_FUNC();
if (producer->options->lower_to_scalar) {
NIR_PASS_V(producer, nir_lower_io_to_scalar_early, nir_var_shader_out);
NIR_PASS_V(consumer, nir_lower_io_to_scalar_early, nir_var_shader_in);
@@ -761,6 +766,8 @@ gl_nir_link_spirv(const struct gl_constants *consts,
struct gl_linked_shader *linked_shader[MESA_SHADER_STAGES];
unsigned num_shaders = 0;
MESA_TRACE_FUNC();
for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
if (prog->_LinkedShaders[i])
linked_shader[num_shaders++] = prog->_LinkedShaders[i];
@@ -925,6 +932,8 @@ gl_nir_link_glsl(const struct gl_constants *consts,
if (prog->NumShaders == 0)
return true;
MESA_TRACE_FUNC();
if (!gl_nir_link_varyings(consts, exts, api, prog))
return false;