mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 15:00:10 +01:00
radeonsi: sample shading state fixes
- really update sample shading state when it's changed - reduce log state bits in the shader key to 2 because we don't support 16x EQAA - exit early from si_update_ps_iter_samples if ps_iter_sample has the same value since the last call - set missing wqm for the PS prolog (this might fix tests) Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33024>
This commit is contained in:
parent
1026402b7c
commit
b1fc34f290
6 changed files with 20 additions and 11 deletions
|
|
@ -468,7 +468,7 @@ static void si_blit_decompress_color(struct si_context *sctx, struct si_texture
|
|||
/* DCC_DECOMPRESS and ELIMINATE_FAST_CLEAR require MSAA_NUM_SAMPLES=0. */
|
||||
if (sctx->gfx_level >= GFX11) {
|
||||
sctx->gfx11_force_msaa_num_samples_zero = true;
|
||||
si_mark_atom_dirty(sctx, &sctx->atoms.s.msaa_config);
|
||||
si_update_ps_iter_samples(sctx);
|
||||
}
|
||||
|
||||
assert(vi_dcc_enabled(tex, first_level));
|
||||
|
|
@ -555,7 +555,7 @@ static void si_blit_decompress_color(struct si_context *sctx, struct si_texture
|
|||
/* Restore gfx11_force_msaa_num_samples_zero. */
|
||||
if (sctx->gfx11_force_msaa_num_samples_zero) {
|
||||
sctx->gfx11_force_msaa_num_samples_zero = false;
|
||||
si_mark_atom_dirty(sctx, &sctx->atoms.s.msaa_config);
|
||||
si_update_ps_iter_samples(sctx);
|
||||
}
|
||||
|
||||
expand_fmask:
|
||||
|
|
|
|||
|
|
@ -1140,7 +1140,8 @@ struct si_context {
|
|||
struct si_resource *last_const_upload_buffer;
|
||||
|
||||
/* MSAA config state. */
|
||||
int ps_iter_samples;
|
||||
uint8_t ps_iter_samples;
|
||||
uint8_t last_ps_iter_samples;
|
||||
bool ps_uses_fbfetch;
|
||||
bool smoothing_enabled;
|
||||
|
||||
|
|
|
|||
|
|
@ -3307,7 +3307,8 @@ static void si_get_ps_prolog_key(struct si_shader *shader, union si_shader_part_
|
|||
key->ps_prolog.states.force_linear_sample_interp ||
|
||||
key->ps_prolog.states.force_persp_center_interp ||
|
||||
key->ps_prolog.states.force_linear_center_interp ||
|
||||
key->ps_prolog.states.bc_optimize_for_persp || key->ps_prolog.states.bc_optimize_for_linear);
|
||||
key->ps_prolog.states.bc_optimize_for_persp || key->ps_prolog.states.bc_optimize_for_linear ||
|
||||
key->ps_prolog.states.samplemask_log_ps_iter);
|
||||
key->ps_prolog.num_fragcoord_components = shader->info.num_fragcoord_components;
|
||||
|
||||
if (shader->key.ps.part.prolog.poly_stipple)
|
||||
|
|
|
|||
|
|
@ -671,7 +671,7 @@ struct si_ps_prolog_bits {
|
|||
unsigned force_linear_center_interp : 1;
|
||||
unsigned bc_optimize_for_persp : 1;
|
||||
unsigned bc_optimize_for_linear : 1;
|
||||
unsigned samplemask_log_ps_iter : 3;
|
||||
unsigned samplemask_log_ps_iter : 2;
|
||||
};
|
||||
|
||||
/* Common PS bits between the shader key and the epilog key. */
|
||||
|
|
|
|||
|
|
@ -2786,6 +2786,7 @@ static void si_set_framebuffer_state(struct pipe_context *ctx,
|
|||
si_ps_key_update_framebuffer(sctx);
|
||||
si_ps_key_update_framebuffer_blend_dsa_rasterizer(sctx);
|
||||
si_ps_key_update_framebuffer_rasterizer_sample_shading(sctx);
|
||||
si_ps_key_update_sample_shading(sctx);
|
||||
si_vs_ps_key_update_rast_prim_smooth_stipple(sctx);
|
||||
si_update_ps_inputs_read_or_disabled(sctx);
|
||||
si_update_vrs_flat_shading(sctx);
|
||||
|
|
@ -3607,6 +3608,11 @@ static void si_emit_msaa_config(struct si_context *sctx, unsigned index)
|
|||
|
||||
void si_update_ps_iter_samples(struct si_context *sctx)
|
||||
{
|
||||
if (sctx->ps_iter_samples == sctx->last_ps_iter_samples)
|
||||
return;
|
||||
|
||||
sctx->last_ps_iter_samples = sctx->ps_iter_samples;
|
||||
si_ps_key_update_sample_shading(sctx);
|
||||
if (sctx->framebuffer.nr_samples > 1)
|
||||
si_mark_atom_dirty(sctx, &sctx->atoms.s.msaa_config);
|
||||
if (sctx->screen->dpbb_allowed)
|
||||
|
|
@ -3625,7 +3631,6 @@ static void si_set_min_samples(struct pipe_context *ctx, unsigned min_samples)
|
|||
|
||||
sctx->ps_iter_samples = min_samples;
|
||||
|
||||
si_ps_key_update_sample_shading(sctx);
|
||||
si_ps_key_update_framebuffer_rasterizer_sample_shading(sctx);
|
||||
sctx->do_update_shaders = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -2811,15 +2811,17 @@ void si_ps_key_update_dsa(struct si_context *sctx)
|
|||
void si_ps_key_update_sample_shading(struct si_context *sctx)
|
||||
{
|
||||
struct si_shader_selector *sel = sctx->shader.ps.cso;
|
||||
union si_shader_key *key = &sctx->shader.ps.key;
|
||||
|
||||
if (!sel)
|
||||
return;
|
||||
|
||||
if (sctx->ps_iter_samples > 1 && sel->info.reads_samplemask)
|
||||
key->ps.part.prolog.samplemask_log_ps_iter = util_logbase2(sctx->ps_iter_samples);
|
||||
else
|
||||
union si_shader_key *key = &sctx->shader.ps.key;
|
||||
unsigned ps_iter_samples = si_get_ps_iter_samples(sctx);
|
||||
|
||||
if (ps_iter_samples > 1 && sel->info.reads_samplemask) {
|
||||
key->ps.part.prolog.samplemask_log_ps_iter = util_logbase2(ps_iter_samples);
|
||||
} else {
|
||||
key->ps.part.prolog.samplemask_log_ps_iter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void si_ps_key_update_framebuffer_rasterizer_sample_shading(struct si_context *sctx)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue