radeonsi: ignore pipe_rasterizer_state::force_persample_interp

It just indicates that sample shading is enabled, which we were
checking already. The state is redundant.

Just check shader_info::fs::uses_sample_shading. ARB_sample_shading (GL3.3)
doesn't set fs.uses_sample_shading in shader_info (which is for GL4.0), and
that's why we have this codepath that forces per-sample interpolation.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32910>
This commit is contained in:
Marek Olšák 2025-01-02 18:52:06 -05:00 committed by Marge Bot
parent 1ff790a4f8
commit 65398d571b
3 changed files with 4 additions and 4 deletions

View file

@ -979,7 +979,6 @@ static void *si_create_rs_state(struct pipe_context *ctx, const struct pipe_rast
rs->clip_halfz = state->clip_halfz;
rs->two_side = state->light_twoside;
rs->multisample_enable = state->multisample;
rs->force_persample_interp = state->force_persample_interp;
rs->clip_plane_enable = state->clip_plane_enable;
rs->half_pixel_center = state->half_pixel_center;
rs->line_stipple_enable = state->line_stipple_enable;
@ -1352,7 +1351,6 @@ static void si_bind_rs_state(struct pipe_context *ctx, void *state)
si_ps_key_update_rasterizer(sctx);
if (old_rs->flatshade != rs->flatshade ||
old_rs->force_persample_interp != rs->force_persample_interp ||
old_rs->multisample_enable != rs->multisample_enable)
si_ps_key_update_framebuffer_rasterizer_sample_shading(sctx);

View file

@ -84,7 +84,6 @@ struct si_state_rasterizer {
unsigned flatshade_first : 1;
unsigned two_side : 1;
unsigned multisample_enable : 1;
unsigned force_persample_interp : 1;
unsigned line_stipple_enable : 1;
unsigned poly_stipple_enable : 1;
unsigned line_smooth : 1;

View file

@ -2852,7 +2852,7 @@ void si_ps_key_update_framebuffer_rasterizer_sample_shading(struct si_context *s
bool uses_persp_sample = sel->info.uses_persp_sample ||
(!rs->flatshade && sel->info.uses_persp_sample_color);
if (rs->force_persample_interp && rs->multisample_enable &&
if (!sel->info.base.fs.uses_sample_shading && rs->multisample_enable &&
sctx->framebuffer.nr_samples > 1 && sctx->ps_iter_samples > 1) {
key->ps.part.prolog.force_persp_sample_interp =
uses_persp_center || uses_persp_centroid;
@ -2867,6 +2867,9 @@ void si_ps_key_update_framebuffer_rasterizer_sample_shading(struct si_context *s
key->ps.part.prolog.force_samplemask_to_helper_invocation = 0;
key->ps.mono.interpolate_at_sample_force_center = 0;
} else if (rs->multisample_enable && sctx->framebuffer.nr_samples > 1) {
/* Note that sample shading is possible here. If it's enabled, all barycentrics are
* already set to "sample" except at_offset/at_sample.
*/
key->ps.part.prolog.force_persp_sample_interp = 0;
key->ps.part.prolog.force_linear_sample_interp = 0;
key->ps.part.prolog.force_persp_center_interp = 0;