[gtk/wip.win32.fixes: 13/13] gskglcompiler.c: Some cleanups
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip.win32.fixes: 13/13] gskglcompiler.c: Some cleanups
- Date: Thu, 2 Dec 2021 03:31:08 +0000 (UTC)
commit 6d6744a7bc77f8272a745e284fbe71308e2e9489
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 70a2da24ad..3449dac50d 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))
{
@@ -564,12 +567,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]