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;