mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-16 14:50:42 +01:00
radeonsi: replace dual_src_blend_swizzle flag with dual_src_blend
We're going to be using this before GFX11 in some situations. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40005>
This commit is contained in:
parent
b4dc39f632
commit
bc66fd6af1
6 changed files with 8 additions and 11 deletions
|
|
@ -1017,7 +1017,7 @@ static void si_postprocess_nir(struct si_nir_shader_ctx *ctx)
|
|||
.bc_optimize_for_linear = key->ps.part.prolog.bc_optimize_for_linear,
|
||||
.uses_discard = shader->info.uses_discard,
|
||||
.alpha_to_coverage_via_mrtz = key->ps.part.epilog.alpha_to_coverage_via_mrtz,
|
||||
.dual_src_blend = key->ps.part.epilog.dual_src_blend_swizzle,
|
||||
.dual_src_blend = key->ps.part.epilog.dual_src_blend,
|
||||
.spi_shader_col_format = key->ps.part.epilog.spi_shader_col_format,
|
||||
.color_is_int8 = key->ps.part.epilog.color_is_int8,
|
||||
.color_is_int10 = key->ps.part.epilog.color_is_int10,
|
||||
|
|
|
|||
|
|
@ -552,7 +552,7 @@ struct si_ps_epilog_bits {
|
|||
unsigned alpha_to_one : 1;
|
||||
unsigned alpha_to_coverage_via_mrtz : 1; /* gfx11+ or alpha_to_one */
|
||||
unsigned clamp_color : 1;
|
||||
unsigned dual_src_blend_swizzle : 1; /* gfx11+ */
|
||||
unsigned dual_src_blend : 1;
|
||||
unsigned rbplus_depth_only_opt:1;
|
||||
unsigned kill_z:1;
|
||||
unsigned kill_stencil:1;
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ si_aco_build_ps_epilog(struct aco_compiler_options *options,
|
|||
.alpha_to_one = key->ps_epilog.states.alpha_to_one,
|
||||
.alpha_to_coverage_via_mrtz = key->ps_epilog.states.alpha_to_coverage_via_mrtz,
|
||||
.clamp_color = key->ps_epilog.states.clamp_color,
|
||||
.mrt0_is_dual_src = key->ps_epilog.states.dual_src_blend_swizzle,
|
||||
.mrt0_is_dual_src = key->ps_epilog.states.dual_src_blend,
|
||||
/* rbplus_depth_only_opt only affects registers, not the shader */
|
||||
.kill_depth = key->ps_epilog.states.kill_z,
|
||||
.kill_stencil = key->ps_epilog.states.kill_stencil,
|
||||
|
|
|
|||
|
|
@ -613,7 +613,7 @@ static void si_dump_shader_key(const struct si_shader *shader, FILE *f)
|
|||
fprintf(f, " epilog.alpha_to_one = %u\n", key->ps.part.epilog.alpha_to_one);
|
||||
fprintf(f, " epilog.alpha_to_coverage_via_mrtz = %u\n", key->ps.part.epilog.alpha_to_coverage_via_mrtz);
|
||||
fprintf(f, " epilog.clamp_color = %u\n", key->ps.part.epilog.clamp_color);
|
||||
fprintf(f, " epilog.dual_src_blend_swizzle = %u\n", key->ps.part.epilog.dual_src_blend_swizzle);
|
||||
fprintf(f, " epilog.dual_src_blend = %u\n", key->ps.part.epilog.dual_src_blend);
|
||||
fprintf(f, " epilog.rbplus_depth_only_opt = %u\n", key->ps.part.epilog.rbplus_depth_only_opt);
|
||||
fprintf(f, " epilog.kill_z = %u\n", key->ps.part.epilog.kill_z);
|
||||
fprintf(f, " epilog.kill_stencil = %u\n", key->ps.part.epilog.kill_stencil);
|
||||
|
|
|
|||
|
|
@ -176,9 +176,8 @@ static bool si_llvm_init_ps_export_args(struct si_shader_context *ctx, LLVMValue
|
|||
/* Specify the target we are exporting */
|
||||
args->target = V_008DFC_SQ_EXP_MRT + compacted_mrt_index;
|
||||
|
||||
if (key->ps.part.epilog.dual_src_blend_swizzle &&
|
||||
if (key->ps.part.epilog.dual_src_blend && ctx->ac.gfx_level >= GFX11 &&
|
||||
(compacted_mrt_index == 0 || compacted_mrt_index == 1)) {
|
||||
assert(ctx->ac.gfx_level >= GFX11);
|
||||
args->target += 21;
|
||||
}
|
||||
|
||||
|
|
@ -786,8 +785,7 @@ void si_llvm_build_ps_epilog(struct si_shader_context *ctx, union si_shader_part
|
|||
exp.args[exp.num - 1].valid_mask = 1; /* whether the EXEC mask is valid */
|
||||
exp.args[exp.num - 1].done = 1; /* DONE bit */
|
||||
|
||||
if (key->ps_epilog.states.dual_src_blend_swizzle) {
|
||||
assert(ctx->ac.gfx_level >= GFX11);
|
||||
if (key->ps_epilog.states.dual_src_blend && ctx->ac.gfx_level >= GFX11) {
|
||||
assert((key->ps_epilog.colors_written & 0x3) == 0x3);
|
||||
ac_build_dual_src_blend_swizzle(&ctx->ac, &exp.args[first_color_export],
|
||||
&exp.args[first_color_export + 1]);
|
||||
|
|
|
|||
|
|
@ -2669,9 +2669,8 @@ void si_ps_key_update_framebuffer_blend_dsa_rasterizer(struct si_context *sctx)
|
|||
sctx->framebuffer.spi_shader_col_format);
|
||||
key->ps.part.epilog.spi_shader_col_format &= blend->cb_target_enabled_4bit;
|
||||
|
||||
key->ps.part.epilog.dual_src_blend_swizzle = sctx->gfx_level >= GFX11 &&
|
||||
blend->dual_src_blend &&
|
||||
(sel->info.colors_written_4bit & 0xff) == 0xff;
|
||||
key->ps.part.epilog.dual_src_blend = sctx->gfx_level >= GFX11 && blend->dual_src_blend &&
|
||||
(sel->info.colors_written_4bit & 0xff) == 0xff;
|
||||
|
||||
/* The output for dual source blending should have
|
||||
* the same format as the first output.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue