radeonsi: merge si_ps_key_update_framebuffer_blend & .._update_blend_rasterizer

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
This commit is contained in:
Marek Olšák
2023-01-25 01:10:41 -05:00
committed by Marge Bot
parent a29218b557
commit f2923168ba
3 changed files with 12 additions and 25 deletions
+3 -4
View File
@@ -755,8 +755,7 @@ static void si_bind_blend_state(struct pipe_context *ctx, void *state)
old_blend->dual_src_blend != blend->dual_src_blend ||
old_blend->blend_enable_4bit != blend->blend_enable_4bit ||
old_blend->need_src_alpha_4bit != blend->need_src_alpha_4bit) {
si_ps_key_update_framebuffer_blend(sctx);
si_ps_key_update_blend_rasterizer(sctx);
si_ps_key_update_framebuffer_blend_rasterizer(sctx);
si_update_ps_inputs_read_or_disabled(sctx);
sctx->do_update_shaders = true;
}
@@ -1214,7 +1213,7 @@ static void si_bind_rs_state(struct pipe_context *ctx, void *state)
old_rs->clamp_fragment_color != rs->clamp_fragment_color ||
old_rs->force_persample_interp != rs->force_persample_interp ||
old_rs->polygon_mode_is_points != rs->polygon_mode_is_points) {
si_ps_key_update_blend_rasterizer(sctx);
si_ps_key_update_framebuffer_blend_rasterizer(sctx);
si_ps_key_update_rasterizer(sctx);
si_ps_key_update_framebuffer_rasterizer_sample_shading(sctx);
si_update_ps_inputs_read_or_disabled(sctx);
@@ -3195,7 +3194,7 @@ static void si_set_framebuffer_state(struct pipe_context *ctx,
}
si_ps_key_update_framebuffer(sctx);
si_ps_key_update_framebuffer_blend(sctx);
si_ps_key_update_framebuffer_blend_rasterizer(sctx);
si_ps_key_update_framebuffer_rasterizer_sample_shading(sctx);
si_update_ps_inputs_read_or_disabled(sctx);
sctx->do_update_shaders = true;
+1 -2
View File
@@ -589,8 +589,7 @@ void si_update_vrs_flat_shading(struct si_context *sctx);
unsigned si_get_input_prim(const struct si_shader_selector *gs, const union si_shader_key *key);
bool si_update_ngg(struct si_context *sctx);
void si_ps_key_update_framebuffer(struct si_context *sctx);
void si_ps_key_update_framebuffer_blend(struct si_context *sctx);
void si_ps_key_update_blend_rasterizer(struct si_context *sctx);
void si_ps_key_update_framebuffer_blend_rasterizer(struct si_context *sctx);
void si_ps_key_update_rasterizer(struct si_context *sctx);
void si_ps_key_update_dsa(struct si_context *sctx);
void si_ps_key_update_sample_shading(struct si_context *sctx);
@@ -2278,15 +2278,21 @@ void si_ps_key_update_framebuffer(struct si_context *sctx)
}
}
void si_ps_key_update_framebuffer_blend(struct si_context *sctx)
void si_ps_key_update_framebuffer_blend_rasterizer(struct si_context *sctx)
{
struct si_shader_selector *sel = sctx->shader.ps.cso;
union si_shader_key *key = &sctx->shader.ps.key;
struct si_state_blend *blend = sctx->queued.named.blend;
struct si_state_rasterizer *rs = sctx->queued.named.rasterizer;
if (!sel)
return;
key->ps.part.epilog.alpha_to_one = blend->alpha_to_one && rs->multisample_enable;
key->ps.part.epilog.alpha_to_coverage_via_mrtz =
sctx->gfx_level >= GFX11 && blend->alpha_to_coverage && rs->multisample_enable &&
(sel->info.writes_z || sel->info.writes_stencil || sel->info.writes_samplemask);
/* Select the shader color format based on whether
* blending or alpha are needed.
*/
@@ -2370,22 +2376,6 @@ void si_ps_key_update_framebuffer_blend(struct si_context *sctx)
key->ps.opt.prefer_mono = 0;
}
void si_ps_key_update_blend_rasterizer(struct si_context *sctx)
{
union si_shader_key *key = &sctx->shader.ps.key;
struct si_state_blend *blend = sctx->queued.named.blend;
struct si_state_rasterizer *rs = sctx->queued.named.rasterizer;
struct si_shader_selector *ps = sctx->shader.ps.cso;
if (!ps)
return;
key->ps.part.epilog.alpha_to_one = blend->alpha_to_one && rs->multisample_enable;
key->ps.part.epilog.alpha_to_coverage_via_mrtz =
sctx->gfx_level >= GFX11 && blend->alpha_to_coverage && rs->multisample_enable &&
(ps->info.writes_z || ps->info.writes_stencil || ps->info.writes_samplemask);
}
void si_ps_key_update_rasterizer(struct si_context *sctx)
{
struct si_shader_selector *sel = sctx->shader.ps.cso;
@@ -3626,8 +3616,7 @@ static void si_bind_ps_shader(struct pipe_context *ctx, void *state)
si_update_ps_colorbuf0_slot(sctx);
si_ps_key_update_framebuffer(sctx);
si_ps_key_update_framebuffer_blend(sctx);
si_ps_key_update_blend_rasterizer(sctx);
si_ps_key_update_framebuffer_blend_rasterizer(sctx);
si_ps_key_update_rasterizer(sctx);
si_ps_key_update_dsa(sctx);
si_ps_key_update_sample_shading(sctx);