Reputation: 473
I am using OpenGL ES 3.0 with Android, and I am compiling two shaders:
vertex shader:
#version 300 es
#extension GL_EXT_shader_io_blocks : enable
layout (location = 0) in vec2 position;
layout (location = 1) in vec4 color;
layout (location = 2) in vec2 uv;
uniform mat4 pr_matrix;
uniform mat4 vw_matrix;
uniform mat4 ml_matrix;
out DATA {
vec2 position;
vec4 color;
vec2 uv;
} vs_out;
void main() {
gl_Position = pr_matrix * vw_matrix * ml_matrix * vec4(position, 0.0, 1.0);
vs_out.position = position;
vs_out.color = color;
vs_out.uv = uv;
}
fragment shader:
#version 300 es
#extension GL_EXT_shader_io_blocks : enable
layout (location = 0) out vec4 color;
uniform sampler2D tex;
in DATA {
vec2 position;
vec4 color;
vec2 uv;
} frag_in;
void main() {
float dist = length(frag_in.position);
color = frag_in.color;
}
Even though I am enabling the GL_EXT_shader_io_blocks extension for both shaders, I get the following error:
ERROR: 0:12: 'DATA' : requires extension GL_EXT_shader_io_blocks to be enabled
ERROR: 1 compilation errors. No code generated.
ERROR: 0:8: 'DATA' : requires extension GL_EXT_shader_io_blocks to be enabled
ERROR: 1 compilation errors. No code generated.
I also tried
#extension GL_EXT_shader_io_blocks : require
which didn't work either.
Upvotes: 0
Views: 731
Reputation: 12109
As stated in the extension specification, the IO Blocks extension requires OpenGL ES 3.10 Shading Language.
Try using #version 310 es
.
Upvotes: 1