Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (744)
Games in Android Showcase (225)
games submitted by our members
Games in WIP (825)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [solved] GLSL Link fails with no error on intel graphics  (Read 2657 times)
0 Members and 1 Guest are viewing this topic.
Offline roland
« Posted 2014-10-09 11:17:33 »

Hi, I am using similar code to http://lwjgl.org/wiki/index.php?title=GLSL_Shaders_with_LWJGL and when I run my program on my intel HD 4000 graphics card, the link stage fails:

1  
ARBShaderObjects.glGetObjectParameteriARB(shaderID, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB)
returns GL_FALSE but when using
1  
ARBShaderObjects.glGetInfoLogARB(obj, ARBShaderObjects.glGetObjectParameteriARB(obj, ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB));

an empty string is returned.


This only happens on my intel card, my ATI one runs fine.
Also a couple of simple shaders did link fine on the intel card but just drew a black screen (They worked fine on the ATI card too)
Is there anything I can do? Or the intel card just sucks and can't handle the shaders?


Thanks,
roland
Offline basil_

« JGO Bitwise Duke »


Medals: 418
Exp: 13 years



« Reply #1 - Posted 2014-10-09 11:35:52 »

sometimes shader compilers fail so hard, they don't even tell you why. depends on the code.

try using https://www.opengl.org/registry/specs/ARB/debug_output.txt for more info.
Offline nsigma
« Reply #2 - Posted 2014-10-09 12:02:12 »

Hi, I am using similar code to

What is "similar"?  One thing that I've found fails on Intel but not other cards is using integers where you mean floats (eg 1 rather than 1.0).  I think the Intel behaviour is actually correct unless you specify #version but it's the one that always seems to bite me.  persecutioncomplex

Praxis LIVE - hybrid visual IDE for (live) creative coding
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline roland
« Reply #3 - Posted 2014-10-10 06:23:43 »

sometimes shader compilers fail so hard, they don't even tell you why. depends on the code.

try using https://www.opengl.org/registry/specs/ARB/debug_output.txt for more info.

Thanks Smiley You're right about the shader compilers fail so hard, they don't even tell you why. I commented out everything and added back one thing at a time, this introduced some errors. I finally got it linking but it still crashed when I ran it.

Turns out using an array of uniform sampler2D was the issue (As I said, worked fine on ATI). So I just replaced it with 4 uniform sampler2Ds instead.
1  
2  
#define NUM_MAP_TEXTURES 4
uniform sampler2D mapTextures[NUM_MAP_TEXTURES]; //fails on intel



Hi, I am using similar code to

What is "similar"?  One thing that I've found fails on Intel but not other cards is using integers where you mean floats (eg 1 rather than 1.0).  I think the Intel behaviour is actually correct unless you specify #version but it's the one that always seems to bite me.  persecutioncomplex
Thanks, I got some of those errors too before, however they printed out fine in the compile stage. Thinking about why the similar shaders linked fine and this one didn't helped though. Smiley

Offline nsigma
« Reply #4 - Posted 2014-10-10 09:06:36 »

Thinking about why the similar shaders linked fine and this one didn't helped though. Smiley

Could even be the same reason - should have been more generic in my answer!  Wink  Looking at something like this ( http://stackoverflow.com/a/12031821 ) arrays of samplers are not valid below 1.30.  Are you using a #version pragma?

According to the GLSL spec ( https://www.opengl.org/wiki/Core_Language_%28GLSL%29#Version )

Quote
If a #version​ directive does not appear at the top, then it assumes 1.10, which is almost certainly not what you want.

What I've found is that AMD & nVidia cards seem to allow features above version to work, whereas Intel cards seem to follow that spec and fail.  The int <> float thing is not the only time I've fallen foul of this, but just the one I keep repeating!  Roll Eyes

Praxis LIVE - hybrid visual IDE for (live) creative coding
Offline roland
« Reply #5 - Posted 2014-10-10 09:52:04 »

Thanks, I wasn't using a #version directive. However, I don't want to go right up to GLSL 4.0 just so that I can loop over the sampler array  Undecided
Quote
In GLSL 1.30 to 3.30, you can have sampler arrays, but with severe restrictions on the index. The index must be an integral constant expression. Thus, while you can declare a sampler array, you can't loop over it.

Oh well, it seems to be fine how I currently have it, apart from a bit of duplicated code. I'll get over it  Smiley

Thanks again,
roland
Pages: [1]
  ignore  |  Print  
 
 

 
Ecumene (142 views)
2017-09-30 02:57:34

theagentd (206 views)
2017-09-26 18:23:31

cybrmynd (290 views)
2017-08-02 12:28:51

cybrmynd (281 views)
2017-08-02 12:19:43

cybrmynd (292 views)
2017-08-02 12:18:09

Sralse (282 views)
2017-07-25 17:13:48

Archive (931 views)
2017-04-27 17:45:51

buddyBro (1087 views)
2017-04-05 03:38:00

CopyableCougar4 (1651 views)
2017-03-24 15:39:42

theagentd (1412 views)
2017-03-24 15:32:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!