Keith Whitwell wrote:
> On Thu, 2009-03-05 at 04:19 -0800, Michel Dänzer wrote:
>> On Wed, 2009-03-04 at 15:53 -0800, Corbin Simpson wrote:
>>> Module: Mesa
>>> Branch: master
>>> Commit: 04ae9c3fdd62831485b7384da62566a0b82b84af
>>> URL:    
>>> http://cgit.freedesktop.org/mesa/mesa/commit/?id=04ae9c3fdd62831485b7384da62566a0b82b84af
>>>
>>> Author: Corbin Simpson <[email protected]>
>>> Date:   Wed Mar  4 13:47:44 2009 -0800
>>>
>>> r300-gallium: Add unaccelerated surface_copy.
>> [...]
>>
>>> +    if (TRUE) {
>>> +        debug_printf("r300: Falling back on surface_copy\n");
>>> +        return util_surface_copy(pipe, do_flip, dest, destx, desty, src,
>>> +                srcx, srcy, w, h);
>>> +    }
>> Have you tried using util_blit_pixels_tex()? I think that'd probably be
>> as good as it's gonna get at least for cards without a 2D engine...
> 
> I think the trouble with the util_blit code is that it's designed to be
> called from outside the driver - ie the state tracker level -- it
> assumes the existence of the CSO code, etc, which strictly isn't
> guaranteed to be there.
> 
> That said, it will probably work just fine...

Let me explain my reasoning.

Okay, so the commented-out code following that fallback is the blitter
setup. It's simple, straightforward, and clean, but it requires a
massive flush before and after, so I probably will toss it out.

So surface_copy will eventually be done on the 3D engine instead. This
works terrifically, as long as there's no overlap between src and dest.
As Jakob has reminded me, there's no guarantee made in Gallium regarding
whether or not the src and dest will overlap in memory. Even worse, the
check for whether or not they overlap is non-trivial and I haven't quite
figured out how I'm going to handle that, although I think just checking
with something like this will work:

fallback_from_overlap = ((src == dest) &&
    ((srcx < destx) ? (srcx + w >= destx) : (destx + w >= srcx)) &&
    ((srcy < desty) ? (srcy + h >= desty) : (desty + h >= srcy));

So my plan is to have code that flows kind of like this:

if (fallback_from_overlap) {
    util_surface_copy();
    return;
}
do_textured_video_style_blit();

So is it possible to guarantee that blits will always be
non-overlapping, or am I just going to have to deal with it?

~ C.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to