[Mesa-dev] [PATCH v2] mesa: Fix swizzling for luminance/intensity in _mesa_readpixels

Chris Wilson chris at chris-wilson.co.uk
Thu Aug 3 09:39:52 UTC 2017


Quoting Kenneth Graunke (2017-08-02 21:43:33)
> I'm not so sure.  Table 8.25 of the GL 4.4 compatibility spec (page 257),
> below glGetTexImage, shows this:
> 
>    +--------------------------------------------+
>    |  Base Internal Format  | R  | G  | B  | A  |
>    +--------------------------------------------+
>    | ALPHA                  | 0  | 0  | 0  | Ai |
>    | LUMINANCE (or 1)       | Li | 0  | 0  | 1  |
>    | LUMINANCE_ALPHA (or 2) | Li | 0  | 0  | Ai |
>    | INTENSITY              | Ii | 0  | 0  | 1  |
>    | RED                    | Ri | 0  | 0  | 1  |
>    | RG                     | Ri | Gi | 0  | 1  |
>    | RGB (or 3)             | Ri | Gi | Bi | 1  |
>    | RGBA (or 4)            | Ri | Gi | Bi | Ai | 
>    +--------------------------------------------+
> 
> which indicates that the current bizarre <R, 0, 0, 1 or A> behavior
> might actually be correct for glGetTexImage (?)

That would make a very nice comment above the swizzling in read_rgba_pixels().

formats.csv still has the old swizzling behaviour listed, but I don't
know if that's relevant.
-Chris


More information about the mesa-dev mailing list