Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2024-04-24 04:50:24



Reply to topic  [ 2 posts ] 
1.26.9.0 GLSL compile failed bug, with fix 
Author Message

Joined: 2009-03-23 19:07:48
Posts: 30
Reply with quote
Installed Cool VL Viewer 1.26.9.0 on:
* Linux 3.8.8 / Fedora 18
* AMD Catalyst 13.1

On startup - crash if deferred rendering was enabled.

The crash message was:
~~~~~~~~~~~~~~~~~~
Loading Shaders:
~~~~~~~~~~~~~~~~~~
2013-04-21T18:54:13Z WARNING: linkProgramObject: GLSL Linker Error:
2013-04-21T18:54:13Z WARNING: dumpObjectLog: Fragment shader(s) failed to link.
Fragment link error: INVALID_OPERATION.
ERROR: 148:1: error(#143) Undeclared identifier: i
ERROR: 148:1: error(#166) Integer expression required: []
ERROR: 148:1: error(#166) Integer expression required: []
ERROR: 148:1: error(#166) Integer expression required: []
ERROR: 148:1: error(#166) Integer expression required: []
ERROR: 148:1: error(#166) Integer expression required: []
ERROR: 148:1: error(#166) Integer expression required: []
ERROR: error(#273) 7 compilation errors. No code generated
2013-04-21T18:54:13Z WARNING: createShader: Failed to link shader: Deferred Skinned Alpha Shader
2013-04-21T18:54:13Z WARNING: createShader: Failed to link using shader level 1 trying again using shader level 0
2013-04-21T18:54:13Z WARNING: loadShaderFile: GLSL Shader file not found: deferred/alphaV.glsl
2013-04-21T18:54:13Z WARNING: loadShaderFile: GLSL Shader file not found: deferred/alphaF.glsl
2013-04-21T18:54:13Z WARNING: createShader: Failed to link shader: Deferred Skinned Alpha Shader

The error seems to be in:
* $INSTALLDIR/app_settings/shaders/class2/deferred/alphaF.glsl line 227
* $INSTALLDIR/app_settings/shaders/class1/deferred/alphaF.glsl line 133

Near the bottom of both files are new code starting with macro #define LIGHT_LOOP(i) followed col.rgb operations.
Then, there are 7 calls to LIGHT_LOOP() with the integers 1-7 passed in.

To fix the error, I had to define i as an integer and initialize it on the line just above the #define LIGHT_LOOP(i):
My resulting alphaF.glsl has:

Code:
   int i = 0;
   #define LIGHT_LOOP(i) \
       col.rgb += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, normal, light_position[i], light_direction[i].xyz, light_a
ttenuation[i].x, light_attenuation[i].y, light_attenuation[i].z);
       
    LIGHT_LOOP(1)
    LIGHT_LOOP(2)
    LIGHT_LOOP(3)
    LIGHT_LOOP(4)
    LIGHT_LOOP(5)
    LIGHT_LOOP(6)
    LIGHT_LOOP(7)


With that initialization (int i=0;) added - I can enable deferred rendering without crashing or GLSL compile errors thrown into the log.
But, I have not tested if materials display properly at this point.


2013-04-21 19:37:34
Profile

Joined: 2009-03-17 18:42:51
Posts: 5550
Reply with quote
Please, do not report bugs about the v1.26.9 viewer shaders... not here, at least. These are "work in progress", and yes, there are many glitches and graphics drivers crashes still to be ironed out, but I'm not the one who will do it. I'm merely piggy-backing on LL's viewer-development-materials for now.

If you wish to submit patches to solve shader issues, do so on the official JIRA, in the MATBUG category.


2013-04-21 21:38:05
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 60 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.