zink: add sample mask support
authorDave Airlie <airlied@redhat.com>
Mon, 22 Oct 2018 23:22:34 +0000 (09:22 +1000)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 08:51:45 +0000 (08:51 +0000)
This isn't really used yet, but may as well just fill it in.

Acked-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/zink/zink_context.c
src/gallium/drivers/zink/zink_pipeline.c
src/gallium/drivers/zink/zink_pipeline.h

index ca111b70659edf753418deb65023541bf23425f6..fb3ee0f6b6ff33dfd345483bbea47d56cb77eeb6 100644 (file)
@@ -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;
index 0dd89187ba4aeb1bd7ffde0f86d9d67d756ca527..3850395b6601ff7847a7f7d2a4e7424b0b1741c3 100644 (file)
@@ -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;
index 87747fce740b3802c8d8b1fb1a3e8f0871c1459b..ec896d0d5834cedfa7a52366edafb657d5110132 100644 (file)
@@ -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