aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeha Bhende <[email protected]>2016-09-01 09:43:54 -0700
committerBrian Paul <[email protected]>2016-09-17 10:08:59 -0600
commitb7bee2505239ef1a14fecde5b73ffdab67694aa2 (patch)
tree459be8a56427fcef470f162bf8da0a8dd85839e2
parentb9f333cc8167594fa2c73a763a4e70ddf98e885f (diff)
svga: Use comparison between svga texture types to use PredCopyRegion command
PredCopyRegion support copy between same type of textures. Instead of comparing src and dst pipe texture type, compare svga texture type which can avoid some software fallback. for example, it avoids a software blit with the Redway3D Aston demo. Tested piglit tests on VGPU9 and VGPU10 on GL/DX11Renderer, Redway3D Aston demo v2: some nit pick suggested by Charmaine. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
-rw-r--r--src/gallium/drivers/svga/svga_pipe_blit.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_blit.c b/src/gallium/drivers/svga/svga_pipe_blit.c
index e1a4c069ca0..5a7fa308718 100644
--- a/src/gallium/drivers/svga/svga_pipe_blit.c
+++ b/src/gallium/drivers/svga/svga_pipe_blit.c
@@ -168,7 +168,8 @@ svga_resource_copy_region(struct pipe_context *pipe,
util_format_is_compressed(dst_tex->format) &&
!util_format_is_depth_and_stencil(src_tex->format) &&
stex->handle != dtex->handle &&
- src_tex->target == dst_tex->target) {
+ svga_resource_type(src_tex->target) ==
+ svga_resource_type(dst_tex->target)) {
copy_region_vgpu10(svga,
src_tex,
src_box->x, src_box->y, src_z,
@@ -229,16 +230,17 @@ can_blit_via_copy_region_vgpu10(struct svga_context *svga,
if (stex->handle == dtex->handle)
return false;
- // can't copy between different resource types
- if (blit_info->src.resource->target != blit_info->dst.resource->target)
+ /* can't copy between different resource types */
+ if (svga_resource_type(blit_info->src.resource->target) !=
+ svga_resource_type(blit_info->dst.resource->target))
return false;
- // check that the blit src/dst regions are same size, no flipping, etc.
+ /* check that the blit src/dst regions are same size, no flipping, etc. */
if (blit_info->src.box.width != blit_info->dst.box.width ||
blit_info->src.box.height != blit_info->dst.box.height)
return false;
- // depth/stencil copies not supported at this time
+ /* depth/stencil copies not supported at this time */
if (blit_info->mask != PIPE_MASK_RGBA)
return false;
@@ -246,7 +248,8 @@ can_blit_via_copy_region_vgpu10(struct svga_context *svga,
blit_info->scissor_enable)
return false;
- // check that src/dst surface formats are compatible for the VGPU device.
+ /* check that src/dst surface formats are compatible for
+ the VGPU device.*/
return util_is_format_compatible(
util_format_description(blit_info->src.resource->format),
util_format_description(blit_info->dst.resource->format));