Mesa (master): svga: allow copy_region if sample counts match

Brian Paul brianp at kemper.freedesktop.org
Thu Nov 3 20:31:02 UTC 2016


Module: Mesa
Branch: master
Commit: ec138d62377adf9aa03bda6a8f882bc3361d170c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ec138d62377adf9aa03bda6a8f882bc3361d170c

Author: Charmaine Lee <charmainel at vmware.com>
Date:   Fri Oct 28 11:39:47 2016 -0700

svga: allow copy_region if sample counts match

With this patch, we will allow blit with copy_region if the
source and destination textures have the same sample counts.

Fixes failures with piglit tests
 spec at arb_texture_float@multisample-formats 2 gl_arb_texture_float
 spec at arb_texture_rg@multisample-formats 2 gl_arb_texture_rg-float

Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/gallium/drivers/svga/svga_pipe_blit.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_pipe_blit.c b/src/gallium/drivers/svga/svga_pipe_blit.c
index 3e236fc..84d36e1 100644
--- a/src/gallium/drivers/svga/svga_pipe_blit.c
+++ b/src/gallium/drivers/svga/svga_pipe_blit.c
@@ -171,7 +171,8 @@ svga_resource_copy_region(struct pipe_context *pipe,
           util_format_is_compressed(dst_tex->format) &&
           stex->handle != dtex->handle &&
           svga_resource_type(src_tex->target) ==
-          svga_resource_type(dst_tex->target)) {
+          svga_resource_type(dst_tex->target) &&
+          stex->b.b.nr_samples == dtex->b.b.nr_samples) {
          copy_region_vgpu10(svga,
                             src_tex,
                             src_box->x, src_box->y, src_z,
@@ -249,7 +250,7 @@ can_blit_via_copy_region_vgpu10(struct svga_context *svga,
    stex = svga_texture(blit_info->src.resource);
    dtex = svga_texture(blit_info->dst.resource);
 
-   // can't copy within one resource
+   /* can't copy within one resource */
    if (stex->handle == dtex->handle)
       return false;
 
@@ -263,8 +264,13 @@ can_blit_via_copy_region_vgpu10(struct svga_context *svga,
        blit_info->src.box.height != blit_info->dst.box.height)
       return false;
 
-   /* For depth+stencil formats, copy with maks != PIPE_MASK_ZS is not
-    * supported */
+   /* check that sample counts are the same */
+   if (stex->b.b.nr_samples != dtex->b.b.nr_samples)
+      return false;
+
+   /* For depth+stencil formats, copy with mask != PIPE_MASK_ZS is not
+    * supported
+    */
    if (util_format_is_depth_and_stencil(blit_info->src.format) &&
       blit_info->mask != (PIPE_MASK_ZS))
      return false;




More information about the mesa-commit mailing list