mirror of
https://github.com/flyinghead/flycast.git
synced 2026-11-08 08:06:48 -10:00
gl: use red for single channel textures instead of alpha on GLES3
Only GLES2 needs to use the alpha channel. glTexStorage2D only supports red. Issue #1391
This commit is contained in:
1 parent
c146a92f83
commit
3469b7fca7
1 file changed
+3
-2
@@ -49,7 +49,7 @@ const char* ShaderCompatSource = R"(
|
||||
#if TARGET_GL == GLES3
|
||||
out highp vec4 FragColor;
|
||||
#define gl_FragColor FragColor
|
||||
#define FOG_CHANNEL a
|
||||
#define FOG_CHANNEL r
|
||||
#elif TARGET_GL == GL3
|
||||
out highp vec4 FragColor;
|
||||
#define gl_FragColor FragColor
|
||||
@@ -554,6 +554,7 @@ void findGLVersion()
|
||||
gl.border_clamp_supported = true;
|
||||
gl.prim_restart_supported = false;
|
||||
gl.prim_restart_fixed_supported = true;
|
||||
gl.single_channel_format = GL_RED;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -562,8 +563,8 @@ void findGLVersion()
|
||||
gl.index_type = GL_UNSIGNED_SHORT;
|
||||
gl.prim_restart_supported = false;
|
||||
gl.prim_restart_fixed_supported = false;
|
||||
gl.single_channel_format = GL_ALPHA;
|
||||
}
|
||||
gl.single_channel_format = GL_ALPHA;
|
||||
const char *extensions = (const char *)glGetString(GL_EXTENSIONS);
|
||||
if (strstr(extensions, "GL_OES_packed_depth_stencil") != NULL)
|
||||
gl.GL_OES_packed_depth_stencil_supported = true;
|
||||
|
||||
Reference in new issue
Block a user