Forums - Shader Compiler internal error

6 posts / 0 new
Last post
Shader Compiler internal error
Sonicadvance1
Join Date: 2 Nov 12
Posts: 51
Posted: Sun, 2013-05-26 23:38

I've been trying to track down a issue with compiling a GLSLES 3 shader on my Galaxy S4. It keeps throwing internal error at me with a shaders and I've narrowed it down to about as far as I can go.

I've got two shaders, one vertex, one fragment, if someone could look to see why it just gives me "Internal Error." That would be great.

The shaders are a bit ugly since they are procedurally generated, but it shouldn't be too difficult to understand.

 

 

 
Error: "Internal error."
// Vertex Shader

#version 300 es
precision highp float;



#define ATTRIN in
#define ATTROUT out
#define VARYIN in
#define VARYOUT out





//Vertex Shader: comp:8402, 
layout(std140) uniform VSBlock {
vec4 cpnmtx[6] ;
vec4 cproj[4] ;
vec4 cmtrl[4] ;
vec4 clights[40] ;
vec4 ctexmtx[24] ;
vec4 ctrmtx[64] ;
vec4 cnmtx[32] ;
vec4 cpostmtx[64] ;
vec4 cDepth ;
};
struct VS_OUTPUT {
   vec4 pos ;// POSITION;
   vec4 colors_0 ;// COLOR0;
   vec4 colors_1 ;// COLOR1;
   vec4 clipPos ;// TEXCOORD0;
};
in vec4 rawpos; // ATTR0,
in float fposmtx; // ATTR1,
in vec3 rawnorm0; // ATTR2,
in vec2 tex0; // ATTR8,
out  vec3 uv0_2;
out  vec3 uv1_2;
out  vec3 uv2_2;
out  vec3 uv3_2;
out  vec3 uv4_2;
out  vec3 uv5_2;
out  vec3 uv6_2;
out  vec3 uv7_2;
out   vec4 clipPos_2;
out   vec4 colors_02;
out   vec4 colors_12;
void main()
{
VS_OUTPUT o;
int posmtx = int(fposmtx);
vec4 pos = vec4(dot(ctrmtx[posmtx], rawpos), dot(ctrmtx[posmtx+1], rawpos), dot(ctrmtx[posmtx+2], rawpos), 1);
int normidx = posmtx >= 32 ? (posmtx-32) : posmtx;
vec3 N0 = cnmtx[normidx].xyz, N1 = cnmtx[normidx+1].xyz, N2 = cnmtx[normidx+2].xyz;
vec3 _norm0 = normalize(vec3(dot(N0, rawnorm0), dot(N1, rawnorm0), dot(N2, rawnorm0)));
o.pos = vec4(dot(cproj[0], pos), dot(cproj[1], pos), dot(cproj[2], pos), dot(cproj[3], pos));
vec4 mat, lacc;
vec3 ldir, h;
float dist, dist2, attn;
{
mat = cmtrl[2];
lacc = vec4(1.0f, 1.0f, 1.0f, 1.0f);
lacc.w = 1.0f;
o.colors_0 = mat * clamp(lacc, 0.0, 1.0);
}
o.colors_1 = o.colors_0;
vec4 coord = vec4(0.0f, 0.0f, 1.0f, 1.0f);
o.clipPos = vec4(pos.x,pos.y,o.pos.z,o.pos.w);
o.pos.z = o.pos.w + o.pos.z * 2.0f;
o.pos.z = o.pos.z * 1048575.0f/1048576.0f;
 uv0_2.xyz =  vec3(0.0f, 0.0f, 0.0f);
 uv1_2.xyz =  vec3(0.0f, 0.0f, 0.0f);
 uv2_2.xyz =  vec3(0.0f, 0.0f, 0.0f);
 uv3_2.xyz =  vec3(0.0f, 0.0f, 0.0f);
 uv4_2.xyz =  vec3(0.0f, 0.0f, 0.0f);
 uv5_2.xyz =  vec3(0.0f, 0.0f, 0.0f);
 uv6_2.xyz =  vec3(0.0f, 0.0f, 0.0f);
 uv7_2.xyz =  vec3(0.0f, 0.0f, 0.0f);
  clipPos_2 = o.clipPos;
colors_02 = o.colors_0;
colors_12 = o.colors_1;
gl_Position = o.pos;
}

// Pixel Shader
#version 300 es
precision highp float;



#define ATTRIN in
#define ATTROUT out
#define VARYIN in
#define VARYOUT out





//Pixel Shader for TEV stages
//1 TEV stages, 0 texgens, XXX IND stages
float fmod( float x, float y )
{
	float z = fract( abs( x / y) ) * abs( y );
	return (x < 0.0) ? -z : z;
}
uniform sampler2D samp0;
uniform sampler2D samp1;
uniform sampler2D samp2;
uniform sampler2D samp3;
uniform sampler2D samp4;
uniform sampler2D samp5;
uniform sampler2D samp6;
uniform sampler2D samp7;

