From aee43b8cb009924c525f8a7ceab2223750b80bef Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 14 May 2021 18:27:02 -0400 Subject: [PATCH] panfrost: Preset evaluate_per_sample Even though this isn't totally known at compile-time, at least one case is, so let's handle that one ahead-of-time. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 3 +-- src/panfrost/lib/pan_shader.h | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 63ff8bdba04..406471e07d1 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -589,7 +589,6 @@ panfrost_prepare_fs_state(struct panfrost_context *ctx, struct MALI_RENDERER_STATE *state) { const struct panfrost_device *dev = pan_device(ctx->base.screen); - struct panfrost_shader_state *fs = panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT); struct pipe_rasterizer_state *rast = &ctx->rasterizer->base; const struct panfrost_zsa_state *zsa = ctx->depth_stencil; bool alpha_to_coverage = ctx->blend->base.alpha_to_coverage; @@ -604,7 +603,7 @@ panfrost_prepare_fs_state(struct panfrost_context *ctx, state->multisample_misc.sample_mask = (msaa ? ctx->sample_mask : ~0) & 0xFFFF; state->multisample_misc.evaluate_per_sample = - msaa && (ctx->min_samples > 1 || fs->info.fs.sample_shading); + msaa && (ctx->min_samples > 1); state->multisample_misc.fixed_function_near_discard = rast->depth_clip_near; state->multisample_misc.fixed_function_far_discard = rast->depth_clip_far; diff --git a/src/panfrost/lib/pan_shader.h b/src/panfrost/lib/pan_shader.h index 33f331a4fb1..dbaaebbe01a 100644 --- a/src/panfrost/lib/pan_shader.h +++ b/src/panfrost/lib/pan_shader.h @@ -185,6 +185,11 @@ pan_shader_prepare_rsd(const struct panfrost_device *dev, shader_info->fs.writes_depth ? MALI_DEPTH_SOURCE_SHADER : MALI_DEPTH_SOURCE_FIXED_FUNCTION; + + /* This also needs to be set if the API forces per-sample + * shading, but that'll just got ORed in */ + rsd->multisample_misc.evaluate_per_sample = + shader_info->fs.sample_shading; } else { rsd->properties.depth_source = MALI_DEPTH_SOURCE_FIXED_FUNCTION;