i965: relAddr local var (to make debug/test a little easier)
[mesa.git] / src / mesa / drivers / dri / s3v / s3v_render.c
index e97a94d25cd4e67d054d0cd81dce1822e2e10ca3..5023f3c46411b296c098b9dd6e78022fd92c873c 100644 (file)
@@ -2,10 +2,10 @@
  * Author: Max Lingua <sunmax@libero.it>
  */
 
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "mtypes.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
 
 #include "tnl/t_context.h"
 
@@ -66,7 +66,7 @@ static const GLuint hw_prim[GL_POLYGON+1] = {
        PrimType_Polygon
 };
 
-static __inline void s3vStartPrimitive( s3vContextPtr vmesa, GLenum prim )
+static INLINE void s3vStartPrimitive( s3vContextPtr vmesa, GLenum prim )
 {
        __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
 
@@ -110,7 +110,7 @@ static __inline void s3vStartPrimitive( s3vContextPtr vmesa, GLenum prim )
        vmesa->restore_primitive = _hw_prim;
 }
 
-static __inline void s3vEndPrimitive( s3vContextPtr vmesa )
+static INLINE void s3vEndPrimitive( s3vContextPtr vmesa )
 {
 /*     GLcontext *ctx = vmesa->glCtx; */
        DEBUG(("s3vEndPrimitive\n"));
@@ -170,7 +170,7 @@ static GLboolean s3v_run_render( GLcontext *ctx,
 
        for (i = 0 ; i < VB->PrimitiveCount ; i++ )
        {
-                GLuint prim = VB->Primitive[i].mode;
+               GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
                GLuint start = VB->Primitive[i].start;
                GLuint length = VB->Primitive[i].count;
 
@@ -191,62 +191,13 @@ static GLboolean s3v_run_render( GLcontext *ctx,
 }
 
 
-static void s3v_check_render( GLcontext *ctx,
-                                struct tnl_pipeline_stage *stage )
-{
-       s3vContextPtr vmesa = S3V_CONTEXT(ctx);
-       GLuint inputs = VERT_BIT_POS | VERT_BIT_COLOR0;
-
-       DEBUG(("s3v_check_render\n"));
-
-       if (ctx->RenderMode == GL_RENDER) {
-       
-               if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
-                       DEBUG(("DD_SEPARATE_SPECULAR\n"));
-                       inputs |= VERT_BIT_COLOR1;
-               }
-               
-               if (ctx->Texture.Unit[0]._ReallyEnabled) {
-                       DEBUG(("ctx->Texture.Unit[0]._ReallyEnabled\n"));
-                       inputs |= VERT_BIT_TEX(0);
-               }
-
-               if (ctx->Texture.Unit[1]._ReallyEnabled) {
-                       DEBUG(("ctx->Texture.Unit[1]._ReallyEnabled\n"));
-                       inputs |= VERT_BIT_TEX(1);
-               }
-
-               if (ctx->Fog.Enabled) {
-                       DEBUG(("ctx->Fog.Enabled\n"));
-                       inputs |= VERT_BIT_FOG;
-               }
-       }
-
-       stage->inputs = inputs;
-       vmesa->SetupNewInputs = inputs;
-}
-
-
-static void dtr( struct tnl_pipeline_stage *stage )
-{
-       (void)stage;
-        /* hack to silence a compiler warning */
-        (void) &s3v_validate_render;
-}
-
 
 const struct tnl_pipeline_stage _s3v_render_stage =
 {
        "s3v render",
-       (_DD_NEW_SEPARATE_SPECULAR |
-        _NEW_TEXTURE|
-        _NEW_FOG|
-        _NEW_RENDERMODE),      /* re-check (new inputs) */
-        0,                     /* re-run (always runs) */
-        GL_TRUE,               /* active */
-        0, 0,                  /* inputs (set in check_render), outputs */
-        0, 0,                  /* changed_inputs, private */
-        dtr,                   /* destructor */
-        s3v_check_render,      /* check - initially set to alloc data */
+       NULL,
+       NULL,
+       NULL,
+       NULL,
         s3v_run_render         /* run */
 };