From bca0739604a6c6b4ef66aaaaca71ed9be5c6b0ae Mon Sep 17 00:00:00 2001 From: Kitlith Date: Fri, 8 May 2015 19:41:16 -0700 Subject: [PATCH] Fix the shader to be compatible with GLSL 1.2 --- src/video_core/renderer_opengl/gl_shaders.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/video_core/renderer_opengl/gl_shaders.h b/src/video_core/renderer_opengl/gl_shaders.h index c478b8185..ce1f3a7c7 100644 --- a/src/video_core/renderer_opengl/gl_shaders.h +++ b/src/video_core/renderer_opengl/gl_shaders.h @@ -7,19 +7,16 @@ namespace GLShaders { const char g_vertex_shader[] = R"( -#version 130 - +#version 120 in vec2 vert_position; in vec2 vert_tex_coord; -out vec2 frag_tex_coord; - +varying out vec2 frag_tex_coord; // This is a truncated 3x3 matrix for 2D transformations: // The upper-left 2x2 submatrix performs scaling/rotation/mirroring. // The third column performs translation. // The third row could be used for projection, which we don't need in 2D. It hence is assumed to // implicitly be [0, 0, 1] uniform mat3x2 modelview_matrix; - void main() { // Multiply input position by the rotscale part of the matrix and then manually translate by // the last column. This is equivalent to using a full 3x3 matrix and expanding the vector @@ -30,15 +27,12 @@ void main() { )"; const char g_fragment_shader[] = R"( -#version 130 - -in vec2 frag_tex_coord; -out vec4 color; - +#version 120 +varying in vec2 frag_tex_coord; +varying out vec4 color; uniform sampler2D color_texture; - void main() { - color = texture(color_texture, frag_tex_coord); + color = texture2D(color_texture, frag_tex_coord); } )";