core | glapi | vbo | math | shader | swrast | swrast_setup | tnl | tnl_dd

t_vb_render.c File Reference

#include "main/glheader.h"
#include "main/context.h"
#include "main/enums.h"
#include "main/macros.h"
#include "main/imports.h"
#include "main/mtypes.h"
#include "t_pipeline.h"
#include "t_vb_cliptmp.h"
#include "t_vb_rendertmp.h"

Defines

#define W(i)   coord[i][3]
#define Z(i)   coord[i][2]
#define Y(i)   coord[i][1]
#define X(i)   coord[i][0]
#define SIZE   4
#define TAG(x)   x##_4
#define NEED_EDGEFLAG_SETUP   (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL)
#define EDGEFLAG_GET(idx)   VB->EdgeFlag[idx]
#define EDGEFLAG_SET(idx, val)   VB->EdgeFlag[idx] = val
#define CLIPMASK   (CLIP_FRUSTUM_BITS | CLIP_CULL_BIT)
#define RENDER_POINTS(start, count)   tnl->Driver.Render.Points( ctx, start, count )
#define RENDER_LINE(v1, v2)
#define RENDER_TRI(v1, v2, v3)
#define RENDER_QUAD(v1, v2, v3, v4)
#define LOCAL_VARS
#define TAG(x)   clip_##x##_verts
#define INIT(x)   tnl->Driver.Render.PrimitiveNotify( ctx, x )
#define RESET_STIPPLE   if (stipple) tnl->Driver.Render.ResetLineStipple( ctx )
#define PRESERVE_VB_DEFS
#define ELT(x)   elt[x]
#define TAG(x)   clip_##x##_elts
#define NEED_EDGEFLAG_SETUP   (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL)
#define EDGEFLAG_GET(idx)   VB->EdgeFlag[idx]
#define EDGEFLAG_SET(idx, val)   VB->EdgeFlag[idx] = val
#define RENDER_POINTS(start, count)   tnl->Driver.Render.Points( ctx, start, count )
#define RENDER_LINE(v1, v2)   LineFunc( ctx, v1, v2 )
#define RENDER_TRI(v1, v2, v3)   TriangleFunc( ctx, v1, v2, v3 )
#define RENDER_QUAD(v1, v2, v3, v4)   QuadFunc( ctx, v1, v2, v3, v4 )
#define TAG(x)   _tnl_##x##_verts
#define LOCAL_VARS
#define RESET_STIPPLE   if (stipple) tnl->Driver.Render.ResetLineStipple( ctx )
#define INIT(x)   tnl->Driver.Render.PrimitiveNotify( ctx, x )
#define RENDER_TAB_QUALIFIER
#define PRESERVE_VB_DEFS
#define TAG(x)   _tnl_##x##_elts
#define ELT(x)   elt[x]

Functions

static void clip_elt_triangles (GLcontext *ctx, GLuint start, GLuint count, GLuint flags)
void _tnl_RenderClippedPolygon (GLcontext *ctx, const GLuint *elts, GLuint n)
void _tnl_RenderClippedLine (GLcontext *ctx, GLuint ii, GLuint jj)
static GLboolean run_render (GLcontext *ctx, struct tnl_pipeline_stage *stage)

Variables

struct tnl_pipeline_stage _tnl_render_stage


Define Documentation

#define CLIPMASK   (CLIP_FRUSTUM_BITS | CLIP_CULL_BIT)

#define EDGEFLAG_GET ( idx   )     VB->EdgeFlag[idx]

#define EDGEFLAG_GET ( idx   )     VB->EdgeFlag[idx]

#define EDGEFLAG_SET ( idx,
val   )     VB->EdgeFlag[idx] = val

#define EDGEFLAG_SET ( idx,
val   )     VB->EdgeFlag[idx] = val

#define ELT (  )     elt[x]

#define ELT (  )     elt[x]

#define INIT (  )     tnl->Driver.Render.PrimitiveNotify( ctx, x )

#define INIT (  )     tnl->Driver.Render.PrimitiveNotify( ctx, x )

#define LOCAL_VARS

Value:

TNLcontext *tnl = TNL_CONTEXT(ctx);                             \
   struct vertex_buffer *VB = &tnl->vb;                         \
   const GLuint * const elt = VB->Elts;                         \
   const tnl_line_func LineFunc = tnl->Driver.Render.Line;              \
   const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle;  \
   const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad;              \
   const GLboolean stipple = ctx->Line.StippleFlag;             \
   (void) (LineFunc && TriangleFunc && QuadFunc);               \
   (void) elt; (void) stipple

#define LOCAL_VARS

Value:

