Victory!

Trumpts sound loud, flags wave abound, in the steady winds of change!  Victory is at hand!  

I have grasped the power of GLSL firm enough to plunge it forthwith into the beast of ignorance.  And, once again, the app does run smoothly to the delight of it's maker.

...not sure where that came from, I think I blacked out.. sorry.

Quite a lot came together to get me to this point.  I predominantly used the Adreno Profiler to figure out what was going wrong.  Though, I wanted to make sure I was compiling on the mobile GPU.  Covering all the nuances of getting that working will require a video, or something.  Maybe I'll put that together.  Anyways, the error message I was getting from the compiler made absolutely no sense at all.  It was throwing a syntax error!?!: 

07-04 08:23:32.520: E/getShader(26035): com.badlogic.gdx.utils.GdxRuntimeException: ERROR: 0:458: '(' : Syntax error:  syntax error

07-04 08:23:32.520: E/getShader(26035): ERROR: 1 compilation errors.  No code generated.

07-04 08:23:32.520: E/getShader(26035): ERROR: 0:215: '(' : Syntax error:  syntax error

07-04 08:23:32.520: E/getShader(26035): ERROR: 1 compilation errors.  No code generated.

07-04 08:23:32.520: E/getShader(26035): at com.badlogic.gdx.graphics.g3d.shaders.BaseShader.init(BaseShader.java:167)

And, for whatever reason, the line numbers mean absolutely nothing.  I think, since the compiler disregards all comments in GLSL, it doesn't count that as a line,, or something.  SO, I went through a broke the application, one... line.... at..... a.... time....  *sigh*  

The last two lines were the problem.  Literally, the last two freaking lines.  And they were functions, which GLSL does support.  BUT!,!,!  It appears that GLSL may not support NESTED functions.  BTW, not only does the line numbers in the ERROR messages not reflect it's where the error actually occured, it only shows where IN THE MAIN function it fails.  It doesn't backtrace the call stack to the function it's calling.  SO, moral of the story, if you're trying to debug GLSL go straight to the main function and start playing around with commenting out lines, breaking stuff to see where you've newly created a problem, then move from there.  You're welcome.

I went looking for anywhere it might mention there being a problem with nested functions in GLSL, low and behold, it's there.

https://www.opengl.org/discussion_boards/showthread.php/173181-Nested-fu...!

... though, Adreno doesn't throw an error even slightly relevent.  A syntax error?... HA!  Though, I guess a '(' is indicative of a function call.  But seriously, a little help here people.

The article even indicates that nVidia disregards this short coming and happily continues into the nested functions, which is why it works fine on my PC.  

I CAN FINALLY PUT THIS APP TO BED.  I don't see any other BIG hurdles in my path.  So, ONWARD!

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.