From 883d8a0b449b53d83cc5970d2ce50df536aef55f Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Thu, 21 Apr 2011 12:53:16 +0200 Subject: gallium: add fallback for copying buffers to all drivers Just to keep drivers working. Reviewed-by: Jakob Bornecrantz --- src/gallium/drivers/i915/i915_surface.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/gallium/drivers/i915') diff --git a/src/gallium/drivers/i915/i915_surface.c b/src/gallium/drivers/i915/i915_surface.c index d02c420f6c2..ac6e94500c8 100644 --- a/src/gallium/drivers/i915/i915_surface.c +++ b/src/gallium/drivers/i915/i915_surface.c @@ -37,6 +37,7 @@ #include "util/u_format.h" #include "util/u_memory.h" #include "util/u_pack_color.h" +#include "util/u_surface.h" /* * surface functions using the render engine @@ -51,6 +52,13 @@ i915_surface_copy_render(struct pipe_context *pipe, { struct i915_context *i915 = i915_context(pipe); + /* Fallback for buffers. */ + if (dst->target == PIPE_BUFFER && src->target == PIPE_BUFFER) { + util_resource_copy_region(pipe, dst, dst_level, dstx, dsty, dstz, + src, src_level, src_box); + return; + } + util_blitter_save_blend(i915->blitter, (void *)i915->blend); util_blitter_save_depth_stencil_alpha(i915->blitter, (void *)i915->depth_stencil); util_blitter_save_stencil_ref(i915->blitter, &i915->stencil_ref); @@ -158,6 +166,13 @@ i915_surface_copy_blitter(struct pipe_context *pipe, struct pipe_resource *spt = &src_tex->b.b; unsigned dst_offset, src_offset; /* in bytes */ + /* Fallback for buffers. */ + if (dst->target == PIPE_BUFFER && src->target == PIPE_BUFFER) { + util_resource_copy_region(pipe, dst, dst_level, dstx, dsty, dstz, + src, src_level, src_box); + return; + } + /* XXX cannot copy 3d regions at this time */ assert(src_box->depth == 1); if (dst->target != PIPE_TEXTURE_CUBE && -- cgit v1.2.3