diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-07-02 10:07:08 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-07-07 01:13:39 +0000 |
commit | f23cdd4f72d1f2d48c5968ccb6f4a3525bf87c0e (patch) | |
tree | 22419d6249da866042f7bf7a90a015b4ff9c4b69 /src/gallium/drivers | |
parent | 3e251328fad5cc123cb40233faa51e0e7cbcf2be (diff) |
panfrost: Pass sample_mask to the hardware
Gallium computes it for us.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5782>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_cmdstream.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_context.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_context.h | 1 |
3 files changed, 9 insertions, 1 deletions
diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index d431afa45ae..f3a4633e69b 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -835,7 +835,9 @@ panfrost_frag_shader_meta_init(struct panfrost_context *ctx, fs = panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT); - fragmeta->coverage_mask = 0xFFFF; + bool msaa = ctx->rasterizer && ctx->rasterizer->base.multisample; + fragmeta->coverage_mask = (msaa ? ctx->sample_mask : ~0) & 0xF; + fragmeta->unknown2_3 = MALI_DEPTH_FUNC(MALI_FUNC_ALWAYS) | 0x10; fragmeta->unknown2_4 = 0x4e0; diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 5514e29a426..b96aef2a11e 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -1168,6 +1168,8 @@ static void panfrost_set_sample_mask(struct pipe_context *pipe, unsigned sample_mask) { + struct panfrost_context *ctx = pan_context(pipe); + ctx->sample_mask = sample_mask; } static void @@ -1526,5 +1528,8 @@ panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags) panfrost_batch_init(ctx); panfrost_invalidate_frame(ctx); + /* By default mask everything on */ + ctx->sample_mask = ~0; + return gallium; } diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h index f54e1631483..adf4adada97 100644 --- a/src/gallium/drivers/panfrost/pan_context.h +++ b/src/gallium/drivers/panfrost/pan_context.h @@ -163,6 +163,7 @@ struct panfrost_context { struct pipe_blend_color blend_color; struct pipe_depth_stencil_alpha_state *depth_stencil; struct pipe_stencil_ref stencil_ref; + unsigned sample_mask; }; /* Corresponds to the CSO */ |