summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorGert Wollny <[email protected]>2018-09-10 12:39:44 +0200
committerGert Wollny <[email protected]>2018-09-11 09:07:05 +0200
commit47e01e77d8b658606527f048cda786440f7fbe85 (patch)
tree410cf8888e6e369a910607df89c7abcfe3c4a51c /src/mesa/main
parent133e12fb69f7d918f9fbaed0341ab83a5d83125c (diff)
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 <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/texparam.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index b5d86d64d5b..a3ec7241986 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -1426,6 +1426,11 @@ get_tex_level_parameter_image(struct gl_context *ctx,
_mesa_get_format_bits(texFormat,
GL_TEXTURE_GREEN_SIZE));
}
+ if (*params == 0 && pname == GL_TEXTURE_INTENSITY_SIZE) {
+ /* Gallium may store intensity as LA */
+ *params = _mesa_get_format_bits(texFormat,
+ GL_TEXTURE_ALPHA_SIZE);
+ }
}
else {
*params = 0;