[Mesa-dev] swizzling in llvmpipe [was: other stuff]
keith whitwell
keith.whitwell at gmail.com
Wed Sep 1 12:40:29 PDT 2010
On Wed, Sep 1, 2010 at 7:54 PM, Luca Barbieri <luca at luca-barbieri.com> wrote:
>> It still sounds that you're referring to sampling from a texture and not
>> rendering/blending to it. Of course the are related (we only want one
>> swizzled layout at most), but the current swizzled layout was chosen to
>> make blending easy; and not to make texture sampling easy.
>>
>> No SoA swizzled layout makes texture sampling easier or more efficient.
>
> Yes, I incorrectly assumed that sampling were performed using the
> swizzled SoA layout too, which is indeed not the case and probably
> would be a bad idea.
>
> Perhaps always keeping the texture in a linear layout and converting
> before/after processing tiles could be an option? It seems the current
> code can do this, but only does in some cases (not totally sure).
We switched to this a little while ago, though the code is more
structured towards the original approach so it isn't easy to tell.
Z buffers are special as they are normally never accessed outside
shaders, so they stay swizzled always. That's about it.
> That would even allow to keep the tiles in a SoA floating point layout
> without any significant RAM usage disadvantage.
> This may perhaps be faster than the current scheme, since you don't
> have to do format conversions during rendering (but you get a larger
> cache footprint, and need to clamp anyway for correctness before and
> after blending).
Switching to this scheme was indeed a win. If nothing changes, this
is where we'll stay but at some point I'll make the experiment of
shading directly into the linear format.
Keith
More information about the mesa-dev
mailing list