예제 #1
0
static void via_draw_line(struct via_context *vmesa,
			  viaVertexPtr v0,
			  viaVertexPtr v1)
{
   GLuint vertsize = vmesa->vertexSize;
   GLuint *vb = viaExtendPrimitive(vmesa, 2 * 4 * vertsize);
   COPY_DWORDS(vb, vertsize, v0);
   COPY_DWORDS(vb, vertsize, v1);
}
예제 #2
0
파일: i830_tris.c 프로젝트: aosm/X11
static __inline__ void i830_draw_line( i830ContextPtr imesa,
				       i830VertexPtr v0,
				       i830VertexPtr v1 )
{
   GLuint vertsize = imesa->vertex_size;
   GLuint *vb = i830AllocDmaLow( imesa, 2 * 4 * vertsize );
   int j;

   COPY_DWORDS( j, vb, vertsize, v0 );
   COPY_DWORDS( j, vb, vertsize, v1 );
}
예제 #3
0
static void via_ptex_line (struct via_context *vmesa,
			   viaVertexPtr v0,
			   viaVertexPtr v1)
{
   GLuint vertsize = vmesa->hwVertexSize;
   GLuint *vb = viaExtendPrimitive(vmesa, 2*4*vertsize);
   viaVertex tmp;

   PTEX_VERTEX(tmp, vertsize, v0); COPY_DWORDS(vb, vertsize, &tmp);
   PTEX_VERTEX(tmp, vertsize, v1); COPY_DWORDS(vb, vertsize, &tmp);
}
예제 #4
0
파일: intel_tris.c 프로젝트: Starlink/mesa
static __inline__ void intel_draw_line( intelContextPtr intel,
					intelVertexPtr v0,
					intelVertexPtr v1 )
{
   GLuint vertsize = intel->vertex_size;
   GLuint *vb = intelExtendInlinePrimitive( intel, 2 * vertsize );
   int j;

   COPY_DWORDS( j, vb, vertsize, v0 );
   COPY_DWORDS( j, vb, vertsize, v1 );
}
예제 #5
0
파일: intel_tris.c 프로젝트: beligit/psx4m
static void
intel_draw_triangle(struct intel_context *intel,
                    intelVertexPtr v0, intelVertexPtr v1, intelVertexPtr v2)
{
   GLuint vertsize = intel->vertex_size;
   GLuint *vb = intelExtendInlinePrimitive(intel, 3 * vertsize);
   int j;

   COPY_DWORDS(j, vb, vertsize, v0);
   COPY_DWORDS(j, vb, vertsize, v1);
   COPY_DWORDS(j, vb, vertsize, v2);
}
예제 #6
0
파일: i830_tris.c 프로젝트: aosm/X11
static void __inline__ i830_draw_triangle( i830ContextPtr imesa,
					   i830VertexPtr v0,
					   i830VertexPtr v1,
					   i830VertexPtr v2 )
{
   GLuint vertsize = imesa->vertex_size;
   GLuint *vb = i830AllocDmaLow( imesa, 3 * 4 * vertsize );
   int j;

   COPY_DWORDS( j, vb, vertsize, v0 );
   COPY_DWORDS( j, vb, vertsize, v1 );
   COPY_DWORDS( j, vb, vertsize, v2 );
}
예제 #7
0
파일: intel_tris.c 프로젝트: beligit/psx4m
static void
intel_draw_quad(struct intel_context *intel,
                intelVertexPtr v0,
                intelVertexPtr v1, intelVertexPtr v2, intelVertexPtr v3)
{
   GLuint vertsize = intel->vertex_size;
   GLuint *vb = intelExtendInlinePrimitive(intel, 6 * vertsize);
   int j;

   COPY_DWORDS(j, vb, vertsize, v0);
   COPY_DWORDS(j, vb, vertsize, v1);

   /* If smooth shading, draw like a trifan which gives better
    * rasterization.  Otherwise draw as two triangles with provoking
    * vertex in third position as required for flat shading.
    */
   if (intel->ctx.Light.ShadeModel == GL_FLAT) {
      COPY_DWORDS(j, vb, vertsize, v3);
      COPY_DWORDS(j, vb, vertsize, v1);
   }
   else {
      COPY_DWORDS(j, vb, vertsize, v2);
      COPY_DWORDS(j, vb, vertsize, v0);
   }

   COPY_DWORDS(j, vb, vertsize, v2);
   COPY_DWORDS(j, vb, vertsize, v3);
}
예제 #8
0
static void i810FastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
				       GLuint n )
{
   i810ContextPtr imesa = I810_CONTEXT( ctx );
   GLuint vertsize = imesa->vertex_size;
   GLuint *vb = i810AllocDmaLow( imesa, (n-2) * 3 * 4 * vertsize );
   GLubyte *vertptr = (GLubyte *)imesa->verts;
   const GLuint *start = (const GLuint *)V(elts[0]);
   int i,j;

   for (i = 2 ; i < n ; i++) {
      COPY_DWORDS( j, vb, vertsize, V(elts[i-1]) );
      COPY_DWORDS( j, vb, vertsize, V(elts[i]) );
      COPY_DWORDS( j, vb, vertsize, start );
   }
}
예제 #9
0
static void emit_vec16( GLcontext *ctx,
			struct radeon_dma_region *rvb,
			char *data,
			int stride,
			int count )
{
   int i;
   int *out = (int *)(rvb->address + rvb->start);

   if (RADEON_DEBUG & DEBUG_VERTS)
      fprintf(stderr, "%s count %d stride %d\n",
	      __FUNCTION__, count, stride);

   if (stride == 16)
      COPY_DWORDS( out, data, count*4 );
   else
      for (i = 0; i < count; i++) {
	 out[0] = *(int *)data;
	 out[1] = *(int *)(data+4);
	 out[2] = *(int *)(data+8);
	 out[3] = *(int *)(data+12);
	 out += 4;
	 data += stride;
      }
}
예제 #10
0
static void viaFastRenderClippedPoly(struct gl_context *ctx, const GLuint *elts,
                                     GLuint n)
{
    struct via_context *vmesa = VIA_CONTEXT(ctx);
    GLuint vertsize = vmesa->vertexSize;
    GLuint *vb = viaExtendPrimitive(vmesa, (n - 2) * 3 * 4 * vertsize);
    GLubyte *vertptr = (GLubyte *)vmesa->verts;
    const GLuint *start = (const GLuint *)V(elts[0]);
    int i;

    for (i = 2; i < n; i++) {
	COPY_DWORDS(vb, vertsize, V(elts[i - 1]));
        COPY_DWORDS(vb, vertsize, V(elts[i]));
	COPY_DWORDS(vb, vertsize, start);	
    }
}
예제 #11
0
파일: intel_tris.c 프로젝트: Starlink/mesa
static void intelFastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
				       GLuint n )
{
   intelContextPtr intel = INTEL_CONTEXT( ctx );
   const GLuint vertsize = intel->vertex_size;
   GLuint *vb = intelExtendInlinePrimitive( intel, (n-2) * 3 * vertsize );
   GLubyte *vertptr = (GLubyte *)intel->verts;
   const GLuint *start = (const GLuint *)V(elts[0]);
   int i,j;

   for (i = 2 ; i < n ; i++) {
      COPY_DWORDS( j, vb, vertsize, V(elts[i-1]) );
      COPY_DWORDS( j, vb, vertsize, V(elts[i]) );
      COPY_DWORDS( j, vb, vertsize, start );
   }
}
예제 #12
0
파일: sis_tris.c 프로젝트: aosm/X11
static void sisFastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
				      GLuint n )
{
   sisContextPtr smesa = SIS_CONTEXT( ctx );
   GLuint vertsize = smesa->vertex_size;
   GLuint *vb = r128AllocDmaLow( rmesa, (n-2) * 3 * 4 * vertsize );
   GLubyte *sisverts = (GLubyte *)smesa->verts;
   const GLuint shift = smesa->vertex_stride_shift;
   const GLuint *start = (const GLuint *)VERT(elts[0]);
   int i,j;

   smesa->num_verts += (n-2) * 3;

   for (i = 2 ; i < n ; i++) {
      COPY_DWORDS( j, vb, vertsize, (sisVertexPtr) VERT(elts[i-1]) );
      COPY_DWORDS( j, vb, vertsize, (sisVertexPtr) VERT(elts[i]) );
      COPY_DWORDS( j, vb, vertsize, (sisVertexPtr) start );
   }
}
예제 #13
0
static void emit_ubyte_rgba4( GLcontext *ctx,
			      struct radeon_dma_region *rvb,
			      char *data,
			      int stride,
			      int count )
{
   int i;
   int *out = (int *)(rvb->address + rvb->start);

   if (RADEON_DEBUG & DEBUG_VERTS)
      fprintf(stderr, "%s count %d stride %d\n",
	      __FUNCTION__, count, stride);

   if (stride == 4)
       COPY_DWORDS( out, data, count );
   else
      for (i = 0; i < count; i++) {
	 *out++ = LE32_TO_CPU(*(int *)data);
	 data += stride;
      }
}
예제 #14
0
static void emit_vec4( GLcontext *ctx,
                       struct r200_dma_region *rvb,
                       char *data,
                       int stride,
                       int count )
{
    int i;
    int *out = (int *)(rvb->address + rvb->start);

    if (R200_DEBUG & DEBUG_VERTS)
        fprintf(stderr, "%s count %d stride %d\n",
                __FUNCTION__, count, stride);

    if (stride == 4)
        COPY_DWORDS( out, data, count );
    else
        for (i = 0; i < count; i++) {
            out[0] = *(int *)data;
            out++;
            data += stride;
        }
}
예제 #15
0
파일: intel_tris.c 프로젝트: Starlink/mesa
static void __inline__ intel_draw_quad( intelContextPtr intel,
					intelVertexPtr v0,
					intelVertexPtr v1,
					intelVertexPtr v2,
					intelVertexPtr v3 )
{
   GLuint vertsize = intel->vertex_size;
   GLuint *vb = intelExtendInlinePrimitive( intel, 6 * vertsize );
   int j;

   COPY_DWORDS( j, vb, vertsize, v0 );
   COPY_DWORDS( j, vb, vertsize, v1 );
   COPY_DWORDS( j, vb, vertsize, v3 );
   COPY_DWORDS( j, vb, vertsize, v1 );
   COPY_DWORDS( j, vb, vertsize, v2 );
   COPY_DWORDS( j, vb, vertsize, v3 );
}
예제 #16
0
static __inline__ void i810_draw_quad( i810ContextPtr imesa,
				       i810VertexPtr v0,
				       i810VertexPtr v1,
				       i810VertexPtr v2,
				       i810VertexPtr v3 )
{
   GLuint vertsize = imesa->vertex_size;
   GLuint *vb = i810AllocDmaLow( imesa, 6 * 4 * vertsize );
   int j;

   COPY_DWORDS( j, vb, vertsize, v0 );
   COPY_DWORDS( j, vb, vertsize, v1 );
   COPY_DWORDS( j, vb, vertsize, v3 );
   COPY_DWORDS( j, vb, vertsize, v1 );
   COPY_DWORDS( j, vb, vertsize, v2 );
   COPY_DWORDS( j, vb, vertsize, v3 );
}
예제 #17
0
static void emit_vec12( GLcontext *ctx,
                        struct r200_dma_region *rvb,
                        char *data,
                        int stride,
                        int count )
{
    int i;
    int *out = (int *)(rvb->address + rvb->start);

    if (R200_DEBUG & DEBUG_VERTS)
        fprintf(stderr, "%s count %d stride %d out %p data %p\n",
                __FUNCTION__, count, stride, (void *)out, (void *)data);

    if (stride == 12)
        COPY_DWORDS( out, data, count*3 );
    else
        for (i = 0; i < count; i++) {
            out[0] = *(int *)data;
            out[1] = *(int *)(data+4);
            out[2] = *(int *)(data+8);
            out += 3;
            data += stride;
        }
}