summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-05-15 22:03:40 -0400
committerMarek Olšák <[email protected]>2018-05-24 13:41:57 -0400
commit07e02c8617ebdc7e4a729676dbd93d63b77bcd9d (patch)
tree90d2da1c6bbe5673fdf98e8d921e1871031c6dc3 /src/gallium/drivers
parent510c88f9d14bf21d98429b05cd69396dff08e058 (diff)
radeonsi: round ps_iter_samples in set_min_samples
Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c6
-rw-r--r--src/gallium/drivers/radeonsi/si_state_shaders.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 5bbf134b706..f4e29f68b29 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -3412,8 +3412,7 @@ static void si_emit_msaa_config(struct si_context *sctx)
};
unsigned log_samples = util_logbase2(coverage_samples);
unsigned ps_iter_samples = si_get_ps_iter_samples(sctx);
- unsigned log_ps_iter_samples =
- util_logbase2(util_next_power_of_two(ps_iter_samples));
+ unsigned log_ps_iter_samples = util_logbase2(ps_iter_samples);
radeon_set_context_reg_seq(cs, R_028BDC_PA_SC_LINE_CNTL, 2);
radeon_emit(cs, sc_line_cntl |
@@ -3468,6 +3467,9 @@ static void si_set_min_samples(struct pipe_context *ctx, unsigned min_samples)
{
struct si_context *sctx = (struct si_context *)ctx;
+ /* The hardware can only do sample shading with 2^n samples. */
+ min_samples = util_next_power_of_two(min_samples);
+
if (sctx->ps_iter_samples == min_samples)
return;
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 2e215b91ce8..1b618502e85 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -1414,7 +1414,7 @@ static inline void si_shader_selector_key(struct pipe_context *ctx,
if (sctx->ps_iter_samples > 1 &&
sel->info.reads_samplemask) {
key->part.ps.prolog.samplemask_log_ps_iter =
- util_logbase2(util_next_power_of_two(sctx->ps_iter_samples));
+ util_logbase2(sctx->ps_iter_samples);
}
if (rs->force_persample_interp &&