[gtk/gl3-shaders] Use GLSL 3.30 shaders



commit bfcd062e8ea4b32444759cef6af45cb924ebcccf
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Wed Mar 27 15:51:34 2019 +0000

    Use GLSL 3.30 shaders
    
    We currently ask for anything above 3.2 GL contexts, but we're still
    using GLSL 1.50 shaders all over the place. If a GL driver supports GL
    3.2+ and GLSL 1.50 only then we'd be in trouble, but the chances of that
    happening are really small.

 gdk/resources/glsl/gl3-texture-2d.fs.glsl | 4 ++--
 gdk/resources/glsl/gl3-texture-2d.vs.glsl | 2 +-
 tests/gtkgears.c                          | 8 +++++---
 3 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/gdk/resources/glsl/gl3-texture-2d.fs.glsl b/gdk/resources/glsl/gl3-texture-2d.fs.glsl
index fe353a6bad..4c1a4251f2 100644
--- a/gdk/resources/glsl/gl3-texture-2d.fs.glsl
+++ b/gdk/resources/glsl/gl3-texture-2d.fs.glsl
@@ -1,4 +1,4 @@
-#version 150
+#version 330
 
 in vec2 vUv;
 
@@ -7,5 +7,5 @@ out vec4 vertexColor;
 uniform sampler2D map;
 
 void main() {
-  vertexColor = texture2D (map, vUv);
+  vertexColor = texture (map, vUv);
 }
diff --git a/gdk/resources/glsl/gl3-texture-2d.vs.glsl b/gdk/resources/glsl/gl3-texture-2d.vs.glsl
index a3a0a5426d..021c9a477b 100644
--- a/gdk/resources/glsl/gl3-texture-2d.vs.glsl
+++ b/gdk/resources/glsl/gl3-texture-2d.vs.glsl
@@ -1,4 +1,4 @@
-#version 150
+#version 330
 
 in vec2 position;
 in vec2 uv;
diff --git a/tests/gtkgears.c b/tests/gtkgears.c
index 32a24dafb4..062b611034 100644
--- a/tests/gtkgears.c
+++ b/tests/gtkgears.c
@@ -652,7 +652,7 @@ gtk_gears_render (GtkGLArea    *area,
 }
 
 static const char vertex_shader_gl[] =
-"#version 150\n"
+"#version 330\n"
 "\n"
 "in vec3 position;\n"
 "in vec3 normal;\n"
@@ -682,13 +682,15 @@ static const char vertex_shader_gl[] =
 "}";
 
 static const char fragment_shader_gl[] =
-"#version 150\n"
+"#version 330\n"
 "\n"
 "smooth in vec4 Color;\n"
 "\n"
+"out vec4 vertexColor;\n"
+"\n"
 "void main(void)\n"
 "{\n"
-"    gl_FragColor = Color;\n"
+"    vertexColor = Color;\n"
 "}";
 
 static const char vertex_shader_gles[] =


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]