Mesa (master): nv50: use 2d blit when src/dst have same number of samples

Ilia Mirkin imirkin at kemper.freedesktop.org
Sun Apr 20 04:31:38 UTC 2014


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

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Thu Apr 17 23:51:25 2014 -0400

nv50: use 2d blit when src/dst have same number of samples

The 2D engine should be usable in more cases, but this fixes MS blits
between textures with the same MS settings. Otherwise a single sample is
selected to be the target texel value.

This allows other tests to work that render to a RB and then blit that
to a texture for input into a shader that uses sampler2DMS to verify it.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>

---

 src/gallium/drivers/nouveau/nv50/nv50_surface.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nv50/nv50_surface.c b/src/gallium/drivers/nouveau/nv50/nv50_surface.c
index 9da88c1..e60aec5 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_surface.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_surface.c
@@ -1292,8 +1292,8 @@ nv50_blit_eng2d(struct nv50_context *nv50, const struct pipe_blit_info *info)
 
    if (src->base.base.nr_samples > dst->base.base.nr_samples) {
       /* center src coorinates for proper MS resolve filtering */
-      srcx += (int64_t)src->ms_x << 32;
-      srcy += (int64_t)src->ms_y << 32;
+      srcx += (int64_t)1 << (src->ms_x + 31);
+      srcy += (int64_t)1 << (src->ms_y + 31);
    }
 
    dstx = info->dst.box.x << dst->ms_x;
@@ -1431,8 +1431,8 @@ nv50_blit(struct pipe_context *pipe, const struct pipe_blit_info *info)
       eng3d = TRUE;
 
    /* FIXME: can't make this work with eng2d anymore */
-   if (info->src.resource->nr_samples > 1 ||
-       info->dst.resource->nr_samples > 1)
+   if ((info->src.resource->nr_samples | 1) !=
+       (info->dst.resource->nr_samples | 1))
       eng3d = TRUE;
 
    /* FIXME: find correct src coordinate adjustments */




More information about the mesa-commit mailing list