svga: issue debug warning for unsupported two-sided stencil state
authorBrian Paul <brianp@vmware.com>
Fri, 10 Nov 2017 20:13:46 +0000 (13:13 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 15 Nov 2017 23:12:43 +0000 (16:12 -0700)
We only have a single stencil read mask and write mask.  Issue a
warning if different front/back values are used.  The Piglit
gl-2.0-two-sided-stencil test hits this.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
src/gallium/drivers/svga/svga_pipe_depthstencil.c

index 1b62290446b258def3387bc0492baa3bf59850e5..e5caa4b2771eff02aee3c7afa192e12250be61a4 100644 (file)
@@ -172,6 +172,21 @@ svga_create_depth_stencil_state(struct pipe_context *pipe,
 
       ds->stencil_mask      = templ->stencil[1].valuemask & 0xff;
       ds->stencil_writemask = templ->stencil[1].writemask & 0xff;
+
+      if (templ->stencil[1].valuemask != templ->stencil[0].valuemask) {
+         pipe_debug_message(&svga->debug.callback, CONFORMANCE,
+                            "two-sided stencil mask not supported "
+                            "(front=0x%x, back=0x%x)",
+                            templ->stencil[0].valuemask,
+                            templ->stencil[1].valuemask);
+      }
+      if (templ->stencil[1].writemask != templ->stencil[0].writemask) {
+         pipe_debug_message(&svga->debug.callback, CONFORMANCE,
+                            "two-sided stencil writemask not supported "
+                            "(front=0x%x, back=0x%x)",
+                            templ->stencil[0].writemask,
+                            templ->stencil[1].writemask);
+      }
    }
    else {
       /* back face state is same as front-face state */