svga: try blitting with copy region in more cases
authorBrian Paul <brianp@vmware.com>
Tue, 28 Jun 2016 23:13:57 +0000 (17:13 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 30 Jun 2016 20:32:08 +0000 (14:32 -0600)
We previously could do blits with util_resource_copy_region() when doing
'loose' format checking.  Also do blits with util_resource_copy_region()
when the blit src/dst formats (not the underlying resources) exactly
match.  Needed for GL_ARB_copy_image.

Acked-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
src/gallium/drivers/svga/svga_pipe_blit.c

index 438151fed70c76588dd8d73ac3a1e86505776783..bbb6156cdc0e183c6c28b52d3a7b41923b61f0d9 100644 (file)
@@ -293,7 +293,13 @@ svga_blit(struct pipe_context *pipe,
       return;
    }
 
-   if (util_try_blit_via_copy_region(pipe, blit_info)) {
+   if (util_can_blit_via_copy_region(blit_info, TRUE) ||
+       util_can_blit_via_copy_region(blit_info, FALSE)) {
+      util_resource_copy_region(pipe, blit_info->dst.resource,
+                                blit_info->dst.level,
+                                blit_info->dst.box.x, blit_info->dst.box.y,
+                                blit_info->dst.box.z, blit_info->src.resource,
+                                blit_info->src.level, &blit_info->src.box);
       return; /* done */
    }