static void si_shader_dump_disassembly(struct si_screen *screen,
const struct si_shader_binary *binary,
- enum pipe_shader_type shader_type, unsigned wave_size,
+ gl_shader_stage stage, unsigned wave_size,
struct pipe_debug_callback *debug, const char *name,
FILE *file)
{
if (!ac_rtld_open(&rtld_binary, (struct ac_rtld_open_info){
.info = &screen->info,
- .shader_type = tgsi_processor_to_shader_stage(shader_type),
+ .shader_type = stage,
.wave_size = wave_size,
.num_parts = 1,
.elf_ptrs = &binary->elf_buffer,
const struct ac_shader_config *conf = &shader->config;
if (screen->options.debug_disassembly)
- si_shader_dump_disassembly(screen, &shader->binary, shader->selector->type,
+ si_shader_dump_disassembly(screen, &shader->binary, shader->selector->info.stage,
si_get_shader_wave_size(shader), debug, "main", NULL);
pipe_debug_message(debug, SHADER_INFO,
void si_shader_dump(struct si_screen *sscreen, struct si_shader *shader,
struct pipe_debug_callback *debug, FILE *file, bool check_debug_option)
{
- enum pipe_shader_type shader_type = shader->selector->type;
gl_shader_stage stage = shader->selector->info.stage;
if (!check_debug_option || si_can_dump_shader(sscreen, stage))
fprintf(file, "\n%s:\n", si_get_shader_name(shader));
if (shader->prolog)
- si_shader_dump_disassembly(sscreen, &shader->prolog->binary, shader_type, wave_size, debug,
+ si_shader_dump_disassembly(sscreen, &shader->prolog->binary, stage, wave_size, debug,
"prolog", file);
if (shader->previous_stage)
- si_shader_dump_disassembly(sscreen, &shader->previous_stage->binary, shader_type,
+ si_shader_dump_disassembly(sscreen, &shader->previous_stage->binary, stage,
wave_size, debug, "previous stage", file);
if (shader->prolog2)
- si_shader_dump_disassembly(sscreen, &shader->prolog2->binary, shader_type, wave_size,
+ si_shader_dump_disassembly(sscreen, &shader->prolog2->binary, stage, wave_size,
debug, "prolog2", file);
- si_shader_dump_disassembly(sscreen, &shader->binary, shader_type, wave_size, debug, "main",
+ si_shader_dump_disassembly(sscreen, &shader->binary, stage, wave_size, debug, "main",
file);
if (shader->epilog)
- si_shader_dump_disassembly(sscreen, &shader->epilog->binary, shader_type, wave_size, debug,
+ si_shader_dump_disassembly(sscreen, &shader->epilog->binary, stage, wave_size, debug,
"epilog", file);
fprintf(file, "\n");
}
const struct si_shader_info *info = &sel->info;
ctx->shader = shader;
- ctx->type = sel->type;
ctx->stage = sel->info.stage;
ctx->num_const_buffers = util_last_bit(info->const_buffers_declared);
return sel->nir;
} else if (sel->nir_binary) {
struct pipe_screen *screen = &sel->screen->b;
- const void *options = screen->get_compiler_options(screen, PIPE_SHADER_IR_NIR, sel->type);
+ const void *options = screen->get_compiler_options(screen, PIPE_SHADER_IR_NIR,
+ pipe_shader_type_from_mesa(sel->info.stage));
struct blob_reader blob_reader;
blob_reader_init(&blob_reader, sel->nir_binary, sel->nir_size);
/* Reset the shader context. */
ctx.shader = shader;
- ctx.type = PIPE_SHADER_TESS_CTRL;
ctx.stage = MESA_SHADER_TESS_CTRL;
si_build_wrapper_function(&ctx, parts + !vs_needs_prolog, 4 - !vs_needs_prolog,
/* Reset the shader context. */
ctx.shader = shader;
- ctx.type = PIPE_SHADER_GEOMETRY;
ctx.stage = MESA_SHADER_GEOMETRY;
/* Prepare the array of shader parts. */
shader.key.opt.ngg_culling & SI_NGG_CULL_GS_FAST_LAUNCH_ALL,
shader.key.opt.vs_as_prim_discard_cs));
ctx.shader = &shader;
- ctx.type = tgsi_processor_to_shader_stage(stage);
ctx.stage = stage;
build(&ctx, key);
key->ps_prolog.color_attr_index[i] = color[i];
- if (shader->key.part.ps.prolog.flatshade_colors && interp == TGSI_INTERPOLATE_COLOR)
- interp = TGSI_INTERPOLATE_CONSTANT;
+ if (shader->key.part.ps.prolog.flatshade_colors && interp == INTERP_MODE_COLOR)
+ interp = INTERP_MODE_FLAT;
switch (interp) {
- case TGSI_INTERPOLATE_CONSTANT:
+ case INTERP_MODE_FLAT:
key->ps_prolog.color_interp_vgpr_index[i] = -1;
break;
- case TGSI_INTERPOLATE_PERSPECTIVE:
- case TGSI_INTERPOLATE_COLOR:
+ case INTERP_MODE_SMOOTH:
+ case INTERP_MODE_COLOR:
/* Force the interpolation location for colors here. */
if (shader->key.part.ps.prolog.force_persp_sample_interp)
location = TGSI_INTERPOLATE_LOC_SAMPLE;
assert(0);
}
break;
- case TGSI_INTERPOLATE_LINEAR:
+ case INTERP_MODE_NOPERSPECTIVE:
/* Force the interpolation location for colors here. */
if (shader->key.part.ps.prolog.force_linear_sample_interp)
location = TGSI_INTERPOLATE_LOC_SAMPLE;