galahad,util: warn on resource target mismatch in copy_region
authorMarek Olšák <maraeo@gmail.com>
Thu, 21 Apr 2011 13:13:34 +0000 (15:13 +0200)
committerMarek Olšák <maraeo@gmail.com>
Thu, 21 Apr 2011 13:51:18 +0000 (15:51 +0200)
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
src/gallium/auxiliary/util/u_surface.c
src/gallium/drivers/galahad/glhd_context.c

index 43a026691d37bac01d74fd9dc4c8ca425559ca56..4c5cc4da18254a2eeedc04f9bdf4f6eabffdb7a3 100644 (file)
@@ -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;
 
index 813a21e2ee30cd29e78404f5600b82c6ac9edcaf..f73d8a5d32e6d8fc61fba8194aca0fa6e226f9be 100644 (file)
@@ -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,