#include "brw_cfg.h"
#include "brw_dead_control_flow.h"
#include "brw_private.h"
+#include "shader_enums.h"
#include "dev/intel_debug.h"
#include "dev/intel_wa.h"
#include "compiler/glsl_types.h"
msg = ralloc_vasprintf(mem_ctx, format, va);
msg = ralloc_asprintf(mem_ctx, "SIMD%d %s compile failed: %s\n",
- dispatch_width, stage_abbrev, msg);
+ dispatch_width, _mesa_shader_stage_to_abbrev(stage), msg);
this->fail_msg = msg;
char *filename;
int ret = asprintf(&filename, "%s/%s%d-%s-%02d-%02d-%s",
debug_get_option("INTEL_SHADER_OPTIMIZER_PATH", "./"),
- stage_abbrev, dispatch_width, nir->info.name,
+ _mesa_shader_stage_to_abbrev(stage), dispatch_width, nir->info.name,
iteration, pass_num, pass_name);
if (ret == -1)
return;
"%s shader triggered register spilling. "
"Try reducing the number of live scalar "
"values to improve performance.\n",
- stage_name);
+ _mesa_shader_stage_to_string(stage));
}
/* This must come after all optimization and register allocation, since
#define fsv_assert(assertion) \
{ \
if (!(assertion)) { \
- fprintf(stderr, "ASSERT: Scalar %s validation failed!\n", stage_abbrev); \
+ fprintf(stderr, "ASSERT: Scalar %s validation failed!\n", \
+ _mesa_shader_stage_to_abbrev(stage)); \
dump_instruction(inst, stderr); \
fprintf(stderr, "%s:%d: '%s' failed\n", __FILE__, __LINE__, #assertion); \
abort(); \
unsigned f = (first); \
unsigned s = (second); \
if (f != s) { \
- fprintf(stderr, "ASSERT: Scalar %s validation failed!\n", stage_abbrev); \
+ fprintf(stderr, "ASSERT: Scalar %s validation failed!\n", \
+ _mesa_shader_stage_to_abbrev(stage)); \
dump_instruction(inst, stderr); \
fprintf(stderr, "%s:%d: A == B failed\n", __FILE__, __LINE__); \
fprintf(stderr, " A = %s = %u\n", #first, f); \
unsigned f = (first); \
unsigned s = (second); \
if (f == s) { \
- fprintf(stderr, "ASSERT: Scalar %s validation failed!\n", stage_abbrev); \
+ fprintf(stderr, "ASSERT: Scalar %s validation failed!\n", \
+ _mesa_shader_stage_to_abbrev(stage)); \
dump_instruction(inst, stderr); \
fprintf(stderr, "%s:%d: A != B failed\n", __FILE__, __LINE__); \
fprintf(stderr, " A = %s = %u\n", #first, f); \
unsigned f = (first); \
unsigned s = (second); \
if (f > s) { \
- fprintf(stderr, "ASSERT: Scalar %s validation failed!\n", stage_abbrev); \
+ fprintf(stderr, "ASSERT: Scalar %s validation failed!\n", \
+ _mesa_shader_stage_to_abbrev(stage)); \
dump_instruction(inst, stderr); \
fprintf(stderr, "%s:%d: A <= B failed\n", __FILE__, __LINE__); \
fprintf(stderr, " A = %s = %u\n", #first, f); \
stage(shader->info.stage),
debug_enabled(debug_enabled)
{
- stage_name = _mesa_shader_stage_to_string(stage);
- stage_abbrev = _mesa_shader_stage_to_abbrev(stage);
}
backend_shader::~backend_shader()
gl_shader_stage stage;
bool debug_enabled;
- const char *stage_name;
- const char *stage_abbrev;
brw::simple_allocator alloc;
if (INTEL_DEBUG(DEBUG_OPTIMIZER) && this_progress) { \
char filename[64]; \
snprintf(filename, 64, "%s-%s-%02d-%02d-" #pass, \
- stage_abbrev, nir->info.name, iteration, pass_num); \
+ _mesa_shader_stage_to_abbrev(stage), \
+ nir->info.name, iteration, pass_num); \
\
backend_shader::dump_instructions(filename); \
} \
if (INTEL_DEBUG(DEBUG_OPTIMIZER)) {
char filename[64];
snprintf(filename, 64, "%s-%s-00-00-start",
- stage_abbrev, nir->info.name);
+ _mesa_shader_stage_to_abbrev(stage), nir->info.name);
backend_shader::dump_instructions(filename);
}
"%s shader triggered register spilling. "
"Try reducing the number of live vec4 values "
"to improve performance.\n",
- stage_name);
+ _mesa_shader_stage_to_string(stage));
while (!reg_allocate()) {
if (failed)
va_start(va, format);
msg = ralloc_vasprintf(mem_ctx, format, va);
va_end(va);
- msg = ralloc_asprintf(mem_ctx, "%s compile failed: %s\n", stage_abbrev, msg);
+ msg = ralloc_asprintf(mem_ctx, "%s compile failed: %s\n",
+ _mesa_shader_stage_to_abbrev(stage), msg);
this->fail_msg = msg;