diff options
author | Marek Olšák <[email protected]> | 2012-07-28 01:19:18 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-08-04 14:05:37 +0200 |
commit | 84645fa61390475e6efb080685e0dec059622a39 (patch) | |
tree | 03da220d7d9dd31568704f10a4cd4610ae693d34 /src/gallium/drivers/i915 | |
parent | e2f623f1d6da9bc987582ff68d0471061ae44030 (diff) |
gallium/u_blitter: add a query for checking whether copying is supported
v2: add comments
Diffstat (limited to 'src/gallium/drivers/i915')
-rw-r--r-- | src/gallium/drivers/i915/i915_resource_texture.c | 7 | ||||
-rw-r--r-- | src/gallium/drivers/i915/i915_surface.c | 7 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/gallium/drivers/i915/i915_resource_texture.c b/src/gallium/drivers/i915/i915_resource_texture.c index 8ff733a7be5..e60b5b435cc 100644 --- a/src/gallium/drivers/i915/i915_resource_texture.c +++ b/src/gallium/drivers/i915/i915_resource_texture.c @@ -739,11 +739,8 @@ i915_texture_get_transfer(struct pipe_context *pipe, /* if we use staging transfers, only support textures we can render to, * because we need that for u_blitter */ if (i915->blitter && - i915_is_format_supported(NULL, /* screen */ - transfer->b.resource->format, - 0, /* target */ - 1, /* sample count */ - PIPE_BIND_RENDER_TARGET) && + util_blitter_is_copy_supported(i915->blitter, resource, resource, + PIPE_MASK_RGBAZS) && (usage & PIPE_TRANSFER_WRITE) && !(usage & (PIPE_TRANSFER_READ | PIPE_TRANSFER_DONTBLOCK | PIPE_TRANSFER_UNSYNCHRONIZED))) use_staging_texture = TRUE; diff --git a/src/gallium/drivers/i915/i915_surface.c b/src/gallium/drivers/i915/i915_surface.c index c51689dcb4c..a25676efeca 100644 --- a/src/gallium/drivers/i915/i915_surface.c +++ b/src/gallium/drivers/i915/i915_surface.c @@ -59,6 +59,13 @@ i915_surface_copy_render(struct pipe_context *pipe, return; } + if (!util_blitter_is_copy_supported(i915->blitter, dst, src, + PIPE_MASK_RGBAZS)) { + 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); |