aco: add support for remapping color attachments
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27263>
This commit is contained in:
committed by
Marge Bot
parent
39379e30db
commit
53a142ad23
@@ -12689,8 +12689,14 @@ select_ps_epilog(Program* program, void* pinfo, ac_shader_config* config,
|
||||
} else {
|
||||
for (unsigned i = 0; i < MAX_DRAW_BUFFERS; i++) {
|
||||
struct aco_export_mrt* mrt = &mrts[mrt_num];
|
||||
if (export_fs_mrt_color(&ctx, einfo, colors[i], i, mrt))
|
||||
const uint8_t cb_idx = einfo->color_map[i];
|
||||
|
||||
if (cb_idx == 0xff || !einfo->colors[cb_idx].used)
|
||||
continue;
|
||||
|
||||
if (export_fs_mrt_color(&ctx, einfo, colors[cb_idx], i, mrt)) {
|
||||
mrt->target += mrt_num++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ struct aco_vs_prolog_info {
|
||||
|
||||
struct aco_ps_epilog_info {
|
||||
struct ac_arg colors[MAX_DRAW_BUFFERS];
|
||||
uint8_t color_map[MAX_DRAW_BUFFERS];
|
||||
|
||||
uint32_t spi_shader_col_format;
|
||||
|
||||
|
||||
@@ -82,6 +82,8 @@ radv_aco_convert_ps_epilog_key(struct aco_ps_epilog_info *aco_info, const struct
|
||||
ASSIGN_FIELD(alpha_to_one);
|
||||
|
||||
memcpy(aco_info->colors, radv_args->colors, sizeof(aco_info->colors));
|
||||
for (uint32_t i = 0; i < MAX_RTS; i++)
|
||||
aco_info->color_map[i] = i;
|
||||
aco_info->depth = radv_args->depth;
|
||||
aco_info->stencil = radv_args->stencil;
|
||||
aco_info->samplemask = radv_args->sample_mask;
|
||||
|
||||
@@ -323,6 +323,7 @@ si_aco_build_ps_epilog(struct aco_compiler_options *options,
|
||||
.skip_null_export = options->gfx_level >= GFX10 && !key->ps_epilog.uses_discard,
|
||||
.broadcast_last_cbuf = key->ps_epilog.states.last_cbuf,
|
||||
.alpha_func = key->ps_epilog.states.alpha_func,
|
||||
.color_map = { 0, 1, 2, 3, 4, 5, 6, 7 },
|
||||
};
|
||||
|
||||
struct si_shader_args args;
|
||||
|
||||
Reference in New Issue
Block a user