예제 #1
0
파일: r600_blit.c 프로젝트: iquiw/xsrc
static void r600_copy_buffer(struct pipe_context *ctx, struct pipe_resource *dst, unsigned dstx,
			     struct pipe_resource *src, const struct pipe_box *src_box)
{
	struct r600_context *rctx = (struct r600_context*)ctx;

	if (rctx->screen->b.has_cp_dma) {
		r600_cp_dma_copy_buffer(rctx, dst, dstx, src, src_box->x, src_box->width);
	}
	else if (rctx->screen->b.has_streamout &&
		 /* Require 4-byte alignment. */
		 dstx % 4 == 0 && src_box->x % 4 == 0 && src_box->width % 4 == 0) {

		r600_blitter_begin(ctx, R600_COPY_BUFFER);
		util_blitter_copy_buffer(rctx->blitter, dst, dstx, src, src_box->x, src_box->width);
		r600_blitter_end(ctx);
	} else {
		util_resource_copy_region(ctx, dst, 0, dstx, 0, 0, src, 0, src_box);
	}

	/* The index buffer (VGT) doesn't seem to see the result of the copying.
	 * Can we somehow flush the index buffer cache? Starting a new IB seems
	 * to do the trick. */
	if (rctx->b.chip_class <= R700)
		rctx->b.rings.gfx.flush(ctx, RADEON_FLUSH_ASYNC, NULL);
}
예제 #2
0
파일: r600_blit.c 프로젝트: UIKit0/mesa-1
void r600_copy_buffer(struct pipe_context *ctx, struct pipe_resource *dst, unsigned dstx,
		      struct pipe_resource *src, const struct pipe_box *src_box)
{
	struct r600_context *rctx = (struct r600_context*)ctx;

	if (rctx->screen->has_cp_dma) {
		r600_cp_dma_copy_buffer(rctx, dst, dstx, src, src_box->x, src_box->width);
	}
	else if (rctx->screen->has_streamout &&
		 /* Require 4-byte alignment. */
		 dstx % 4 == 0 && src_box->x % 4 == 0 && src_box->width % 4 == 0) {

		/* Flush both resources. */
		r600_flag_resource_cache_flush(rctx, src);
		r600_flag_resource_cache_flush(rctx, dst);

		r600_blitter_begin(ctx, R600_COPY_BUFFER);
		util_blitter_copy_buffer(rctx->blitter, dst, dstx, src, src_box->x, src_box->width);
		r600_blitter_end(ctx);

		/* Flush the dst in case the 3D engine has been prefetching the resource. */
		r600_flag_resource_cache_flush(rctx, dst);
	} else {
		util_resource_copy_region(ctx, dst, 0, dstx, 0, 0, src, 0, src_box);
	}
}
예제 #3
0
파일: r600_blit.c 프로젝트: Kalamatee/mesa
static void r600_copy_buffer(struct pipe_context *ctx, struct pipe_resource *dst, unsigned dstx,
                             struct pipe_resource *src, const struct pipe_box *src_box)
{
    struct r600_context *rctx = (struct r600_context*)ctx;

    if (rctx->screen->b.has_cp_dma) {
        r600_cp_dma_copy_buffer(rctx, dst, dstx, src, src_box->x, src_box->width);
    }
    else if (rctx->screen->b.has_streamout &&
             /* Require 4-byte alignment. */
             dstx % 4 == 0 && src_box->x % 4 == 0 && src_box->width % 4 == 0) {

        r600_blitter_begin(ctx, R600_COPY_BUFFER);
        util_blitter_copy_buffer(rctx->blitter, dst, dstx, src, src_box->x, src_box->width);
        r600_blitter_end(ctx);
    } else {
        util_resource_copy_region(ctx, dst, 0, dstx, 0, 0, src, 0, src_box);
    }
}