[Mesa-dev] [PATCH] st/mesa: optionally apply texture swizzle to border color

Christoph Bumiller e0425955 at student.tuwien.ac.at
Sun Apr 14 05:59:21 PDT 2013


On 14.04.2013 14:33, Christoph Bumiller wrote:
>  
> ===
> In the format description (including swizzle), each color component of
> RGBA (as seen by the shader) gets mapped a memory component
> {C0,C1,C2,C3} or {ZERO,ONE_INT,ONE_FLOAT}.
>
> When a memory (!) component (Cx) is first encountered when going through
> RGBA, it is assigned the SAMPLER_BORDER_COLOR component value for that
> component, and if the memory component is encountered again (because of
> swizzle), that same value will be used.
>
> So, assuming memory format RGBA and the swizzle 1RBG:
> R = ONE
> G = C0
> B = C2
> A = C1
> the border colour will be SAMPLER_BORDER_COLOR.1GBA.
>
> The resulting border colour with swizzle applied to the sampler would be
> (lowercase being user values):
> R=1
> G=r
> B=b
> A=g
>
> resulting in 1rbg, which works out.
> ===
>

Sorry, that was a bad example, I feel the need to give a better one:

When a memory component (Cx) is first encountered when going through RGBA, it is assigned the SAMPLER_BORDER_COLOR.R/G/B/A component value, and if the memory component is encountered again (because of swizzle), that same value will be used.

RGBA8 with swizzle G1GB:
R=C1
G=ONE
B=C1
A=C2

gets BORDER_COLOR.R1RA.

Maybe that's the same thing that happens on r600 (I just recall "undo
the swizzle in a weird way") ?




More information about the mesa-dev mailing list