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

Chris Forbes chrisf at ijw.co.nz
Sat Mar 29 11:48:34 PDT 2014


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