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 <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
This commit is contained in:
Alyssa Rosenzweig
2022-06-12 09:49:24 -04:00
committed by Marge Bot
parent b891d60efa
commit 02babc834a
2 changed files with 6 additions and 4 deletions

View File

@@ -347,8 +347,8 @@
<field name="Visibility mode" size="2" start="1:14" type="Visibility Mode"/>
<field name="Scissor enable" size="1" start="1:16" type="bool"/>
<field name="Depth bias enable" size="1" start="1:17" type="bool"/>
<field name="Unk ZS" size="1" start="1:18" type="hex" default="0x1"/>
<field name="Unk 2" size="2" start="1:19" type="hex" default="0x0"/>
<field name="Stencil test enable" size="1" start="1:18" type="bool"/>
<field name="Two-sided stencil" size="1" start="1:19" type="bool"/>
<field name="Unk fill lines" size="1" start="1:26" type="hex" default="0x0"/> <!-- set when drawing LINES -->
<field name="Front" size="64" start="2:0" type="Rasterizer face"/>
<field name="Back" size="64" start="4:0" type="Rasterizer face"/>

View File

@@ -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;