panfrost: Correct the type of sample_mask
authorAlyssa Rosenzweig <alyssa@collabora.com>
Fri, 14 May 2021 22:28:10 +0000 (18:28 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 18 May 2021 22:51:56 +0000 (22:51 +0000)
Let's not encode impossible masks.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>

src/gallium/drivers/panfrost/pan_cmdstream.c
src/gallium/drivers/panfrost/pan_context.h

index 406471e..4c08026 100644 (file)
@@ -600,7 +600,7 @@ panfrost_prepare_fs_state(struct panfrost_context *ctx,
 
         bool msaa = rast->multisample;
         state->multisample_misc.multisample_enable = msaa;
-        state->multisample_misc.sample_mask = (msaa ? ctx->sample_mask : ~0) & 0xFFFF;
+        state->multisample_misc.sample_mask = msaa ? ctx->sample_mask : 0xFFFF;
 
         state->multisample_misc.evaluate_per_sample =
                 msaa && (ctx->min_samples > 1);
index e7105f0..7401841 100644 (file)
@@ -187,7 +187,7 @@ struct panfrost_context {
         struct pipe_blend_color blend_color;
         struct panfrost_zsa_state *depth_stencil;
         struct pipe_stencil_ref stencil_ref;
-        unsigned sample_mask;
+        uint16_t sample_mask;
         unsigned min_samples;
 
         struct panfrost_query *cond_query;