nouveau : fix NV10_TCL_PRIMITIVE_3D_CLIP_PLANE
authorMatthieu Castet <castet.matthieu@free.fr>
Fri, 14 Sep 2007 20:07:34 +0000 (22:07 +0200)
committerMatthieu Castet <castet.matthieu@free.fr>
Fri, 14 Sep 2007 20:07:34 +0000 (22:07 +0200)
src/mesa/drivers/dri/nouveau/nouveau_reg.h
src/mesa/drivers/dri/nouveau/nv10_state.c

index b5e40dd6c64e1e691862190512c2618a918c1fe4..e08a5e4f7bd1252c1c7afec674f8254c0d87d6d6 100644 (file)
@@ -393,7 +393,7 @@ Object NV11_TCL_PRIMITIVE_3D used on: NV15
 #      define          NV10_TCL_PRIMITIVE_3D_COLOR_MATERIAL_A                  0x000003b4
 #      define          NV10_TCL_PRIMITIVE_3D_COLOR_CONTROL                     0x000003b8      /* Parameters: color_control */
 #      define          NV10_TCL_PRIMITIVE_3D_ENABLED_LIGHTS                    0x000003bc      /* Parameters: light 7 light 6 light 5 light 4 light 3 light 2 light 1 light 0 */
-#      define          NV10_TCL_PRIMITIVE_3D_CLIP_PLANE_ENABLE( d)             (0x000003c0 + d * 0x0004)
+#      define          NV10_TCL_PRIMITIVE_3D_CLIP_PLANE_ENABLE( d)             (0x000003c0 + (d) * 0x0004)
 #      define          NV10_TCL_PRIMITIVE_3D_VIEW_MATRIX_ENABLE                0x000003e8      /* Parameters: projection modelview0 modelview1 */
 #      define          NV10_TCL_PRIMITIVE_3D_POINT_SIZE                        0x000003ec
 #      define          NV10_TCL_PRIMITIVE_3D_MODELVIEW0_MATRIX( d)             (0x00000400 + d * 0x0004)
@@ -401,7 +401,7 @@ Object NV11_TCL_PRIMITIVE_3D used on: NV15
 #      define          NV10_TCL_PRIMITIVE_3D_INVERSE_MODELVIEW0_MATRIX( d)     (0x00000480 + d * 0x0004)
 #      define          NV10_TCL_PRIMITIVE_3D_INVERSE_MODELVIEW1_MATRIX( d)     (0x000004c0 + d * 0x0004)
 #      define          NV10_TCL_PRIMITIVE_3D_PROJECTION_MATRIX( d)             (0x00000500 + d * 0x0004)
-#      define          NV10_TCL_PRIMITIVE_3D_CLIP_PLANE_A(d)                   (0x00000600 + d * 0x0010)
+#      define          NV10_TCL_PRIMITIVE_3D_CLIP_PLANE_A(d)                   (0x00000600 + (d) * 0x0010)
 #      define          NV10_TCL_PRIMITIVE_3D_CLIP_PLANE_B(d)                   (0x00000604 + d * 0x0010)
 #      define          NV10_TCL_PRIMITIVE_3D_CLIP_PLANE_C(d)                   (0x00000608 + d * 0x0010)
 #      define          NV10_TCL_PRIMITIVE_3D_CLIP_PLANE_D(d)                   (0x0000060c + d * 0x0010)
index 154ba3cce12c2ae1fcfd161efe5024a35d6a9e20..2ba5d79684a5def97a4566f98843955017e76e7a 100644 (file)
@@ -200,7 +200,7 @@ static void nv10ClearStencil(GLcontext *ctx, GLint s)
 static void nv10ClipPlane(GLcontext *ctx, GLenum plane, const GLfloat *equation)
 {
        nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
-       BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_CLIP_PLANE_A(plane), 4);
+       BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_CLIP_PLANE_A(plane - GL_CLIP_PLANE0), 4);
        OUT_RING_CACHEf(equation[0]);
        OUT_RING_CACHEf(equation[1]);
        OUT_RING_CACHEf(equation[2]);