mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
cogl: Don't use GL_ALPHA
It was deprecated in OpenGL and it isn't even a valid value anymore for functions like `glTextImage2D()` in OpenGL 4. https://gitlab.gnome.org/GNOME/mutter/merge_requests/612
This commit is contained in:
parent
d3e789e677
commit
e04cbddf92
@ -111,20 +111,8 @@ _cogl_driver_pixel_format_to_gl (CoglContext *context,
|
|||||||
switch (format)
|
switch (format)
|
||||||
{
|
{
|
||||||
case COGL_PIXEL_FORMAT_A_8:
|
case COGL_PIXEL_FORMAT_A_8:
|
||||||
/* If the driver doesn't natively support alpha textures then we
|
glintformat = GL_RED;
|
||||||
* will use a red component texture with a swizzle to implement
|
glformat = GL_RED;
|
||||||
* the texture */
|
|
||||||
if (_cogl_has_private_feature
|
|
||||||
(context, COGL_PRIVATE_FEATURE_ALPHA_TEXTURES) == 0)
|
|
||||||
{
|
|
||||||
glintformat = GL_RED;
|
|
||||||
glformat = GL_RED;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
glintformat = GL_ALPHA;
|
|
||||||
glformat = GL_ALPHA;
|
|
||||||
}
|
|
||||||
gltype = GL_UNSIGNED_BYTE;
|
gltype = GL_UNSIGNED_BYTE;
|
||||||
break;
|
break;
|
||||||
case COGL_PIXEL_FORMAT_G_8:
|
case COGL_PIXEL_FORMAT_G_8:
|
||||||
|
@ -98,11 +98,8 @@ _cogl_texture_driver_gen (CoglContext *ctx,
|
|||||||
g_assert_not_reached();
|
g_assert_not_reached();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the driver doesn't support alpha textures directly then we'll
|
/* GL_ALPHA is deprecated; instead, use GL_RED with a swizzle mask */
|
||||||
* fake them by setting the swizzle parameters */
|
if (internal_format == COGL_PIXEL_FORMAT_A_8)
|
||||||
if (internal_format == COGL_PIXEL_FORMAT_A_8 &&
|
|
||||||
!_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_ALPHA_TEXTURES) &&
|
|
||||||
_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_TEXTURE_SWIZZLE))
|
|
||||||
{
|
{
|
||||||
static const GLint red_swizzle[] = { GL_ZERO, GL_ZERO, GL_ZERO, GL_RED };
|
static const GLint red_swizzle[] = { GL_ZERO, GL_ZERO, GL_ZERO, GL_RED };
|
||||||
|
|
||||||
|
@ -83,8 +83,8 @@ _cogl_driver_pixel_format_to_gl (CoglContext *context,
|
|||||||
switch (format)
|
switch (format)
|
||||||
{
|
{
|
||||||
case COGL_PIXEL_FORMAT_A_8:
|
case COGL_PIXEL_FORMAT_A_8:
|
||||||
glintformat = GL_ALPHA;
|
glintformat = GL_RED;
|
||||||
glformat = GL_ALPHA;
|
glformat = GL_RED;
|
||||||
gltype = GL_UNSIGNED_BYTE;
|
gltype = GL_UNSIGNED_BYTE;
|
||||||
break;
|
break;
|
||||||
case COGL_PIXEL_FORMAT_G_8:
|
case COGL_PIXEL_FORMAT_G_8:
|
||||||
|
Loading…
Reference in New Issue
Block a user