mesa/texture: Also check for LA texture when querying intensity component size
authorGert Wollny <gert.wollny@collabora.com>
Mon, 10 Sep 2018 10:39:44 +0000 (12:39 +0200)
committerGert Wollny <gw.fossdev@gmail.com>
Tue, 11 Sep 2018 07:07:05 +0000 (09:07 +0200)
commit47e01e77d8b658606527f048cda786440f7fbe85
tree410cf8888e6e369a910607df89c7abcfe3c4a51c
parent133e12fb69f7d918f9fbaed0341ab83a5d83125c
mesa/texture: Also check for LA texture when querying intensity component size

Gallium may pick L16A16_FLOAT to represent GL_INTENSITY16F if no intensity
format is provided by the driver. However, when calling

   glGetTexLevelParameteriv(..., GL_TEXTURE_INTENSITY_SIZE, ...)

mesa will return a zero size because the actually used format has no
intensity channel and as a fallback only the sizes of the red/green
channels are checked.

Also checking for LA sizes in the allocated texture resolves this problem.

v2: Only check alpha channel size and return it (Marek)
    L and A size are always the same in this case.

Fixes (on virgl):
  ext_framebuffer_multisample-fast-clear GL_ARB_texture_float *

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107832

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/main/texparam.c