diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-07-15 11:38:39 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-07-15 22:19:37 +0000 |
commit | 8225604fd520de6cfbfcfbafccfa7f049a1c4355 (patch) | |
tree | efae140744b2f418b55f79412f95315cdedcb03e /src/gallium | |
parent | 080b751d4ac5a1eacc44f7cef4e772734b3c5c18 (diff) |
panfrost: Handle per-sample shading
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5929>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_cmdstream.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_context.c | 10 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_context.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_screen.c | 4 |
4 files changed, 19 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 9806f74a1e7..8fecdde0066 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -567,6 +567,10 @@ panfrost_frag_meta_rasterizer_update(struct panfrost_context *ctx, /* TODO: Sample size */ SET_BIT(fragmeta->unknown2_3, MALI_HAS_MSAA, msaa); SET_BIT(fragmeta->unknown2_4, MALI_NO_MSAA, !msaa); + + SET_BIT(fragmeta->unknown2_3, MALI_PER_SAMPLE, + msaa && ctx->min_samples > 1); + fragmeta->depth_units = rast->offset_units * 2.0f; fragmeta->depth_factor = rast->offset_scale; diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 6a0280ec533..4ae8ee31229 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -1203,6 +1203,15 @@ panfrost_set_sample_mask(struct pipe_context *pipe, } static void +panfrost_set_min_samples(struct pipe_context *pipe, + unsigned min_samples) +{ + struct panfrost_context *ctx = pan_context(pipe); + ctx->min_samples = min_samples; +} + + +static void panfrost_set_clip_state(struct pipe_context *pipe, const struct pipe_clip_state *clip) { @@ -1509,6 +1518,7 @@ panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags) gallium->delete_depth_stencil_alpha_state = panfrost_delete_depth_stencil_state; gallium->set_sample_mask = panfrost_set_sample_mask; + gallium->set_min_samples = panfrost_set_min_samples; gallium->set_clip_state = panfrost_set_clip_state; gallium->set_viewport_states = panfrost_set_viewport_states; diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h index 3e5c6d614ed..8e247091c40 100644 --- a/src/gallium/drivers/panfrost/pan_context.h +++ b/src/gallium/drivers/panfrost/pan_context.h @@ -164,6 +164,7 @@ struct panfrost_context { struct pipe_depth_stencil_alpha_state *depth_stencil; struct pipe_stencil_ref stencil_ref; unsigned sample_mask; + unsigned min_samples; }; /* Corresponds to the CSO */ diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index e22363ff533..b705c362594 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -122,6 +122,10 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param) case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS: return 1; + case PIPE_CAP_SAMPLE_SHADING: + /* WIP */ + return is_gl3 ? 1 : 0; + /* Throttling frames breaks pipelining */ case PIPE_CAP_THROTTLE: return 0; |