diff options
author | Roland Scheidegger <rscheidegger@gmx.ch> | 2005-10-05 16:15:16 +0000 |
---|---|---|
committer | Roland Scheidegger <rscheidegger@gmx.ch> | 2005-10-05 16:15:16 +0000 |
commit | 44dace86eaf9eded8e6465adfadf6345658686dd (patch) | |
tree | 1439d84e53dec0a7f108e05e1f221e57c35876a4 /src/mesa/drivers/dri/r200/r200_swtcl.c | |
parent | 26f69d87a4e6f4d39ce10864e9e70689646155ed (diff) |
enable point sizes larger than 1 (for aliased points only) by using the hw point sprite primitive.
Diffstat (limited to 'src/mesa/drivers/dri/r200/r200_swtcl.c')
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_swtcl.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_swtcl.c b/src/mesa/drivers/dri/r200/r200_swtcl.c index 375db2658d..826c668b8d 100644 --- a/src/mesa/drivers/dri/r200/r200_swtcl.c +++ b/src/mesa/drivers/dri/r200/r200_swtcl.c @@ -340,18 +340,24 @@ r200AllocDmaLowVerts( r200ContextPtr rmesa, int nverts, int vsize ) /**************************************************************************/ -static const GLuint reduced_hw_prim[GL_POLYGON+1] = { - R200_VF_PRIM_POINTS, - R200_VF_PRIM_LINES, - R200_VF_PRIM_LINES, - R200_VF_PRIM_LINES, - R200_VF_PRIM_TRIANGLES, - R200_VF_PRIM_TRIANGLES, - R200_VF_PRIM_TRIANGLES, - R200_VF_PRIM_TRIANGLES, - R200_VF_PRIM_TRIANGLES, - R200_VF_PRIM_TRIANGLES -}; +static INLINE GLuint reduced_hw_prim( GLcontext *ctx, GLuint prim) +{ + switch (prim) { + case GL_POINTS: + return (ctx->_TriangleCaps & DD_POINT_SIZE) ? + R200_VF_PRIM_POINT_SPRITES : R200_VF_PRIM_POINTS; + case GL_LINES: + /* fallthrough */ + case GL_LINE_LOOP: + /* fallthrough */ + case GL_LINE_STRIP: + return R200_VF_PRIM_LINES; + default: + /* all others reduced to triangles */ + return R200_VF_PRIM_TRIANGLES; + } +} + static void r200RasterPrimitive( GLcontext *ctx, GLuint hwprim ); static void r200RenderPrimitive( GLcontext *ctx, GLenum prim ); @@ -496,7 +502,7 @@ do { \ * Helpers for rendering unfilled primitives * ***********************************************************************/ -#define RASTERIZE(x) r200RasterPrimitive( ctx, reduced_hw_prim[x] ) +#define RASTERIZE(x) r200RasterPrimitive( ctx, reduced_hw_prim(ctx, x) ) #define RENDER_PRIMITIVE rmesa->swtcl.render_primitive #undef TAG #define TAG(x) x @@ -631,7 +637,7 @@ static void r200RenderPrimitive( GLcontext *ctx, GLenum prim ) r200ContextPtr rmesa = R200_CONTEXT(ctx); rmesa->swtcl.render_primitive = prim; if (prim < GL_TRIANGLES || !(ctx->_TriangleCaps & DD_TRI_UNFILLED)) - r200RasterPrimitive( ctx, reduced_hw_prim[prim] ); + r200RasterPrimitive( ctx, reduced_hw_prim(ctx, prim) ); } static void r200RenderFinish( GLcontext *ctx ) |