Mesa (master): mesa: Add GL_BGRA_EXT to the list of GenerateMipmap internal formats.
Kenneth Graunke
kwg at kemper.freedesktop.org
Fri Jul 22 04:38:38 UTC 2016
Module: Mesa
Branch: master
Commit: cb7077312954299fb1febed5b016190c00cccfa0
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cb7077312954299fb1febed5b016190c00cccfa0
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Thu Jul 21 16:48:05 2016 -0700
mesa: Add GL_BGRA_EXT to the list of GenerateMipmap internal formats.
The GL_EXT_texture_format_BGRA8888 extension specification defines a
GL_BGRA_EXT unsized internal format (which is a little odd - usually
BGRA is a pixel transfer format). The extension is written against
the ES 1.0 specification, so it's a little hard to map, but I believe
it's effectively adding it to the table used here, so we should allow
it here as well.
Note that GL_EXT_texture_format_BGRA8888 is always enabled (dummy_true),
so we don't need to check if it's enabled here.
This fixes mipmap generation in Skia and ChromeOS.
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
References: https://bugs.chromium.org/p/chromium/issues/detail?id=630371
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reported-by: Stéphane Marchesin <marcheu at chromium.org>
Cc: mesa-stable at lists.freedesktop.org
---
src/mesa/main/genmipmap.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/mesa/main/genmipmap.c b/src/mesa/main/genmipmap.c
index 5e780c9..c952c4f 100644
--- a/src/mesa/main/genmipmap.c
+++ b/src/mesa/main/genmipmap.c
@@ -85,10 +85,15 @@ _mesa_is_valid_generate_texture_mipmap_internalformat(struct gl_context *ctx,
* not specified with an unsized internal format from table 8.3 or a
* sized internal format that is both color-renderable and
* texture-filterable according to table 8.10."
+ *
+ * GL_EXT_texture_format_BGRA8888 adds a GL_BGRA_EXT unsized internal
+ * format, and includes it in a very similar looking table. So we
+ * include it here as well.
*/
return internalformat == GL_RGBA || internalformat == GL_RGB ||
internalformat == GL_LUMINANCE_ALPHA ||
internalformat == GL_LUMINANCE || internalformat == GL_ALPHA ||
+ internalformat == GL_BGRA_EXT ||
(_mesa_is_es3_color_renderable(internalformat) &&
_mesa_is_es3_texture_filterable(ctx, internalformat));
}
More information about the mesa-commit
mailing list