Re: [Mesa-dev] [RFC] gallium/u_blitter: support blitting PIPE_BUFFERs

2017-11-22 Thread Roland Scheidegger
Am 22.11.2017 um 16:56 schrieb Rob Clark: > So, I could potentially do this for a5xx, which actually has a sort of > blit engine. But for earlier gen's, everything is a glDraw(), and I > don't want to duplicate the functionality of u_blitter. > > I suppose I could bypass util_blitter_blit() and u

Re: [Mesa-dev] [RFC] gallium/u_blitter: support blitting PIPE_BUFFERs

2017-11-22 Thread Marek Olšák
I don't have anything against driver-specific hacks in u_blitter, because it already contains a lot of that, although separated in special functions. For buffer blitting, I recommend using DMA. Your hw should have it, because it's roughly based on radeon, which has had CP DMA since r200. If not,

Re: [Mesa-dev] [RFC] gallium/u_blitter: support blitting PIPE_BUFFERs

2017-11-22 Thread Rob Clark
So, I could potentially do this for a5xx, which actually has a sort of blit engine. But for earlier gen's, everything is a glDraw(), and I don't want to duplicate the functionality of u_blitter. I suppose I could bypass util_blitter_blit() and use util_blitter_blit_generic() directly.. BR, -R O

Re: [Mesa-dev] [RFC] gallium/u_blitter: support blitting PIPE_BUFFERs

2017-11-22 Thread Roland Scheidegger
I don't think this is a good idea. 1D and buffer resources are fundamentally incompatible, it is highly illegal to use targets in views which are incompatible, so I'd rather not see such atrocities in shared code. I think you really want to fix up your resource_copy_region implementation one way or

Re: [Mesa-dev] [RFC] gallium/u_blitter: support blitting PIPE_BUFFERs

2017-11-22 Thread Rob Clark
yes, because that ends up being a cpu copy for BUFFER (ie. stall), which is what I'm trying to avoid in the first place ;-) Maybe this needs to map things to a linear 2d buffer for larger sizes, not sure. One way or another at the hw level this gets treated like a 2d render target (which might ha

Re: [Mesa-dev] [RFC] gallium/u_blitter: support blitting PIPE_BUFFERs

2017-11-22 Thread Ilia Mirkin
Are you sure you're not looking for resource_copy_region? BUFFERs can be wide (128MB in many impls), 1D textures can't. There are probably other differences. On Wed, Nov 22, 2017 at 9:43 AM, Rob Clark wrote: > It is useful for staging/shadow transfers for drivers to be able to blit > BUFFERs. Tr

[Mesa-dev] [RFC] gallium/u_blitter: support blitting PIPE_BUFFERs

2017-11-22 Thread Rob Clark
It is useful for staging/shadow transfers for drivers to be able to blit BUFFERs. Treat them as R8 1D textures for this purpose. Signed-off-by: Rob Clark --- This works at least if 1D textures are linear, so I suppose might not work for all drivers. Although I'm not entirely sure what the point