Remove in/out from shaders, replace w/ attribute/varying.

I don't like this, since it looks like fragment shaders are not supposed to give any output besides built in variables, after much searching.
My conclusion is that mesa is to lenient.
This commit is contained in:
kitling 2015-05-08 21:37:23 -07:00
parent 1f04567b81
commit a11e990a13

View File

@ -8,9 +8,9 @@ namespace GLShaders {
const char g_vertex_shader[] = R"( const char g_vertex_shader[] = R"(
#version 120 #version 120
in vec2 vert_position; attribute vec2 vert_position;
in vec2 vert_tex_coord; attribute vec2 vert_tex_coord;
varying out vec2 frag_tex_coord; varying vec2 frag_tex_coord;
// This is a truncated 3x3 matrix for 2D transformations: // This is a truncated 3x3 matrix for 2D transformations:
// The upper-left 2x2 submatrix performs scaling/rotation/mirroring. // The upper-left 2x2 submatrix performs scaling/rotation/mirroring.
// The third column performs translation. // The third column performs translation.
@ -28,11 +28,10 @@ void main() {
const char g_fragment_shader[] = R"( const char g_fragment_shader[] = R"(
#version 120 #version 120
varying in vec2 frag_tex_coord; varying vec2 frag_tex_coord;
varying out vec4 color;
uniform sampler2D color_texture; uniform sampler2D color_texture;
void main() { void main() {
color = texture2D(color_texture, frag_tex_coord); gl_FragColor = texture2D(color_texture, frag_tex_coord);
} }
)"; )";