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)) {
/** Is the drivers uniform storage packed or padded to 16 bytes. */
bool PackedDriverUniformStorage;
+ /** Wether or not glBitmap uses red textures rather than alpha */
+ bool BitmapUsesRed;
+
/** GL_ARB_gl_spirv */
struct spirv_supported_capabilities SpirVCapabilities;
ctx->Const.PackedDriverUniformStorage =
screen->get_param(screen, PIPE_CAP_PACKED_UNIFORMS);
+ ctx->Const.BitmapUsesRed =
+ screen->is_format_supported(screen, PIPE_FORMAT_R8_UNORM,
+ PIPE_TEXTURE_2D, 0, 0,
+ PIPE_BIND_SAMPLER_VIEW);
+
st->has_stencil_export =
screen->get_param(screen, PIPE_CAP_SHADER_STENCIL_EXPORT);
st->has_etc1 = screen->is_format_supported(screen, PIPE_FORMAT_ETC1_RGB8,