From: Alyssa Rosenzweig Date: Thu, 6 Aug 2020 14:02:35 +0000 (-0400) Subject: panfrost: Simplify zsa == NULL case X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1675d92d663bf92cb5f8d699a096748e7bdd768f;p=mesa.git panfrost: Simplify zsa == NULL case Stencil fields are only used if stenciling is enabled. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Tomeu Vizoso Part-of: --- diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 8f6142f7b4a..8b4fe46aaab 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -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 {