AnsweredAssumed Answered

GPU Shader Analyzer doesn't compile a GLSL shader.

Question asked by Andrey2007AMD on Jun 1, 2012
Latest reply on Jul 31, 2015 by Andrey2007AMD

Hello, i have a glsl shader, this shader is working in my 3D Engine, but GPU Shader Analyzer doesn't compile his:

 

I have ATI 5670 with the last driver version, and last version of  GPU Shader Analyzer.

 

Internal compilation failure. Possibly caused by GSA not supporting a GLSL feature used in shader.

ERROR: 0:7: error(#132) Syntax error: ';' parse error

ERROR: error(#273) 1 compilation errors.  No code generated

 

 

// glslv output by Cg compiler

// cgc version 3.1.0013, build date Apr 18 2012

// command line args: -q -no_uniform_blocks -profile glslv -entry vsMain -fastprecision -fastmath -O3 -d3d -DBLENDWEIGHT=ATTR1 -profileopts version=130

//vendor NVIDIA Corporation

//version 3.1.0.13

//profile glslv

//program vsMain

 

#version 130

#extension GL_ARB_uniform_buffer_object : enable

           

struct PS {

    vec4 _position2;

    vec2 _uv01;

    vec3 _LightDir1;

    vec4 _shadowCrd;

    vec3 _ViewDir;

    vec3 _Normal;

    float _AlphaRef1;

};

 

vec4 _position1;

float _TMP0;

float _a0014;

vec4 _r0016;

vec4 _r0018;

vec4 _r0020;

vec3 _r0022;

in vec4 TEXCOORD0;

in vec4 NORMAL;

vec3 _TMP23;

vec3 _TMP24;

vec3 _TMP25;

 

layout (std140) uniform UBO

{

        vec4 _ModelViewProjection[4];

        float _time_0_X;

        vec3 _objPosition;

        vec4 _MatTexture[4];

        vec4 _WorldMatrix[4];

        vec4 _LightDir;

        vec4 _CameraPosition;

        float _AlphaRef;

};                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

in vec4 cg_Vertex;

out vec4 cg_TexCoord4;

out vec4 cg_TexCoord1;

out vec4 cg_TexCoord3;

out vec4 cg_TexCoord0;

out vec4 cg_TexCoord5;

out vec4 cg_TexCoord2;

 

// main procedure, the original name was vsMain

void main()

{

 

    PS _vsOut;

    float _d;

    float _Sin_;

 

    _d = float(((_objPosition.x + _objPosition.y + _objPosition.z)*3.33333343E-001));

    _a0014 = float(_d) + _time_0_X + (((_objPosition.x - cg_Vertex.x) + _objPosition.y) - cg_Vertex.y)/8.00000000E+000;

    _TMP0 = sin(_a0014);

    _Sin_ = float((_TMP0*cg_Vertex.y));

    _position1.x = cg_Vertex.x + float((_Sin_*9.99755859E-002));

    _position1.z = cg_Vertex.z + float((_Sin_*9.99755859E-002));

    _r0016 = _position1.x*_ModelViewProjection[0];

    _r0016 = _r0016 + cg_Vertex.y*_ModelViewProjection[1];

    _r0016 = _r0016 + _position1.z*_ModelViewProjection[2];

    _r0016 = _r0016 + cg_Vertex.w*_ModelViewProjection[3];

    _r0018 = _position1.x*_MatTexture[0];

    _r0018 = _r0018 + cg_Vertex.y*_MatTexture[1];

    _r0018 = _r0018 + _position1.z*_MatTexture[2];

    _r0018 = _r0018 + cg_Vertex.w*_MatTexture[3];

    _r0020 = _position1.x*_WorldMatrix[0];

    _r0020 = _r0020 + cg_Vertex.y*_WorldMatrix[1];

    _r0020 = _r0020 + _position1.z*_WorldMatrix[2];

    _r0020 = _r0020 + cg_Vertex.w*_WorldMatrix[3];

    _vsOut._ViewDir = _r0020.xyz - _CameraPosition.xyz;

    _TMP23.x = _WorldMatrix[0].x;

    _TMP23.y = _WorldMatrix[0].y;

    _TMP23.z = _WorldMatrix[0].z;

    _r0022 = NORMAL.x*_TMP23;

    _TMP24.x = _WorldMatrix[1].x;

    _TMP24.y = _WorldMatrix[1].y;

    _TMP24.z = _WorldMatrix[1].z;

    _r0022 = _r0022 + NORMAL.y*_TMP24;

    _TMP25.x = _WorldMatrix[2].x;

    _TMP25.y = _WorldMatrix[2].y;

    _TMP25.z = _WorldMatrix[2].z;

    _r0022 = _r0022 + NORMAL.z*_TMP25;

    cg_TexCoord2 = _r0018;

    cg_TexCoord5.x = _AlphaRef;

    cg_TexCoord0.xy = TEXCOORD0.xy;

    cg_TexCoord3.xyz = _vsOut._ViewDir;

    cg_TexCoord1.xyz = _LightDir.xyz;

    cg_TexCoord4.xyz = _r0022;

    gl_Position = _r0016;

    return;

} // main end

 

 

Сообщение отредактировано: Andrey Geets

Outcomes