static void mgaDmaPrimitive( GLcontext *ctx, GLenum prim )
{
   mgaContextPtr mmesa = MGA_CONTEXT(ctx);
   GLuint hwprim;

   switch (prim) {
   case GL_TRIANGLES:
      hwprim = MGA_WA_TRIANGLES;
      break;
   case GL_TRIANGLE_STRIP:
      if (mmesa->vertex_size == 8)
	 hwprim = MGA_WA_TRISTRIP_T0;
      else
	 hwprim = MGA_WA_TRISTRIP_T0T1;
      break;
   case GL_TRIANGLE_FAN:
      if (mmesa->vertex_size == 8)
	 hwprim = MGA_WA_TRIFAN_T0;
      else
	 hwprim = MGA_WA_TRIFAN_T0T1;
      break;
   default:
      return;
   }

   mgaRasterPrimitive( ctx, GL_TRIANGLES, hwprim );
}
Esempio n. 2
0
/* Determine the rasterized primitive when not drawing unfilled 
 * polygons.
 *
 * Used only for the default render stage which always decomposes
 * primitives to trianges/lines/points.  For the accelerated stage,
 * which renders strips as strips, the equivalent calculations are
 * performed in mgarender.c.
 */
static void mgaRenderPrimitive( GLcontext *ctx, GLenum prim )
{
   mgaContextPtr mmesa = MGA_CONTEXT(ctx);
   GLuint rprim = reduced_prim[prim];

   mmesa->render_primitive = prim;

   if (rprim == GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED))
      return;
       
   if (mmesa->raster_primitive != rprim) {
      mgaRasterPrimitive( ctx, rprim, MGA_WA_TRIANGLES );
   }
}