OK, here's the patch:<br><br> galahad,util: warn on resource target mismatch in copy_region<br><br>diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surfac<br>index 43a0266..4c5cc4d 100644<br>
--- a/src/gallium/auxiliary/util/u_surface.c<br>+++ b/src/gallium/auxiliary/util/u_surface.c<br>@@ -157,6 +157,9 @@ util_resource_copy_region(struct pipe_context *pipe,<br> unsigned h = src_box->height;<br> <br> assert(src && dst);<br>
+ assert((src->target == PIPE_BUFFER && dst->target == PIPE_BUFFER) ||<br>+ (src->target != PIPE_BUFFER && dst->target != PIPE_BUFFER));<br>+<br> if (!src || !dst)<br> return;<br>
<br>diff --git a/src/gallium/drivers/galahad/glhd_context.c b/src/gallium/drivers/galahad/glh<br>index 813a21e..f73d8a5 100644<br>--- a/src/gallium/drivers/galahad/glhd_context.c<br>+++ b/src/gallium/drivers/galahad/glhd_context.c<br>
@@ -685,6 +685,12 @@ galahad_resource_copy_region(struct pipe_context *_pipe,<br> util_format_short_name(_dst->format));<br> }<br> <br>+ if ((_src->target == PIPE_BUFFER && _dst->target != PIPE_BUFFER) ||<br>
+ (_src->target != PIPE_BUFFER && _dst->target == PIPE_BUFFER)) {<br>+ glhd_warn("Resource target mismatch: Source is %i, destination is %i",<br>+ _src->target, _dst->target);<br>
+ }<br>+<br> pipe->resource_copy_region(pipe,<br> dst,<br> dst_level,<br><br>Marek<br><br><div class="gmail_quote">On Thu, Apr 21, 2011 at 2:53 PM, Jakob Bornecrantz <span dir="ltr"><<a href="mailto:wallbraker@gmail.com" target="_blank">wallbraker@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div>On Thu, Apr 21, 2011 at 2:47 PM, Marek Olšák <<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>> wrote:<br>
> On Thu, Apr 21, 2011 at 1:19 PM, Jakob Bornecrantz <<a href="mailto:wallbraker@gmail.com" target="_blank">wallbraker@gmail.com</a>><br>
> wrote:<br>
>><br>
>> On Thu, Apr 21, 2011 at 1:11 PM, Marek Olšák <<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>> wrote:<br>
>> > Hi,<br>
>> ><br>
>> > This little series implements CopyBufferSubData via resource_copy_region<br>
>> > and adds a fallback implementation to all drivers. Now drivers can implement<br>
>> > a fast path for CopyBufferSubData instead of always defaulting to the<br>
>> > software path.<br>
>> ><br>
>> > I have tested this series with glean/bufferObject on r600g, softpipe,<br>
>> > and llvmpipe. Please review.<br>
>><br>
>> I'm assuming that it is not allowed to copy_region between buffers and<br>
>> none buffers? Maybe some asserts to that effect?<br>
><br>
> In util_resource_copy_region? Or in all the drivers? Or just Galahad?<br>
<br>
</div></div>util_resource_copy_region and Galahad, drivers are free to assert if<br>
they want to but its not something you need to add.<br>
<br>
Cheers Jakob.<br>
</blockquote></div><br>