[Mesa-dev] [PATCH 1/2] st: fix st_choose_matching_format to ignore intensity

Marek Olšák maraeo at gmail.com
Sat Mar 29 17:46:49 PDT 2014


However st_choose_matching_format is also used by other clients such
as TexImage, GetTexImage, and ReadPixels, so this should really be
fixed in the problematic caller of st_choose_matching_format, that is
DrawPixels.

Marek

On Sat, Mar 29, 2014 at 7:48 PM, Chris Forbes <chrisf at ijw.co.nz> wrote:
> On Sun, Mar 30, 2014 at 12:50 AM, Marek Olšák <maraeo at gmail.com> wrote:
>
>> Why is this needed?
>
> The second patch fixes format/type to mesa_format matching for
> intensity formats, so that texture uploads / buffer object clears /
> etc can get the memcpy paths. (Previously, we were testing on pixel
> format = GL_INTENSITY, which is nonsense and disallowed by earlier
> checks.)
>
> Unfortunately, the intensity mesa_formats are listed before their red
> equivalants in the formats, so we'd end up picking an intensity format
> for DrawPixels( GL_RED, ...
>
> If that happens, then the actual draw later in DrawPixels would write
> <I, I, I, I> to the destination, rather than <R, 0, 0, 1>.
>
> https://bugs.freedesktop.org/show_bug.cgi?id=76601
> https://bugs.freedesktop.org/show_bug.cgi?id=76602


More information about the mesa-dev mailing list