start_time = get_time();
}
- if (unlikely(INTEL_DEBUG & DEBUG_CS))
- brw_dump_ir("compute", prog, &cs->base, &cp->program);
-
int st_index = -1;
if (INTEL_DEBUG & DEBUG_SHADER_TIME)
st_index = brw_get_shader_time_index(brw, prog, &cp->program, ST_CS);
prog_data.base.total_scratch,
scratch_ids_per_subslice * subslices);
- if (unlikely(INTEL_DEBUG & DEBUG_CS))
- fprintf(stderr, "\n");
-
brw_upload_cache(&brw->cache, BRW_CACHE_CS_PROG,
key, sizeof(*key),
program, program_size,
&prog_data.base.vue_map, outputs_written,
prog->SeparateShader);
- if (unlikely(INTEL_DEBUG & DEBUG_GS))
- brw_dump_ir("geometry", prog, gs, NULL);
-
int st_index = -1;
if (INTEL_DEBUG & DEBUG_SHADER_TIME)
st_index = brw_get_shader_time_index(brw, prog, NULL, ST_GS);
brw_add_texrect_params(prog);
+ bool debug_enabled =
+ (INTEL_DEBUG & intel_debug_flag_for_shader_stage(shader->Stage));
+
+ if (debug_enabled && shader->ir) {
+ fprintf(stderr, "GLSL IR for native %s shader %d:\n",
+ _mesa_shader_stage_to_string(shader->Stage), shProg->Name);
+ _mesa_print_ir(stderr, shader->ir, NULL);
+ fprintf(stderr, "\n\n");
+ }
+
prog->nir = brw_create_nir(brw, shProg, prog, (gl_shader_stage) stage,
compiler->scalar_stage[stage]);
}
void
-brw_dump_ir(const char *stage, struct gl_shader_program *shader_prog,
- struct gl_linked_shader *shader, struct gl_program *prog)
+brw_dump_arb_asm(const char *stage, struct gl_program *prog)
{
- if (shader_prog) {
- if (shader->ir) {
- fprintf(stderr,
- "GLSL IR for native %s shader %d:\n",
- stage, shader_prog->Name);
- _mesa_print_ir(stderr, shader->ir, NULL);
- fprintf(stderr, "\n\n");
- }
- } else {
- fprintf(stderr, "ARB_%s_program %d ir for native %s shader\n",
- stage, prog->Id, stage);
- _mesa_print_program(prog);
- }
+ fprintf(stderr, "ARB_%s_program %d ir for native %s shader\n",
+ stage, prog->Id, stage);
+ _mesa_print_program(prog);
}
void
brw_stage_prog_data_free(const void *prog_data);
void
-brw_dump_ir(const char *stage, struct gl_shader_program *shader_prog,
- struct gl_linked_shader *shader, struct gl_program *prog);
+brw_dump_arb_asm(const char *stage, struct gl_program *prog);
void brw_upload_tcs_prog(struct brw_context *brw);
void brw_tcs_populate_key(struct brw_context *brw,
}
}
- if (unlikely(INTEL_DEBUG & DEBUG_TCS) && tcs)
- brw_dump_ir("tessellation control", shader_prog, tcs, NULL);
-
int st_index = -1;
if (unlikely(INTEL_DEBUG & DEBUG_SHADER_TIME))
st_index = brw_get_shader_time_index(brw, shader_prog, NULL, ST_TCS);
&prog_data.base.base,
compiler->scalar_stage[MESA_SHADER_TESS_EVAL]);
- if (unlikely(INTEL_DEBUG & DEBUG_TES))
- brw_dump_ir("tessellation evaluation", shader_prog, tes, NULL);
-
int st_index = -1;
if (unlikely(INTEL_DEBUG & DEBUG_SHADER_TIME))
st_index = brw_get_shader_time_index(brw, shader_prog, NULL, ST_TES);
}
if (unlikely(INTEL_DEBUG & DEBUG_VS)) {
- brw_dump_ir("vertex", prog, vs ? &vs->base : NULL, &vp->program);
+ if (!prog)
+ brw_dump_arb_asm("vertex", &vp->program);
fprintf(stderr, "VS Output ");
brw_print_vue_map(stderr, &prog_data.base.vue_map);
} else {
brw_nir_setup_arb_uniforms(fp->program.nir, &fp->program,
&prog_data.base);
+
+ if (unlikely(INTEL_DEBUG & DEBUG_WM))
+ brw_dump_arb_asm("fragment", &fp->program);
}
if (unlikely(brw->perf_debug)) {
start_time = get_time();
}
- if (unlikely(INTEL_DEBUG & DEBUG_WM))
- brw_dump_ir("fragment", prog, fs ? &fs->base : NULL, &fp->program);
-
int st_index8 = -1, st_index16 = -1;
if (INTEL_DEBUG & DEBUG_SHADER_TIME) {
st_index8 = brw_get_shader_time_index(brw, prog, &fp->program, ST_FS8);
prog_data.base.total_scratch,
devinfo->max_wm_threads);
- if (unlikely(INTEL_DEBUG & DEBUG_WM))
+ if (unlikely((INTEL_DEBUG & DEBUG_WM) && !prog))
fprintf(stderr, "\n");
brw_upload_cache(&brw->cache, BRW_CACHE_FS_PROG,