diff options
author | Dave Airlie <[email protected]> | 2018-10-23 09:22:34 +1000 |
---|---|---|
committer | Erik Faye-Lund <[email protected]> | 2019-10-28 08:51:45 +0000 |
commit | 0c5f3e50aea46b1aa9456c40ac0607253fcd06cd (patch) | |
tree | 0cf95f9e0fbf6019d79ccbf3b03eca59a33c9493 /src/gallium | |
parent | dbf67e8a20219bfe08f30c1da94760ac706fa2e2 (diff) |
zink: add sample mask support
This isn't really used yet, but may as well just fill it in.
Acked-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/zink/zink_context.c | 9 | ||||
-rw-r--r-- | src/gallium/drivers/zink/zink_pipeline.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/zink/zink_pipeline.h | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index ca111b70659..fb3ee0f6b6f 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -642,6 +642,13 @@ zink_set_blend_color(struct pipe_context *pctx, memcpy(ctx->blend_constants, color->color, sizeof(float) * 4); } +static void +zink_set_sample_mask(struct pipe_context *pctx, unsigned sample_mask) +{ + struct zink_context *ctx = zink_context(pctx); + ctx->gfx_pipeline_state.sample_mask = sample_mask; +} + static VkAccessFlags access_flags(VkImageLayout layout) { @@ -1344,6 +1351,8 @@ zink_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags) ctx->base.set_active_query_state = zink_set_active_query_state; ctx->base.set_blend_color = zink_set_blend_color; + ctx->base.set_sample_mask = zink_set_sample_mask; + ctx->base.clear = zink_clear; ctx->base.draw_vbo = zink_draw_vbo; ctx->base.flush = zink_flush; diff --git a/src/gallium/drivers/zink/zink_pipeline.c b/src/gallium/drivers/zink/zink_pipeline.c index 0dd89187ba4..3850395b660 100644 --- a/src/gallium/drivers/zink/zink_pipeline.c +++ b/src/gallium/drivers/zink/zink_pipeline.c @@ -62,6 +62,7 @@ zink_create_gfx_pipeline(VkDevice dev, struct zink_gfx_program *prog, ms_state.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT; ms_state.alphaToCoverageEnable = state->blend_state->alpha_to_coverage; ms_state.alphaToOneEnable = state->blend_state->alpha_to_one; + ms_state.pSampleMask = state->sample_mask ? &state->sample_mask : NULL; VkPipelineViewportStateCreateInfo viewport_state = {}; viewport_state.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO; diff --git a/src/gallium/drivers/zink/zink_pipeline.h b/src/gallium/drivers/zink/zink_pipeline.h index 87747fce740..ec896d0d583 100644 --- a/src/gallium/drivers/zink/zink_pipeline.h +++ b/src/gallium/drivers/zink/zink_pipeline.h @@ -49,6 +49,8 @@ struct zink_gfx_pipeline_state { struct zink_depth_stencil_alpha_state *depth_stencil_alpha_state; float line_width; + + VkSampleMask sample_mask; }; VkPipeline |