Swizzling is implemented by the hardware. Nouveau doesn't implement it
directly -- we just blit from a linear surface into a swizzled
surface.
Ideally you should be able to ignore swizzling entirely. However if an
application uploads pre-swizzled data, you have to deal with it. This
isn't possible with GL/DX, by the way... but obviously the driver
embedded in an application can do it if it chooses. Nouveau never
does.
https://envytools.readthedocs.io/en/latest/hw/memory/g80-surface.html#blocklinear-surfaces
Has an example of how blocklinear texture swizzling is done by the
hardware as a function of the various parameters.
Cheers,
-ilia
On Wed, Sep 19, 2018 at 7:26 PM, Fernando Sahmkow <fsahmkow27 at
gmail.com> wrote:> Thanks for the last info it was truely helpful.
>
> Anyways, I'm currently trying to implement 3D textures into yuzu, as
far as
> I know they are twiddled in a different manner to 2D textures. Could one of
> you guys point me in the right direction? I've been meddling around:
>
https://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/nouveau/nv50/nv50_tex.c
> but I can't see where the swizzling actualy takes place.
>
> _______________________________________________
> Nouveau mailing list
> Nouveau at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/nouveau
>