From bbdbb02a5fc16dfd9bc4ff3142c3177e2051b87e Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 15 Jul 2019 12:03:43 +0200 Subject: mesa/main: prefer R8-textures instead of A8 for glBitmap in display lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows drivers to communicate that they prefer R8 textures rather than A8 for glBitmap usage. Reviewed-by: Marek Olšák --- src/mesa/main/dlist.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/mesa/main/dlist.c') diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 708c25f004e..622fb805660 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -941,9 +941,14 @@ build_bitmap_atlas(struct gl_context *ctx, struct gl_bitmap_atlas *atlas, goto out_of_memory; } - _mesa_init_teximage_fields(ctx, atlas->texImage, - atlas->texWidth, atlas->texHeight, 1, 0, - GL_ALPHA, MESA_FORMAT_A_UNORM8); + if (ctx->Const.BitmapUsesRed) + _mesa_init_teximage_fields(ctx, atlas->texImage, + atlas->texWidth, atlas->texHeight, 1, 0, + GL_RED, MESA_FORMAT_R_UNORM8); + else + _mesa_init_teximage_fields(ctx, atlas->texImage, + atlas->texWidth, atlas->texHeight, 1, 0, + GL_ALPHA, MESA_FORMAT_A_UNORM8); /* alloc image storage */ if (!ctx->Driver.AllocTextureImageBuffer(ctx, atlas->texImage)) { -- cgit v1.2.3