panfrost: Simplify zsa == NULL case
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 6 Aug 2020 14:02:35 +0000 (10:02 -0400)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Thu, 13 Aug 2020 06:55:16 +0000 (08:55 +0200)
Stencil fields are only used if stenciling is enabled.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>

src/gallium/drivers/panfrost/pan_cmdstream.c

index 8f6142f7b4a76415eda630638ce97e7d4bc1120f..8b4fe46aaab3f572c907539b73d8e04d966a41f9 100644 (file)
@@ -582,21 +582,7 @@ panfrost_frag_meta_zsa_update(struct panfrost_context *ctx,
         int zfunc = PIPE_FUNC_ALWAYS;
 
         if (!zsa) {
-                struct pipe_stencil_state default_stencil = {
-                        .enabled = 0,
-                        .func = PIPE_FUNC_ALWAYS,
-                        .fail_op = PIPE_STENCIL_OP_KEEP,
-                        .zfail_op = PIPE_STENCIL_OP_KEEP,
-                        .zpass_op = PIPE_STENCIL_OP_KEEP,
-                        .writemask = 0xFF,
-                        .valuemask = 0xFF
-                };
-
-                panfrost_make_stencil_state(&default_stencil,
-                                            &fragmeta->stencil_front);
-                fragmeta->stencil_mask_front = default_stencil.writemask;
-                fragmeta->stencil_back = fragmeta->stencil_front;
-                fragmeta->stencil_mask_back = default_stencil.writemask;
+                /* If stenciling is disabled, the state is irrelevant */
                 SET_BIT(fragmeta->unknown2_4, MALI_STENCIL_TEST, false);
                 SET_BIT(fragmeta->unknown2_3, MALI_DEPTH_WRITEMASK, false);
         } else {