mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
panfrost: Pass sample_mask to the hardware
Gallium computes it for us. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5782>
This commit is contained in:
parent
3e251328fa
commit
f23cdd4f72
3 changed files with 9 additions and 1 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue