}
}
-static inline const char *
-shader_stage_name(gl_shader_stage type)
-{
- /* NOTE these names are chosen to match the INTEL_DEBUG output
- * which frameretrace parses. Hurray accidental ABI!
- */
- switch (type) {
- case MESA_SHADER_VERTEX: return "vertex";
- case MESA_SHADER_TESS_CTRL: return "tessellation control";
- case MESA_SHADER_TESS_EVAL: return "tessellation evaluation";
- case MESA_SHADER_GEOMETRY: return "geometry";
- case MESA_SHADER_FRAGMENT: return "fragment";
- case MESA_SHADER_COMPUTE: return "compute";
- default:
- debug_assert(0);
- return NULL;
- }
-}
-
/* bitmask of debug flags */
enum debug_t {
PRINT_RAW = 0x1, /* dump raw hexdump */
if (shader_debug_enabled(so->type)) {
fprintf(stderr, "NIR (final form) for %s shader:\n",
- shader_stage_name(so->type));
+ _mesa_shader_stage_to_string(so->type));
nir_print_shader(ctx->s, stderr);
}
if (shader_debug_enabled(v->shader->type)) {
fprintf(stderr, "Native code for unnamed %s shader %s:\n",
- shader_stage_name(v->shader->type), v->shader->nir->info.name);
+ _mesa_shader_stage_to_string(v->shader->type),
+ v->shader->nir->info.name);
if (v->shader->type == MESA_SHADER_FRAGMENT)
fprintf(stderr, "SIMD0\n");
ir3_shader_disasm(v, bin, stderr);