Mesa (master): galahad,util: warn on resource target mismatch in copy_region

Marek Olšák mareko at kemper.freedesktop.org
Thu Apr 21 06:53:02 PDT 2011


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Thu Apr 21 15:13:34 2011 +0200

galahad,util: warn on resource target mismatch in copy_region

Reviewed-by: Jakob Bornecrantz <jakob at vmware.com>

---

 src/gallium/auxiliary/util/u_surface.c     |    3 +++
 src/gallium/drivers/galahad/glhd_context.c |    6 ++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c
index 43a0266..4c5cc4d 100644
--- a/src/gallium/auxiliary/util/u_surface.c
+++ b/src/gallium/auxiliary/util/u_surface.c
@@ -157,6 +157,9 @@ util_resource_copy_region(struct pipe_context *pipe,
    unsigned h = src_box->height;
 
    assert(src && dst);
+   assert((src->target == PIPE_BUFFER && dst->target == PIPE_BUFFER) ||
+          (src->target != PIPE_BUFFER && dst->target != PIPE_BUFFER));
+
    if (!src || !dst)
       return;
 
diff --git a/src/gallium/drivers/galahad/glhd_context.c b/src/gallium/drivers/galahad/glhd_context.c
index 813a21e..f73d8a5 100644
--- a/src/gallium/drivers/galahad/glhd_context.c
+++ b/src/gallium/drivers/galahad/glhd_context.c
@@ -685,6 +685,12 @@ galahad_resource_copy_region(struct pipe_context *_pipe,
          util_format_short_name(_dst->format));
    }
 
+   if ((_src->target == PIPE_BUFFER && _dst->target != PIPE_BUFFER) ||
+       (_src->target != PIPE_BUFFER && _dst->target == PIPE_BUFFER)) {
+      glhd_warn("Resource target mismatch: Source is %i, destination is %i",
+                _src->target, _dst->target);
+   }
+
    pipe->resource_copy_region(pipe,
                               dst,
                               dst_level,



More information about the mesa-commit mailing list