diff options
author | Marek Olšák <[email protected]> | 2011-04-21 12:53:16 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-04-21 15:51:18 +0200 |
commit | 883d8a0b449b53d83cc5970d2ce50df536aef55f (patch) | |
tree | 10b09a02971b2b1194e5406e67c1c7927f2ae143 /src/gallium/drivers/i915/i915_surface.c | |
parent | 64f55216e4c11e8acb787bfe40e6dd25e862cd43 (diff) |
gallium: add fallback for copying buffers to all drivers
Just to keep drivers working.
Reviewed-by: Jakob Bornecrantz <[email protected]>
Diffstat (limited to 'src/gallium/drivers/i915/i915_surface.c')
-rw-r--r-- | src/gallium/drivers/i915/i915_surface.c | 15 |
1 files changed, 15 insertions, 0 deletions
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 && |