#include "main/mtypes.h"
#include "util/hash_table.h"
#include "util/u_math.h"
+#include "util/perf/cpu_trace.h"
#include "nir.h"
#include "nir_builder.h"
unsigned first, last;
+ MESA_TRACE_FUNC();
+
first = MESA_SHADER_STAGES;
last = 0;
#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
{
bool progress;
+ MESA_TRACE_FUNC();
+
do {
progress = false;
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);
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];
if (prog->NumShaders == 0)
return true;
+ MESA_TRACE_FUNC();
+
if (!gl_nir_link_varyings(consts, exts, api, prog))
return false;
#include "main/mtypes.h"
#include "main/shaderobj.h"
#include "util/u_math.h"
+#include "util/perf/cpu_trace.h"
/*
* pass to lower GLSL IR to NIR
const struct gl_shader_compiler_options *gl_options =
&consts->ShaderCompilerOptions[stage];
+ MESA_TRACE_FUNC();
+
/* glsl_to_nir can only handle converting certain function paramaters
* to NIR. If we find something we can't handle then we get the GLSL IR
* opts to remove it before we continue on.
#include "util/u_debug.h"
#include "util/disk_cache.h"
#include "util/u_memory.h"
+#include "util/perf/cpu_trace.h"
#include "util/ralloc.h"
#include "pipe/p_screen.h"
{
struct nir_shader *nir = c->build.shader;
+ MESA_TRACE_FUNC();
+
NIR_PASS_V(nir, nir_lower_vars_to_ssa);
NIR_PASS_V(nir, nir_lower_regs_to_ssa);
#include "util/crc32.h"
#include "util/os_file.h"
#include "util/list.h"
+#include "util/perf/cpu_trace.h"
#include "util/u_process.h"
#include "util/u_string.h"
#include "api_exec_decl.h"
if (!shProg)
return;
+ MESA_TRACE_FUNC();
+
if (!no_error) {
/* From the ARB_transform_feedback2 specification:
* "The error INVALID_OPERATION is generated by LinkProgram if <program>
#include "compiler/glsl/linker.h"
#include "compiler/glsl/program.h"
#include "compiler/glsl/shader_cache.h"
+#include "util/perf/cpu_trace.h"
#include "state_tracker/st_glsl_to_ir.h"
unsigned int i;
bool spirv = false;
+ MESA_TRACE_FUNC();
+
_mesa_clear_shader_program_data(ctx, prog);
prog->data = _mesa_create_shader_program_data();
return GL_TRUE;
}
+ MESA_TRACE_FUNC();
+
assert(prog->data->LinkStatus);
/* Skip the GLSL steps when using SPIR-V. */
{
struct pipe_context *pctx = st_context(ctx)->pipe;
+ MESA_TRACE_FUNC();
+
GLboolean ret = link_shader(ctx, prog);
if (pctx->link_shader) {
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 (shader_program->_LinkedShaders[i])
linked_shader[num_shaders++] = shader_program->_LinkedShaders[i];
{
struct pipe_screen *screen = st->screen;
+ MESA_TRACE_FUNC();
+
NIR_PASS_V(nir, nir_split_var_copies);
NIR_PASS_V(nir, nir_lower_var_copies);
#include "st_context.h"
#include "compiler/shader_enums.h"
+#include "util/perf/cpu_trace.h"
#ifdef __cplusplus
extern "C" {
struct pipe_screen *screen = st->screen;
gl_shader_stage stage = nir->info.stage;
+ MESA_TRACE_FUNC();
+
nir->info.separate_shader = true;
if (stage == MESA_SHADER_FRAGMENT)
nir->info.fs.untyped_color_outputs = true;
struct gl_program *prog,
const struct st_common_variant_key *key)
{
+ MESA_TRACE_FUNC();
+
struct st_common_variant *v = CALLOC_STRUCT(st_common_variant);
struct pipe_shader_state state = {0};
if (!variant)
return NULL;
+ MESA_TRACE_FUNC();
+
/* Translate ATI_fs to NIR at variant time because that's when we have the
* texture types.
*/
struct gl_context *ctx = st->ctx;
bool is_bound = false;
+ MESA_TRACE_FUNC();
+
if (prog->info.stage == MESA_SHADER_VERTEX)
is_bound = prog == ctx->VertexProgram._Current;
else if (prog->info.stage == MESA_SHADER_TESS_CTRL)
#include "main/uniforms.h"
#include "pipe/p_shader_tokens.h"
#include "util/u_memory.h"
+#include "util/perf/cpu_trace.h"
void
st_get_program_binary_driver_sha1(struct gl_context *ctx, uint8_t *sha1)
size_t size = prog->driver_cache_blob_size;
uint8_t *buffer = (uint8_t *) prog->driver_cache_blob;
+ MESA_TRACE_FUNC();
+
st_set_prog_affected_state_flags(prog);
/* Avoid reallocation of the program parameter list, because the uniform