Hi!
Anreno 305, Android 4.4.2, HTC desire 601, OpenGL ES info:
The simple shader with UBO produce linking error, linking log:
--From Vertex Shader:
Internal error.
Shader:
#version 300 es #define attribute in #define varying out #define lerp mix #define saturate(x) clamp(x, 0.0, 1.0) #define frac fract #define NUM_BONES 31 #define NUM_WEIGHT 2 // #ifndef NUM_WEIGHT #define NUM_WEIGHT 4 #endif #ifndef NUM_BONES #define NUM_BONES 47 #endif layout(std140) uniform UBO { mat4 lightMatrix; vec4 bones[3 * NUM_BONES]; }; attribute vec4 POSITION; attribute vec4 BLENDWEIGHT; attribute vec4 BLENDINDICES; varying float Depth; void main() { vec4 Pos = vec4(0.0, 0.0, 0.0, 1.0); vec4 position = vec4(POSITION.xyz, 1.0); ivec4 BoneIndices = ivec4(BLENDINDICES); vec4 BlendWeight = BLENDWEIGHT; for(int i = 0; i < NUM_WEIGHT; ++i) { int index = 3 * BoneIndices[i]; vec3 pos; pos.x = dot(bones[index + 0], position); pos.y = dot(bones[index + 1], position); pos.z = dot(bones[index + 2], position); Pos.xyz += (pos.xyz * BlendWeight[i]); } gl_Position = lightMatrix * Pos; Depth = gl_Position.z; }
All other shaders with UBO and without vec4 arrays are linked correctly. Also i have no linking problem on Adreno 510, Mali-T720.
Whats do i do wrong ?
Thanks!
Regards,
Andrey