Forums - Adreno 305: OpenGL ES 3.0 UBO Linking Error

1 post / 0 new
Adreno 305: OpenGL ES 3.0 UBO Linking Error
AndreyOGL_D3D
Profile picture
Join Date: 10 Jun 13
Posts: 4
Posted: Tue, 2017-10-31 13:26

Hi!

Anreno 305, Android 4.4.2, HTC desire 601, OpenGL ES info:

Adreno (TM) 305
Qualcomm
OpenGL ES 3.0 V@45.0 AU@  (CL@4169980)
 

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 i do wrong ?

Thanks!

Regards,

Andrey

  • Up0
  • Down0

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.