[gtk/gtk4-win32-egl: 4/4] gskglcompiler.c: Some cleanups
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk4-win32-egl: 4/4] gskglcompiler.c: Some cleanups
- Date: Thu, 2 Dec 2021 03:32:15 +0000 (UTC)
commit 929a863f22bde88e147ed714858dfd7cd5d7951c
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Thu Dec 2 11:26:29 2021 +0800
gskglcompiler.c: Some cleanups
We don't really need an extra define in the shaders for whether to use
'noperspective', so we can drop that.
Just see whether our GLES version is 3.0 or greater and apply the shader
version directive accordingly. Otherwise, in the shaders, for GLES 3.0+
contexts, we treat things just like normal desktop GL without the GL 3.x
specific bits.
gsk/gl/gskglcompiler.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/gsk/gl/gskglcompiler.c b/gsk/gl/gskglcompiler.c
index a89445cc84..ca76c60aae 100644
--- a/gsk/gl/gskglcompiler.c
+++ b/gsk/gl/gskglcompiler.c
@@ -54,7 +54,6 @@ struct _GskGLCompiler
guint gl3 : 1;
guint gles : 1;
- guint use_glsl_300es : 1;
guint legacy : 1;
guint debug_shaders : 1;
};
@@ -133,10 +132,14 @@ gsk_gl_compiler_new (GskGLDriver *driver,
/* for OpenGL/ES 3.0+, use "300 es" as our shader version */
gdk_gl_context_get_version (context, &maj, &min);
- self->use_glsl_300es = (maj >= 3);
- self->glsl_version = self->use_glsl_300es ? SHADER_VERSION_GLES3 : SHADER_VERSION_GLES;
- self->gles = TRUE;
+ if (maj >= 3)
+ self->glsl_version = SHADER_VERSION_GLES3;
+ else
+ {
+ self->glsl_version = SHADER_VERSION_GLES;
+ self->gles = TRUE;
+ }
}
else if (gdk_gl_context_is_legacy (context))
{
@@ -563,12 +566,7 @@ gsk_gl_compiler_compile (GskGLCompiler *self,
legacy = "#define GSK_LEGACY 1\n";
if (self->gles)
- {
- if (self->use_glsl_300es)
- gles = "#define GSK_GLES3 1\n";
- else
- gles = "#define GSK_GLES 1\n";
- }
+ gles = "#define GSK_GLES 1\n";
if (self->gl3)
gl3 = "#define GSK_GL3 1\n";
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]