if (need_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));
/* disable levels without DCC */
level_mask &= ~(1 << i);
}
} else if (tex->surface.fmask_size) {
+ assert(sctx->gfx_level < GFX11);
custom_blend = sctx->custom_blend_fmask_decompress;
} else {
+ assert(sctx->gfx_level < GFX11);
custom_blend = sctx->custom_blend_eliminate_fastclear;
}
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);
+ /* 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:
if (need_fmask_expand && tex->surface.fmask_offset && !tex->fmask_is_identity) {
assert(sctx->gfx_level < GFX11); /* no FMASK on gfx11 */
unsigned wait_mem_number;
uint16_t prefetch_L2_mask;
- bool blitter_running;
- bool suppress_update_ps_colorbuf0_slot;
+ bool blitter_running:1;
+ bool suppress_update_ps_colorbuf0_slot:1;
bool is_noop:1;
bool has_graphics:1;
bool gfx_flush_in_progress : 1;
bool gfx_last_ib_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 */
unsigned num_gfx_cs_flushes;
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)
return sctx->framebuffer.nr_color_samples;
*/
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
* performance, so don't use it.
*/
sctx->smoothing_enabled) {
if (sctx->framebuffer.state.zsbuf) {
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 {
z_samples = coverage_samples;
}