示例#1
0
static void r200_emit_vecfog(GLcontext *ctx, struct radeon_aos *aos,
			     GLvoid *data, int stride, int count)
{
	radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
	uint32_t *out;
	int i;
	int size = 1;

	if (stride == 0) {
		radeonAllocDmaRegion(rmesa, &aos->bo, &aos->offset, size * 4, 32);
		count = 1;
		aos->stride = 0;
	} else {
		radeonAllocDmaRegion(rmesa, &aos->bo, &aos->offset, size * 4, 32);
		aos->stride = size;
	}

	aos->components = size;
	aos->count = count;

	out = (uint32_t*)((char*)aos->bo->ptr + aos->offset);
	for (i = 0; i < count; i++) {
	  out[0] = r200ComputeFogBlendFactor( ctx, *(GLfloat *)data );
	  out++;
	  data += stride;
	}
}
示例#2
0
static void r200_FogCoordfvEXT( const GLfloat *v )
{
   GET_CURRENT_CONTEXT(ctx);
   r200ContextPtr rmesa = R200_CONTEXT(ctx);
   GLfloat *dest = rmesa->vb.fogptr;
   dest[0] = r200ComputeFogBlendFactor( ctx, v[0] );
/*   ctx->Current.Attrib[VERT_ATTRIB_FOG][0] = v[0];*/
}
示例#3
0
static void emit_vecfog( GLcontext *ctx,
                         struct r200_dma_region *rvb,
                         char *data,
                         int stride,
                         int count )
{
    int i;
    GLfloat *out;

    r200ContextPtr rmesa = R200_CONTEXT(ctx);

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

    assert (!rvb->buf);

    if (stride == 0) {
        r200AllocDmaRegion( rmesa, rvb, 4, 4 );
        count = 1;
        rvb->aos_start = GET_START(rvb);
        rvb->aos_stride = 0;
        rvb->aos_size = 1;
    }
    else {
        r200AllocDmaRegion( rmesa, rvb, count * 4, 4 );	/* alignment? */
        rvb->aos_start = GET_START(rvb);
        rvb->aos_stride = 1;
        rvb->aos_size = 1;
    }

    /* Emit the data
     */
    out = (GLfloat *)(rvb->address + rvb->start);
    for (i = 0; i < count; i++) {
        out[0] = r200ComputeFogBlendFactor( ctx, *(GLfloat *)data );
        out++;
        data += stride;
    }

}