nvc0: front stencil mask and func mask methods are swapped
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Mon, 14 Feb 2011 01:04:58 +0000 (02:04 +0100)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Wed, 16 Feb 2011 14:45:31 +0000 (15:45 +0100)
src/gallium/drivers/nvc0/nvc0_3d.xml.h
src/gallium/drivers/nvc0/nvc0_state.c

index 4b1325a30436c6ced494d632e327f3be03e56e6c..59da15ed4304b319aeae6598ec551862c22438c8 100644 (file)
@@ -575,7 +575,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define NVC0_3D_BLEND_ENABLE__ESIZE                            0x00000004
 #define NVC0_3D_BLEND_ENABLE__LEN                              0x00000008
 
-#define NVC0_3D_STENCIL_FRONT_ENABLE                           0x00001380
+#define NVC0_3D_STENCIL_ENABLE                                 0x00001380
 
 #define NVC0_3D_STENCIL_FRONT_OP_FAIL                          0x00001384
 #define NVC0_3D_STENCIL_FRONT_OP_FAIL_ZERO                     0x00000000
@@ -619,9 +619,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #define NVC0_3D_STENCIL_FRONT_FUNC_REF                         0x00001394
 
-#define NVC0_3D_STENCIL_FRONT_MASK                             0x00001398
+#define NVC0_3D_STENCIL_FRONT_FUNC_MASK                                0x00001398
 
-#define NVC0_3D_STENCIL_FRONT_FUNC_MASK                                0x0000139c
+#define NVC0_3D_STENCIL_FRONT_MASK                             0x0000139c
 
 #define NVC0_3D_DRAW_TFB_BASE                                  0x000013a4
 
index 7fb91b1191d26df10930eab19eecf572ef1f8f4b..7f59d40c5fb5d66a2b7d294e9f6195a02c37b558 100644 (file)
@@ -284,20 +284,21 @@ nvc0_zsa_state_create(struct pipe_context *pipe,
    }
 
    if (cso->stencil[0].enabled) {
-      SB_BEGIN_3D(so, STENCIL_FRONT_ENABLE, 5);
+      SB_BEGIN_3D(so, STENCIL_ENABLE, 5);
       SB_DATA    (so, 1);
       SB_DATA    (so, nvgl_stencil_op(cso->stencil[0].fail_op));
       SB_DATA    (so, nvgl_stencil_op(cso->stencil[0].zfail_op));
       SB_DATA    (so, nvgl_stencil_op(cso->stencil[0].zpass_op));
       SB_DATA    (so, nvgl_comparison_op(cso->stencil[0].func));
-      SB_BEGIN_3D(so, STENCIL_FRONT_MASK, 2);
-      SB_DATA    (so, cso->stencil[0].writemask);
+      SB_BEGIN_3D(so, STENCIL_FRONT_FUNC_MASK, 2);
       SB_DATA    (so, cso->stencil[0].valuemask);
+      SB_DATA    (so, cso->stencil[0].writemask);
    } else {
-      SB_IMMED_3D(so, STENCIL_FRONT_ENABLE, 0);
+      SB_IMMED_3D(so, STENCIL_ENABLE, 0);
    }
 
    if (cso->stencil[1].enabled) {
+      assert(cso->stencil[0].enabled);
       SB_BEGIN_3D(so, STENCIL_TWO_SIDE_ENABLE, 5);
       SB_DATA    (so, 1);
       SB_DATA    (so, nvgl_stencil_op(cso->stencil[1].fail_op));
@@ -307,7 +308,8 @@ nvc0_zsa_state_create(struct pipe_context *pipe,
       SB_BEGIN_3D(so, STENCIL_BACK_MASK, 2);
       SB_DATA    (so, cso->stencil[1].writemask);
       SB_DATA    (so, cso->stencil[1].valuemask);
-   } else {
+   } else
+   if (cso->stencil[0].enabled) {
       SB_IMMED_3D(so, STENCIL_TWO_SIDE_ENABLE, 0);
    }