summaryrefslogtreecommitdiff
path: root/glamor/glamor.c
diff options
context:
space:
mode:
authorKonstantin Pugin <ria.freelander@gmail.com>2022-07-24 16:03:51 +0300
committerEmma Anholt <emma@anholt.net>2023-10-09 17:25:28 +0000
commitee107cd4911e692480ab2ff9c12e3c6958bdec4e (patch)
tree5f8ed817acb1f24dcaf3da248848f7b12ea90e5a /glamor/glamor.c
parent8adff2891f23b1cb097a4132f39fa96667313af5 (diff)
glamor: support GLES3 shaders
Some hardware (preferably mobile) working on GLES3 way faster than on desktop GL and supports more features. This commit will allow using GLES3 if glamor is running over GL ES, and version 3 is supported. Changes are the following: 1. Add compatibility layer for 120/GLES2 shaders with defines in and out 2. Switch attribute and varying to in and out in almost all shaders (aside gradient) 3. Add newGL-only frag_color variable, which defines as gl_FragColor on old pipelines 4. Switch all shaders to use frag_color. 5. Previous commit is reverted, because now we have more than one GL ES version, previous commit used to set version 100 for all ES shaders, which is not true for ES 3 Signed-off-by: Konstantin Pugin <ria.freelander@gmail.com>
Diffstat (limited to 'glamor/glamor.c')
-rw-r--r--glamor/glamor.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/glamor/glamor.c b/glamor/glamor.c
index 848b484cf..a2cee41a0 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -689,17 +689,6 @@ glamor_init(ScreenPtr screen, unsigned int flags)
glamor_priv->glsl_version = epoxy_glsl_version();
- if (glamor_priv->is_gles) {
- /* Force us back to the base version of our programs on an ES
- * context, anyway. Basically glamor only uses desktop 1.20
- * or 1.30 currently. 1.30's new features are also present in
- * ES 3.0, but our glamor_program.c constructions use a lot of
- * compatibility features (to reduce the diff between 1.20 and
- * 1.30 programs).
- */
- glamor_priv->glsl_version = 120;
- }
-
/* We'd like to require GL_ARB_map_buffer_range or
* GL_OES_map_buffer_range, since it offers more information to
* the driver than plain old glMapBuffer() or glBufferSubData().
@@ -733,6 +722,7 @@ glamor_init(ScreenPtr screen, unsigned int flags)
* etnaviv offers GLSL 140 with OpenGL 2.1.
*/
if (glamor_glsl_has_ints(glamor_priv) &&
+ !glamor_priv->is_gles &&
!epoxy_has_gl_extension("GL_ARB_instanced_arrays"))
glamor_priv->glsl_version = 120;
} else {