mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 11:20:11 +01:00
radeonsi/gfx11: always set MSAA_NUM_SAMPLES=0 for DCC_DECOMPRESS
hw requirement Acked-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:
parent
8532cb8e7e
commit
a29218b557
3 changed files with 25 additions and 3 deletions
|
|
@ -467,6 +467,12 @@ static void si_blit_decompress_color(struct si_context *sctx, struct si_texture
|
||||||
if (need_dcc_decompress) {
|
if (need_dcc_decompress) {
|
||||||
custom_blend = sctx->custom_blend_dcc_decompress;
|
custom_blend = sctx->custom_blend_dcc_decompress;
|
||||||
|
|
||||||
|
/* 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);
|
||||||
|
}
|
||||||
|
|
||||||
assert(vi_dcc_enabled(tex, first_level));
|
assert(vi_dcc_enabled(tex, first_level));
|
||||||
|
|
||||||
/* disable levels without DCC */
|
/* disable levels without DCC */
|
||||||
|
|
@ -475,8 +481,10 @@ static void si_blit_decompress_color(struct si_context *sctx, struct si_texture
|
||||||
level_mask &= ~(1 << i);
|
level_mask &= ~(1 << i);
|
||||||
}
|
}
|
||||||
} else if (tex->surface.fmask_size) {
|
} else if (tex->surface.fmask_size) {
|
||||||
|
assert(sctx->gfx_level < GFX11);
|
||||||
custom_blend = sctx->custom_blend_fmask_decompress;
|
custom_blend = sctx->custom_blend_fmask_decompress;
|
||||||
} else {
|
} else {
|
||||||
|
assert(sctx->gfx_level < GFX11);
|
||||||
custom_blend = sctx->custom_blend_eliminate_fastclear;
|
custom_blend = sctx->custom_blend_eliminate_fastclear;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -542,6 +550,12 @@ static void si_blit_decompress_color(struct si_context *sctx, struct si_texture
|
||||||
si_make_CB_shader_coherent(sctx, tex->buffer.b.b.nr_samples, vi_dcc_enabled(tex, first_level),
|
si_make_CB_shader_coherent(sctx, tex->buffer.b.b.nr_samples, vi_dcc_enabled(tex, first_level),
|
||||||
tex->surface.u.gfx9.color.dcc.pipe_aligned);
|
tex->surface.u.gfx9.color.dcc.pipe_aligned);
|
||||||
|
|
||||||
|
/* 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);
|
||||||
|
}
|
||||||
|
|
||||||
expand_fmask:
|
expand_fmask:
|
||||||
if (need_fmask_expand && tex->surface.fmask_offset && !tex->fmask_is_identity) {
|
if (need_fmask_expand && tex->surface.fmask_offset && !tex->fmask_is_identity) {
|
||||||
assert(sctx->gfx_level < GFX11); /* no FMASK on gfx11 */
|
assert(sctx->gfx_level < GFX11); /* no FMASK on gfx11 */
|
||||||
|
|
|
||||||
|
|
@ -1006,13 +1006,14 @@ struct si_context {
|
||||||
unsigned wait_mem_number;
|
unsigned wait_mem_number;
|
||||||
uint16_t prefetch_L2_mask;
|
uint16_t prefetch_L2_mask;
|
||||||
|
|
||||||
bool blitter_running;
|
bool blitter_running:1;
|
||||||
bool suppress_update_ps_colorbuf0_slot;
|
bool suppress_update_ps_colorbuf0_slot:1;
|
||||||
bool is_noop:1;
|
bool is_noop:1;
|
||||||
bool has_graphics:1;
|
bool has_graphics:1;
|
||||||
bool gfx_flush_in_progress : 1;
|
bool gfx_flush_in_progress : 1;
|
||||||
bool gfx_last_ib_is_busy : 1;
|
bool gfx_last_ib_is_busy : 1;
|
||||||
bool compute_is_busy : 1;
|
bool compute_is_busy : 1;
|
||||||
|
bool gfx11_force_msaa_num_samples_zero:1;
|
||||||
int8_t pipeline_stats_enabled; /* -1 = unknown, 0 = disabled, 1 = enabled */
|
int8_t pipeline_stats_enabled; /* -1 = unknown, 0 = disabled, 1 = enabled */
|
||||||
|
|
||||||
unsigned num_gfx_cs_flushes;
|
unsigned num_gfx_cs_flushes;
|
||||||
|
|
@ -1914,6 +1915,9 @@ static inline bool vi_tc_compat_htile_enabled(struct si_texture *tex, unsigned l
|
||||||
|
|
||||||
static inline unsigned si_get_ps_iter_samples(struct si_context *sctx)
|
static inline unsigned si_get_ps_iter_samples(struct si_context *sctx)
|
||||||
{
|
{
|
||||||
|
if (sctx->gfx11_force_msaa_num_samples_zero)
|
||||||
|
return 1;
|
||||||
|
|
||||||
if (sctx->ps_uses_fbfetch)
|
if (sctx->ps_uses_fbfetch)
|
||||||
return sctx->framebuffer.nr_color_samples;
|
return sctx->framebuffer.nr_color_samples;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3824,6 +3824,10 @@ static void si_emit_msaa_config(struct si_context *sctx)
|
||||||
*/
|
*/
|
||||||
coverage_samples = si_get_num_coverage_samples(sctx);
|
coverage_samples = si_get_num_coverage_samples(sctx);
|
||||||
|
|
||||||
|
/* DCC_DECOMPRESS and ELIMINATE_FAST_CLEAR require MSAA_NUM_SAMPLES=0. */
|
||||||
|
if (sctx->gfx_level >= GFX11 && sctx->gfx11_force_msaa_num_samples_zero)
|
||||||
|
coverage_samples = 1;
|
||||||
|
|
||||||
/* The DX10 diamond test is not required by GL and decreases line rasterization
|
/* The DX10 diamond test is not required by GL and decreases line rasterization
|
||||||
* performance, so don't use it.
|
* performance, so don't use it.
|
||||||
*/
|
*/
|
||||||
|
|
@ -3857,7 +3861,7 @@ static void si_emit_msaa_config(struct si_context *sctx)
|
||||||
sctx->smoothing_enabled) {
|
sctx->smoothing_enabled) {
|
||||||
if (sctx->framebuffer.state.zsbuf) {
|
if (sctx->framebuffer.state.zsbuf) {
|
||||||
z_samples = sctx->framebuffer.state.zsbuf->texture->nr_samples;
|
z_samples = sctx->framebuffer.state.zsbuf->texture->nr_samples;
|
||||||
z_samples = MAX2(1, z_samples);
|
z_samples = MIN2(MAX2(1, z_samples), coverage_samples);
|
||||||
} else {
|
} else {
|
||||||
z_samples = coverage_samples;
|
z_samples = coverage_samples;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue