Merge branch 'llvm-cliptest-viewport'
[mesa.git] / src / mesa / drivers / windows / gldirect / dx8 / gld_primitive_dx8.c
index a5b5462f039c0208a70424df8eade38fbebf3cc9..5b9dac09c6d6dcf94961f035b0befc01f1e4998d 100644 (file)
                GLfloat         ex,ey,fx,fy,cc;                                                 \
                /* Get vars for later */                                                        \
                VB              = &TNL_CONTEXT(ctx)->vb;                                        \
-               vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->data;         \
-               if (VB->SecondaryColorPtr[1]) {                                         \
-                       vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->data; \
+               vbcolor = (GLchan (*)[4])VB->BackfaceColorPtr->data;    \
+               if (VB->BackfaceSecondaryColorPtr) {                    \
+                       vbspec = (GLchan (*)[4])VB->BackfaceSecondaryColorPtr->data;    \
                } else {                                                                                                        \
                        vbspec = NULL;                                                                                  \
                }                                                                                                                       \
        DWORD                                   dwColor;
 
 #define GLD_SETUP_3D_VERTEX(v)                                 \
-       p4f                             = VB->ObjPtr->data;                     \
+       p4f = VB->AttribPtr[_TNL_ATTRIB_POS]->data;             \
        pV->Position.x  = p4f[##v][0];                          \
        pV->Position.y  = p4f[##v][1];                          \
        pV->Position.z  = p4f[##v][2];
 
 #define GLD_SETUP_SMOOTH_COLOUR_3D(v)                                                                                                                  \
-       p4f                     = (GLfloat (*)[4])VB->ColorPtr[0]->data;                                                                                \
+       p4f = (GLfloat (*)[4])VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;  \
        pV->Diffuse     = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
 
 
 #define GLD_SETUP_GET_FLAT_COLOUR_3D(v)                                                                                                        \
-       p4f             = (GLfloat (*)[4])VB->ColorPtr[0]->data;                                                                                \
+       p4f = (GLfloat (*)[4])VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data;  \
        dwColor = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]);
 
 #define GLD_SETUP_USE_FLAT_COLOUR_3D                   \
        pV->Diffuse = dwColor;
 
 #define GLD_SETUP_TEX0_3D(v)                                           \
-       if (VB->TexCoordPtr[0]) {                                               \
-               tc                              = VB->TexCoordPtr[0]->data;     \
+       if (VB->AttribPtr[_TNL_ATTRIB_TEX0]) {                          \
+               tc = VB->TnlAttribPtr[_TNL_ATTRIB_TEX0]->data;          \
                pV->TexUnit0.x  = tc[##v][0];                           \
                pV->TexUnit0.y  = tc[##v][1];                           \
        }
 
 #define GLD_SETUP_TEX1_3D(v)                                           \
-       if (VB->TexCoordPtr[1]) {                                               \
-               tc                              = VB->TexCoordPtr[1]->data;     \
+       if (VB->TnlAttribPtr[_TNL_ATTRIB_TEX1]) {                       \
+               tc = VB->TnlAttribPtr[_TNL_ATTRIB_TEX1]->data;          \
                pV->TexUnit1.x  = tc[##v][0];                           \
                pV->TexUnit1.y  = tc[##v][1];                           \
        }
 //---------------------------------------------------------------------------
 
 __inline DWORD _gldComputeFog(
-       GLcontext *ctx,
+       struct gl_context *ctx,
        SWvertex *swv)
 {
        // Full fog calculation.
@@ -300,7 +300,7 @@ __inline DWORD _gldComputeFog(
 //---------------------------------------------------------------------------
 
 void gld_ResetLineStipple_DX8(
-       GLcontext *ctx)
+       struct gl_context *ctx)
 {
        // TODO: Fake stipple with a 32x32 texture.
 }
@@ -310,7 +310,7 @@ void gld_ResetLineStipple_DX8(
 //---------------------------------------------------------------------------
 
 void gld_Points2D_DX8(
-       GLcontext *ctx,
+       struct gl_context *ctx,
        GLuint first,
        GLuint last)
 {
@@ -357,7 +357,7 @@ void gld_Points2D_DX8(
 //---------------------------------------------------------------------------
 
 void gld_Line2DFlat_DX8(
-       GLcontext *ctx,
+       struct gl_context *ctx,
        GLuint v0,
        GLuint v1)
 {
@@ -390,7 +390,7 @@ void gld_Line2DFlat_DX8(
 //---------------------------------------------------------------------------
 
 void gld_Line2DSmooth_DX8(
-       GLcontext *ctx,
+       struct gl_context *ctx,
        GLuint v0,
        GLuint v1)
 {
@@ -421,7 +421,7 @@ void gld_Line2DSmooth_DX8(
 //---------------------------------------------------------------------------
 
 void gld_Triangle2DFlat_DX8(
-       GLcontext *ctx,
+       struct gl_context *ctx,
        GLuint v0,
        GLuint v1,
        GLuint v2)
@@ -460,7 +460,7 @@ void gld_Triangle2DFlat_DX8(
 //---------------------------------------------------------------------------
 
 void gld_Triangle2DSmooth_DX8(
-       GLcontext *ctx,
+       struct gl_context *ctx,
        GLuint v0,
        GLuint v1,
        GLuint v2)
@@ -499,7 +499,7 @@ void gld_Triangle2DSmooth_DX8(
 //---------------------------------------------------------------------------
 
 void gld_Triangle2DFlatExtras_DX8(
-       GLcontext *ctx,
+       struct gl_context *ctx,
        GLuint v0,
        GLuint v1,
        GLuint v2)
@@ -548,7 +548,7 @@ void gld_Triangle2DFlatExtras_DX8(
 //---------------------------------------------------------------------------
 
 void gld_Triangle2DSmoothExtras_DX8(
-       GLcontext *ctx,
+       struct gl_context *ctx,
        GLuint v0,
        GLuint v1,
        GLuint v2)
@@ -588,7 +588,7 @@ void gld_Triangle2DSmoothExtras_DX8(
 //---------------------------------------------------------------------------
 
 void gld_Quad2DFlat_DX8(
-       GLcontext *ctx,
+       struct gl_context *ctx,
        GLuint v0,
        GLuint v1,
        GLuint v2,
@@ -652,7 +652,7 @@ void gld_Quad2DFlat_DX8(
 //---------------------------------------------------------------------------
 
 void gld_Quad2DSmooth_DX8(
-       GLcontext *ctx,
+       struct gl_context *ctx,
        GLuint v0,
        GLuint v1,
        GLuint v2,
@@ -715,7 +715,7 @@ void gld_Quad2DSmooth_DX8(
 //---------------------------------------------------------------------------
 
 void gld_Quad2DFlatExtras_DX8(
-       GLcontext *ctx,
+       struct gl_context *ctx,
        GLuint v0,
        GLuint v1,
        GLuint v2,
@@ -792,7 +792,7 @@ void gld_Quad2DFlatExtras_DX8(
 //---------------------------------------------------------------------------
 
 void gld_Quad2DSmoothExtras_DX8(
-       GLcontext *ctx,
+       struct gl_context *ctx,
        GLuint v0,
        GLuint v1,
        GLuint v2,
@@ -859,7 +859,7 @@ void gld_Quad2DSmoothExtras_DX8(
 //---------------------------------------------------------------------------
 
 void gld_Points3D_DX8(
-       GLcontext *ctx,
+       struct gl_context *ctx,
        GLuint first,
        GLuint last)
 {
@@ -911,7 +911,7 @@ void gld_Points3D_DX8(
 //---------------------------------------------------------------------------
 
 void gld_Line3DFlat_DX8(
-       GLcontext *ctx,
+       struct gl_context *ctx,
        GLuint v0,
        GLuint v1)
 {
@@ -937,7 +937,7 @@ void gld_Line3DFlat_DX8(
 //---------------------------------------------------------------------------
 
 void gld_Line3DSmooth_DX8(
-       GLcontext *ctx,
+       struct gl_context *ctx,
        GLuint v0,
        GLuint v1)
 {
@@ -964,7 +964,7 @@ void gld_Line3DSmooth_DX8(
 //---------------------------------------------------------------------------
 
 void gld_Triangle3DFlat_DX8(
-       GLcontext *ctx,
+       struct gl_context *ctx,
        GLuint v0,
        GLuint v1,
        GLuint v2)
@@ -997,7 +997,7 @@ void gld_Triangle3DFlat_DX8(
 //---------------------------------------------------------------------------
 
 void gld_Triangle3DSmooth_DX8(
-       GLcontext *ctx,
+       struct gl_context *ctx,
        GLuint v0,
        GLuint v1,
        GLuint v2)
@@ -1031,7 +1031,7 @@ void gld_Triangle3DSmooth_DX8(
 //---------------------------------------------------------------------------
 
 void gld_Quad3DFlat_DX8(
-       GLcontext *ctx,
+       struct gl_context *ctx,
        GLuint v0,
        GLuint v1,
        GLuint v2,
@@ -1083,7 +1083,7 @@ void gld_Quad3DFlat_DX8(
 //---------------------------------------------------------------------------
 
 void gld_Quad3DSmooth_DX8(
-       GLcontext *ctx,
+       struct gl_context *ctx,
        GLuint v0,
        GLuint v1,
        GLuint v2,
@@ -1137,34 +1137,34 @@ void gld_Quad3DSmooth_DX8(
 
 /*
 
-void gld_Points2DTwoside_DX8(GLcontext *ctx, GLuint first, GLuint last)
+void gld_Points2DTwoside_DX8(struct gl_context *ctx, GLuint first, GLuint last)
 {
        // NOTE: Two-sided lighting does not apply to Points
 }
 
 //---------------------------------------------------------------------------
 
-void gld_Line2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1)
+void gld_Line2DFlatTwoside_DX8(struct gl_context *ctx, GLuint v0, GLuint v1)
 {
        // NOTE: Two-sided lighting does not apply to Lines
 }
 
 //---------------------------------------------------------------------------
 
-void gld_Line2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1)
+void gld_Line2DSmoothTwoside_DX8(struct gl_context *ctx, GLuint v0, GLuint v1)
 {
        // NOTE: Two-sided lighting does not apply to Lines
 }
 
 //---------------------------------------------------------------------------
 
-void gld_Triangle2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2)
+void gld_Triangle2DFlatTwoside_DX8(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2)
 {
 }
 
 //---------------------------------------------------------------------------
 
-void gld_Triangle2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2)
+void gld_Triangle2DSmoothTwoside_DX8(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2)
 {
        GLD_context                     *gldCtx = GLD_GET_CONTEXT(ctx);
        GLD_driver_dx8          *gld    = GLD_GET_DX8_DRIVER(gldCtx);
@@ -1229,7 +1229,7 @@ void gld_Triangle2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuin
 
 //---------------------------------------------------------------------------
 
-void gld_Quad2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
+void gld_Quad2DFlatTwoside_DX8(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
 {
        GLD_context                     *gldCtx = GLD_GET_CONTEXT(ctx);
        GLD_driver_dx8          *gld    = GLD_GET_DX8_DRIVER(gldCtx);
@@ -1336,7 +1336,7 @@ void gld_Quad2DFlatTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2,
 
 //---------------------------------------------------------------------------
 
-void gld_Quad2DSmoothTwoside_DX8(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
+void gld_Quad2DSmoothTwoside_DX8(struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
 {
        GLD_context                     *gldCtx = GLD_GET_CONTEXT(ctx);
        GLD_driver_dx8          *gld    = GLD_GET_DX8_DRIVER(gldCtx);