[Mesa-dev] [PATCH 2/2] radeonsi: add support for compressed texture

Marek Olšák maraeo at gmail.com
Mon Apr 8 03:03:51 PDT 2013


On Mon, Apr 8, 2013 at 11:29 AM, Michel Dänzer <michel at daenzer.net> wrote:

> On Fre, 2013-04-05 at 17:36 -0400, j.glisse at gmail.com wrote:
> > From: Jerome Glisse <jglisse at redhat.com>
> >
> > Most test pass, issue are with border color and swizzle.
>
> FWIW, those issues are there with non-compressed formats as well. I'm
> afraid we might need to change the hardware border colour depending on
> the swizzle.
>

I don't think so. The issue with the swizzled border color seems to be a
bad hardware design decision present since r600 rather than a hardware bug.
I tried fixing it for older chipsets with no success. I doubt the hw
designers fixed this for SI. The problem is the hardware tries to guess
what the border color swizzle is from the combined pipe_format+sampler view
swizzle combination. You need 2 texture swizzle states in the texture unit
for the border color to be swizzled correctly, because texels must be
swizzled by the pipe_format swizzle and sampler view swizzle, but the
border color must be swizzled by the sampler view only. The main problem is
that the hardware internally tries to undo the pipe_format swizzle in a way
that just doesn't work. I don't remember the exact swizzles being used by
hardware, but I got crazy cases like if I set texture swizzle to ywzx, the
border color will be ywyy. There is no way to access those zx components of
the border color for that specific swizzling. For some cases, the hardware
succeeds in guessing what the border color should be, e.g. if I set texture
swizzle to .zyxw, the returned border color will be .xyzw (and that would
be correct if the swizzle came from pipe_format, and incorrect if the
swizzle came from sampler view).

It was easy with r300, because I could just undo pipe_format swizzling
before passing the border color to the hardware.

Marek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130408/30796fd5/attachment.html>


More information about the mesa-dev mailing list