TNLcontext *tnl = TNL_CONTEXT(ctx);                             \
   struct vertex_buffer *VB = &tnl->vb;                         \
   const GLuint * const elt = VB->Elts;                         \
   const GLubyte *mask = VB->ClipMask;                          \
   const GLuint sz = VB->ClipPtr->size;                         \
   const tnl_line_func LineFunc = tnl->Driver.Render.Line;              \
   const tnl_triangle_func TriangleFunc = tnl->Driver.Render.Triangle;  \
   const tnl_quad_func QuadFunc = tnl->Driver.Render.Quad;              \
   const GLboolean stipple = ctx->Line.StippleFlag;             \
   (void) (LineFunc && TriangleFunc && QuadFunc);               \
   (void) elt; (void) mask; (void) sz; (void) stipple;

#define NEED_EDGEFLAG_SETUP   (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL)

#define NEED_EDGEFLAG_SETUP   (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL)

#define PRESERVE_VB_DEFS

#define PRESERVE_VB_DEFS

#define RENDER_LINE ( v1,
v2   )     LineFunc( ctx, v1, v2 )

#define RENDER_LINE ( v1,
v2   ) 

Value:

do {                                            \
   GLubyte c1 = mask[v1], c2 = mask[v2];        \
   GLubyte ormask = c1|c2;                      \
   if (!ormask)                                 \
      LineFunc( ctx, v1, v2 );                  \
   else if (!(c1 & c2 & CLIPMASK))                      \
      clip_line_4( ctx, v1, v2, ormask );       \
} while (0)

#define RENDER_POINTS ( start,
count   )     tnl->Driver.Render.Points( ctx, start, count )

#define RENDER_POINTS ( start,
count   )     tnl->Driver.Render.Points( ctx, start, count )

#define RENDER_QUAD ( v1,
v2,
v3,
v4   )     QuadFunc( ctx, v1, v2, v3, v4 )

#define RENDER_QUAD ( v1,
v2,
v3,
v4   ) 

Value:

do {                                                    \
   GLubyte c1 = mask[v1], c2 = mask[v2];                \
   GLubyte c3 = mask[v3], c4 = mask[v4];                \
   GLubyte ormask = c1|c2|c3|c4;                        \
   if (!ormask)                                         \
      QuadFunc( ctx, v1, v2, v3, v4 );                  \
   else if (!(c1 & c2 & c3 & c4 & CLIPMASK))            \
      clip_quad_4( ctx, v1, v2, v3, v4, ormask );       \
} while (0)

#define RENDER_TAB_QUALIFIER

#define RENDER_TRI ( v1,
v2,
v3   )     TriangleFunc( ctx, v1, v2, v3 )

#define RENDER_TRI ( v1,
v2,
v3   ) 

Value:

do {                                                    \
   GLubyte c1 = mask[v1], c2 = mask[v2], c3 = mask[v3]; \
   GLubyte ormask = c1|c2|c3;                           \
   if (!ormask)                                         \
      TriangleFunc( ctx, v1, v2, v3 );                  \
   else if (!(c1 & c2 & c3 & CLIPMASK))                         \
      clip_tri_4( ctx, v1, v2, v3, ormask );            \
} while (0)

#define RESET_STIPPLE   if (stipple) tnl->Driver.Render.ResetLineStipple( ctx )

#define RESET_STIPPLE   if (stipple) tnl->Driver.Render.ResetLineStipple( ctx )

#define SIZE   4

#define TAG (  )     _tnl_##x##_elts

#define TAG (  )     _tnl_##x##_verts

#define TAG (  )     clip_##x##_elts

#define TAG (  )     clip_##x##_verts

#define TAG (  )     x##_4

#define W (  )     coord[i][3]

#define X (  )     coord[i][0]

#define Y (  )     coord[i][1]

#define Z (  )     coord[i][2]


Function Documentation

void _tnl_RenderClippedLine ( GLcontext ctx,
GLuint  ii,
GLuint  jj 
)

void _tnl_RenderClippedPolygon ( GLcontext ctx,
const GLuint *  elts,
GLuint  n 
)

static void clip_elt_triangles ( GLcontext ctx,
GLuint  start,
GLuint  count,
GLuint  flags 
) [static]

static GLboolean run_render ( GLcontext ctx,
struct tnl_pipeline_stage stage 
) [static]


Variable Documentation

struct tnl_pipeline_stage _tnl_render_stage

Initial value:

{
   "render",                    
   NULL,                        
   NULL,                        
   NULL,                        
   NULL,                        
   run_render                   
}


Generated on Sun Sep 27 06:48:09 2009 for Mesa Transform and Lighting (tnl) by  doxygen 1.5.4