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

Vadim Girlin vadimgirlin at gmail.com
Mon Apr 8 10:18:33 PDT 2013


On 04/08/2013 02:03 PM, Marek Olšák wrote:
> 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).
>

I also looked into this issue some time ago (on evergreen) and IIRC I 
found that the swizzle is actually applied twice to border color in most 
cases (at least when swizzle_y is not 2 or 3), I think it's just a bug 
(or we are missing something in the hw configuration).

Anyway, according to my tests in many cases (960 of 1296 total swizzles, 
74%) it's possible to apply some precomputed swizzle to border color 
before writing it to the registers to get the correct result in the end, 
but I'm not sure if it makes sense to implement that.

Vadim

> It was easy with r300, because I could just undo pipe_format swizzling
> before passing the border color to the hardware.
>
> Marek
>
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>



More information about the mesa-dev mailing list