From 02babc834a508adf7726f783abf97dd2fe13e763 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sun, 12 Jun 2022 09:49:24 -0400 Subject: [PATCH] asahi: Identify stencil test enable There are a pair of flags controlling the stencil test. One enables stencil testing in general, the other enables two-sided stencil. Compare the identical "twosided" flag in src/imagination/csbgen/rogue_ppp.xml's STATE_ISPCTL structure, at the samebit offset even. Evidently this word of the "Rasterizer" is, in fact, a derivative of STATE_ISPCTL. Fixes dEQP-GLES2.functional.fragment_ops.depth_stencil.* dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.* dEQP-GLES2.functional.fragment_ops.random.* Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/lib/cmdbuf.xml | 4 ++-- src/gallium/drivers/asahi/agx_state.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/asahi/lib/cmdbuf.xml b/src/asahi/lib/cmdbuf.xml index cff6a6c7401..cba145e191a 100644 --- a/src/asahi/lib/cmdbuf.xml +++ b/src/asahi/lib/cmdbuf.xml @@ -347,8 +347,8 @@ - - + + diff --git a/src/gallium/drivers/asahi/agx_state.c b/src/gallium/drivers/asahi/agx_state.c index e5a24876398..3b81ca77722 100644 --- a/src/gallium/drivers/asahi/agx_state.c +++ b/src/gallium/drivers/asahi/agx_state.c @@ -1496,9 +1496,11 @@ demo_rasterizer(struct agx_context *ctx, struct agx_pool *pool, bool is_points) struct agx_rasterizer_packed out; agx_pack(&out, RASTERIZER, cfg) { - bool back_stencil = ctx->zs->base.stencil[1].enabled; + cfg.stencil_test_enable = ctx->zs->base.stencil[0].enabled; + cfg.two_sided_stencil = ctx->zs->base.stencil[1].enabled; + cfg.front.stencil_reference = ctx->stencil_ref.ref_value[0]; - cfg.back.stencil_reference = back_stencil ? + cfg.back.stencil_reference = cfg.two_sided_stencil ? ctx->stencil_ref.ref_value[1] : cfg.front.stencil_reference;