struct gl_program *prog,
struct brw_vue_prog_data *prog_data,
void *mem_ctx,
- bool debug_flag);
+ bool debug_flag,
+ const char *stage_name,
+ const char *stage_abbrev);
~vec4_generator();
const unsigned *generate_assembly(const cfg_t *cfg, unsigned *asm_size);
struct brw_vue_prog_data *prog_data;
void *mem_ctx;
+ const char *stage_name;
+ const char *stage_abbrev;
const bool debug_flag;
};
* IN THE SOFTWARE.
*/
+#include <ctype.h>
#include "brw_vec4.h"
#include "brw_cfg.h"
struct gl_program *prog,
struct brw_vue_prog_data *prog_data,
void *mem_ctx,
- bool debug_flag)
+ bool debug_flag,
+ const char *stage_name,
+ const char *stage_abbrev)
: brw(brw), shader_prog(shader_prog), prog(prog), prog_data(prog_data),
- mem_ctx(mem_ctx), debug_flag(debug_flag)
+ mem_ctx(mem_ctx), stage_name(stage_name), stage_abbrev(stage_abbrev),
+ debug_flag(debug_flag)
{
p = rzalloc(mem_ctx, struct brw_compile);
brw_init_compile(brw, p, mem_ctx);
if (unlikely(debug_flag)) {
if (shader_prog) {
- fprintf(stderr, "Native code for %s vertex shader %d:\n",
+ fprintf(stderr, "Native code for %s %s shader %d:\n",
shader_prog->Label ? shader_prog->Label : "unnamed",
- shader_prog->Name);
+ stage_name, shader_prog->Name);
} else {
- fprintf(stderr, "Native code for vertex program %d:\n", prog->Id);
+ fprintf(stderr, "Native code for %s program %d:\n", prog->Id,
+ stage_name);
}
- fprintf(stderr, "vec4 shader: %d instructions. %d loops. Compacted %d to %d"
+ fprintf(stderr, "%s vec4 shader: %d instructions. %d loops. Compacted %d to %d"
" bytes (%.0f%%)\n",
+ stage_abbrev,
before_size / 16, loop_count, before_size, after_size,
100.0f * (before_size - after_size) / before_size);
MESA_DEBUG_SOURCE_SHADER_COMPILER,
MESA_DEBUG_TYPE_OTHER,
MESA_DEBUG_SEVERITY_NOTIFICATION,
- "VS vec4 shader: %d inst, %d loops, "
+ "%s vec4 shader: %d inst, %d loops, "
"compacted %d to %d bytes.\n",
+ stage_abbrev,
before_size / 16, loop_count,
before_size, after_size);
}