aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_state.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-05-15 22:04:20 -0400
committerMarek Olšák <[email protected]>2018-05-24 13:41:57 -0400
commit508b423dd6f08591a911f83e7a798027ab0021c0 (patch)
tree57e56930ed898cf83a8caea610082a61d3a4b924 /src/gallium/drivers/radeonsi/si_state.c
parent07e02c8617ebdc7e4a729676dbd93d63b77bcd9d (diff)
radeonsi: set DB_EQAA.MAX_ANCHOR_SAMPLES correctly
Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index f4e29f68b29..3a7e928df53 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -3340,7 +3340,7 @@ static void si_emit_msaa_config(struct si_context *sctx)
S_028804_INCOHERENT_EQAA_READS(1) |
S_028804_INTERPOLATE_COMP_Z(1) |
S_028804_STATIC_ANCHOR_ASSOCIATIONS(1);
- unsigned coverage_samples, color_samples;
+ unsigned coverage_samples, color_samples, z_samples;
/* S: Coverage samples (up to 16x):
* - Scan conversion samples (PA_SC_AA_CONFIG.MSAA_NUM_SAMPLES)
@@ -3386,10 +3386,17 @@ static void si_emit_msaa_config(struct si_context *sctx)
if (sctx->framebuffer.nr_samples > 1) {
coverage_samples = sctx->framebuffer.nr_samples;
color_samples = sctx->framebuffer.nr_color_samples;
+
+ if (sctx->framebuffer.state.zsbuf) {
+ z_samples = sctx->framebuffer.state.zsbuf->texture->nr_samples;
+ z_samples = MAX2(1, z_samples);
+ } else {
+ z_samples = coverage_samples;
+ }
} else if (sctx->smoothing_enabled) {
- coverage_samples = color_samples = SI_NUM_SMOOTH_AA_SAMPLES;
+ coverage_samples = color_samples = z_samples = SI_NUM_SMOOTH_AA_SAMPLES;
} else {
- coverage_samples = color_samples = 1;
+ coverage_samples = color_samples = z_samples = 1;
}
/* Required by OpenGL line rasterization.
@@ -3411,6 +3418,7 @@ static void si_emit_msaa_config(struct si_context *sctx)
8, /* 16x MSAA */
};
unsigned log_samples = util_logbase2(coverage_samples);
+ unsigned log_z_samples = util_logbase2(z_samples);
unsigned ps_iter_samples = si_get_ps_iter_samples(sctx);
unsigned log_ps_iter_samples = util_logbase2(ps_iter_samples);
@@ -3424,7 +3432,7 @@ static void si_emit_msaa_config(struct si_context *sctx)
if (sctx->framebuffer.nr_samples > 1) {
radeon_set_context_reg(cs, R_028804_DB_EQAA,
db_eqaa |
- S_028804_MAX_ANCHOR_SAMPLES(log_samples) |
+ S_028804_MAX_ANCHOR_SAMPLES(log_z_samples) |
S_028804_PS_ITER_SAMPLES(log_ps_iter_samples) |
S_028804_MASK_EXPORT_NUM_SAMPLES(log_samples) |
S_028804_ALPHA_TO_MASK_NUM_SAMPLES(log_samples));