layout(std140) uniform PSBlock {
	vec4 color[4] ;
	vec4 k[4] ;
	vec4 alphaRef[1] ;
	vec4 texdim[8] ;
	vec4 czbias[2] ;
	vec4 cindscale[2] ;
	vec4 cindmtx[6] ;
	vec4 cfog[3] ;
	vec4 cPLights[40] ;
	vec4 cPmtrl[4] ;
};
layout(location = 0) out vec4 ocol0;
vec4 rawpos = gl_FragCoord;
in vec4 colors_02;
in vec4 colors_12;
vec4 colors_0 = colors_02;
vec4 colors_1 = colors_12;
in vec3 uv0_2;
vec3 uv0 = uv0_2;
in vec3 uv1_2;
vec3 uv1 = uv1_2;
in vec3 uv2_2;
vec3 uv2 = uv2_2;
in vec3 uv3_2;
vec3 uv3 = uv3_2;
in vec3 uv4_2;
vec3 uv4 = uv4_2;
in vec3 uv5_2;
vec3 uv5 = uv5_2;
in vec3 uv6_2;
vec3 uv6 = uv6_2;
in vec3 uv7_2;
vec3 uv7 = uv7_2;
in vec4 clipPos_2;
vec4 clipPos = clipPos_2;
void main()
{
  vec4 c0 = color[1], c1 = color[2], c2 = color[3], prev = vec4(0.0f, 0.0f, 0.0f, 0.0f), textemp = vec4(0.0f, 0.0f, 0.0f, 0.0f), rastemp = vec4(0.0f, 0.0f, 0.0f, 0.0f), konsttemp = vec4(0.0f, 0.0f, 0.0f, 0.0f);
  vec3 comp16 = vec3(1.0f, 255.0f, 0.0f), comp24 = vec3(1.0f, 255.0f, 255.0f*255.0f);
  float alphabump=0.0f;
  vec3 tevcoord=vec3(0.0f, 0.0f, 0.0f);
  vec2 wrappedcoord=vec2(0.0f,0.0f), tempcoord=vec2(0.0f,0.0f);
  vec4 cc0=vec4(0.0f,0.0f,0.0f,0.0f), cc1=vec4(0.0f,0.0f,0.0f,0.0f);
  vec4 cc2=vec4(0.0f,0.0f,0.0f,0.0f), cprev=vec4(0.0f,0.0f,0.0f,0.0f);
  vec4 crastemp=vec4(0.0f,0.0f,0.0f,0.0f),ckonsttemp=vec4(0.0f,0.0f,0.0f,0.0f);

	clipPos = vec4(rawpos.x, rawpos.y, clipPos.z, clipPos.w);
	vec3 uv0 = vec3(0.0f, 0.0f, 0.0f);
// TEV stage 0
rastemp = colors_0.rgba;
crastemp = fract(rastemp * (255.0f/256.0f)) * (256.0f/255.0f);
textemp = vec4(1.0f, 1.0f, 1.0f, 1.0f);
// color combine
prev.rgb = clamp((rastemp.rgb)+vec3(0.0f, 0.0f, 0.0f), 0.0, 1.0);
// alpha combine
prev.a = clamp(vec4(0.0f, 0.0f, 0.0f, 0.0f).a, 0.0, 1.0);

// TEV done
float zCoord = rawpos.z;
	ocol0 = prev;
}

 

  • Up0
  • Down0
Sonicadvance1
Join Date: 2 Nov 12
Posts: 51
Posted: Tue, 2013-05-28 00:55

Tracked down the issue on this one. The vertex shader as a integer in it and apparently that causes the shader compiler angst issues. Should probably say something other than "Internal Error"

  • Up0
  • Down0
Sonicadvance1
Join Date: 2 Nov 12
Posts: 51
Posted: Sun, 2013-06-02 06:15

Any news on this? Is it known that integer support in the shaders is broken? I've yet to test if uniform integers work or not yet.

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Mon, 2013-06-03 07:07

Hi..  Got word back from our compiler team, that there is indeed a problem in our parsing which doesn't handle the dynamic indexing of arrays inside Uniform Buffer Objects.  Uniform integers should work.

 

 

  • Up0
  • Down0
Sonicadvance1
Join Date: 2 Nov 12
Posts: 51
Posted: Sat, 2013-10-12 22:09

Has this issue been fixed on Qualcomm's side with development versions?

I would like to mark this off our list of bugs as being fixed in a future driver release.

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Mon, 2013-10-14 13:36

Yes, this problem is now fixed in our mainline driver source.

  • Up0
  • Down0
or Register

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.