zink: use pipe_stencil_ref instead of uint32_t-array
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 10 Jul 2019 14:56:10 +0000 (16:56 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 08:51:46 +0000 (08:51 +0000)
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/zink/zink_context.c
src/gallium/drivers/zink/zink_context.h

index ca69b1d..884455c 100644 (file)
@@ -451,8 +451,7 @@ zink_set_stencil_ref(struct pipe_context *pctx,
                      const struct pipe_stencil_ref *ref)
 {
    struct zink_context *ctx = zink_context(pctx);
-   ctx->stencil_ref[0] = ref->ref_value[0];
-   ctx->stencil_ref[1] = ref->ref_value[1];
+   ctx->stencil_ref = *ref;
 }
 
 static void
@@ -1081,8 +1080,8 @@ zink_draw_vbo(struct pipe_context *pctx,
       vkCmdSetScissor(batch->cmdbuf, 0, 1, &fb_scissor);
    }
 
-   vkCmdSetStencilReference(batch->cmdbuf, VK_STENCIL_FACE_FRONT_BIT, ctx->stencil_ref[0]);
-   vkCmdSetStencilReference(batch->cmdbuf, VK_STENCIL_FACE_BACK_BIT, ctx->stencil_ref[1]);
+   vkCmdSetStencilReference(batch->cmdbuf, VK_STENCIL_FACE_FRONT_BIT, ctx->stencil_ref.ref_value[0]);
+   vkCmdSetStencilReference(batch->cmdbuf, VK_STENCIL_FACE_BACK_BIT, ctx->stencil_ref.ref_value[1]);
 
    if (depth_bias)
       vkCmdSetDepthBias(batch->cmdbuf, rast_state->offset_units, rast_state->offset_clamp, rast_state->offset_scale);
index 8c17b1c..57c077d 100644 (file)
@@ -101,7 +101,7 @@ struct zink_context {
 
    float blend_constants[4];
 
-   uint32_t stencil_ref[2];
+   struct pipe_stencil_ref stencil_ref;
 };
 
 static inline struct zink_context *